g_u32DMAConfig = \
((PDMA_TEST_LENGTH/2 -1)<< PDMA_DSCT_CTL_TXCNT_Pos) | /* Transfer count is 1 */ \
PDMA_WIDTH_8 | /* Transfer width is 8 bits(one word) */ \
PDMA_SAR_FIX | /* Source increment size is fixed(no increment) */ \
PDMA_DAR_INC | /* Destination increment size is increment(increment) */ \
PDMA_REQ_SINGLE | /* Transfer type is burst transfer type */ \
PDMA_BURST_1 | /* Burst size is 128. No effect in single transfer type */ \
/* PDMA_TBINTDIS_DISABLE | Disable transfer done and table empty interrupt */
PDMA_OP_SCATTER; /* Operation mode is scatter-gather mode */
/* Enable transfer done interrupt */
PDMA_EnableInt(PDMA3,1, PDMA_INT_TRANS_DONE);
NVIC_EnableIRQ(PDMA3_IRQn);
}
void PDMA3_IRQHandler(void)
{
/* Check channel transfer done status */
if (PDMA_GET_TD_STS(PDMA3) == PDMA_TDSTS_TDIF1_Msk)
{
/* When finished a descriptor table then g_u32TransferredCount increases 1 */
pdma_test();
/* Clear transfer done flag of channel 4 */
PDMA_CLR_TD_FLAG(PDMA3,PDMA_TDSTS_TDIF1_Msk);
PDMA_SetTransferCnt(PDMA,1, PDMA_WIDTH_8, PDMA_TEST_LENGTH);
// printf("%x,pdma ok\r\n",PDMA3->DSCT[1].CTL);
}
}
static void SendChar_ToUART(int ch)
{
while(UART6->FIFOSTS & UART_FIFOSTS_TXFULL_Msk);