34 #ifndef ADC_H_INCLUDED 35 #define ADC_H_INCLUDED 43 #define ADC_UNKNOWN_ERROR 0xffffffff //error value for wrong A/D conversion (for unknown reason) 44 #define ADC_PIN_ERROR 0xfffffffe //wrong pin configuration for A/D conversion 45 #define ADC_FREQUENCY_ERROR 0xfffffffd //wrong sample frequency requested 46 #define ADC_NUMBERCYCLES_ERROR 0xfffffffc //wrong number of conversion cycles 48 #define MAX_NUMBER_ADC_CYCLES 838 //number of possible single shot cycles (overflow avoidance) 49 #define MIN_ADC_FREQUENCY 50 //lowest ADC sampling frequency [kHz] 50 #define MAX_ADC_FREQUENCY 200 //highest ADC sampling frequency [kHz] 52 #define ADC_REF_AREF 0x0 //Reference Voltage: AREF, internal VREF turned off 53 #define ADC_REF_AVCC 0x1 //Reference Voltage: AVCC, with external capacitor at AREF pin 54 #define ADC_REF_VREF 0x3 //Reference Voltage: internal VREF (2,56 V) with external capacitor at AREF pin 64 uint16_t number_cycles, uint16_t min_freq);
69 #endif // ADC_H_INCLUDED uint32_t single_adc_read(uint8_t vref_reg, uint16_t vref_val, uint16_t number_cycles, uint16_t min_freq)
void adc_pin_deinit(void)