Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
![]() |
Data Structures | |
struct | bflb_spi_config_s |
SPI configuration structure. More... | |
Functions | |
void | bflb_spi_init (struct bflb_device_s *dev, const struct bflb_spi_config_s *config) |
Initialize spi. More... | |
void | bflb_spi_deinit (struct bflb_device_s *dev) |
Deinitialize spi. More... | |
void | bflb_spi_link_txdma (struct bflb_device_s *dev, bool enable) |
Enable spi tx dma. More... | |
void | bflb_spi_link_rxdma (struct bflb_device_s *dev, bool enable) |
Enable spi rx dma. More... | |
uint32_t | bflb_spi_poll_send (struct bflb_device_s *dev, uint32_t data) |
Send and receive one data on spi. More... | |
int | bflb_spi_poll_exchange (struct bflb_device_s *dev, const void *txbuffer, void *rxbuffer, size_t nbytes) |
Send and receive a block of data on spi. More... | |
bool | bflb_spi_isbusy (struct bflb_device_s *dev) |
Check if spi is busy. More... | |
void | bflb_spi_txint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable spi rx fifo threhold interrupt. More... | |
void | bflb_spi_rxint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable spi rx fifo threhold interrupt. More... | |
void | bflb_spi_tcint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable spi transfer done interrupt. More... | |
void | bflb_spi_errint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable spi error interrupt. More... | |
uint32_t | bflb_spi_get_intstatus (struct bflb_device_s *dev) |
Get spi interrupt status. More... | |
void | bflb_spi_int_clear (struct bflb_device_s *dev, uint32_t int_clear) |
Clear spi interrupt status. More... | |
int | bflb_spi_feature_control (struct bflb_device_s *dev, int cmd, size_t arg) |
Control spi feature. More... | |
void bflb_spi_deinit | ( | struct bflb_device_s * | dev | ) |
Deinitialize spi.
[in] | dev | device handle |
void bflb_spi_errint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable spi error interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
int bflb_spi_feature_control | ( | struct bflb_device_s * | dev, |
int | cmd, | ||
size_t | arg | ||
) |
Control spi feature.
[in] | dev | device handle |
[in] | cmd | feature command, use spi feature control cmd definition |
[in] | arg | user data |
uint32_t bflb_spi_get_intstatus | ( | struct bflb_device_s * | dev | ) |
Get spi interrupt status.
[in] | dev | device handle |
void bflb_spi_init | ( | struct bflb_device_s * | dev, |
const struct bflb_spi_config_s * | config | ||
) |
Initialize spi.
[in] | dev | device handle |
[in] | config | pointer to save spi config |
void bflb_spi_int_clear | ( | struct bflb_device_s * | dev, |
uint32_t | int_clear | ||
) |
Clear spi interrupt status.
[in] | dev | device handle |
[in] | int_clear | clear value, use spi interrupt clear definition |
bool bflb_spi_isbusy | ( | struct bflb_device_s * | dev | ) |
Check if spi is busy.
[in] | dev | device handle |
void bflb_spi_link_rxdma | ( | struct bflb_device_s * | dev, |
bool | enable | ||
) |
Enable spi rx dma.
[in] | dev | device handle |
[in] | enable | true means enable, otherwise disable. |
void bflb_spi_link_txdma | ( | struct bflb_device_s * | dev, |
bool | enable | ||
) |
Enable spi tx dma.
[in] | dev | device handle |
[in] | enable | true means enable, otherwise disable. |
int bflb_spi_poll_exchange | ( | struct bflb_device_s * | dev, |
const void * | txbuffer, | ||
void * | rxbuffer, | ||
size_t | nbytes | ||
) |
Send and receive a block of data on spi.
[in] | dev | device handle |
[in] | txbuffer | pointer to send buffer |
[in] | rxbuffer | pointer to receive buffer |
[in] | nbytes | bytes to send |
uint32_t bflb_spi_poll_send | ( | struct bflb_device_s * | dev, |
uint32_t | data | ||
) |
Send and receive one data on spi.
[in] | dev | device handle |
[in] | data | data to send |
void bflb_spi_rxint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable spi rx fifo threhold interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
void bflb_spi_tcint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable spi transfer done interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
void bflb_spi_txint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable spi rx fifo threhold interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |