24 #ifndef _WATCH_ADC_H_INCLUDED
25 #define _WATCH_ADC_H_INCLUDED
98 ADC_REFERENCE_INTREF = ADC_REFCTRL_REFSEL_INTREF_Val,
99 ADC_REFERENCE_VCC_DIV1POINT6 = ADC_REFCTRL_REFSEL_INTVCC0_Val,
100 ADC_REFERENCE_VCC_DIV2 = ADC_REFCTRL_REFSEL_INTVCC1_Val,
101 ADC_REFERENCE_VCC = ADC_REFCTRL_REFSEL_INTVCC2_Val,
102 } watch_adc_reference_voltage;
uint16_t watch_get_analog_pin_level(const uint8_t pin)
Reads an analog value from one of the pins.
Definition: watch_adc.c:104
void watch_enable_analog_input(const uint8_t pin)
Configures the selected pin for analog input.
Definition: watch_adc.c:81
uint16_t watch_get_vcc_voltage(void)
Returns the voltage of the VCC supply in millivolts (i.e. 3000 mV == 3.0 V). If running on a coin cel...
Definition: watch_adc.c:154
void watch_enable_adc(void)
Enables the ADC peripheral. You must call this before attempting to read a value from an analog pin.
Definition: watch_adc.c:43
void watch_set_analog_num_samples(uint16_t samples)
Sets the number of samples to accumulate when measuring a pin level. Default is 16.
Definition: watch_adc.c:121
void watch_set_analog_reference_voltage(watch_adc_reference_voltage reference)
Selects the reference voltage to use for analog readings. Default is ADC_REFERENCE_VCC.
Definition: watch_adc.c:141
void watch_disable_analog_input(const uint8_t pin)
Disables the analog circuitry on the selected pin.
Definition: watch_adc.c:170
void watch_set_analog_sampling_length(uint8_t cycles)
Sets the length of time spent sampling, which allows measurement of higher impedance inputs....
Definition: watch_adc.c:133
void watch_disable_adc(void)
Disables the ADC peripheral.
Definition: watch_adc.c:174