ADCIFE Window Monitor example for SAM4L.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | MAX_DIGITAL (4095) |
The maximal digital value. More... | |
#define | MENU_HEADER |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
#define | VDDANA 3300 |
#define | VOLT_REF 1000 |
Functions | |
static void | adcife_wm_handler (void) |
Callback function for ADCIFE interrupt. More... | |
static void | configure_console (void) |
Configure UART console. More... | |
static void | display_info (void) |
Display current information,including voltage on division resistor, thresholds and window monitor mode. More... | |
static void | display_menu (void) |
Display main menu. More... | |
static uint32_t | f_to_int (float x) |
Transform float data type to int. More... | |
static int16_t | get_voltage (void) |
Get voltage from user input (range from 0 to 3300 mv). More... | |
static uint8_t | get_wm_mode (void) |
Get window monitor mode. More... | |
int | main (void) |
Example entry point. More... | |
static void | start_dac (void) |
Start DAC ouput. More... | |
Variables | |
struct adc_dev_inst | g_adc_inst |
ADC instance. More... | |
static uint16_t | gs_us_high_threshold = 0 |
High threshold. More... | |
static uint16_t | gs_us_low_threshold = 0 |
Low threshold. More... | |
#define MAX_DIGITAL (4095) |
The maximal digital value.
Referenced by adcife_wm_handler(), display_info(), and main().
#define MENU_HEADER |
Referenced by display_menu().
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
#define VDDANA 3300 |
Referenced by main().
#define VOLT_REF 1000 |
Referenced by adcife_wm_handler(), display_info(), get_voltage(), and main().
|
static |
Callback function for ADCIFE interrupt.
References adc_clear_status(), adc_disable_interrupt(), adc_get_last_conv_value(), adc_get_status(), adc_get_wm_mode(), ADC_WINDOW_MONITOR, g_adc_inst, gs_us_high_threshold, gs_us_low_threshold, MAX_DIGITAL, and VOLT_REF.
Referenced by main().
|
static |
Configure UART console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
|
static |
Display current information,including voltage on division resistor, thresholds and window monitor mode.
References adc_get_last_conv_value(), adc_get_wm_mode(), f_to_int(), g_adc_inst, gs_us_high_threshold, gs_us_low_threshold, MAX_DIGITAL, and VOLT_REF.
Referenced by main().
|
static |
|
static |
Transform float data type to int.
Referenced by display_info(), and main().
|
static |
|
static |
int main | ( | void | ) |
Example entry point.
References ADC_BIPOLAR_SINGLEENDED, adc_ch_set_config(), adc_clear_status(), ADC_CLKSEL_APBCLK, adc_configure_gain(), adc_configure_trigger(), adc_configure_wm_mode(), adc_configure_wm_threshold(), adc_disable_interrupt(), adc_enable(), adc_enable_interrupt(), ADC_GAIN_1X, ADC_GCOMP_DIS, ADC_HWLA_DIS, adc_init(), ADC_INTERNAL_3, ADC_MUXNEG_1, ADC_MUXPOS_3, ADC_PRESCAL_DIV16, ADC_REFSEL_0, ADC_RES_12_BIT, adc_set_callback(), ADC_SPEED_150K, ADC_TRIG_CON, ADC_WINDOW_MONITOR, ADC_WM_MODE_3, ADC_ZOOMRANGE_0, adcife_wm_handler(), board_init(), configure_console(), DACC_MAX_DATA, dacc_write_conversion_data(), delay_ms, display_info(), display_menu(), f_to_int(), g_adc_inst, get_voltage(), get_wm_mode(), gs_us_high_threshold, gs_us_low_threshold, MAX_DIGITAL, adc_config::prescal, adc_ch_config::seq_cfg, start_dac(), STATUS_OK, STRING_HEADER, sysclk_init(), VDDANA, VOLT_REF, and adc_seq_config::zoomrange.
|
static |
Start DAC ouput.
Initialize DAC, set clock and timing, and set DAC to given mode.
References dacc_enable(), dacc_reset(), dacc_set_timing(), dacc_set_transfer_mode(), dacc_write_conversion_data(), and sysclk_enable_peripheral_clock().
Referenced by main().
struct adc_dev_inst g_adc_inst |
ADC instance.
Referenced by adcife_read_conv_result(), adcife_set_conv_flag(), adcife_set_wm_flag(), adcife_wm_handler(), display_info(), get_wm_mode(), main(), run_adcife_diff_test(), run_adcife_init_test(), run_adcife_itimer_trig_test(), run_adcife_multichannel_test(), run_adcife_wm_test(), and start_adc().
|
static |
High threshold.
Referenced by adcife_wm_handler(), display_info(), and main().
|
static |
Low threshold.
Referenced by adcife_wm_handler(), display_info(), and main().