I have some questions about DMA 。(k60f12)
1)DMAMUX0_CHCFG0 is equal to Channel0, is DMAMUX1_CHCFG0 equal to Channel16?
2)Whether Channel0 and Channel16 share the interrupt DMA0_DMA16_IRQHandler?
3)If I use Channel0 and Channel16 at the same time。A trigger Channel0 ,B trigger Channel16。
How to write the interrupt callback?
Hi, ChengHuang,
The MK60F12 family has 32 DMA channels totally, and the chip includes two DMA request MUXes that allows up to 126 DMA request signals to be mapped to any of the 32 DMA channels. The first MUX is connected to channels 0-15 and the second MUX is connected to channels 16-31.
In other words, the DMA MUX0_0~15 maps to DMA0~15, the DMA MUX1_0~15 maps to DMA16~31.
This is the maps:
DMA_MUX0 channel0 DMA0
DMA_MUX0 channel1 DMA1
DMA_MUX0 channel2 DMA2
......................
DMA MUX0 channel15 DMA15
DMA_MUX1 channel0 DMA16
DMA_MUX1 channel1 DMA17
DMA_MUX1 channel2 DMA18
......................
DMA MUX1 channel15 DMA31
1)DMAMUX0_CHCFG0 is equal to Channel0, is DMAMUX1_CHCFG0 equal to Channel16?
>>>>>>>>>>>>you are right, DMAMUX0_CHCFG0 triggers DMA0, DMAMUX1_CHCFG0 triggers DMA16.
2)Whether Channel0 and Channel16 share the interrupt DMA0_DMA16_IRQHandler?
3)If I use Channel0 and Channel16 at the same time。A trigger Channel0 ,B trigger Channel16。 How to write the interrupt callback?
>>>>>>>Anyway, one DMA source can not trigger two DMA channels, it is not allowed than one DMA source trigger two DMA channel: DMA0 and DMA16 as you said.
The source defined in MAMUX0_CHCFG0 triggers DMA0, the source defined in DMAMUX1_CHCFG0 triggers DMA16. the DMA0 and DMA16 are independent channels, each DMA channels has it's independent interrupt vector, you write the interrupt callback one by one, it is okay.
Hope it can help you
BR
XiangJun Rong