Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
![]() |
Modules | |
dma transfer direction definition | |
dma source and destination address increment definition | |
dma data width definition | |
dma burst increment count definition | |
dma feature control cmd definition | |
Data Structures | |
union | bflb_dma_lli_control_s |
struct | bflb_dma_channel_lli_pool_s |
DMA channel lli pool structure. More... | |
struct | bflb_dma_channel_lli_transfer_s |
DMA channel lli transfer structure. More... | |
struct | bflb_dma_channel_config_s |
DMA configuration structure. More... | |
struct | bflb_rx_cycle_dma |
Functions | |
void | bflb_dma_channel_init (struct bflb_device_s *dev, const struct bflb_dma_channel_config_s *config) |
Initialize dma channel. More... | |
void | bflb_dma_channel_deinit (struct bflb_device_s *dev) |
Deinitialize dma channel. More... | |
void | bflb_dma_channel_start (struct bflb_device_s *dev) |
Start dma channel transfer. More... | |
void | bflb_dma_channel_stop (struct bflb_device_s *dev) |
Stop dma channel transfer. More... | |
bool | bflb_dma_channel_isbusy (struct bflb_device_s *dev) |
Check if dma channel is in busy. More... | |
void | bflb_dma_channel_irq_attach (struct bflb_device_s *dev, void(*callback)(void *arg), void *arg) |
Register dma channel transmission completion interrupt callback. More... | |
void | bflb_dma_channel_irq_detach (struct bflb_device_s *dev) |
Unregister dma channel transmission completion interrupt callback. More... | |
int | bflb_dma_channel_lli_reload (struct bflb_device_s *dev, struct bflb_dma_channel_lli_pool_s *lli_pool, uint32_t max_lli_count, struct bflb_dma_channel_lli_transfer_s *transfer, uint32_t count) |
Config dma channel lli. More... | |
void | bflb_dma_channel_lli_link_head (struct bflb_device_s *dev, struct bflb_dma_channel_lli_pool_s *lli_pool, uint32_t used_lli_count) |
Enable lli continueous mode. More... | |
void | bflb_rx_cycle_dma_init (struct bflb_rx_cycle_dma *rx_dma, struct bflb_device_s *dma_ch, struct bflb_dma_channel_lli_pool_s *rx_llipool, uint8_t rx_llipool_size, uint32_t src_addr, uint8_t *dst_buf, uint32_t dst_buf_size, void(*copy)(uint8_t *data, uint32_t len)) |
Init rx cycle dma. More... | |
void | bflb_rx_cycle_dma_process (struct bflb_rx_cycle_dma *rx_dma, bool in_dma_isr) |
Rx cycle dma process. More... | |
int | bflb_dma_feature_control (struct bflb_device_s *dev, int cmd, size_t arg) |
Control dma feature. More... | |
void | bflb_dma_channel_tcint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable dma channel transmission completion interrupt. More... | |
bool | bflb_dma_channel_get_tcint_status (struct bflb_device_s *dev) |
Check if dma channel transfers completely. More... | |
void | bflb_dma_channel_tcint_clear (struct bflb_device_s *dev) |
Clear dma channel transmission completion interrupt status. More... | |
void bflb_dma_channel_deinit | ( | struct bflb_device_s * | dev | ) |
Deinitialize dma channel.
[in] | dev | device handle |
bool bflb_dma_channel_get_tcint_status | ( | struct bflb_device_s * | dev | ) |
Check if dma channel transfers completely.
[in] | dev | device handle |
void bflb_dma_channel_init | ( | struct bflb_device_s * | dev, |
const struct bflb_dma_channel_config_s * | config | ||
) |
Initialize dma channel.
[in] | dev | device handle |
[in] | config | pointer to save dma channel configuration |
void bflb_dma_channel_irq_attach | ( | struct bflb_device_s * | dev, |
void(*)(void *arg) | callback, | ||
void * | arg | ||
) |
Register dma channel transmission completion interrupt callback.
[in] | dev | device handle |
[in] | callback | interrupt callback |
[in] | arg | user data |
void bflb_dma_channel_irq_detach | ( | struct bflb_device_s * | dev | ) |
Unregister dma channel transmission completion interrupt callback.
[in] | dev | device handle |
bool bflb_dma_channel_isbusy | ( | struct bflb_device_s * | dev | ) |
Check if dma channel is in busy.
[in] | dev | device handle |
void bflb_dma_channel_lli_link_head | ( | struct bflb_device_s * | dev, |
struct bflb_dma_channel_lli_pool_s * | lli_pool, | ||
uint32_t | used_lli_count | ||
) |
Enable lli continueous mode.
[in] | dev | device handle |
[in] | lli_pool | pointer to lli pool |
[in] | used_lli_count | number of used lli. |
int bflb_dma_channel_lli_reload | ( | struct bflb_device_s * | dev, |
struct bflb_dma_channel_lli_pool_s * | lli_pool, | ||
uint32_t | max_lli_count, | ||
struct bflb_dma_channel_lli_transfer_s * | transfer, | ||
uint32_t | count | ||
) |
Config dma channel lli.
[in] | dev | device handle |
[in] | lli_pool | pointer to lli pool |
[in] | max_lli_count | lli pool size |
[in] | transfer | pointer to transfer structure |
[in] | count | transfer count. |
void bflb_dma_channel_start | ( | struct bflb_device_s * | dev | ) |
Start dma channel transfer.
[in] | dev | device handle |
void bflb_dma_channel_stop | ( | struct bflb_device_s * | dev | ) |
Stop dma channel transfer.
[in] | dev | device handle |
void bflb_dma_channel_tcint_clear | ( | struct bflb_device_s * | dev | ) |
Clear dma channel transmission completion interrupt status.
[in] | dev | device handle |
void bflb_dma_channel_tcint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable dma channel transmission completion interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
int bflb_dma_feature_control | ( | struct bflb_device_s * | dev, |
int | cmd, | ||
size_t | arg | ||
) |
Control dma feature.
[in] | dev | device handle |
[in] | cmd | feature command. use dma feature control cmd definition |
[in] | arg | user data |
void bflb_rx_cycle_dma_init | ( | struct bflb_rx_cycle_dma * | rx_dma, |
struct bflb_device_s * | dma_ch, | ||
struct bflb_dma_channel_lli_pool_s * | rx_llipool, | ||
uint8_t | rx_llipool_size, | ||
uint32_t | src_addr, | ||
uint8_t * | dst_buf, | ||
uint32_t | dst_buf_size, | ||
void(*)(uint8_t *data, uint32_t len) | copy | ||
) |
Init rx cycle dma.
[in] | rx_dma | rx dma handle |
[in] | dma_ch | dma channel handle |
[in] | rx_llipool | pointer to lli pool |
[in] | rx_llipool_size | number of used lli |
[in] | src_addr | dma source addr |
[in] | dst_buf | dma dest addr |
[in] | dst_buf_size | dma dest buffer size |
[in] | copy | pointer to data copy |
void bflb_rx_cycle_dma_process | ( | struct bflb_rx_cycle_dma * | rx_dma, |
bool | in_dma_isr | ||
) |
Rx cycle dma process.
[in] | rx_dma | rx dma handle |
[in] | in_dma_isr | if called in dma isr |