|
|
◆ single_adc_read()
| uint32_t single_adc_read |
( |
uint8_t |
vref_reg, |
|
|
uint16_t |
vref_val, |
|
|
uint16_t |
number_cycles, |
|
|
uint16_t |
min_freq |
|
) |
| |
Performs an A/D conversion. Converts the input value for the specified number of cycles and returns the mean value of all conversion cycles.
- Parameters
-
| [in] | v_ref_reg | reference voltage (content of REFS0 and REFS1) |
| [in] | v_ref_val | reference voltage [mV] |
| [in] | number_cycles | number of cycles for conversion |
| [in] | min_freq | minimum frequency for conversion [Hz] |
- Returns
- ADC_UNKNOWN_ERROR in case of an unknown error
ADC_PIN_ERROR if the ADC pin has not the correct configuration
ADC_NUMBERCYCLES_ERROR if the specified number of cycles exceeds MAX_NUMBER_ADC_CYCLES
ADC_FREQUENCY_ERROR if the specified min frequency is outside of the ranges defined by MIN_ADC_FREQUENCY and MAX_ADC_FREQUENCY
in case of no error: mean A/D value in mV
- Date
- Created 01.02.2019
- Modified 01.02.2019
- See also
- port_definitions.h
- Author
- Michael Skutek, micha.nosp@m.el@s.nosp@m.kutek.nosp@m..de
Definition at line 74 of file adc.c.
Referenced by main().
|