I would like to send data from an STM32 (Cortex M4) device via its I2S peripheral using DMA in 24bit mode, MSB first. The I2S data register is however only 16bit, according to the datasheet you have to send the upper halfword first, then the lower one. This is problematic when using the DMA, it will always send the lower halfword first.
What is an efficient way in c or ARM-assembler to switch the two halfwords?