Once both channels are configured, they are enabled, a SPI DMA request is made, and finally the code waits for a completion flag. Notice that in this implementation, the processor sets up the transfer and then waits for completion, but this still involves busy waiting. An alternative approach (not considered here) is to enable a DMA interrupt and define an appropriate handler (e.g. DM1_Channel1_IRQHandler). The main code could then return and await an appropriate completion event. I postpone discussion of such an architecture until I have the opportunity to introduce an RTOS