Data Structures | |
| struct | hpm_spi_cfg_t |
Macros | |
| #define | SPI_COMP_FREQUENCY_THRESHOLD (20000000U) |
Functions | |
| static hpm_stat_t | hpm_spi_tx_trigger_dma (DMA_Type *dma_ptr, uint8_t ch_num, SPI_Type *spi_ptr, uint32_t src, uint8_t data_width, uint32_t size) |
| static hpm_stat_t | hpm_spi_rx_trigger_dma (DMA_Type *dma_ptr, uint8_t ch_num, SPI_Type *spi_ptr, uint32_t dst, uint8_t data_width, uint32_t size) |
| void | hpm_spi_prepare_dma_tx_descriptors (spi_context_t *context, spi_control_config_t *config, uint32_t trans_count, uint32_t *spi_transctrl, dma_linked_descriptor_t *tx_dma_descriptors) |
| void | hpm_prepare_dma_rx_descriptors (spi_context_t *context, spi_control_config_t *config, uint32_t trans_count, uint32_t *spi_transctrl, dma_linked_descriptor_t *rx_dma_descriptors) |
| static uint32_t | hpm_spi_get_trans_count (spi_context_t *context, spi_control_config_t *config) |
| static hpm_stat_t | spi_setup_trans_with_dma_chain (spi_context_t *context, spi_control_config_t *config) |
| static hpm_stat_t | spi_setup_trans_with_dma (spi_context_t *context, spi_control_config_t *config) |
| 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... | |
| static hpm_stat_t | wait_spi_slave_active (SPI_Type *ptr, bool active_status, uint32_t timeout) |
| static hpm_spi_cfg_t * | hpm_spi_get_cfg_obj (SPI_Type *ptr) |
| static hpm_stat_t | hpm_spi_transfer_init (SPI_Type *ptr, spi_trans_mode_t mode, uint32_t size) |
| static hpm_stat_t | write_read_data_together (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *wbuff, uint32_t wsize, uint8_t *rbuff, uint32_t rsize, uint32_t timeout) |
| static hpm_stat_t | read_data_single (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *rbuff, uint32_t rsize, uint32_t timeout) |
| static hpm_stat_t | write_data_single (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *wbuff, uint32_t wsize, uint32_t timeout) |
| 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... | |
Variables | |
| static hpm_spi_cfg_t | spi_dma_cfg_table [] |
| #define SPI_COMP_FREQUENCY_THRESHOLD (20000000U) |
| void hpm_prepare_dma_rx_descriptors | ( | spi_context_t * | context, |
| spi_control_config_t * | config, | ||
| uint32_t | trans_count, | ||
| uint32_t * | spi_transctrl, | ||
| dma_linked_descriptor_t * | rx_dma_descriptors | ||
| ) |
|
static |
| void hpm_spi_get_default_init_config | ( | spi_initialize_config_t * | config | ) |
spi get default init config
| [out] | config | spi_init_config_t |
|
static |
| hpm_stat_t hpm_spi_initialize | ( | SPI_Type * | ptr, |
| spi_initialize_config_t * | config | ||
| ) |
initialize for spi
| [in] | ptr | SPI base address |
| [in] | config | spi_init_config_t struct |
| hpm_stat_t | status_success if spi in busy status |
| void hpm_spi_prepare_dma_tx_descriptors | ( | spi_context_t * | context, |
| spi_control_config_t * | config, | ||
| uint32_t | trans_count, | ||
| uint32_t * | spi_transctrl, | ||
| dma_linked_descriptor_t * | tx_dma_descriptors | ||
| ) |
| hpm_stat_t hpm_spi_receive_blocking | ( | SPI_Type * | ptr, |
| uint8_t * | buff, | ||
| uint32_t | size, | ||
| uint32_t | timeout | ||
| ) |
receive block for spi
| [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 |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t hpm_spi_receive_setup_dma | ( | SPI_Type * | ptr, |
| uint32_t | size | ||
| ) |
receive setup dma for spi
| [in] | ptr | SPI base address |
| [in] | size | spi receive data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t hpm_spi_release_gpio_cs | ( | spi_context_t * | context | ) |
hpm_spi releases gpio cs pin after SPI transfer completed
| [in] | spi_context | A pointer to the struct of "spi_context_t" |
| status_success | if SPI releases gpio cs pin successfully. |
|
static |
| hpm_stat_t hpm_spi_set_sclk_frequency | ( | SPI_Type * | ptr, |
| uint32_t | freq | ||
| ) |
set spi sclk frequency for spi master
| [in] | ptr | SPI base address |
| [in] | freq | spi sclk frequency |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t hpm_spi_setup_dma_transfer | ( | spi_context_t * | context, |
| spi_control_config_t * | config | ||
| ) |
hpm_spi setup dma transfer
| [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" |
| status_success | if SPI transfers data successfully. |
|
static |
| hpm_stat_t hpm_spi_transmit_blocking | ( | SPI_Type * | ptr, |
| uint8_t * | buff, | ||
| uint32_t | size, | ||
| uint32_t | timeout | ||
| ) |
transmit block for spi
| [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 |
| hpm_stat_t | status_success if spi in busy status |
| 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
| [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 |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t hpm_spi_transmit_receive_setup_dma | ( | SPI_Type * | ptr, |
| uint32_t | size | ||
| ) |
transmit and receive setup dma for spi
| [in] | ptr | SPI base address |
| [in] | size | spi sent and receive data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t hpm_spi_transmit_setup_dma | ( | SPI_Type * | ptr, |
| uint32_t | size | ||
| ) |
transmit setup dma for spi
| [in] | ptr | SPI base address |
| [in] | size | spi transmit data count(word unit), not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi in busy status |
|
static |
|
static |
|
static |
|
static |
spi with dma chain workflow
|
static |
|
static |
|
static |
|
static |