SPI driver APIs. More...
Data Structures | |
| struct | spi_master_timing_config_t |
| spi master interface timing config structure More... | |
| struct | spi_timing_config_t |
| spi interface timing config structure More... | |
| struct | spi_master_format_config_t |
| spi master transfer format config structure More... | |
| struct | spi_common_format_config_t |
| spi common format config structure More... | |
| struct | spi_format_config_t |
| spi format config structure More... | |
| struct | spi_master_control_config_t |
| spi master transfer control config structure More... | |
| struct | spi_slave_control_config_t |
| spi slave transfer control config structure More... | |
| struct | spi_common_control_config_t |
| spi common transfer control config structure More... | |
| struct | spi_control_config_t |
| spi control config structure More... | |
Functions | |
| void | spi_master_get_default_timing_config (spi_timing_config_t *config) |
| spi master get default timing config More... | |
| void | spi_master_get_default_format_config (spi_format_config_t *config) |
| spi master get default format config More... | |
| void | spi_master_get_default_control_config (spi_control_config_t *config) |
| spi master get default control config More... | |
| void | spi_slave_get_default_format_config (spi_format_config_t *config) |
| spi slave get default format config More... | |
| void | spi_slave_get_default_control_config (spi_control_config_t *config) |
| spi slave get default control config More... | |
| hpm_stat_t | spi_master_timing_init (SPI_Type *ptr, spi_timing_config_t *config) |
| spi master timing initialization More... | |
| void | spi_format_init (SPI_Type *ptr, spi_format_config_t *config) |
| spi format initialization More... | |
| hpm_stat_t | spi_transfer (SPI_Type *ptr, spi_control_config_t *config, uint8_t *cmd, uint32_t *addr, uint8_t *wbuff, uint32_t wcount, uint8_t *rbuff, uint32_t rcount) |
| spi transfer More... | |
| hpm_stat_t | spi_setup_dma_transfer (SPI_Type *ptr, spi_control_config_t *config, uint8_t *cmd, uint32_t *addr, uint32_t wcount, uint32_t rcount) |
| spi setup dma transfer More... | |
| hpm_stat_t | spi_wait_for_idle_status (SPI_Type *ptr) |
| spi wait for idle status More... | |
| hpm_stat_t | spi_wait_for_busy_status (SPI_Type *ptr) |
| spi wait for busy status More... | |
| static void | spi_set_tx_fifo_threshold (SPI_Type *ptr, uint32_t threshold) |
| SPI set TX FIFO threshold. More... | |
| static void | spi_set_rx_fifo_threshold (SPI_Type *ptr, uint32_t threshold) |
| SPI set RX FIFO threshold. More... | |
| static void | spi_enable_dma (SPI_Type *ptr, uint32_t mask) |
| Enables the SPI DMA request. More... | |
| static void | spi_disable_dma (SPI_Type *ptr, uint32_t mask) |
| Disables the SPI DMA request. More... | |
| static uint32_t | spi_get_interrupt_status (SPI_Type *ptr) |
| Get the SPI interrupt status. More... | |
| static void | spi_clear_interrupt_status (SPI_Type *ptr, uint32_t mask) |
| Clear the SPI interrupt status. More... | |
| static void | spi_enable_interrupt (SPI_Type *ptr, uint32_t mask) |
| Enables the SPI interrupt. More... | |
| static void | spi_disable_interrupt (SPI_Type *ptr, uint32_t mask) |
| Disables the SPI interrupt. More... | |
| hpm_stat_t | spi_write_read_data (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *wbuff, uint32_t wcount, uint8_t *rbuff, uint32_t rcount) |
| spi write and read data More... | |
| hpm_stat_t | spi_read_data (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *buff, uint32_t count) |
| spi read data More... | |
| hpm_stat_t | spi_write_data (SPI_Type *ptr, uint8_t data_len_in_bytes, uint8_t *buff, uint32_t count) |
| spi write data More... | |
| hpm_stat_t | spi_write_command (SPI_Type *ptr, spi_mode_selection_t mode, spi_control_config_t *config, uint8_t *cmd) |
| spi write command More... | |
| hpm_stat_t | spi_read_command (SPI_Type *ptr, spi_mode_selection_t mode, spi_control_config_t *config, uint8_t *cmd) |
| spi read command More... | |
| hpm_stat_t | spi_write_address (SPI_Type *ptr, spi_mode_selection_t mode, spi_control_config_t *config, uint32_t *addr) |
| spi write address More... | |
| hpm_stat_t | spi_control_init (SPI_Type *ptr, spi_control_config_t *config, uint32_t wcount, uint32_t rcount) |
| spi control initialization More... | |
| static uint8_t | spi_get_data_length_in_bits (SPI_Type *ptr) |
| Get the SPI data length in bits. More... | |
| static uint8_t | spi_get_data_length_in_bytes (SPI_Type *ptr) |
| Get the SPI data length in bytes. More... | |
| static bool | spi_is_active (SPI_Type *ptr) |
| SPI get active status. More... | |
| static void | spi_enable_tx_dma (SPI_Type *ptr) |
| SPI enable tx dma. More... | |
| static void | spi_disable_tx_dma (SPI_Type *ptr) |
| SPI disable tx dma. More... | |
| static void | spi_enable_rx_dma (SPI_Type *ptr) |
| SPI enable rx dma. More... | |
| static void | spi_disable_rx_dma (SPI_Type *ptr) |
| SPI disable rx dma. More... | |
| static uint32_t | spi_slave_get_sent_data_count (SPI_Type *ptr) |
| SPI slave get sent data count. More... | |
| static uint32_t | spi_slave_get_received_data_count (SPI_Type *ptr) |
| SPI slave get received data count. More... | |
| static void | spi_set_clock_phase (SPI_Type *ptr, spi_sclk_sampling_clk_edges_t clock_phase) |
| set spi clock phase More... | |
| static spi_sclk_sampling_clk_edges_t | spi_get_clock_phase (SPI_Type *ptr) |
| get spi clock phase More... | |
| static void | spi_set_clock_polarity (SPI_Type *ptr, spi_sclk_idle_state_t clock_polarity) |
| set spi clock polarity More... | |
| static spi_sclk_idle_state_t | spi_get_clock_polarity (SPI_Type *ptr) |
| get spi clock phase More... | |
| static hpm_stat_t | spi_set_data_bits (SPI_Type *ptr, uint8_t nbits) |
| set spi the length of each data unit in bits More... | |
| static void | spi_transmit_fifo_reset (SPI_Type *ptr) |
| SPI transmit fifo reset. More... | |
| static void | spi_receive_fifo_reset (SPI_Type *ptr) |
| SPI receive fifo reset. More... | |
| static void | spi_reset (SPI_Type *ptr) |
| SPI reset. More... | |
| static void | spi_set_address_len (SPI_Type *ptr, spi_address_len_t addrlen) |
| set spi the length of address More... | |
| static void | spi_enable_data_merge (SPI_Type *ptr) |
| Enable SPI data merge. More... | |
| static void | spi_disable_data_merge (SPI_Type *ptr) |
| Disable SPI data merge. More... | |
| hpm_stat_t | spi_directio_enable_output (SPI_Type *ptr, spi_directio_pin_t pin) |
| enable specific pin output for spi directio More... | |
| hpm_stat_t | spi_directio_disable_output (SPI_Type *ptr, spi_directio_pin_t pin) |
| disable specific pin output for spi directio More... | |
| hpm_stat_t | spi_directio_write (SPI_Type *ptr, spi_directio_pin_t pin, bool high) |
| write specified pin level for spi directio More... | |
| uint8_t | spi_directio_read (SPI_Type *ptr, spi_directio_pin_t pin) |
| Read specified pin level for spi directio. More... | |
| static void | spi_enable_directio (SPI_Type *ptr) |
| Enable SPI directIO control function. More... | |
| static void | spi_disable_directio (SPI_Type *ptr) |
| Disable SPI directIO control function. More... | |
| static uint8_t | spi_get_directio_enable_status (SPI_Type *ptr) |
| get whether spi directio function is enabled More... | |
| static uint8_t | spi_get_rx_fifo_valid_data_size (SPI_Type *ptr) |
| Get valid data size in receive FIFO. More... | |
| static uint8_t | spi_get_tx_fifo_valid_data_size (SPI_Type *ptr) |
| Get valid data size in transmit FIFO. More... | |
| static uint8_t | spi_get_rx_fifo_size (SPI_Type *ptr) |
| Get SPI RXFIFO size. More... | |
| static uint8_t | spi_get_tx_fifo_size (SPI_Type *ptr) |
| Get SPI TXFIFO size. More... | |
| static void | spi_slave_enable_data_only (SPI_Type *ptr) |
| SPI slave enable only date mode. More... | |
| static void | spi_slave_disable_data_only (SPI_Type *ptr) |
| SPI slave disable only date mode. More... | |
| static void | spi_master_enable_command_phase (SPI_Type *ptr) |
| SPI master enable command phase. More... | |
| static void | spi_master_disable_command_phase (SPI_Type *ptr) |
| SPI master disable command phase. More... | |
| static void | spi_master_enable_address_phase (SPI_Type *ptr) |
| SPI master enable address phase. More... | |
| static void | spi_master_disable_address_phase (SPI_Type *ptr) |
| SPI master disable address phase. More... | |
| static void | spi_master_set_address_phase_format (SPI_Type *ptr, spi_addr_phase_format_t format) |
| SPI master set address phase format. More... | |
| static void | spi_set_transfer_mode (SPI_Type *ptr, spi_trans_mode_t mode) |
| SPI master set transfer mode. More... | |
| static void | spi_master_enable_token_transfer (SPI_Type *ptr) |
| SPI master enable token transfer. More... | |
| static void | spi_master_disable_token_transfer (SPI_Type *ptr) |
| SPI master disable token transfer. More... | |
| static void | spi_set_write_data_count (SPI_Type *ptr, uint32_t count) |
| SPI master set transfer count for write data. More... | |
| static void | spi_set_read_data_count (SPI_Type *ptr, uint32_t count) |
| SPI master set transfer count for read data. More... | |
| static void | spi_master_set_token_value (SPI_Type *ptr, spi_token_value_t value) |
| SPI master set the value of the one-byte special token following the address phase for SPI read transfers. More... | |
| static void | spi_set_dummy_count (SPI_Type *ptr, spi_dummy_count_t count) |
| SPI master set dummy data count. More... | |
| static void | spi_master_set_cs2sclk_timing (SPI_Type *ptr, spi_cs2sclk_duration_t duration) |
| SPI master set the minimum time between the edges of SPI CS and the edges of SCLK. More... | |
| static spi_cs2sclk_duration_t | spi_master_get_cs2sclk_timing (SPI_Type *ptr) |
| SPI master get the minimum time between the edges of SPI CS and the edges of SCLK. More... | |
| static void | spi_master_set_csht_timing (SPI_Type *ptr, spi_csht_duration_t duration) |
| SPI master set the minimum time that SPI CS should stay HIGH. More... | |
| static spi_csht_duration_t | spi_master_get_csht_timing (SPI_Type *ptr) |
| SPI master get the minimum time that SPI CS should stay HIGH. More... | |
| static void | spi_master_set_sclk_div (SPI_Type *ptr, uint8_t div) |
| SPI master set the clock frequency ratio between the clock source and SPI SCLK. More... | |
| static uint8_t | spi_master_get_sclk_div (SPI_Type *ptr) |
| SPI master get the clock frequency ratio between the clock source and SPI SCLK. More... | |
| static void | spi_slave_set_user_status (SPI_Type *ptr, uint16_t user_status) |
| SPI slave set the user defined status flags. More... | |
| static void | spi_master_set_data_phase_format (SPI_Type *ptr, spi_data_phase_format_t format) |
| SPI master set data phase format. More... | |
| static spi_data_phase_format_t | spi_master_get_data_phase_format (SPI_Type *ptr) |
| SPI master get data phase format. More... | |
| static void | spi_set_shift_direction (SPI_Type *ptr, spi_shift_direction_t shift_direction) |
| set spi shift direction More... | |
| static spi_shift_direction_t | spi_get_shift_direction (SPI_Type *ptr) |
| get spi shift direction More... | |
SPI driver APIs.
| anonymous enum |
#include <drivers/inc/hpm_spi_drv.h>
spi address phase format
| Enumerator | |
|---|---|
| spi_address_phase_format_single_io_mode | |
| spi_address_phase_format_dualquad_io_mode | |
| enum spi_address_len_t |
#include <drivers/inc/hpm_spi_drv.h>
| Enumerator | |
|---|---|
| addrlen_8bit | |
| addrlen_16bit | |
| addrlen_24bit | |
| addrlen_32bit | |
#include <drivers/inc/hpm_spi_drv.h>
spi cs to sclk edge duration
| Enumerator | |
|---|---|
| spi_cs2sclk_half_sclk_1 | |
| spi_cs2sclk_half_sclk_2 | |
| spi_cs2sclk_half_sclk_3 | |
| spi_cs2sclk_half_sclk_4 | |
| enum spi_cs_index_t |
#include <drivers/inc/hpm_spi_drv.h>
| Enumerator | |
|---|---|
| spi_cs_0 | |
| spi_cs_1 | |
| spi_cs_2 | |
| spi_cs_3 | |
| enum spi_csht_duration_t |
#include <drivers/inc/hpm_spi_drv.h>
spi cs high level duration
#include <drivers/inc/hpm_spi_drv.h>
spi data phase format
| Enumerator | |
|---|---|
| spi_single_io_mode | |
| spi_dual_io_mode | |
| spi_quad_io_mode | |
| enum spi_directio_pin_t |
#include <drivers/inc/hpm_spi_drv.h>
| Enumerator | |
|---|---|
| hold_pin | |
| wp_pin | |
| miso_pin | |
| mosi_pin | |
| sclk_pin | |
| cs_pin | |
| enum spi_dma_enable_t |
| enum spi_dummy_count_t |
#include <drivers/inc/hpm_spi_drv.h>
spi dummy count
| Enumerator | |
|---|---|
| spi_dummy_count_1 | |
| spi_dummy_count_2 | |
| spi_dummy_count_3 | |
| spi_dummy_count_4 | |
| enum spi_interrupt_t |
#include <drivers/inc/hpm_spi_drv.h>
spi interrupt mask
| Enumerator | |
|---|---|
| spi_rx_fifo_overflow_int | |
| spi_tx_fifo_underflow_int | |
| spi_rx_fifo_threshold_int | |
| spi_tx_fifo_threshold_int | |
| spi_end_int | |
| spi_slave_cmd_int | |
| enum spi_mode_selection_t |
#include <drivers/inc/hpm_spi_drv.h>
spi clock polarity
| Enumerator | |
|---|---|
| spi_sclk_low_idle | |
| spi_sclk_high_idle | |
#include <drivers/inc/hpm_spi_drv.h>
spi clock phase
| Enumerator | |
|---|---|
| spi_sclk_sampling_odd_clk_edges | |
| spi_sclk_sampling_even_clk_edges | |
#include <drivers/inc/hpm_spi_drv.h>
| Enumerator | |
|---|---|
| msb_first | |
| lsb_first | |
| enum spi_token_value_t |
#include <drivers/inc/hpm_spi_drv.h>
spi token value
| Enumerator | |
|---|---|
| spi_token_value_0x00 | |
| spi_token_value_0x69 | |
| enum spi_trans_mode_t |
#include <drivers/inc/hpm_spi_drv.h>
spi transfer mode
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Clear the SPI interrupt status.
This function clears interrupt status of the SPI.
| ptr | SPI base address. |
| mask | The interrupt mask; Use the spi_interrupt_t. |
| hpm_stat_t spi_control_init | ( | SPI_Type * | ptr, |
| spi_control_config_t * | config, | ||
| uint32_t | wcount, | ||
| uint32_t | rcount | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi control initialization
| [in] | ptr | SPI base address |
| [in] | config | point to spi_control_config_t |
| [in] | wcount | spi sent data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [in] | rcount | spi receive count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi transfer without any error |
| hpm_stat_t spi_directio_disable_output | ( | SPI_Type * | ptr, |
| spi_directio_pin_t | pin | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
disable specific pin output for spi directio
| [in] | ptr | SPI base address |
| [in] | pin | spi_directio_pin_t enum |
| hpm_stat_t spi_directio_enable_output | ( | SPI_Type * | ptr, |
| spi_directio_pin_t | pin | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
enable specific pin output for spi directio
| [in] | ptr | SPI base address |
| [in] | pin | spi_directio_pin_t enum |
| uint8_t spi_directio_read | ( | SPI_Type * | ptr, |
| spi_directio_pin_t | pin | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
Read specified pin level for spi directio.
| [in] | ptr | SPI base address |
| pin | spi_directio_pin_t enum |
| hpm_stat_t spi_directio_write | ( | SPI_Type * | ptr, |
| spi_directio_pin_t | pin, | ||
| bool | high | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
write specified pin level for spi directio
| [in] | ptr | SPI base address |
| [in] | pin | spi_directio_pin_t enum |
| [in] | high | Pin level set to high when it is set to true |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Disable SPI directIO control function.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Disables the SPI DMA request.
This function configures the Rx and Tx DMA mask of the SPI. The parameters are base and a DMA mask.
| ptr | SPI base address. |
| mask | The dma enable mask; Use the spi_dma_enable_t. |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Disables the SPI interrupt.
This function configures interrupt of the SPI. The parameters are base and a interrupt mask.
| ptr | SPI base address. |
| mask | The interrupt mask; Use the spi_interrupt_t. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Enable SPI directIO control function.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Enables the SPI DMA request.
This function configures the Rx and Tx DMA mask of the SPI. The parameters are base and a DMA mask.
| ptr | SPI base address. |
| mask | The dma enable mask; Use the spi_dma_enable_t. |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Enables the SPI interrupt.
This function configures interrupt of the SPI. The parameters are base and a interrupt mask.
| ptr | SPI base address. |
| mask | The interrupt mask; Use the spi_interrupt_t. |
|
inlinestatic |
|
inlinestatic |
| void spi_format_init | ( | SPI_Type * | ptr, |
| spi_format_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi format initialization
| [in] | ptr | SPI base address |
| [in] | config | spi_format_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
get spi clock phase
| [in] | ptr | SPI base address |
| spi_sclk_sampling_clk_edges_t | spi_sclk_sampling_odd_clk_edges if CPHA is 0 |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
get spi clock phase
| [in] | ptr | SPI base address |
| spi_sclk_idle_state_t | spi_sclk_low_idle if CPOL is 0 |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get the SPI data length in bits.
| ptr | SPI base address. |
| SPI | data length in bits |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get the SPI data length in bytes.
| ptr | SPI base address. |
| SPI | data length in bytes |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
get whether spi directio function is enabled
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get the SPI interrupt status.
This function gets interrupt status of the SPI.
| ptr | SPI base address. |
| SPI | interrupt status register value |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get SPI RXFIFO size.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get valid data size in receive FIFO.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
get spi shift direction
| [in] | ptr | SPI base address |
| spi_shift_direction_t | msb_first if frist MSB |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get SPI TXFIFO size.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
Get valid data size in transmit FIFO.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI get active status.
| ptr | SPI base address. |
| bool | true for active, false for inactive |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master disable address phase.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master disable command phase.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master disable token transfer.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master enable address phase.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master enable command phase.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master enable token transfer.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master get the minimum time between the edges of SPI CS and the edges of SCLK.
| [in] | ptr | SPI base address |
| spi_cs2sclk_duration_t | enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master get the minimum time that SPI CS should stay HIGH.
| [in] | ptr | SPI base address |
| spi_csht_duration_t | enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master get data phase format.
| [in] | ptr | SPI base address |
| return | the data phase format |
| void spi_master_get_default_control_config | ( | spi_control_config_t * | config | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi master get default control config
| [out] | config | spi_control_config_t |
| void spi_master_get_default_format_config | ( | spi_format_config_t * | config | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi master get default format config
| [out] | config | spi_format_config_t |
| void spi_master_get_default_timing_config | ( | spi_timing_config_t * | config | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi master get default timing config
| [out] | config | spi_timing_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master get the clock frequency ratio between the clock source and SPI SCLK.
| [in] | ptr | SPI base address |
| return | the frequency ratio value |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set address phase format.
| [in] | ptr | SPI base address |
| [in] | format | spi_addr_phase_format_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set the minimum time between the edges of SPI CS and the edges of SCLK.
| [in] | ptr | SPI base address |
| [in] | duration | spi_cs2sclk_duration_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set the minimum time that SPI CS should stay HIGH.
| [in] | ptr | SPI base address |
| [in] | duration | spi_csht_duration_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set data phase format.
| [in] | ptr | SPI base address |
| [in] | format | spi_data_phase_format_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set the clock frequency ratio between the clock source and SPI SCLK.
| [in] | ptr | SPI base address |
| [in] | div | the frequency ratio value |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set the value of the one-byte special token following the address phase for SPI read transfers.
| [in] | ptr | SPI base address |
| [in] | value | spi_token_value_t enum |
| hpm_stat_t spi_master_timing_init | ( | SPI_Type * | ptr, |
| spi_timing_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi master timing initialization
| [in] | ptr | SPI base address |
| [in] | config | spi_timing_config_t |
| hpm_stat_t | status_invalid_argument or status_success |
| hpm_stat_t spi_read_command | ( | SPI_Type * | ptr, |
| spi_mode_selection_t | mode, | ||
| spi_control_config_t * | config, | ||
| uint8_t * | cmd | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi read command
On slave mode, the command field of the last received SPI transaction is stored in this SPI Command Register
| [in] | ptr | SPI base address |
| [in] | mode | spi mode, use the spi_mode_selection_t |
| [in] | config | point to spi_control_config_t |
| [out] | cmd | command data address |
| hpm_stat_t | status_success if spi transfer without any error |
| hpm_stat_t spi_read_data | ( | SPI_Type * | ptr, |
| uint8_t | data_len_in_bytes, | ||
| uint8_t * | buff, | ||
| uint32_t | count | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi read data
| [in] | ptr | SPI base address |
| [in] | data_len_in_bytes | data length in bytes |
| [out] | buff | spi receive data buff address |
| [in] | count | spi receive data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi transfer without any error |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
set spi the length of address
| [in] | ptr | SPI base address |
| [in] | addrlen | address lenth enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
set spi clock phase
| [in] | ptr | SPI base address |
| [in] | clock_phase | clock phase enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
set spi clock polarity
| [in] | ptr | SPI base address |
| [in] | clock_polarity | clock polarity enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
set spi the length of each data unit in bits
| [in] | ptr | SPI base address |
| [in] | nbits | the actual bits number of a data |
| hpm_stat_t | status_success if spi transfer without any error |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set dummy data count.
| [in] | ptr | SPI base address |
| [in] | count | spi_dummy_count_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set transfer count for read data.
| [in] | ptr | SPI base address |
| [in] | count | the number of units of data to be received from SPI bus and stored to the Data |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI set RX FIFO threshold.
This function configures SPI RX FIFO threshold.
| ptr | SPI base address. |
| threshold | The FIFO threshold value, the value should not greater than FIFO size. |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
set spi shift direction
| [in] | ptr | SPI base address |
| [in] | shift_direction | shift direction enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set transfer mode.
| [in] | ptr | SPI base address |
| [in] | mode | spi_trans_mode_t enum |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI set TX FIFO threshold.
This function configures SPI TX FIFO threshold.
| ptr | SPI base address. |
| threshold | The FIFO threshold value, the value should not greater than FIFO size. |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI master set transfer count for write data.
| [in] | ptr | SPI base address |
| [in] | count | the number of units of data to be transmitted to the SPI bus from the Data |
| hpm_stat_t spi_setup_dma_transfer | ( | SPI_Type * | ptr, |
| spi_control_config_t * | config, | ||
| uint8_t * | cmd, | ||
| uint32_t * | addr, | ||
| uint32_t | wcount, | ||
| uint32_t | rcount | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi setup dma transfer
| [in] | ptr | SPI base address |
| [in] | config | spi_control_config_t |
| [in] | cmd | spi transfer command address |
| [in] | addr | spi transfer target address |
| [in] | wcount | spi sent data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [in] | rcount | spi receive data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi setup dma transfer without any error |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI slave disable only date mode.
| [in] | ptr | SPI base address |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI slave enable only date mode.
| [in] | ptr | SPI base address |
| void spi_slave_get_default_control_config | ( | spi_control_config_t * | config | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi slave get default control config
| [out] | config | spi_control_config_t |
| void spi_slave_get_default_format_config | ( | spi_format_config_t * | config | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi slave get default format config
| [out] | config | spi_format_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI slave get received data count.
| ptr | SPI base address |
| uint32_t | data count |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI slave get sent data count.
| ptr | SPI base address |
| uint32_t | data count |
|
inlinestatic |
#include <drivers/inc/hpm_spi_drv.h>
SPI slave set the user defined status flags.
| [in] | ptr | SPI base address |
| [in] | user_status | user status value |
| hpm_stat_t spi_transfer | ( | SPI_Type * | ptr, |
| spi_control_config_t * | config, | ||
| uint8_t * | cmd, | ||
| uint32_t * | addr, | ||
| uint8_t * | wbuff, | ||
| uint32_t | wcount, | ||
| uint8_t * | rbuff, | ||
| uint32_t | rcount | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi transfer
| [in] | ptr | SPI base address |
| [in] | config | spi_control_config_t |
| [in,out] | cmd | spi transfer command address |
| [in] | addr | spi transfer target address |
| [in] | wbuff | spi sent data buff address |
| [in] | wcount | spi sent data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [out] | rbuff | spi receive data buff address |
| [in] | rcount | spi receive data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi transfer without any error |
|
inlinestatic |
| hpm_stat_t spi_wait_for_busy_status | ( | SPI_Type * | ptr | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi wait for busy status
| [in] | ptr | SPI base address |
| hpm_stat_t | status_success if spi in busy status |
| hpm_stat_t spi_wait_for_idle_status | ( | SPI_Type * | ptr | ) |
#include <drivers/inc/hpm_spi_drv.h>
spi wait for idle status
| [in] | ptr | SPI base address |
| hpm_stat_t | status_success if spi in idle status |
| hpm_stat_t spi_write_address | ( | SPI_Type * | ptr, |
| spi_mode_selection_t | mode, | ||
| spi_control_config_t * | config, | ||
| uint32_t * | addr | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi write address
| [in] | ptr | SPI base address |
| [in] | mode | spi mode, use the spi_mode_selection_t |
| [in] | config | point to spi_control_config_t |
| [in] | addr | point to address |
| hpm_stat_t | status_success if spi transfer without any error |
| hpm_stat_t spi_write_command | ( | SPI_Type * | ptr, |
| spi_mode_selection_t | mode, | ||
| spi_control_config_t * | config, | ||
| uint8_t * | cmd | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi write command
Writing operations on this register will trigger SPI transfers, call this function on master mode.
| [in] | ptr | SPI base address |
| [in] | mode | spi mode, use the spi_mode_selection_t |
| [in] | config | point to spi_control_config_t |
| [in] | cmd | command data address |
| hpm_stat_t | status_success if spi transfer without any error |
| hpm_stat_t spi_write_data | ( | SPI_Type * | ptr, |
| uint8_t | data_len_in_bytes, | ||
| uint8_t * | buff, | ||
| uint32_t | count | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi write data
| [in] | ptr | SPI base address |
| [in] | data_len_in_bytes | data length in bytes |
| [in] | buff | spi sent data buff address |
| [in] | count | spi sent data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi transfer without any error |
| hpm_stat_t spi_write_read_data | ( | SPI_Type * | ptr, |
| uint8_t | data_len_in_bytes, | ||
| uint8_t * | wbuff, | ||
| uint32_t | wcount, | ||
| uint8_t * | rbuff, | ||
| uint32_t | rcount | ||
| ) |
#include <drivers/inc/hpm_spi_drv.h>
spi write and read data
| [in] | ptr | SPI base address |
| [in] | data_len_in_bytes | data length in bytes |
| [in] | wbuff | spi sent data buff address |
| [in] | wcount | spi sent data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| [out] | rbuff | spi receive data buff address |
| [in] | rcount | spi receive data count, not greater than SPI_SOC_TRANSFER_COUNT_MAX |
| hpm_stat_t | status_success if spi transfer without any error |