adc.h
Go to the documentation of this file.00001
00002
00003
00004
00005
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,
00026 CONTINUOUS = 1,
00027 TIMER1 = 2,
00028 ST = 3
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