Create variables
- Create a module software instance structure for the USART module to store the USART driver state while it is in use.
structusart_module usart_instance;Note: This should never go out of scope as long as the module is in use. In most cases, this should be global. - Create module software instance structures for DMA resources to store the DMA resource state while it is in use.
structdma_resource usart_dma_resource_rx;structdma_resource usart_dma_resource_tx;Note: This should never go out of scope as long as the module is in use. In most cases, this should be global. - Create a buffer to store the data to be transferred /received.
#define BUFFER_LEN 8staticuint16_tstring[BUFFER_LEN]; - Create DMA transfer descriptors for RX/TX.
COMPILER_ALIGNED(16)DmacDescriptor example_descriptor_rx;DmacDescriptor example_descriptor_tx;
