DMA_StructInit(&stcDmaInit);
stcDmaInit.u32IntEn = DMA_INT_DISABLE;
stcDmaInit.u32BlockSize = 1UL;
stcDmaInit.u32TransCount = 512;
stcDmaInit.u32DataWidth = DMA_DATAWIDTH_8BIT;
stcDmaInit.u32DestAddr = (uint32_t)DMARecBuf_USART4;
stcDmaInit.u32SrcAddr = (uint32_t)(&CM_USART4->RDR);
stcDmaInit.u32SrcAddrInc = DMA_SRC_ADDR_FIX;
stcDmaInit.u32DestAddrInc = DMA_DEST_ADDR_INC;
DMA_Init(USART4_RX_DMA_UNIT, USART4_RX_DMA_CH, &stcDmaInit);
pstcDmaRepeatInit.u32Mode=DMA_RPT_DEST;
pstcDmaRepeatInit.u32DestCount=512;
pstcDmaRepeatInit.u32SrcCount=0;
DMA_RepeatInit(USART4_RX_DMA_UNIT, USART4_RX_DMA_CH, &pstcDmaRepeatInit);
AOS_SetTriggerEventSrc(USART4_RX_DMA_TRIG_SEL, USART4_RX_DMA_TRIG_EVT_SRC);
DMA_Cmd(USART4_RX_DMA_UNIT, ENABLE);
DMA_ChCmd(USART4_RX_DMA_UNIT, USART4_RX_DMA_CH, ENABLE);
对着手册研究了半天,实在是搞不清错在哪了
|