Contiki 2.5
adc.h
Go to the documentation of this file.
1 /**
2  * \file
3  * Header file for ADC.
4  * \author
5  * Anthony "Asterisk" Ambuehl
6  *
7  */
8 
9 #ifndef __ADC_H
10 #define __ADC_H
11 #define ADC_DMA_CONFIG_CHANNEL 1
12 #define ADC_CHANNELS 8
13 #include "cc2430_sfr.h"
14 #include "dma.h"
15 #include "banked.h"
16 
17 typedef struct adc_result
18 {
19  uint16_t adc:14;
20  uint16_t unused:2;
21 } adc_result_t;
22 
23 typedef enum adc_stsel_t
24 {
25  EXT = 0, /* externally triggered by P2_0 */
26  CONTINUOUS = 1, /* continuous full speed conversion */
27  TIMER1 = 2, /* Timer 1 channel 0 compare event */
28  ST = 3 /* ADCCON1.ST = 1 */
29 } adc_stsel_t;
30 
31 extern void adc_init(void) __banked;
32 extern void adc_single_shot(void) __banked;
33 extern int16_t adc_convert_result(int16_t ptr) __banked;
34 extern int16_t adc_get_last_conv() __banked;
35 extern void adc_dma_callback(void) __banked;
36 #ifdef HAVE_DMA
37 extern xDMAHandle adc_dma;
38 extern unsigned int *adc_dma_dest;
39 #endif
40 
41 #endif /*__ADC_H*/