Revision 275
Converted analog function to use interrupts and continuously poll. Need to test it.
Functions in the library that depend on analog will need to be updated to take
advantage of this when it works.
analog.h | ||
---|---|---|
42 | 42 |
#ifndef _ANALOG_H |
43 | 43 |
#define _ANALOG_H |
44 | 44 |
|
45 |
#include <inttypes.h> |
|
46 |
|
|
45 | 47 |
/** |
46 | 48 |
* @addtogroup analog |
47 | 49 |
* @{ |
... | ... | |
87 | 89 |
/** @brief Analog port for the battery voltage detector **/ |
88 | 90 |
#define BATT_PORT AN11 |
89 | 91 |
|
92 |
typedef union adc_t{ |
|
93 |
uint8_t adc8; |
|
94 |
uint16_t adc10; |
|
95 |
} adc_t; |
|
96 |
|
|
97 |
extern adc_t an_val[9]; |
|
98 |
|
|
90 | 99 |
/** @brief Initialize analog ports. **/ |
91 | 100 |
void analog_init(void); |
92 | 101 |
/** @brief Read an 8-bit number from an analog port. **/ |
... | ... | |
95 | 104 |
unsigned int analog10(int which); |
96 | 105 |
/** @brief Read the position of the wheel. **/ |
97 | 106 |
int wheel(void); |
107 |
unsigned int analog_get8(int which); |
|
108 |
unsigned int analog_get10(int which); |
|
98 | 109 |
|
110 |
|
|
99 | 111 |
/**@}**/ //end group |
100 | 112 |
|
101 | 113 |
#endif |
Also available in: Unified diff