Versão limpa em 04/09/2014. Telnet funcionando.

Dependencies:   EthernetInterface mbed-rtos mbed NTPClient

Committer:
rebonatto
Date:
Mon Jan 18 18:26:03 2016 +0000
Revision:
43:69afea5f5a4d
Parent:
0:66d8bd1f9d4c
Aquisi??o sem DMA, 256 amostras.; Buffer simples com  copia de buffer para calculo da FFT.; Com telnetr e TFTP ativos. Telnet funcionando sem travar.; Vers?o com WhatDog.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebonatto 0:66d8bd1f9d4c 1 /*
rebonatto 0:66d8bd1f9d4c 2 * adc.h
rebonatto 0:66d8bd1f9d4c 3 *
rebonatto 0:66d8bd1f9d4c 4 * Created on: 02/07/2011
rebonatto 0:66d8bd1f9d4c 5 * Author: francisco
rebonatto 0:66d8bd1f9d4c 6 */
rebonatto 0:66d8bd1f9d4c 7
rebonatto 0:66d8bd1f9d4c 8 #ifndef ADC_H_
rebonatto 0:66d8bd1f9d4c 9 #define ADC_H_
rebonatto 0:66d8bd1f9d4c 10
rebonatto 0:66d8bd1f9d4c 11
rebonatto 0:66d8bd1f9d4c 12 #define PCADC (1U<<12)
rebonatto 0:66d8bd1f9d4c 13
rebonatto 0:66d8bd1f9d4c 14 #define ADC_CCLK_4 0U
rebonatto 0:66d8bd1f9d4c 15 #define ADC_CCLK 1U
rebonatto 0:66d8bd1f9d4c 16 #define ADC_CCLK_2 2U
rebonatto 0:66d8bd1f9d4c 17 #define ADC_CCLK_8 3U
rebonatto 0:66d8bd1f9d4c 18
rebonatto 0:66d8bd1f9d4c 19 #define PCLK_ADC 24U
rebonatto 0:66d8bd1f9d4c 20
rebonatto 0:66d8bd1f9d4c 21 #define ADC_CH_0 (1U<<0)
rebonatto 0:66d8bd1f9d4c 22 #define ADC_CH_1 (1U<<1)
rebonatto 0:66d8bd1f9d4c 23 #define ADC_CH_2 (1U<<2)
rebonatto 0:66d8bd1f9d4c 24 #define ADC_CH_3 (1U<<3)
rebonatto 0:66d8bd1f9d4c 25 #define ADC_CH_4 (1U<<4)
rebonatto 0:66d8bd1f9d4c 26 #define ADC_CH_5 (1U<<5)
rebonatto 0:66d8bd1f9d4c 27 #define ADC_CH_6 (1U<<6)
rebonatto 0:66d8bd1f9d4c 28 #define ADC_CH_7 (1U<<7)
rebonatto 0:66d8bd1f9d4c 29 #define ADC_CLKDIV(val) ((val)<<8)
rebonatto 0:66d8bd1f9d4c 30 #define ADC_MODE_BURST (1U<<16)
rebonatto 0:66d8bd1f9d4c 31 #define ADC_OPERATIONAL (1U<< 21)
rebonatto 0:66d8bd1f9d4c 32 #define ADC_NO_START ~(7U<<24)
rebonatto 0:66d8bd1f9d4c 33 #define ADC_START_NOW (1U<<24)
rebonatto 0:66d8bd1f9d4c 34 #define ADC_START_ON_PIO2_10 (2U<<24)
rebonatto 0:66d8bd1f9d4c 35 #define ADC_START_ON_PIO1_27 (3U<<24)
rebonatto 0:66d8bd1f9d4c 36 #define ADC_START_ON_MAT0_1 (4U<<24)
rebonatto 0:66d8bd1f9d4c 37 #define ADC_START_ON_MAT0_3 (5U<<24)
rebonatto 0:66d8bd1f9d4c 38 #define ADC_START_ON_MAT1_0 (6U<<24)
rebonatto 0:66d8bd1f9d4c 39 #define ADC_START_ON_MAT1_1 (7U<<24)
rebonatto 0:66d8bd1f9d4c 40 #define ADC_EDGE_FALLING (1U<<27)
rebonatto 0:66d8bd1f9d4c 41 #define ADC_EDGE_RAISING ~(1U<<27)
rebonatto 0:66d8bd1f9d4c 42
rebonatto 0:66d8bd1f9d4c 43 #define ADC_GLOBAL_INT (1U<<8)
rebonatto 0:66d8bd1f9d4c 44 #define ADC_INT_CH_0 (1U<<0)
rebonatto 0:66d8bd1f9d4c 45 #define ADC_INT_CH_1 (1U<<1)
rebonatto 0:66d8bd1f9d4c 46 #define ADC_INT_CH_2 (1U<<2)
rebonatto 0:66d8bd1f9d4c 47 #define ADC_INT_CH_3 (1U<<3)
rebonatto 0:66d8bd1f9d4c 48 #define ADC_INT_CH_4 (1U<<4)
rebonatto 0:66d8bd1f9d4c 49 #define ADC_INT_CH_5 (1U<<5)
rebonatto 0:66d8bd1f9d4c 50 #define ADC_INT_CH_6 (1U<<6)
rebonatto 0:66d8bd1f9d4c 51 #define ADC_INT_CH_7 (1U<<7)
rebonatto 0:66d8bd1f9d4c 52
rebonatto 0:66d8bd1f9d4c 53 #define ADC_LAST_CONVERSION() ((LPC_ADC->ADGDR&(0xFFFU<<4))>>4)
rebonatto 0:66d8bd1f9d4c 54 #define ADC_LAST_CONVERSION_CHANNEL() ((LPC_ADC->ADGDR&(7U<<24))>>24)
rebonatto 0:66d8bd1f9d4c 55 #define ADC_LAST_CONVERSION_DONE() (LPC_ADC->ADGDR&(1U<<31))
rebonatto 0:66d8bd1f9d4c 56 #define ADC_LAST_CONVERSION_OVERUN() (LPC_ADC->ADGDR&(1U<<30))
rebonatto 0:66d8bd1f9d4c 57 #define ADC_CONVERSION_CH(ch) ((LPC_ADC->ADDR[ch]&(0xFFFU<<4))>>4)
rebonatto 0:66d8bd1f9d4c 58 #define ADC_CONVERSION_DONE_CH(ch) (LPC_ADC->ADDR[ch]&(1U<<31))
rebonatto 0:66d8bd1f9d4c 59 #define ADC_CONVERSION_OVERUN_CH(ch) (LPC_ADC->ADDR[ch]&(1U<<30))
rebonatto 0:66d8bd1f9d4c 60
rebonatto 0:66d8bd1f9d4c 61 #define ADC_CONVERT(val) ((val&(0xFFFU<<4))>>4)
rebonatto 0:66d8bd1f9d4c 62 #define ADC_CHANNEL(val) ((val&(7U<<24))>>24)
rebonatto 0:66d8bd1f9d4c 63
rebonatto 0:66d8bd1f9d4c 64 #ifdef __cplusplus
rebonatto 0:66d8bd1f9d4c 65 extern "C" {
rebonatto 0:66d8bd1f9d4c 66 #endif
rebonatto 0:66d8bd1f9d4c 67
rebonatto 0:66d8bd1f9d4c 68 extern void init_adc(int adc_clk);
rebonatto 0:66d8bd1f9d4c 69 extern void setup_start(int mode,int edge);
rebonatto 0:66d8bd1f9d4c 70 extern void select_channels(int adc_ch);
rebonatto 0:66d8bd1f9d4c 71
rebonatto 0:66d8bd1f9d4c 72 #ifdef __cplusplus
rebonatto 0:66d8bd1f9d4c 73 }
rebonatto 0:66d8bd1f9d4c 74 #endif
rebonatto 0:66d8bd1f9d4c 75
rebonatto 0:66d8bd1f9d4c 76 #endif /* ADC_H_ */