adc.h

Go to the documentation of this file.
00001 /**
00002  * \file
00003  *   Header file for ADC.
00004  * \author
00005  *   Anthony "Asterisk" Ambuehl
00006  *
00007  */
00008 
00009 #ifndef __ADC_H
00010 #define __ADC_H
00011 #define ADC_DMA_CONFIG_CHANNEL 1
00012 #define ADC_CHANNELS 8
00013 #include "cc2430_sfr.h"
00014 #include "dma.h"
00015 #include "banked.h"
00016 
00017 typedef struct adc_result
00018 {
00019   uint16_t adc:14;
00020   uint16_t unused:2;
00021 } adc_result_t;
00022 
00023 typedef enum adc_stsel_t
00024 {
00025         EXT = 0, /* externally triggered by P2_0 */
00026         CONTINUOUS = 1, /* continuous full speed conversion */
00027         TIMER1 = 2, /* Timer 1 channel 0 compare event  */
00028         ST = 3 /* ADCCON1.ST = 1  */
00029 } adc_stsel_t;
00030 
00031 extern void adc_init(void) __banked;
00032 extern void adc_single_shot(void) __banked;
00033 extern int16_t adc_convert_result(int16_t ptr) __banked;
00034 extern int16_t adc_get_last_conv() __banked;
00035 extern void adc_dma_callback(void) __banked;
00036 #ifdef HAVE_DMA
00037 extern xDMAHandle adc_dma;
00038 extern unsigned int *adc_dma_dest;
00039 #endif
00040 
00041 #endif /*__ADC_H*/

Generated on Mon Apr 11 14:23:38 2011 for Contiki 2.5 by  doxygen 1.6.1