40 #ifndef __DRIVERLIB_UDMA_H__
41 #define __DRIVERLIB_UDMA_H__
73 volatile void *pvSrcEndAddr;
78 volatile void *pvDstEndAddr;
83 volatile uint32_t ui32Control;
88 volatile uint32_t ui32Spare;
161 #define uDMATaskStructEntry(ui32TransferCount, \
170 (((ui32SrcIncrement) == UDMA_SRC_INC_NONE) ? (void *)(pvSrcAddr) : \
171 ((void *)(&((uint8_t *)(pvSrcAddr))[((ui32TransferCount) << \
172 ((ui32SrcIncrement) >> 26)) - 1]))), \
173 (((ui32DstIncrement) == UDMA_DST_INC_NONE) ? (void *)(pvDstAddr) :\
174 ((void *)(&((uint8_t *)(pvDstAddr))[((ui32TransferCount) << \
175 ((ui32DstIncrement) >> 30)) - 1]))), \
176 (ui32SrcIncrement) | (ui32DstIncrement) | (ui32ItemSize) | \
178 (((ui32TransferCount) - 1) << 4) | \
179 ((((ui32Mode) == UDMA_MODE_MEM_SCATTER_GATHER) || \
180 ((ui32Mode) == UDMA_MODE_PER_SCATTER_GATHER)) ? \
181 (ui32Mode) | UDMA_MODE_ALT_SELECT : (ui32Mode)), 0 \
197 #define UDMA_ATTR_USEBURST 0x00000001
198 #define UDMA_ATTR_ALTSELECT 0x00000002
199 #define UDMA_ATTR_HIGH_PRIORITY 0x00000004
200 #define UDMA_ATTR_REQMASK 0x00000008
201 #define UDMA_ATTR_ALL 0x0000000F
209 #define UDMA_MODE_STOP 0x00000000
210 #define UDMA_MODE_BASIC 0x00000001
211 #define UDMA_MODE_AUTO 0x00000002
212 #define UDMA_MODE_PINGPONG 0x00000003
213 #define UDMA_MODE_MEM_SCATTER_GATHER \
215 #define UDMA_MODE_PER_SCATTER_GATHER \
217 #define UDMA_MODE_ALT_SELECT 0x00000001
224 #define UDMA_DST_INC_8 0x00000000
225 #define UDMA_DST_INC_16 0x40000000
226 #define UDMA_DST_INC_32 0x80000000
227 #define UDMA_DST_INC_NONE 0xc0000000
228 #define UDMA_SRC_INC_8 0x00000000
229 #define UDMA_SRC_INC_16 0x04000000
230 #define UDMA_SRC_INC_32 0x08000000
231 #define UDMA_SRC_INC_NONE 0x0c000000
232 #define UDMA_SIZE_8 0x00000000
233 #define UDMA_SIZE_16 0x11000000
234 #define UDMA_SIZE_32 0x22000000
235 #define UDMA_DST_PROT_PRIV 0x00200000
236 #define UDMA_SRC_PROT_PRIV 0x00040000
237 #define UDMA_ARB_1 0x00000000
238 #define UDMA_ARB_2 0x00004000
239 #define UDMA_ARB_4 0x00008000
240 #define UDMA_ARB_8 0x0000c000
241 #define UDMA_ARB_16 0x00010000
242 #define UDMA_ARB_32 0x00014000
243 #define UDMA_ARB_64 0x00018000
244 #define UDMA_ARB_128 0x0001c000
245 #define UDMA_ARB_256 0x00020000
246 #define UDMA_ARB_512 0x00024000
247 #define UDMA_ARB_1024 0x00028000
248 #define UDMA_NEXT_USEBURST 0x00000008
256 #define UDMA_CHANNEL_USBEP1RX 0
257 #define UDMA_CHANNEL_USBEP1TX 1
258 #define UDMA_CHANNEL_USBEP2RX 2
259 #define UDMA_CHANNEL_USBEP2TX 3
260 #define UDMA_CHANNEL_USBEP3RX 4
261 #define UDMA_CHANNEL_USBEP3TX 5
262 #define UDMA_CHANNEL_ETH0RX 6
263 #define UDMA_CHANNEL_ETH0TX 7
264 #define UDMA_CHANNEL_UART0RX 8
265 #define UDMA_CHANNEL_UART0TX 9
266 #define UDMA_CHANNEL_SSI0RX 10
267 #define UDMA_CHANNEL_SSI0TX 11
268 #define UDMA_CHANNEL_ADC0 14
269 #define UDMA_CHANNEL_ADC1 15
270 #define UDMA_CHANNEL_ADC2 16
271 #define UDMA_CHANNEL_ADC3 17
272 #define UDMA_CHANNEL_TMR0A 18
273 #define UDMA_CHANNEL_TMR0B 19
274 #define UDMA_CHANNEL_TMR1A 20
275 #define UDMA_CHANNEL_TMR1B 21
276 #define UDMA_CHANNEL_UART1RX 22
277 #define UDMA_CHANNEL_UART1TX 23
278 #define UDMA_CHANNEL_SSI1RX 24
279 #define UDMA_CHANNEL_SSI1TX 25
280 #define UDMA_CHANNEL_I2S0RX 28
281 #define UDMA_CHANNEL_I2S0TX 29
282 #define UDMA_CHANNEL_SW 30
290 #define UDMA_PRI_SELECT 0x00000000
291 #define UDMA_ALT_SELECT 0x00000020
299 #define UDMA_INT_SW 62
300 #define UDMA_INT_ERR 63
308 #define UDMA_SEC_CHANNEL_UART2RX_0 \
310 #define UDMA_SEC_CHANNEL_UART2TX_1 \
312 #define UDMA_SEC_CHANNEL_TMR3A 2
313 #define UDMA_SEC_CHANNEL_TMR3B 3
314 #define UDMA_SEC_CHANNEL_TMR2A_4 \
316 #define UDMA_SEC_CHANNEL_TMR2B_5 \
318 #define UDMA_SEC_CHANNEL_TMR2A_6 \
320 #define UDMA_SEC_CHANNEL_TMR2B_7 \
322 #define UDMA_SEC_CHANNEL_UART1RX \
324 #define UDMA_SEC_CHANNEL_UART1TX \
326 #define UDMA_SEC_CHANNEL_SSI1RX 10
327 #define UDMA_SEC_CHANNEL_SSI1TX 11
328 #define UDMA_SEC_CHANNEL_UART2RX_12 \
330 #define UDMA_SEC_CHANNEL_UART2TX_13 \
332 #define UDMA_SEC_CHANNEL_TMR2A_14 \
334 #define UDMA_SEC_CHANNEL_TMR2B_15 \
336 #define UDMA_SEC_CHANNEL_TMR1A 18
337 #define UDMA_SEC_CHANNEL_TMR1B 19
338 #define UDMA_SEC_CHANNEL_EPI0RX 20
339 #define UDMA_SEC_CHANNEL_EPI0TX 21
340 #define UDMA_SEC_CHANNEL_ADC10 24
341 #define UDMA_SEC_CHANNEL_ADC11 25
342 #define UDMA_SEC_CHANNEL_ADC12 26
343 #define UDMA_SEC_CHANNEL_ADC13 27
344 #define UDMA_SEC_CHANNEL_SW 30
352 #define UDMA_DEF_USBEP1RX_SEC_UART2RX \
354 #define UDMA_DEF_USBEP1TX_SEC_UART2TX \
356 #define UDMA_DEF_USBEP2RX_SEC_TMR3A \
358 #define UDMA_DEF_USBEP2TX_SEC_TMR3B \
360 #define UDMA_DEF_USBEP3RX_SEC_TMR2A \
362 #define UDMA_DEF_USBEP3TX_SEC_TMR2B \
364 #define UDMA_DEF_ETH0RX_SEC_TMR2A \
366 #define UDMA_DEF_ETH0TX_SEC_TMR2B \
368 #define UDMA_DEF_UART0RX_SEC_UART1RX \
370 #define UDMA_DEF_UART0TX_SEC_UART1TX \
372 #define UDMA_DEF_SSI0RX_SEC_SSI1RX \
374 #define UDMA_DEF_SSI0TX_SEC_SSI1TX \
376 #define UDMA_DEF_RESERVED_SEC_UART2RX \
378 #define UDMA_DEF_RESERVED_SEC_UART2TX \
380 #define UDMA_DEF_ADC00_SEC_TMR2A \
382 #define UDMA_DEF_ADC01_SEC_TMR2B \
384 #define UDMA_DEF_ADC02_SEC_RESERVED \
386 #define UDMA_DEF_ADC03_SEC_RESERVED \
388 #define UDMA_DEF_TMR0A_SEC_TMR1A \
390 #define UDMA_DEF_TMR0B_SEC_TMR1B \
392 #define UDMA_DEF_TMR1A_SEC_EPI0RX \
394 #define UDMA_DEF_TMR1B_SEC_EPI0TX \
396 #define UDMA_DEF_UART1RX_SEC_RESERVED \
398 #define UDMA_DEF_UART1TX_SEC_RESERVED \
400 #define UDMA_DEF_SSI1RX_SEC_ADC10 \
402 #define UDMA_DEF_SSI1TX_SEC_ADC11 \
404 #define UDMA_DEF_RESERVED_SEC_ADC12 \
406 #define UDMA_DEF_RESERVED_SEC_ADC13 \
408 #define UDMA_DEF_I2S0RX_SEC_RESERVED \
410 #define UDMA_DEF_I2S0TX_SEC_RESERVED \
423 #define UDMA_CH0_USB0EP1RX 0x00000000
424 #define UDMA_CH0_UART2RX 0x00010000
425 #define UDMA_CH0_RESERVED2 0x00020000
426 #define UDMA_CH0_TIMER4A 0x00030000
427 #define UDMA_CH0_RESERVED4 0x00040000
432 #define UDMA_CH1_USB0EP1TX 0x00000001
433 #define UDMA_CH1_UART2TX 0x00010001
434 #define UDMA_CH1_RESERVED2 0x00020001
435 #define UDMA_CH1_TIMER4B 0x00030001
436 #define UDMA_CH1_RESERVED4 0x00040001
441 #define UDMA_CH2_USB0EP2RX 0x00000002
442 #define UDMA_CH2_TIMER3A 0x00010002
443 #define UDMA_CH2_RESERVED2 0x00020002
444 #define UDMA_CH2_RESERVED3 0x00030002
445 #define UDMA_CH2_RESERVED4 0x00040002
450 #define UDMA_CH3_USB0EP2TX 0x00000003
451 #define UDMA_CH3_TIMER3B 0x00010003
452 #define UDMA_CH3_RESERVED2 0x00020003
453 #define UDMA_CH3_LPC0_3 0x00030003
454 #define UDMA_CH3_RESERVED4 0x00040003
459 #define UDMA_CH4_USB0EP3RX 0x00000004
460 #define UDMA_CH4_TIMER2A 0x00010004
461 #define UDMA_CH4_RESERVED2 0x00020004
462 #define UDMA_CH4_GPIOA 0x00030004
463 #define UDMA_CH4_RESERVED4 0x00040004
468 #define UDMA_CH5_USB0EP3TX 0x00000005
469 #define UDMA_CH5_TIMER2B 0x00010005
470 #define UDMA_CH5_RESERVED2 0x00020005
471 #define UDMA_CH5_GPIOB 0x00030005
472 #define UDMA_CH5_RESERVED4 0x00040005
477 #define UDMA_CH6_RESERVED0 0x00000006
478 #define UDMA_CH6_TIMER2A 0x00010006
479 #define UDMA_CH6_UART5RX 0x00020006
480 #define UDMA_CH6_GPIOC 0x00030006
481 #define UDMA_CH6_I2C0RX 0x00040006
486 #define UDMA_CH7_RESERVED0 0x00000007
487 #define UDMA_CH7_TIMER2B 0x00010007
488 #define UDMA_CH7_UART5TX 0x00020007
489 #define UDMA_CH7_GPIOD 0x00030007
490 #define UDMA_CH7_I2C0TX 0x00040007
495 #define UDMA_CH8_UART0RX 0x00000008
496 #define UDMA_CH8_UART1RX 0x00010008
497 #define UDMA_CH8_RESERVED2 0x00020008
498 #define UDMA_CH8_TIMER5A 0x00030008
499 #define UDMA_CH8_I2C1RX 0x00040008
504 #define UDMA_CH9_UART0TX 0x00000009
505 #define UDMA_CH9_UART1TX 0x00010009
506 #define UDMA_CH9_RESERVED2 0x00020009
507 #define UDMA_CH9_TIMER5B 0x00030009
508 #define UDMA_CH9_I2C1TX 0x00040009
513 #define UDMA_CH10_SSI0RX 0x0000000A
514 #define UDMA_CH10_SSI1RX 0x0001000A
515 #define UDMA_CH10_UART6RX 0x0002000A
516 #define UDMA_CH10_WTIMER0A 0x0003000A
517 #define UDMA_CH10_I2C2RX 0x0004000A
522 #define UDMA_CH11_SSI0TX 0x0000000B
523 #define UDMA_CH11_SSI1TX 0x0001000B
524 #define UDMA_CH11_UART6TX 0x0002000B
525 #define UDMA_CH11_WTIMER0B 0x0003000B
526 #define UDMA_CH11_I2C2TX 0x0004000B
531 #define UDMA_CH12_RESERVED0 0x0000000C
532 #define UDMA_CH12_UART2RX 0x0001000C
533 #define UDMA_CH12_SSI2RX 0x0002000C
534 #define UDMA_CH12_WTIMER1A 0x0003000C
535 #define UDMA_CH12_GPIOK 0x0004000C
540 #define UDMA_CH13_RESERVED0 0x0000000D
541 #define UDMA_CH13_UART2TX 0x0001000D
542 #define UDMA_CH13_SSI2TX 0x0002000D
543 #define UDMA_CH13_WTIMER1B 0x0003000D
544 #define UDMA_CH13_GPIOL 0x0004000D
549 #define UDMA_CH14_ADC0_0 0x0000000E
550 #define UDMA_CH14_TIMER2A 0x0001000E
551 #define UDMA_CH14_SSI3RX 0x0002000E
552 #define UDMA_CH14_GPIOE 0x0003000E
553 #define UDMA_CH14_GPIOM 0x0004000E
558 #define UDMA_CH15_ADC0_1 0x0000000F
559 #define UDMA_CH15_TIMER2B 0x0001000F
560 #define UDMA_CH15_SSI3TX 0x0002000F
561 #define UDMA_CH15_GPIOF 0x0003000F
562 #define UDMA_CH15_GPION 0x0004000F
567 #define UDMA_CH16_ADC0_2 0x00000010
568 #define UDMA_CH16_RESERVED1 0x00010010
569 #define UDMA_CH16_UART3RX 0x00020010
570 #define UDMA_CH16_WTIMER2A 0x00030010
571 #define UDMA_CH16_GPIOP 0x00040010
576 #define UDMA_CH17_ADC0_3 0x00000011
577 #define UDMA_CH17_RESERVED1 0x00010011
578 #define UDMA_CH17_UART3TX 0x00020011
579 #define UDMA_CH17_WTIMER2B 0x00030011
580 #define UDMA_CH17_RESERVED4 0x00040011
585 #define UDMA_CH18_TIMER0A 0x00000012
586 #define UDMA_CH18_TIMER1A 0x00010012
587 #define UDMA_CH18_UART4RX 0x00020012
588 #define UDMA_CH18_GPIOB 0x00030012
589 #define UDMA_CH18_I2C3RX 0x00040012
594 #define UDMA_CH19_TIMER0B 0x00000013
595 #define UDMA_CH19_TIMER1B 0x00010013
596 #define UDMA_CH19_UART4TX 0x00020013
597 #define UDMA_CH19_GPIOG 0x00030013
598 #define UDMA_CH19_I2C3TX 0x00040013
603 #define UDMA_CH20_TIMER1A 0x00000014
604 #define UDMA_CH20_RESERVED1 0x00010014
605 #define UDMA_CH20_UART7RX 0x00020014
606 #define UDMA_CH20_GPIOH 0x00030014
607 #define UDMA_CH20_I2C4RX 0x00040014
612 #define UDMA_CH21_TIMER1B 0x00000015
613 #define UDMA_CH21_RESERVED1 0x00010015
614 #define UDMA_CH21_UART7TX 0x00020015
615 #define UDMA_CH21_GPIOJ 0x00030015
616 #define UDMA_CH21_I2C4TX 0x00040015
621 #define UDMA_CH22_UART1RX 0x00000016
622 #define UDMA_CH22_RESERVED1 0x00010016
623 #define UDMA_CH22_RESERVED2 0x00020016
624 #define UDMA_CH22_LPC0_2 0x00030016
625 #define UDMA_CH22_I2C5RX 0x00040016
630 #define UDMA_CH23_UART1TX 0x00000017
631 #define UDMA_CH23_RESERVED1 0x00010017
632 #define UDMA_CH23_RESERVED2 0x00020017
633 #define UDMA_CH23_LPC0_1 0x00030017
634 #define UDMA_CH23_I2C5TX 0x00040017
639 #define UDMA_CH24_SSI1RX 0x00000018
640 #define UDMA_CH24_ADC1_0 0x00010018
641 #define UDMA_CH24_RESERVED2 0x00020018
642 #define UDMA_CH24_WTIMER3A 0x00030018
643 #define UDMA_CH24_GPIOQ 0x00040018
648 #define UDMA_CH25_SSI1TX 0x00000019
649 #define UDMA_CH25_ADC1_1 0x00010019
650 #define UDMA_CH25_RESERVED2 0x00020019
651 #define UDMA_CH25_WTIMER3B 0x00030019
652 #define UDMA_CH25_RESERVED4 0x00040019
657 #define UDMA_CH26_RESERVED0 0x0000001A
658 #define UDMA_CH26_ADC1_2 0x0001001A
659 #define UDMA_CH26_RESERVED2 0x0002001A
660 #define UDMA_CH26_WTIMER4A 0x0003001A
661 #define UDMA_CH26_RESERVED4 0x0004001A
666 #define UDMA_CH27_RESERVED0 0x0000001B
667 #define UDMA_CH27_ADC1_3 0x0001001B
668 #define UDMA_CH27_RESERVED2 0x0002001B
669 #define UDMA_CH27_WTIMER4B 0x0003001B
670 #define UDMA_CH27_RESERVED4 0x0004001B
675 #define UDMA_CH28_RESERVED0 0x0000001C
676 #define UDMA_CH28_RESERVED1 0x0001001C
677 #define UDMA_CH28_RESERVED2 0x0002001C
678 #define UDMA_CH28_WTIMER5A 0x0003001C
679 #define UDMA_CH28_RESERVED4 0x0004001C
684 #define UDMA_CH29_RESERVED0 0x0000001D
685 #define UDMA_CH29_RESERVED1 0x0001001D
686 #define UDMA_CH29_RESERVED2 0x0002001D
687 #define UDMA_CH29_WTIMER5B 0x0003001D
688 #define UDMA_CH29_RESERVED4 0x0004001D
693 #define UDMA_CH30_SW 0x0000001E
694 #define UDMA_CH30_RESERVED1 0x0001001E
695 #define UDMA_CH30_RESERVED2 0x0002001E
696 #define UDMA_CH30_RESERVED3 0x0003001E
697 #define UDMA_CH30_RESERVED4 0x0004001E
702 #define UDMA_CH31_RESERVED0 0x0000001F
703 #define UDMA_CH31_RESERVED1 0x0001001F
704 #define UDMA_CH31_RESERVED2 0x0002001F
705 #define UDMA_CH31_LPC0_0 0x0003001F
706 #define UDMA_CH31_RESERVED4 0x0004001F
730 uint32_t ui32Control);
732 uint32_t ui32Mode,
void *pvSrcAddr,
733 void *pvDstAddr, uint32_t ui32TransferSize);
735 uint32_t ui32TaskCount,
737 uint32_t ui32IsPeriphSG);
740 extern void uDMAIntRegister(uint32_t ui32IntChannel,
void (*pfnHandler)(
void));
757 #endif // __DRIVERLIB_UDMA_H__
uint32_t uDMAChannelModeGet(uint32_t ui32ChannelStructIndex)
Definition: udma.c:1018
void uDMAEnable(void)
Definition: udma.c:67
void uDMAChannelAssign(uint32_t ui32Mapping)
Definition: udma.c:1339
uint32_t uDMAChannelSizeGet(uint32_t ui32ChannelStructIndex)
Definition: udma.c:948
void uDMAIntUnregister(uint32_t ui32IntChannel)
Definition: udma.c:1246
void uDMAChannelTransferSet(uint32_t ui32ChannelStructIndex, uint32_t ui32Mode, void *pvSrcAddr, void *pvDstAddr, uint32_t ui32TransferSize)
Definition: udma.c:710
void uDMAChannelSelectDefault(uint32_t ui32DefPeriphs)
Definition: udma.c:1171
uint32_t uDMAIntStatus(void)
Definition: udma.c:1279
void uDMAChannelAttributeEnable(uint32_t ui32ChannelNum, uint32_t ui32Attr)
Definition: udma.c:356
void uDMAChannelSelectSecondary(uint32_t ui32SecPeriphs)
Definition: udma.c:1114
void uDMAChannelControlSet(uint32_t ui32ChannelStructIndex, uint32_t ui32Control)
Definition: udma.c:603
bool uDMAChannelIsEnabled(uint32_t ui32ChannelNum)
Definition: udma.c:206
uint32_t uDMAChannelAttributeGet(uint32_t ui32ChannelNum)
Definition: udma.c:500
void * uDMAControlAlternateBaseGet(void)
Definition: udma.c:290
void uDMAChannelRequest(uint32_t ui32ChannelNum)
Definition: udma.c:320
void uDMAChannelScatterGatherSet(uint32_t ui32ChannelNum, uint32_t ui32TaskCount, void *pvTaskList, uint32_t ui32IsPeriphSG)
Definition: udma.c:861
void uDMAChannelAttributeDisable(uint32_t ui32ChannelNum, uint32_t ui32Attr)
Definition: udma.c:429
void uDMADisable(void)
Definition: udma.c:86
void uDMAChannelDisable(uint32_t ui32ChannelNum)
Definition: udma.c:179
void uDMAIntClear(uint32_t ui32ChanMask)
Definition: udma.c:1306
void * uDMAControlBaseGet(void)
Definition: udma.c:269
void uDMAIntRegister(uint32_t ui32IntChannel, void(*pfnHandler)(void))
Definition: udma.c:1208
uint32_t uDMAErrorStatusGet(void)
Definition: udma.c:106
void uDMAErrorStatusClear(void)
Definition: udma.c:126
void uDMAControlBaseSet(void *pControlTable)
Definition: udma.c:242
void uDMAChannelEnable(uint32_t ui32ChannelNum)
Definition: udma.c:152