Analog Comparator Controller (ACC) example for SAMV71/SAME70.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | DACC_ANALOG_CONTROL |
Analog control value. More... | |
#define | DACC_CHANNEL_0 0 |
The DAC Channel value. More... | |
#define | MAX_DIGITAL (4095) |
The maximal digital value. More... | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
#define | VOLT_REF (3300) |
Reference voltage for DACC,in mv. More... | |
Functions | |
void | ACC_Handler (void) |
Interrupt handler for the ACC. More... | |
static void | configure_console (void) |
Configure UART console. More... | |
static void | dsplay_menu (void) |
Display main menu. More... | |
static int16_t | get_input_voltage (void) |
Get voltage from user input, the input range is: (1/6)*ADVREF~(5/6)*ADVREF (mv) More... | |
int | main (void) |
ACC example application entry point. More... | |
#define DACC_ANALOG_CONTROL |
Analog control value.
Referenced by main().
#define DACC_CHANNEL_0 0 |
The DAC Channel value.
Referenced by main().
#define MAX_DIGITAL (4095) |
The maximal digital value.
Referenced by main().
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
#define VOLT_REF (3300) |
Reference voltage for DACC,in mv.
Referenced by get_input_voltage(), and main().
void ACC_Handler | ( | void | ) |
Interrupt handler for the ACC.
References acc_get_comparison_result(), and acc_get_interrupt_status().
|
static |
Configure UART console.
References uart_rs232_options::baudrate, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_CHAR_LENGTH, CONF_UART_PARITY, CONF_UART_STOP_BITS, CONSOLE_UART_ID, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
|
static |
Display main menu.
Referenced by main().
|
static |
Get voltage from user input, the input range is: (1/6)*ADVREF~(5/6)*ADVREF (mv)
References CONSOLE_UART, usart_read(), and VOLT_REF.
Referenced by main().
int main | ( | void | ) |
ACC example application entry point.
References acc_enable_interrupt(), acc_init(), afec_ch_get_config_defaults(), afec_ch_set_config(), afec_channel_enable(), afec_channel_get_value(), AFEC_CHANNEL_POTENTIOMETER, afec_channel_set_analog_offset(), afec_enable(), AFEC_GAINVALUE_0, afec_get_config_defaults(), afec_get_interrupt_status(), afec_init(), afec_set_trigger(), afec_start_software_conversion(), AFEC_TRIG_SW, board_init(), configure_console(), CONSOLE_UART, DACC_ANALOG_CONTROL, DACC_CHANNEL_0, dacc_disable_trigger(), dacc_enable_channel(), dacc_reset(), dacc_set_analog_control(), dacc_set_power_save(), dacc_set_transfer_mode(), dacc_write_conversion_data(), dsplay_menu(), afec_ch_config::gain, get_input_voltage(), MAX_DIGITAL, pmc_enable_periph_clk(), STRING_HEADER, sysclk_init(), usart_read(), and VOLT_REF.