|
1 #ifndef _ADC_H__ |
|
2 #define _ADC_H__ |
|
3 #include <stdint.h> |
|
4 |
|
5 // Functions to access the ADC |
|
6 |
|
7 // We have two implementations: |
|
8 // MCP3204.c and internal_ADC.c |
|
9 |
|
10 |
|
11 // get a sample from ADC chip. |
|
12 uint16_t getADC(int channel); |
|
13 |
|
14 // initialize the ADC chip |
|
15 void initADC(void); |
|
16 |
|
17 // select reference |
|
18 // returns 1 on success |
|
19 uint8_t setAREF(char* name); |
|
20 |
|
21 #ifdef EXT_AREF |
|
22 // get current reference voltage |
|
23 float getAREF(void); |
|
24 #endif |
|
25 |
|
26 // get smoothed adc readings |
|
27 uint16_t getADC_smooth(uint8_t channel, uint8_t samples); |
|
28 |
|
29 |
|
30 #endif // _ADC_H__ |