Versão do protegemed que calcula o tempo em ms da fuga, calcula o numero de onverflow (valores muito baixo) e underflow (valores muito altos). Além disso, calcula um valor médio a partir dos valores capturados e não apenas pela fft.

Dependencies:   EthernetInterface mbed-rtos mbed

Committer:
rebonatto
Date:
Wed Jul 09 21:16:23 2014 +0000
Revision:
0:c64e1194230b
Vers?o do Protegemed com calculo de tempo de fuga, overflow, underflow e novo valor m?dio (manual).

Who changed what in which revision?

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