SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
The SPI module provides an interface to the μDMA controller with separate channels for transmit and receive. The SPI DMA Control register (SPI.DMACR) allows the μDMA to operate with the SPI. When μDMA operation is enabled, the SPI asserts a μDMA request on the receive or transmit channel when the associated FIFO can transfer data. For the receive channel, a single transfer request is asserted whenever any data is in the RX FIFO. Whenever data in the RX FIFO reaches the configured level set in the SPI.IFLS[10:8] RXSEL bit field, a burst transfer request is asserted. The supported settings for RX FIFO are: ¼, ½ (default), ¾, full, and at least one location is available in the FIFO. For the transmit channel, a single transfer request is asserted whenever at least one empty location is in the TX FIFO. Whenever the TX FIFO reaches the configured level set through SPI.IFLS[2:0] TXSEL, the burst request is asserted. The supported settings for TX FIFO are ¼, ½ (default), ¾, and empty, and at least one location is available in the FIFO. The μDMA controller handles the single and burst μDMA transfer requests automatically depending on how the μDMA channel is configured.
To enable μDMA operation for the receive channel, set the SPI.DMACR[0] RXEN bit. To enable μDMA operation for the transmit channel, set the SPI.DMACR[8] TXEN register bit. If the μDMA is enabled and appropriate bits are cleared in the DMA Done Mask register (DMA.DONEMASK) the μDMA controller triggers an interrupt when a transfer completes. This interrupt can be chosen as one of the sources of the combined SPI interrupt. If interrupts are used for SPI operation and the μDMA is enabled, the SPI interrupt handler must be designed to handle the μDMA completion interrupt. The status of TX and RX DMA done interrupts can be read from the Channel Request Done register (DMA.REQDONE). They can also be read from SPI.RIS[8] DMATX bit and the SPI.RIS[7] DMARX bit. For clearing the TX and RX DMA done interrupts, the corresponding bits in the DMA.REQDONE register must be set to 1.
For more details about programming the μDMA controller, see Chapter 15