19.4.3.1.3 Adding a Descriptor Between Existing Descriptors
To insert a new descriptor ‘C’ between two existing descriptors (‘A’ and ‘B’), the descriptor currently being executed by the DMA must be identified.
- If DMA is executing descriptor B, descriptor C cannot be inserted.
- If DMA has not started executing descriptor A, follow the steps:
- Clear the Descriptor Valid (BTCTRL.VALID) bit of Descriptor A.
- Configure the Next Descriptor Address (DESCADDR) register of descriptor A to point to descriptor C instead of descriptor B.
- Configure the Next Descriptor Address (DESCADDR) register of descriptor C to point to descriptor B.
- Set the Descriptor Valid (BTCTRL.VALID) bit of descriptor A.
- If DMA is executing descriptor A:
- Issue a Suspend software command (CHCTRLB.CMD =
0x01) to the channel. - Perform steps 2.a through 2.d.
- Issue a Resume software command (CHCTRLB.CMD =
0x02) to the channel.
- Issue a Suspend software command (CHCTRLB.CMD =
