English
Language : 

PXD10RM Datasheet, PDF (476/1332 Pages) Freescale Semiconductor, Inc – PXD10 Microcontroller
/* if enabled, apply the power-of-2 modulo to the next-state addr */
if (dma_engine.smod != 0)
address_select = (1 << dma_engine.smod) - 1; }
else
address_select = 0xffff_ffff;
dma_engine.saddr = ns_addr
& address_select
| dma_engine.saddr & ~address_select; }
}
/* process the destination address, WRITE data from buffer */
/* write “xfr_size” bytes to the destination */
/* if the dsize < ssize, do multiple writes to equal the ssize */
/* if the dsize => ssize, do a single write of dest data */
number_of_dest_writes = xfer_size / dest_xfer_size;
for (number_of_dest_writes) {
write_to_amba-ahb (dma_engine.daddr, dest_xfr_size) = dma_engine.data;
/* generate the next-state destination address */
/* sum the current daddr with the signed destination offset */
ns_addr = dma_engine.daddr + (int) dma_engine.doff;
/* if enabled, apply the power-of-2 modulo to the next-state dest addr */
if (dma_engine.dmod != 0)
address_select = (1 << dma_engine.dmod) - 1;
else
address_select = 0xffff_ffff;
dma_engine.daddr = ns_addr
& address_select
| dma_engine.daddr & ~address_select;
}
if (cancel_transfer)
break;
/* check for a higher priority channel to service if: */
/* 1) preemption is enabled */
/* 2) in fixed arbitration mode */
/* 3) a higher priority channel is requesting service */
/* 4) not already servicing a preempting channel */
if ((DCHPRIn.ecp = 1) & fixed_arbitration_mode
higher_pri_request & ~current_channel_is_preempt)
service_preempt_channel;
/* the bandwidth control field determines when the next read/write occurs */
if (dma_engine.bwc > 1)
stall_dma_engine (1 << dma_engine.bwc);
/* decrement the minor loop byte count */
dma_engine.nbytes = dma_engine.nbytes - xfr_size;
}while (dma_engine.nbytes > 0) /* end of minor inner loop */
dma_engine.citer--;
/* decrement major loop iteration count */
15-6
PXD10 Microcontroller Reference Manual, Rev. 1
Preliminary—Subject to Change Without Notice
Freescale Semiconductor