#include "hpm_common.h"
#include "hpm_spi_drv.h"
#include "hpm_dma_drv.h"
#include "hpm_dmamux_drv.h"
#include "hpm_misc.h"
#include "hpm_l1c_drv.h"
Go to the source code of this file.
|
| hpm_stat_t | hpm_spi_setup_dma_transfer (spi_context_t *context, spi_control_config_t *config) |
| | hpm_spi setup dma transfer More...
|
| |
| hpm_stat_t | hpm_spi_release_gpio_cs (spi_context_t *context) |
| | hpm_spi releases gpio cs pin after SPI transfer completed More...
|
| |
| void | hpm_spi_get_default_init_config (spi_initialize_config_t *config) |
| | spi get default init config More...
|
| |
| hpm_stat_t | hpm_spi_initialize (SPI_Type *ptr, spi_initialize_config_t *config) |
| | initialize for spi More...
|
| |
| hpm_stat_t | hpm_spi_set_sclk_frequency (SPI_Type *ptr, uint32_t freq) |
| | set spi sclk frequency for spi master More...
|
| |
| hpm_stat_t | hpm_spi_transmit_receive_blocking (SPI_Type *ptr, uint8_t *wbuff, uint8_t *rbuff, uint32_t size, uint32_t timeout) |
| | transmit and receive block for spi More...
|
| |
| hpm_stat_t | hpm_spi_receive_blocking (SPI_Type *ptr, uint8_t *buff, uint32_t size, uint32_t timeout) |
| | receive block for spi More...
|
| |
| hpm_stat_t | hpm_spi_transmit_blocking (SPI_Type *ptr, uint8_t *buff, uint32_t size, uint32_t timeout) |
| | transmit block for spi More...
|
| |
| hpm_stat_t | hpm_spi_transmit_receive_setup_dma (SPI_Type *ptr, uint32_t size) |
| | transmit and receive setup dma for spi More...
|
| |
| hpm_stat_t | hpm_spi_receive_setup_dma (SPI_Type *ptr, uint32_t size) |
| | receive setup dma for spi More...
|
| |
| hpm_stat_t | hpm_spi_transmit_setup_dma (SPI_Type *ptr, uint32_t size) |
| | transmit setup dma for spi More...
|
| |
◆ SPI_CS_ACTIVE
◆ SPI_DMA_DESC_COUNT_PER_TRANS
| #define SPI_DMA_DESC_COUNT_PER_TRANS (3U) |
◆ USE_DMA_MGR
◆ hpm_spi_get_default_init_config()
spi get default init config
- Note
- it's no command/address/token phase, only data phase.
- Parameters
-
| [out] | config | spi_init_config_t |
◆ hpm_spi_initialize()
initialize for spi
- Note
- it's no command/address/token phase, only data phase.
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | config | spi_init_config_t struct |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_receive_blocking()
| hpm_stat_t hpm_spi_receive_blocking |
( |
SPI_Type * |
ptr, |
|
|
uint8_t * |
buff, |
|
|
uint32_t |
size, |
|
|
uint32_t |
timeout |
|
) |
| |
receive block for spi
- Note
- it's no command/address/token phase, only data phase.
- Parameters
-
| [in] | ptr | SPI base address |
| [out] | buff | spi receive data buff address |
| [in] | size | spi sent data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [in] | timeout | wait time. unit is millisecond |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_receive_setup_dma()
receive setup dma for spi
- Note
- it's no command/address/token phase, only data phase. main configuration spi dma related, call this API after configuring DMA best
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | size | spi receive data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_release_gpio_cs()
hpm_spi releases gpio cs pin after SPI transfer completed
- Parameters
-
| [in] | spi_context | A pointer to the struct of "spi_context_t" |
- Return values
-
| status_success | if SPI releases gpio cs pin successfully. |
◆ hpm_spi_set_sclk_frequency()
set spi sclk frequency for spi master
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | freq | spi sclk frequency |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_setup_dma_transfer()
hpm_spi setup dma transfer
- Note
- if the transferred data count more than SPI_SOC_TRANSFER_COUNT_MAX, this API will using DMA chain descriptors to link SPI transmission.
- Parameters
-
| [in] | spi_context | A pointer to the struct of "spi_context_t" |
| [in] | spi_config | A pointer to the struct of "spi_control_config_t" |
- Return values
-
| status_success | if SPI transfers data successfully. |
◆ hpm_spi_transmit_blocking()
| hpm_stat_t hpm_spi_transmit_blocking |
( |
SPI_Type * |
ptr, |
|
|
uint8_t * |
buff, |
|
|
uint32_t |
size, |
|
|
uint32_t |
timeout |
|
) |
| |
transmit block for spi
- Note
- it's no command/address/token phase, only data phase.
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | buff | spi sent data buff address |
| [in] | size | spi sent data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [in] | timeout | wait time. unit is millisecond |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_transmit_receive_blocking()
| hpm_stat_t hpm_spi_transmit_receive_blocking |
( |
SPI_Type * |
ptr, |
|
|
uint8_t * |
wbuff, |
|
|
uint8_t * |
rbuff, |
|
|
uint32_t |
size, |
|
|
uint32_t |
timeout |
|
) |
| |
transmit and receive block for spi
- Note
- it's no command/address/token phase, only data phase.
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | wbuff | spi sent data buff address |
| [out] | rbuff | spi receive data buff address |
| [in] | size | spi sent data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [in] | timeout | wait time. unit is millisecond |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_transmit_receive_setup_dma()
transmit and receive setup dma for spi
- Note
- it's no command/address/token phase, only data phase. main configuration spi dma related, call this API after configuring DMA best
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | size | spi sent and receive data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |
◆ hpm_spi_transmit_setup_dma()
transmit setup dma for spi
- Note
- it's no command/address/token phase, only data phase. main configuration spi dma related, call this API after configuring DMA best
- Parameters
-
| [in] | ptr | SPI base address |
| [in] | size | spi transmit data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
- Return values
-
| hpm_stat_t | status_success if spi in busy status |