Content originally posted in LPCWare by leluno on Tue Apr 15 01:37:23 MST 2014
i am trying AN10850 with codeRed/LPC1768. I do not understand, how pins are fixed to DMACCDestAddr
<code>
/* extensions for test DMA to FIOPIN */
int32_t dma_start_m2pin(int32_t ch,
void *src,
void *dest,
DMAC_LL_T *plli,
int32_t trans)
{
int32_t sts = _ERROR;
/* Verify that the selected channel has been allocated */
if (dmadrv_dat.alloc_ch [ch] == TRUE)
{
/* Setup source and destination and clear LLI */
dmadrv_dat.pdma->dma_chan [ch].src_addr = (uint32_t) src;
dmadrv_dat.pdma->dma_chan [ch].dest_addr = (uint32_t) dest;
//dmadrv_dat.pdma->dma_chan [ch].dest_addr = (uint32_t) 0x2009C054+3;
dmadrv_dat.pdma->dma_chan [ch].lli = (uint32_t) plli;
/* Use linked list control word if available */
if (plli != NULL)
{
dmadrv_dat.pdma->dma_chan [ch].control = plli->next_ctrl;
}
else
{
/* Setup channel configuration */
dmadrv_dat.pdma->dma_chan [ch].control =
(DMAC_CHAN_INT_TC_EN |
DMAC_CHAN_SRC_AUTOINC | DMAC_CHAN_DEST_WIDTH_8 |
DMAC_CHAN_SRC_WIDTH_8 | DMAC_CHAN_DEST_BURST_1 |
DMAC_CHAN_SRC_BURST_1 |
DMAC_CHAN_TRANSFER_SIZE(trans));
}
/* Start channel transfer */
dmadrv_dat.pdma->dma_chan [ch].config_ch =
(DMAC_CHAN_FLOW_D_P2M | DMAC_CHAN_ENABLE | DMAC_SRC_PERIP(9) );
sts = _NO_ERROR;
}
return sts;
}
...
/* Use DMA to copy the data PIN2/2-6 */
dma_start_m2pin(dmach, (void *)(MEMSTART_U),(void *)(&(LPC_GPIO2->FIOPIN)), NULL, MEMSIZE);
//pin 3/25
// dma_start_m2pin(dmach, (void *)(MEMSTART_U),(void *)(&(LPC_GPIO3->FIOPIN)), NULL, MEMSIZE);
...</code>
&(LPC_GPIO2->FIOPIN) is a 32bit value. wehre is the mcu told to choose the special Pins 2-6 from GPIO2?
How can i change DMACCDestAddr to GPIO3.25?