SAM Sigma-Delta Analog-to-Digital Converter (SDADC) Driver.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
#include "sdadc.h"
Functions | |
static void | _sdadc_configure_ain_pin (uint32_t pin) |
static enum status_code | _sdadc_set_config (struct sdadc_module *const module_inst, struct sdadc_config *const config) |
enum status_code | sdadc_init (struct sdadc_module *const module_inst, Sdadc *hw, struct sdadc_config *config) |
Initializes the SDADC. More... | |
|
inlinestatic |
Configure MUX settings for the analog pins
This function will set the given SDADC input pins to the analog function in the pinmux, giving the SDADC access to the analog signal
[in] | pin | AINxx pin to configure |
References system_pinmux_config::input_pull, system_pinmux_config::mux_position, system_pinmux_get_config_defaults(), SYSTEM_PINMUX_PIN_PULL_NONE, and system_pinmux_pin_set_config().
Referenced by _sdadc_set_config().
|
static |
Writes an SDADC configuration to the hardware module
Writes out a given SDADC module configuration to the hardware module.
[out] | module_inst | Pointer to the SDADC software instance struct |
[in] | config | Pointer to configuration struct |
STATUS_OK | The configuration was successful |
STATUS_ERR_INVALID_ARG | Invalid argument(s) were provided |
References _sdadc_configure_ain_pin(), sdadc_config::clock_prescaler, sdadc_config::clock_source, sdadc_config::correction, sdadc_config::event_action, sdadc_config::freerunning, sdadc_correction_config::gain_correction, sdadc_config::mux_input, sdadc_correction_config::offset_correction, sdadc_config::on_command, sdadc_reference::on_ref_buffer, sdadc_config::osr, sdadc_reference::ref_range, sdadc_reference::ref_sel, sdadc_config::reference, sdadc_config::run_in_standby, sdadc_is_syncing(), SDADC_WINDOW_MODE_DISABLE, sdadc_config::seq_enable, sdadc_correction_config::shift_correction, sdadc_config::skip_count, system_gclk_chan_config::source_generator, STATUS_ERR_INVALID_ARG, STATUS_OK, system_gclk_chan_enable(), system_gclk_chan_get_config_defaults(), system_gclk_chan_set_config(), sdadc_config::window, sdadc_window_config::window_lower_value, sdadc_window_config::window_mode, and sdadc_window_config::window_upper_value.
Referenced by sdadc_init().