
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
Содержание K22F series
Страница 2: ...K22F Sub Family Reference Manual Rev 4 08 2016 2 NXP Semiconductors...
Страница 150: ...Private Peripheral Bus PPB memory map K22F Sub Family Reference Manual Rev 4 08 2016 150 NXP Semiconductors...
Страница 168: ...Module clocks K22F Sub Family Reference Manual Rev 4 08 2016 168 NXP Semiconductors...
Страница 198: ...Security Interactions with other Modules K22F Sub Family Reference Manual Rev 4 08 2016 198 NXP Semiconductors...
Страница 258: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 258 NXP Semiconductors...
Страница 292: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 292 NXP Semiconductors...
Страница 398: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 398 NXP Semiconductors...
Страница 628: ...Initialization and application information K22F Sub Family Reference Manual Rev 4 08 2016 628 NXP Semiconductors...
Страница 740: ...Initialization Application Information K22F Sub Family Reference Manual Rev 4 08 2016 740 NXP Semiconductors...
Страница 750: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 750 NXP Semiconductors...
Страница 816: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 816 NXP Semiconductors...
Страница 866: ...Initialization Application Information K22F Sub Family Reference Manual Rev 4 08 2016 866 NXP Semiconductors...
Страница 890: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 890 NXP Semiconductors...
Страница 1028: ...Initialization Procedure K22F Sub Family Reference Manual Rev 4 08 2016 1028 NXP Semiconductors...
Страница 1040: ...Example configuration for chained timers K22F Sub Family Reference Manual Rev 4 08 2016 1040 NXP Semiconductors...
Страница 1118: ...Device mode IRC48 operation K22F Sub Family Reference Manual Rev 4 08 2016 1118 NXP Semiconductors...
Страница 1122: ...USB Voltage Regulator Module Signal Descriptions K22F Sub Family Reference Manual Rev 4 08 2016 1122 NXP Semiconductors...
Страница 1180: ...Initialization application information K22F Sub Family Reference Manual Rev 4 08 2016 1180 NXP Semiconductors...
Страница 1302: ...Application information K22F Sub Family Reference Manual Rev 4 08 2016 1302 NXP Semiconductors...
Страница 1374: ...Functional description K22F Sub Family Reference Manual Rev 4 08 2016 1374 NXP Semiconductors...