
2. Configure channel 1 in the DMA, including enabling the channel.
3. Configure a timer for the desired trigger interval.
4. Write 0xC5 to CHCFG1.
The following code example illustrates steps 1 and 4 above:
void DMAMUX_Init(uint8_t DMA_CH, uint8_t DMAMUX_SOURCE)
{
DMAMUX_0.CHCFG[DMA_CH].B.SOURCE = DMAMUX_SOURCE;
DMAMUX_0.CHCFG[DMA_CH].B.ENBL = 1;
DMAMUX_0.CHCFG[DMA_CH].B.TRIG = 1;
}
To enable a source, without periodic triggering:
1. Determine with which DMA channel the source will be associated. Note that only the
first 4 DMA channels have periodic triggering capability.
2. Clear the CHCFG[ENBL] and CHCFG[TRIG] fields of the DMA channel.
3. Ensure that the DMA channel is properly configured in the DMA. The DMA channel
may be enabled at this point.
4. Select the source to be routed to the DMA channel. Write to the corresponding
CHCFG register, ensuring that CHCFG[ENBL] is set while CHCFG[TRIG] is
cleared.
NOTE
The following is an example. See the chip configuration details
for the number of this device's DMA channels that have
triggering capability.
To configure source #5 transmit for use with DMA channel 1, with no periodic triggering
capability:
1. Write 0x00 to CHCFG1.
2. Configure channel 1 in the DMA, including enabling the channel.
3. Write 0x85 to CHCFG1.
The following code example illustrates steps 1 and 3 above:
In File registers.h:
#define DMAMUX_BASE_ADDR 0x40021000/* Example only ! */
/* Following example assumes char is 8-bits */
volatile unsigned char *CHCFG0 = (volatile unsigned char *) (DMAMUX_BA0x0003);
volatile unsigned char *CHCFG1 = (volatile unsigned char *) (DMAMUX_BA0x0002);
volatile unsigned char *CHCFG2 = (volatile unsigned char *) (DMAMUX_BA0x0001);
volatile unsigned char *CHCFG3 = (volatile unsigned char *) (DMAMUX_BA0x0000);
volatile unsigned char *CHCFG4 = (volatile unsigned char *) (DMAMUX_BA0x0007);
volatile unsigned char *CHCFG5 = (volatile unsigned char *) (DMAMUX_BA0x0006);
volatile unsigned char *CHCFG6 = (volatile unsigned char *) (DMAMUX_BA0x0005);
volatile unsigned char *CHCFG7 = (volatile unsigned char *) (DMAMUX_BA0x0004);
volatile unsigned char *CHCFG8 = (volatile unsigned char *) (DMAMUX_BA0x000B);
volatile unsigned char *CHCFG9 = (volatile unsigned char *) (DMAMUX_BA0x000A);
volatile unsigned char *CHCFG10= (volatile unsigned char *) (DMAMUX_BA0x0009);
volatile unsigned char *CHCFG11= (volatile unsigned char *) (DMAMUX_BA0x0008);
volatile unsigned char *CHCFG12= (volatile unsigned char *) (DMAMUX_BA0x000F);
volatile unsigned char *CHCFG13= (volatile unsigned char *) (DMAMUX_BA0x000E);
Initialization/application information
K22F Sub-Family Reference Manual, Rev. 4, 08/2016
422
NXP Semiconductors
Summary of Contents for K22F series
Page 2: ...K22F Sub Family Reference Manual Rev 4 08 2016 2 NXP Semiconductors...
Page 168: ...Module clocks K22F Sub Family Reference Manual Rev 4 08 2016 168 NXP Semiconductors...
Page 258: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 258 NXP Semiconductors...
Page 292: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 292 NXP Semiconductors...
Page 398: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 398 NXP Semiconductors...
Page 750: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 750 NXP Semiconductors...
Page 816: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 816 NXP Semiconductors...
Page 890: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 890 NXP Semiconductors...
Page 1302: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 1302 NXP Semiconductors...
Page 1374: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 1374 NXP Semiconductors...