
volatile unsigned char *CHCFG14= (volatile unsigned char *) (DMAMUX_BA0x000D);
volatile unsigned char *CHCFG15= (volatile unsigned char *) (DMAMUX_BA0x000C);
In File main.c:
#include "registers.h"
:
:
*CHCFG1 = 0x00;
*CHCFG1 = 0x85;
To disable a source:
A particular DMA source may be disabled by not writing the corresponding source value
into any of the CHCFG registers. Additionally, some module-specific configuration may
be necessary. See the appropriate section for more details.
To switch the source of a DMA channel:
1. Disable the DMA channel in the DMA and reconfigure the channel for the new
source.
2. Clear the CHCFG[ENBL] and CHCFG[TRIG] bits of the DMA channel.
3. Select the source to be routed to the DMA channel. Write to the corresponding
CHCFG register, ensuring that the CHCFG[ENBL] and CHCFG[TRIG] fields are
set.
To switch DMA channel 8 from source #5 transmit to source #7 transmit:
1. In the DMA configuration registers, disable DMA channel 8 and reconfigure it to
handle the transfers to peripheral slot 7. This example assumes channel 8 doesn't
have triggering capability.
2. Write 0x00 to CHCFG8.
3. Write 0x87 to CHCFG8. (In this example, setting CHCFG[TRIG] would have no
effect due to the assumption that channel 8 does not support the periodic triggering
functionality.)
The following code example illustrates steps 2 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);
volatile unsigned char *CHCFG14= (volatile unsigned char *) (DMAMUX_BA0x000D);
volatile unsigned char *CHCFG15= (volatile unsigned char *) (DMAMUX_BA0x000C);
Chapter 21 Direct Memory Access Multiplexer (DMAMUX)
K22F Sub-Family Reference Manual, Rev. 4, 08/2016
NXP Semiconductors
423
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...