First Version
Dependencies: EthernetInterface mbed-rtos mbed
Drivers/dma.h@0:9df41090ba33, 2015-07-21 (annotated)
- Committer:
- rebonatto
- Date:
- Tue Jul 21 21:29:49 2015 +0000
- Revision:
- 0:9df41090ba33
First Version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rebonatto | 0:9df41090ba33 | 1 | /* |
rebonatto | 0:9df41090ba33 | 2 | * dma.h |
rebonatto | 0:9df41090ba33 | 3 | * |
rebonatto | 0:9df41090ba33 | 4 | * Created on: 03/07/2011 |
rebonatto | 0:9df41090ba33 | 5 | * Author: francisco |
rebonatto | 0:9df41090ba33 | 6 | */ |
rebonatto | 0:9df41090ba33 | 7 | #ifndef DMA_H |
rebonatto | 0:9df41090ba33 | 8 | #define DMA_H |
rebonatto | 0:9df41090ba33 | 9 | |
rebonatto | 0:9df41090ba33 | 10 | #define DMA_MEMORY -1 |
rebonatto | 0:9df41090ba33 | 11 | |
rebonatto | 0:9df41090ba33 | 12 | #define DMA_PERIPHERAL_SSP0_TX 0U |
rebonatto | 0:9df41090ba33 | 13 | #define DMA_PERIPHERAL_SSP0_RX 1U |
rebonatto | 0:9df41090ba33 | 14 | #define DMA_PERIPHERAL_SSP1_TX 2U |
rebonatto | 0:9df41090ba33 | 15 | #define DMA_PERIPHERAL_SSP1_RX 3U |
rebonatto | 0:9df41090ba33 | 16 | #define DMA_PERIPHERAL_ADC 4U |
rebonatto | 0:9df41090ba33 | 17 | #define DMA_PERIPHERAL_I2S0 5U |
rebonatto | 0:9df41090ba33 | 18 | #define DMA_PERIPHERAL_I2S1 6U |
rebonatto | 0:9df41090ba33 | 19 | #define DMA_PERIPHERAL_DAC 7U |
rebonatto | 0:9df41090ba33 | 20 | #define DMA_PERIPHERAL_UART0_TX 8U |
rebonatto | 0:9df41090ba33 | 21 | #define DMA_PERIPHERAL_UART0_RX 9U |
rebonatto | 0:9df41090ba33 | 22 | #define DMA_PERIPHERAL_UART1_TX 10U |
rebonatto | 0:9df41090ba33 | 23 | #define DMA_PERIPHERAL_UART1_RX 11U |
rebonatto | 0:9df41090ba33 | 24 | #define DMA_PERIPHERAL_UART2_TX 12U |
rebonatto | 0:9df41090ba33 | 25 | #define DMA_PERIPHERAL_UART2_RX 13U |
rebonatto | 0:9df41090ba33 | 26 | #define DMA_PERIPHERAL_UART3_TX 14U |
rebonatto | 0:9df41090ba33 | 27 | #define DMA_PERIPHERAL_UART3_RX 15U |
rebonatto | 0:9df41090ba33 | 28 | |
rebonatto | 0:9df41090ba33 | 29 | #define DMA_MEMORY_TO_MEMORY 0U |
rebonatto | 0:9df41090ba33 | 30 | #define DMA_MEMORY_TO_PERIPHERAL 1U |
rebonatto | 0:9df41090ba33 | 31 | #define DMA_PERIPHERAL_TO_MEMORY 2U |
rebonatto | 0:9df41090ba33 | 32 | #define DMA_PERIPHERAL_TO_PERIPHERAL 3U |
rebonatto | 0:9df41090ba33 | 33 | |
rebonatto | 0:9df41090ba33 | 34 | #define DMA_DEST_SIZE(n) (n<<15) |
rebonatto | 0:9df41090ba33 | 35 | #define DMA_SRC_SIZE(n) (n<<12) |
rebonatto | 0:9df41090ba33 | 36 | |
rebonatto | 0:9df41090ba33 | 37 | #define DMA_SRC_WIDTH_BYTE (0U<<18) |
rebonatto | 0:9df41090ba33 | 38 | #define DMA_SRC_WIDTH_HALFWORD (1U<<18) |
rebonatto | 0:9df41090ba33 | 39 | #define DMA_SRC_WIDTH_WORD (2U<<18) |
rebonatto | 0:9df41090ba33 | 40 | |
rebonatto | 0:9df41090ba33 | 41 | #define DMA_DST_WIDTH_BYTE (0U<<21) |
rebonatto | 0:9df41090ba33 | 42 | #define DMA_DST_WIDTH_HALFWORD (1U<<21) |
rebonatto | 0:9df41090ba33 | 43 | #define DMA_DST_WIDTH_WORD (2U<<21) |
rebonatto | 0:9df41090ba33 | 44 | |
rebonatto | 0:9df41090ba33 | 45 | #define DMA_SRC_INCREMENT (1U<<26) |
rebonatto | 0:9df41090ba33 | 46 | #define DMA_DST_INCREMENT (1U<<27) |
rebonatto | 0:9df41090ba33 | 47 | |
rebonatto | 0:9df41090ba33 | 48 | #define DMA_TC_INT (1U<<31) |
rebonatto | 0:9df41090ba33 | 49 | |
rebonatto | 0:9df41090ba33 | 50 | #ifdef __cplusplus |
rebonatto | 0:9df41090ba33 | 51 | extern "C" { |
rebonatto | 0:9df41090ba33 | 52 | #endif |
rebonatto | 0:9df41090ba33 | 53 | |
rebonatto | 0:9df41090ba33 | 54 | typedef struct |
rebonatto | 0:9df41090ba33 | 55 | { |
rebonatto | 0:9df41090ba33 | 56 | unsigned long int sourceAddr; |
rebonatto | 0:9df41090ba33 | 57 | unsigned long int destAddr; |
rebonatto | 0:9df41090ba33 | 58 | unsigned long int nextNode; |
rebonatto | 0:9df41090ba33 | 59 | unsigned long int dmaControl; |
rebonatto | 0:9df41090ba33 | 60 | } dmaLinkedListNode; |
rebonatto | 0:9df41090ba33 | 61 | |
rebonatto | 0:9df41090ba33 | 62 | extern void init_dma(void); |
rebonatto | 0:9df41090ba33 | 63 | extern void setup_channel(dmaLinkedListNode* pList,int ch,int src,int dst); |
rebonatto | 0:9df41090ba33 | 64 | extern void stop_channel(void); |
rebonatto | 0:9df41090ba33 | 65 | |
rebonatto | 0:9df41090ba33 | 66 | #ifdef __cplusplus |
rebonatto | 0:9df41090ba33 | 67 | } |
rebonatto | 0:9df41090ba33 | 68 | #endif |
rebonatto | 0:9df41090ba33 | 69 | |
rebonatto | 0:9df41090ba33 | 70 | #endif //#define DMA_H |