XMEGA ADC oversampling header file for ADC source code This file contains the function prototypes.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | ASCII_BUFFER_SIZE 9 |
#define | NUMBER_OF_DIGITS_IN_ADCCOUNT 5 |
#define | NUMBER_OF_DIGITS_IN_RESULT 6 |
Functions | |
static int8_t | adc_offset_get_signed (void) |
Function to get the offset of ADC. More... | |
void | adc_oversampled (void) |
Function to process sampled ADC values. More... | |
static void | convert_to_ascii (uint8_t *buf_index, uint64_t dec_val) |
Function to convert decimal value to ASCII. More... | |
void | display_adccount (uint64_t adc_rawcount, uint8_t x_cordinate, uint8_t sign_flag) |
Function to display raw ADC count on LCD. More... | |
void | init_adc (void) |
Function to initialize the ADC. More... | |
Variables | |
volatile bool | adc_oversampled_flag |
Static variable/flag to indicate that one set of oversampling is done for start processing. More... | |
#define ASCII_BUFFER_SIZE 9 |
Referenced by adc_oversampled().
#define NUMBER_OF_DIGITS_IN_ADCCOUNT 5 |
Referenced by display_adccount().
#define NUMBER_OF_DIGITS_IN_RESULT 6 |
Referenced by convert_to_ascii().
|
static |
Function to get the offset of ADC.
void adc_oversampled | ( | void | ) |
Function to process sampled ADC values.
Function to process sampled ADC values.
References abs, ADC_CH0, adc_ch_conf, ADC_GAIN_ERROR_FACTOR, ADC_NO_OVER_SAMP_MAX_COUNT, adc_offset, adc_offset_one_sample, ADC_OVER_SAMP_MAX_COUNT, ADC_OVER_SAMP_REF_VOLT_IN_MICRO, ADC_OVER_SAMP_SCALING_FACTOR, adc_result_accum_processed, adc_result_accumulator, adc_result_one_sample, adc_result_one_sample_processed, adc_samplecount, adcch_enable_interrupt(), ADCCH_MODE_COMPLETE, adcch_set_interrupt_mode(), adcch_write_configuration(), ASCII_BUFFER_SIZE, convert_to_ascii(), display_adccount(), gfx_mono_draw_string(), sysfont, v_input, v_input_ascii_buf, and v_input_one_sample.
Referenced by main().
|
static |
Function to convert decimal value to ASCII.
void display_adccount | ( | uint64_t | adc_rawcount, |
uint8_t | x_cordinate, | ||
uint8_t | sign_flag | ||
) |
Function to display raw ADC count on LCD.
Function to display raw ADC count on LCD.
adc_rawcount | ADC raw count value to be displayed. |
x_cordinate | X-coordinate where display should end. |
sign_flag | Sign of ADC count.If negative sign_flag is set. |
References gfx_mono_draw_char(), NUMBER_OF_DIGITS_IN_ADCCOUNT, and sysfont.
Referenced by adc_oversampled().
void init_adc | ( | void | ) |
Function to initialize the ADC.
Function to initialize the ADC.
References ADC_CH0, adc_ch_conf, adc_conf, adc_disable(), adc_enable(), adc_handler(), adc_offset, adc_offset_get_signed(), adc_offset_one_sample, ADC_OVER_SAMP_NEGATIVE_PIN, ADC_OVER_SAMP_POSTIVE_PIN, ADC_OVER_SAMPLED_NUMBER, adc_read_configuration(), ADC_REF_AREFB, ADC_RES_12, adc_set_callback(), adc_set_clock_rate(), adc_set_conversion_parameters(), adc_set_conversion_trigger(), ADC_SIGN_ON, ADC_TRIG_MANUAL, adc_write_configuration(), adcch_enable_interrupt(), ADCCH_MODE_COMPLETE, ADCCH_NEG_PIN3, ADCCH_POS_PIN3, adcch_read_configuration(), adcch_set_input(), adcch_set_interrupt_mode(), and adcch_write_configuration().
Referenced by main().
volatile bool adc_oversampled_flag |
Static variable/flag to indicate that one set of oversampling is done for start processing.
Static variable/flag to indicate that one set of oversampling is done for start processing.
Referenced by adc_handler(), and main().