(async-transfer)

General Description

Data Structures

struct  mtb_async_transfer_interface_t
 Async Transfer interface data structure. More...
 
struct  mtb_async_transfer_context_t
 Async Transfer context data structure. More...
 

Data Structure Documentation

◆ mtb_async_transfer_interface_t

struct mtb_async_transfer_interface_t
Data Fields
void * inst_ref The opaque pointer that is passed as the first argument to all non-DMA functions.

For e.g. this could be pointer to peripheral instance base address

volatile uint32_t * rx_addr Pointer to the read data source address.
volatile uint32_t * tx_addr Pointer to the write data destination address.
mtb_async_transfer_get_num_fifo_t get_num_rx_fifo Function to get the number of elements available in the RX FIFO.
mtb_async_transfer_get_num_fifo_t get_num_tx_fifo Function to get the number of elements that can be written to the TX FIFO.
mtb_async_transfer_set_fifo_level_t set_rx_fifo_level Function to set the RX FIFO level above which the interrupt is triggered.
mtb_async_transfer_set_fifo_level_t set_tx_fifo_level Function to set the TX FIFO level below which the interrupt is triggered.
mtb_async_transfer_set_enabled_t enable_rx_event Function to enable/disable RX FIFO level interrupt event.
mtb_async_transfer_set_enabled_t enable_tx_event Function to enable/disable TX FIFO level interrupt event.
mtb_async_transfer_set_enabled_t dma_enable_rx Function to enable/disable RX DMA event and RX DMA channel.
mtb_async_transfer_set_enabled_t dma_enable_tx Function to enable/disable TX DMA event and TX DMA channel.
mtb_async_transfer_get_len_t get_rx_transfer_len Number of elements that the peripheral interface can receive in a single transfer.
mtb_async_transfer_get_len_t get_tx_transfer_len Number of elements that the peripheral interface can transmit in a single transfer.
uint32_t transfer_width Width, in bytes, of each FIFO element.
void * dma_rx_ref Opaque pointer that is passed as the first argument when operating on the RX DMA.
void * dma_tx_ref Opaque pointer that is passed as the first argument when operating on the TX DMA.
mtb_async_transfer_dma_set_len_t dma_set_length Function to set the DMA transfer length.
mtb_async_transfer_dma_set_addr_t dma_set_src Function to set the DMA source address.
mtb_async_transfer_dma_set_addr_t dma_set_dest Function to set the DMA destination address.
mtb_async_transfer_enter_critical_section_t enter_critical_section Function to enter critical section.
mtb_async_transfer_exit_critical_section_t exit_critical_section Function to exit critical section.

◆ mtb_async_transfer_context_t

struct mtb_async_transfer_context_t
Data Fields
mtb_async_transfer_interface_t interface Async Transfer interface that holds the information needed to perform the data transfer on the peripheral.
void * src_addr Pointer to the source address from which the data is transferred in case of write.
uint32_t src_length Number of bytes to be transferred from the source.
void * dest_addr Pointer to the destination address to which the data is transferred in case of read.
uint32_t dest_length Number of bytes to be transferred to the destination.
mtb_async_transfer_event_callback_t callback Callback function to be invoked once the read/write async transfer is complete.
void * callback_arg Argument to be provided to the transfer complete callback function when invoked.