Part Number: MSPM0G3519-Q1
I'd like to use the DMA to extend the RX FIFO in the UART for receiving long messages without an interrupt. The messages might be 2 bytes or as much as 256 bytes, and I'd like to check for message data from time to time from my main loop, with no interrupts.
Looking at the configuration of the example uart_rx_multibyte_fifo_dma_interrupts, the DMA is set up for a single transfer of 4 bytes to a buffer: volatile uint8_t gRxPacket[4]. When the DMA completes, the example catches an interrupt to handle the receipt.
Supposing I change it to volatile uint8_t gRxPacket[256] (changing the #define UART_PACKET_SIZE to 256), I'd expect the DMA to grab a few characters (e.g. 4 characters) but not fire the interrupt.
From my main loop, how can I query the DMA state to know 4 characters have arrived?
With that knowledge, I can process that portion of the message and re-enable the DMA, maybe back at &gRxPacket[0].
Is it safe to disable the DMA channel, check for and process the messages, reset the destination address, and re-enable the DMA? Do I need to do any other steps for characters that might arrive at the rx fifo while the DMA was disabled? Is there a better way to do this (without interrupts)?
Thanks!