/* configure the direction of data transfer on the channel  */
void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint8_t direction)
/* configure the direction of data transfer on the channel  */
void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint8_t direction)
{
    uint32_t ctl;
    ctl = DMA_CHCTL(dma_periph, channelx);
    ctl &= ~DMA_CHXCTL_TM;
    ctl |= direction;
    DMA_CHCTL(dma_periph, channelx) = ctl;
}