/* Set DMA control A register used by a HDMA channel.  */
void DMA_SetSourceBufferSize(unsigned char channel, unsigned int size, unsigned char sourceWidth, unsigned char destWidth, unsigned char done)
/* Set DMA control A register used by a HDMA channel.  */
void DMA_SetSourceBufferSize(unsigned char channel, unsigned int size, unsigned char sourceWidth, unsigned char destWidth, unsigned char done)
{
    ASSERT(channel < DMA_CHANNEL_NUM, "this channel does not exist");
    ASSERT(sourceWidth < 4, "width does not support");
    ASSERT(destWidth < 4, "width does not support");
    AT91C_BASE_HDMA->HDMA_CH[channel].HDMA_CTRLA = (size |
                                                   sourceWidth << 24 |
                                                   destWidth << 28 |
                                                   done << 31);
}