/* Set the transfer count of the specified dma channel.  */
en_result_t Dma_SetTransferCnt(en_dma_channel_t enCh, uint16_t u16TrnCnt)
/* Set the transfer count of the specified dma channel.  */
en_result_t Dma_SetTransferCnt(en_dma_channel_t enCh, uint16_t u16TrnCnt)
{
  ASSERT(IS_VALID_CH(enCh));
  ASSERT(IS_VALID_TRNCNT(u16TrnCnt));
  if((!IS_VALID_CH(enCh)) || (!IS_VALID_TRNCNT(u16TrnCnt)))
  {
    return ErrorInvalidParameter;
  }
  if(enCh == DmaCh0)
  {
    M0P_DMAC->CONFA0_f.TC = u16TrnCnt - 1;
  }
  else
  {
    M0P_DMAC->CONFA1_f.TC = u16TrnCnt - 1;     }
  return Ok;
}