Appiko
|
A simple driver for the SAADC unit to get ADC values. The spec of this module are: 12 bit resolution, internal reference of 0.6 V, single ended conversion, input impedance of upto 100k Ohm and a blocking class for the conversion period of 12 us. More...
Macros | |
#define | SIMPLE_ADC_CHANNEL_USED SAADC_CHANNEL_USED_SIMPLE_ADC |
Enumerations | |
enum | simple_adc_input_t |
Input selection for the analog-to-digital converter. | |
enum | simple_adc_gain_t { SIMPLE_ADC_GAIN1_6 = SAADC_CH_CONFIG_GAIN_Gain1_6, SIMPLE_ADC_GAIN1_5 = SAADC_CH_CONFIG_GAIN_Gain1_5, SIMPLE_ADC_GAIN1_4 = SAADC_CH_CONFIG_GAIN_Gain1_4, SIMPLE_ADC_GAIN1_3 = SAADC_CH_CONFIG_GAIN_Gain1_3, SIMPLE_ADC_GAIN1_2 = SAADC_CH_CONFIG_GAIN_Gain1_2, SIMPLE_ADC_GAIN1 = SAADC_CH_CONFIG_GAIN_Gain1, SIMPLE_ADC_GAIN2 = SAADC_CH_CONFIG_GAIN_Gain2, SIMPLE_ADC_GAIN4 = SAADC_CH_CONFIG_GAIN_Gain4 } |
Gain factor of the ADC input source. More... | |
Functions | |
uint32_t | simple_adc_get_value (simple_adc_gain_t gain, simple_adc_input_t pin) |
This function initializes the SAADC peripheral, gets an ADC value and then deinitializes The function blocks for about 13 us for the ADC sampling to occur. More... | |
#define SIMPLE_ADC_CHANNEL_USED SAADC_CHANNEL_USED_SIMPLE_ADC |
To assign default SAADC channel to this module if nothing is mentioned
Definition at line 47 of file simple_adc.h.
enum simple_adc_gain_t |
Definition at line 68 of file simple_adc.h.
uint32_t simple_adc_get_value | ( | simple_adc_gain_t | gain, |
simple_adc_input_t | pin | ||
) |
gain | The gain applied to the analog input to the ADC unit |
pin | The pin at which the analog sample needs to be converted to digital |
Definition at line 25 of file simple_adc.c.
Referenced by aa_aaa_battery_status(), led_sense_get(), oper_manage_check_update(), and rc_test().