Analog Comparator Controller (ACC) example for SAM.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | ADC_CLOCK 6400000 |
The ADC Clock value. More... | |
#define | ADC_STARTUP_TIME_SETTING 0x8u |
The ADC Start Up Time value. More... | |
#define | ADC_TRACK_SETTING 0x0u |
The ADC Start Up Time value. More... | |
#define | ADC_TRANSFER_SETTING 0x1u |
The ADC Start Up Time value. More... | |
#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) |
[acc_irq_handler_end] 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 ADC_CLOCK 6400000 |
The ADC Clock value.
Referenced by main().
#define ADC_STARTUP_TIME_SETTING 0x8u |
The ADC Start Up Time value.
Referenced by main().
#define ADC_TRACK_SETTING 0x0u |
The ADC Start Up Time value.
Referenced by main().
#define ADC_TRANSFER_SETTING 0x1u |
The ADC Start Up Time value.
Referenced by main().
#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.
[acc_irq_handler_start]
[acc_irq_handler_start]
[acc_irq_handler_status]
Compare Output Interrupt
[acc_irq_handler_status] [acc_irq_handler_result_1]
[acc_irq_handler_result_1]
[acc_irq_handler_result_2]
[acc_irq_handler_result_2]
[acc_irq_handler_result_3]
[acc_irq_handler_result_3] [acc_irq_handler_result_end]
[acc_irq_handler_result_end] [acc_irq_handler_end]
|
static |
[acc_irq_handler_end]
Configure UART console.
References uart_rs232_options::baudrate, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_PARITY, 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 uart_read(), us_value, and VOLT_REF.
Referenced by main().
int main | ( | void | ) |
ACC example application entry point.
[acc_enable_clock]
Enable clock for ACC
[acc_enable_clock]
[acc_init]
Initialize ACC
[acc_init]
[acc_irq_enable]
Enable ACC interrupt
Enable
[acc_irq_enable]
References acc_enable_interrupt(), acc_init(), ADC_CLOCK, adc_enable_channel(), adc_get_channel_value(), adc_get_status(), adc_start(), ADC_STARTUP_TIME_SETTING, ADC_TRACK_SETTING, ADC_TRANSFER_SETTING, board_init(), configure_console(), DACC_ANALOG_CONTROL, DACC_CHANNEL_0, dacc_disable_trigger(), dacc_enable_channel(), dacc_reset(), dacc_set_analog_control(), dacc_set_channel_selection(), dacc_set_power_save(), dacc_set_timing(), dacc_set_transfer_mode(), dacc_write_conversion_data(), dsplay_menu(), get_input_voltage(), MAX_DIGITAL, pmc_enable_periph_clk(), STRING_HEADER, sysclk_get_cpu_hz(), sysclk_init(), uart_read(), and VOLT_REF.