VSF Documented
|
#include "hal/driver/driver.h"
Macros | |
#define | VSF_SPI_CFG_FUNCTION_RENAME DISABLED |
Functions | |
vsf_err_t | vsf_spi_init (vsf_spi_t *spi_ptr, vsf_spi_cfg_t *cfg_ptr) |
initialize a spi instance. | |
void | vsf_spi_fini (vsf_spi_t *spi_ptr) |
finalize a spi instance. | |
fsm_rt_t | vsf_spi_enable (vsf_spi_t *spi_ptr) |
enable interrupt masks of spi instance. | |
fsm_rt_t | vsf_spi_disable (vsf_spi_t *spi_ptr) |
disable interrupt masks of spi instance. | |
void | vsf_spi_irq_enable (vsf_spi_t *spi_ptr, vsf_spi_irq_mask_t irq_mask) |
enable interrupt masks of spi instance. | |
void | vsf_spi_irq_disable (vsf_spi_t *spi_ptr, vsf_spi_irq_mask_t irq_mask) |
disable interrupt masks of spi instance. | |
vsf_spi_status_t | vsf_spi_status (vsf_spi_t *spi_ptr) |
get the status of spi instance. | |
void | vsf_spi_cs_active (vsf_spi_t *spi_ptr, uint_fast8_t index) |
spi set chip select active | |
void | vsf_spi_cs_inactive (vsf_spi_t *spi_ptr, uint_fast8_t index) |
spi set chip select inactive | |
void | vsf_spi_fifo_transfer (vsf_spi_t *spi_ptr, void *out_buffer_ptr, uint_fast32_t *out_offset_ptr, void *in_buffer_ptr, uint_fast32_t *in_offset_ptr, uint_fast32_t cnt) |
spi fifo transfer | |
vsf_err_t | vsf_spi_request_transfer (vsf_spi_t *spi_ptr, void *out_buffer_ptr, void *in_buffer_ptr, uint_fast32_t count) |
start spi transfer. The best way to do this is to use DMA. Software implementation is the solution when DMA cannot be used | |
vsf_err_t | vsf_spi_cancel_transfer (vsf_spi_t *spi_ptr) |
spi cancel transfer | |
void | vsf_spi_get_transferred_count (vsf_spi_t *spi_ptr, uint_fast32_t *tx_count, uint_fast32_t *rx_count) |
spi get transferred counter | |
vsf_spi_capability_t | vsf_spi_capability (vsf_spi_t *spi_ptr) |
get the capability of spi instance. | |
#define VSF_SPI_CFG_FUNCTION_RENAME DISABLED |
vsf_err_t vsf_spi_init | ( | vsf_spi_t * | spi_ptr, |
vsf_spi_cfg_t * | cfg_ptr | ||
) |
initialize a spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | cfg_ptr | a pointer to structure vsf_spi_cfg_t |
void vsf_spi_fini | ( | vsf_spi_t * | spi_ptr | ) |
enable interrupt masks of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
disable interrupt masks of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
void vsf_spi_irq_enable | ( | vsf_spi_t * | spi_ptr, |
vsf_spi_irq_mask_t | irq_mask | ||
) |
enable interrupt masks of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | irq_mask | one or more value of enum vsf_spi_irq_mask_t |
void vsf_spi_irq_disable | ( | vsf_spi_t * | spi_ptr, |
vsf_spi_irq_mask_t | irq_mask | ||
) |
disable interrupt masks of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | irq_mask | one or more value of enum vsf_spi_irq_mask_t, vsf_spi_irq_mask_t |
vsf_spi_status_t vsf_spi_status | ( | vsf_spi_t * | spi_ptr | ) |
get the status of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |
void vsf_spi_cs_active | ( | vsf_spi_t * | spi_ptr, |
uint_fast8_t | index | ||
) |
spi set chip select active
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | index | chip select index |
void vsf_spi_cs_inactive | ( | vsf_spi_t * | spi_ptr, |
uint_fast8_t | index | ||
) |
spi set chip select inactive
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | index | chip select index |
void vsf_spi_fifo_transfer | ( | vsf_spi_t * | spi_ptr, |
void * | out_buffer_ptr, | ||
uint_fast32_t * | out_offset_ptr, | ||
void * | in_buffer_ptr, | ||
uint_fast32_t * | in_offset_ptr, | ||
uint_fast32_t | count | ||
) |
spi fifo transfer
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | out_buffer_ptr | a pointer to spi send data buffer, it can be a null pointer |
[in,out] | out_offset_ptr | a pointer to spi send data buffer offset |
[in] | in_buffer_ptr | a pointer to spi receive data buffer, it can be a null pointer |
[in,out] | in_offset_ptr | a pointer to spi send data buffer offset |
[in] | count | The number of data received or sent |
vsf_err_t vsf_spi_request_transfer | ( | vsf_spi_t * | spi_ptr, |
void * | out_buffer_ptr, | ||
void * | in_buffer_ptr, | ||
uint_fast32_t | count | ||
) |
start spi transfer. The best way to do this is to use DMA. Software implementation is the solution when DMA cannot be used
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[in] | out_buffer_ptr | a pointer to spi send data buffer, it can be a null pointer |
[in] | in_buffer_ptr | a pointer to spi receive data buffer, it can be a null pointer |
[in] | count | The number of data received or sent |
spi cancel transfer
[in] | spi_ptr | a pointer to structure vsf_spi_t |
void vsf_spi_get_transferred_count | ( | vsf_spi_t * | spi_ptr, |
uint_fast32_t * | sent_count, | ||
uint_fast32_t * | received_count | ||
) |
spi get transferred counter
[in] | spi_ptr | a pointer to structure vsf_spi_t |
[out] | send_count | a pointer to the number of spi data already sent |
[out] | received_count | a pointer to the number of spi data already received |
vsf_spi_capability_t vsf_spi_capability | ( | vsf_spi_t * | spi_ptr | ) |
get the capability of spi instance.
[in] | spi_ptr | a pointer to structure vsf_spi_t |