Revision 314
Updated BOM and rangefinder to use new analog. Entering alpha testing phase.
analog.h | ||
---|---|---|
96 | 96 |
|
97 | 97 |
#define ADMUX_OPT 0x60 |
98 | 98 |
|
99 |
/** @brief Struct to hold the value of a particular analog port */ |
|
99 | 100 |
typedef struct { |
100 | 101 |
uint8_t adc8; |
101 | 102 |
uint16_t adc10; |
102 | 103 |
} adc_t; |
103 | 104 |
|
104 |
//extern adc_t an_val[10]; |
|
105 | 105 |
|
106 |
/** @brief Initialize analog ports. **/ |
|
106 |
/** @brief Initialize analog ports. Will start running a loop |
|
107 |
if start_conversion is ADC_START.**/ |
|
107 | 108 |
void analog_init(int start_conversion); |
109 |
/** @brief starts the analog loop. Doesn't do anything if the loop is already running. **/ |
|
108 | 110 |
void analog_start_loop(void); |
111 |
/** @brief Stops the analog loop. Doesn't do anything if the loop is already stopped. **/ |
|
109 | 112 |
void analog_stop_loop(void); |
110 |
/** @brief Read an 8-bit number from an analog port. **/ |
|
113 |
/** @brief Read an 8-bit number from an analog port. Loop must be stopped for this to work. **/
|
|
111 | 114 |
unsigned int analog8(int which); |
112 |
/** @brief Read a 10-bit number from an analog port. **/ |
|
115 |
/** @brief Read a 10-bit number from an analog port. Loop must be stopped for this to work. **/
|
|
113 | 116 |
unsigned int analog10(int which); |
114 | 117 |
/** @brief Read the position of the wheel. **/ |
115 | 118 |
int wheel(void); |
119 |
/** @brief Returns an 8-bit analog value from the look up table. Use this instead of analog8. **/ |
|
116 | 120 |
unsigned int analog_get8(int which); |
121 |
/** @brief Returns an 10-bit analog value from the look up table. Use this instead of analog10. **/ |
|
117 | 122 |
unsigned int analog_get10(int which); |
118 | 123 |
|
119 | 124 |
|
Also available in: Unified diff