Create variables

  1. Create a module software instance structure for the USART module to store the USART driver state while it is in use.
    struct usart_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.
  2. Create module software instance structures for DMA resources to store the DMA resource state while it is in use.
    struct dma_resource usart_dma_resource_rx;
    struct dma_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.
  3. Create a buffer to store the data to be transferred /received.
    #define BUFFER_LEN    8
    static uint16_t string[BUFFER_LEN];
    
  4. Create DMA transfer descriptors for RX/TX.
    COMPILER_ALIGNED(16)
    DmacDescriptor example_descriptor_rx;
    DmacDescriptor example_descriptor_tx;