volatile unsigned char *CHCFG14= (volatile unsigned char *) (DMAMUX_BA0x000E);
volatile unsigned char *CHCFG15= (volatile unsigned char *) (DMAMUX_BA0x000F);
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 (base a 0x08).
3. Write 0x87 to CHCFG8 (base a 0x08). (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_BA0x0000);
volatile unsigned char *CHCFG1 = (volatile unsigned char *) (DMAMUX_BA0x0001);
volatile unsigned char *CHCFG2 = (volatile unsigned char *) (DMAMUX_BA0x0002);
volatile unsigned char *CHCFG3 = (volatile unsigned char *) (DMAMUX_BA0x0003);
volatile unsigned char *CHCFG4 = (volatile unsigned char *) (DMAMUX_BA0x0004);
volatile unsigned char *CHCFG5 = (volatile unsigned char *) (DMAMUX_BA0x0005);
volatile unsigned char *CHCFG6 = (volatile unsigned char *) (DMAMUX_BA0x0006);
volatile unsigned char *CHCFG7 = (volatile unsigned char *) (DMAMUX_BA0x0007);
volatile unsigned char *CHCFG8 = (volatile unsigned char *) (DMAMUX_BA0x0008);
volatile unsigned char *CHCFG9 = (volatile unsigned char *) (DMAMUX_BA0x0009);
volatile unsigned char *CHCFG10= (volatile unsigned char *) (DMAMUX_BA0x000A);
volatile unsigned char *CHCFG11= (volatile unsigned char *) (DMAMUX_BA0x000B);
volatile unsigned char *CHCFG12= (volatile unsigned char *) (DMAMUX_BA0x000C);
volatile unsigned char *CHCFG13= (volatile unsigned char *) (DMAMUX_BA0x000D);
volatile unsigned char *CHCFG14= (volatile unsigned char *) (DMAMUX_BA0x000E);
volatile unsigned char *CHCFG15= (volatile unsigned char *) (DMAMUX_BA0x000F);
Chapter 21 Direct Memory Access Multiplexer (DMAMUX)
K22F Sub-Family Reference Manual , Rev. 3, 7/2014
Freescale Semiconductor, Inc.
415
Содержание MK22FN256VDC12
Страница 2: ...K22F Sub Family Reference Manual Rev 3 7 2014 2 Freescale Semiconductor Inc...
Страница 136: ...Human machine interfaces K22F Sub Family Reference Manual Rev 3 7 2014 136 Freescale Semiconductor Inc...
Страница 164: ...Module clocks K22F Sub Family Reference Manual Rev 3 7 2014 164 Freescale Semiconductor Inc...
Страница 246: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 246 Freescale Semiconductor Inc...
Страница 328: ...Kinetis Flashloader Status Error Codes K22F Sub Family Reference Manual Rev 3 7 2014 328 Freescale Semiconductor Inc...
Страница 360: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 360 Freescale Semiconductor Inc...
Страница 388: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 388 Freescale Semiconductor Inc...
Страница 402: ...Initialization application information K22F Sub Family Reference Manual Rev 3 7 2014 402 Freescale Semiconductor Inc...
Страница 500: ...Initialization application information K22F Sub Family Reference Manual Rev 3 7 2014 500 Freescale Semiconductor Inc...
Страница 670: ...Flash memory map for EzPort access K22F Sub Family Reference Manual Rev 3 7 2014 670 Freescale Semiconductor Inc...
Страница 680: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 680 Freescale Semiconductor Inc...
Страница 744: ...Application information K22F Sub Family Reference Manual Rev 3 7 2014 744 Freescale Semiconductor Inc...
Страница 784: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 784 Freescale Semiconductor Inc...
Страница 794: ...Initialization Application Information K22F Sub Family Reference Manual Rev 3 7 2014 794 Freescale Semiconductor Inc...
Страница 960: ...Example configuration for chained timers K22F Sub Family Reference Manual Rev 3 7 2014 960 Freescale Semiconductor Inc...
Страница 1036: ...Device mode IRC48 operation K22F Sub Family Reference Manual Rev 3 7 2014 1036 Freescale Semiconductor Inc...
Страница 1040: ...USB Voltage Regulator Module Signal Descriptions K22F Sub Family Reference Manual Rev 3 7 2014 1040 Freescale Semiconductor Inc...
Страница 1094: ...Initialization application information K22F Sub Family Reference Manual Rev 3 7 2014 1094 Freescale Semiconductor Inc...
Страница 1128: ...Initialization application information K22F Sub Family Reference Manual Rev 3 7 2014 1128 Freescale Semiconductor Inc...
Страница 1216: ...Application information K22F Sub Family Reference Manual Rev 3 7 2014 1216 Freescale Semiconductor Inc...
Страница 1298: ...Functional description K22F Sub Family Reference Manual Rev 3 7 2014 1298 Freescale Semiconductor Inc...
Страница 1312: ...K22F Sub Family Reference Manual Rev 3 7 2014 1312 Freescale Semiconductor Inc...