const unsigned char samples[] = { ... }; ... DACR = samples[idx] << 8; |
Chip_GPDMA_Transfer(LPC_GPDMA, dmaChannelNum, (uint32_t) &DMAbuffer, GPDMA_CONN_DAC, GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA, 1); |
volatile static const void *GPDMA_LUTPerAddr[] = { 0,/* Reserved */ [...] (&LPC_DAC->CR),/* DAC */ [...] }; int Chip_GPDMA_InitChannelCfg(LPC_GPDMA_T *pGPDMA, GPDMA_CH_CFG_T *GPDMACfg, uint8_t ChannelNum, uint32_t src, uint32_t dst, uint32_t Size, GPDMA_FLOW_CONTROL_T TransferType) { int rval = -1; GPDMACfg->ChannelNum = ChannelNum; GPDMACfg->TransferType = TransferType; GPDMACfg->TransferSize = Size; switch (TransferType) { [...] case GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA: case GPDMA_TRANSFERTYPE_M2P_CONTROLLER_PERIPHERAL: GPDMACfg->SrcAddr = (uint32_t) src; rval = 1; GPDMACfg->DstAddr = (uint32_t) GPDMA_LUTPerAddr[dst]; break; [...] } |
int Chip_GPDMA_InitChannelCfg(LPC_GPDMA_T *pGPDMA, GPDMA_CH_CFG_T *GPDMACfg, uint8_t ChannelNum, uint32_t src, uint32_t dst, uint32_t Size, GPDMA_FLOW_CONTROL_T TransferType) { [...] switch (TransferType) { case GPDMA_TRANSFERTYPE_M2M_CONTROLLER_DMA: GPDMACfg->SrcAddr = (uint32_t) src; GPDMACfg->DstAddr = (uint32_t) dst; rval = 3; GPDMACfg->TransferWidth = GPDMA_WIDTH_WORD; GPDMACfg->TransferSize = Size / 4; break; [...] } |