/* 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)
{
    if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){
        DMA_WRONG_HANDLE
    }
    if(DMA_PERIPHERAL_TO_MEMORY == direction){
        DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR;
    } else {
        DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR;
    }
}