See Quickstart guide for SAM ADCIFE driver.
Driver for the Analog-to-digital Converter. This driver provides access to the main features of the ADC controller.
Functions | |
void | adc_ch_set_config (struct adc_dev_inst *const dev_inst, struct adc_ch_config *cfg) |
Configure ADC channel with specified value. More... | |
void | adc_disable (struct adc_dev_inst *const dev_inst) |
Disable ADC module. More... | |
status_code_t | adc_enable (struct adc_dev_inst *const dev_inst) |
Enable ADC module. More... | |
status_code_t | adc_init (struct adc_dev_inst *const dev_inst, Adcife *const adc, struct adc_config *const cfg) |
Initialize the ADC module. More... | |
static void | adc_interrupt (void) |
Common ADCIFE interrupt handler. More... | |
void | adc_pdca_set_config (struct adc_pdca_config *cfg) |
Configure ADC sequencer support multi-channel mode. More... | |
void | adc_set_callback (struct adc_dev_inst *const dev_inst, adc_interrupt_source_t source, adc_callback_t callback, uint8_t irq_line, uint8_t irq_level) |
Set callback for ADC. More... | |
void | adc_set_config (struct adc_dev_inst *const dev_inst, struct adc_config *cfg) |
Configure ADC with specified value. More... | |
void | ADCIFE_Handler (void) |
Interrupt handler for ADCIFE interrupt. More... | |
Variables | |
adc_callback_t | adc_callback_pointer |
void adc_ch_set_config | ( | struct adc_dev_inst *const | dev_inst, |
struct adc_ch_config * | cfg | ||
) |
Configure ADC channel with specified value.
dev_inst | Device structure pointer. |
cfg | Pointer to ADC Channel configuration. |
References adc_configure_wm_mode(), adc_configure_wm_threshold(), adc_ch_config::high_threshold, adc_dev_inst::hw_dev, adc_ch_config::low_threshold, adc_ch_config::seq_cfg, and adc_ch_config::window_mode.
Referenced by run_adcife_diff_test(), run_adcife_itimer_trig_test(), and run_adcife_wm_test().
void adc_disable | ( | struct adc_dev_inst *const | dev_inst | ) |
Disable ADC module.
dev_inst | Device structure pointer. |
References adc_dev_inst::hw_dev, SLEEPMGR_SLEEP_1, sleepmgr_unlock_mode(), and sysclk_disable_peripheral_clock().
Referenced by run_adcife_wm_test().
status_code_t adc_enable | ( | struct adc_dev_inst *const | dev_inst | ) |
Enable ADC module.
dev_inst | Device structure pointer. |
References ADC_NUM_OF_ATTEMPTS, ERR_TIMEOUT, adc_dev_inst::hw_dev, sleepmgr_lock_mode(), SLEEPMGR_SLEEP_1, STATUS_OK, and sysclk_enable_peripheral_clock().
Referenced by run_adcife_init_test().
status_code_t adc_init | ( | struct adc_dev_inst *const | dev_inst, |
Adcife *const | adc, | ||
struct adc_config *const | cfg | ||
) |
Initialize the ADC module.
dev_inst | Device structure pointer. |
adc | Base address of the ADC instance. |
cfg | Pointer to AES configuration. |
true | if the initialization was successful. |
false | if initialization failed. |
References adc_dev_inst::adc_cfg, adc_set_config(), Assert, adc_dev_inst::hw_dev, STATUS_OK, sysclk_disable_peripheral_clock(), and sysclk_enable_peripheral_clock().
Referenced by run_adcife_init_test().
|
static |
Common ADCIFE interrupt handler.
The optional callback used by the interrupt handler is set by the adcife_set_callback() function.
References adc_callback_pointer.
Referenced by ADCIFE_Handler().
void adc_pdca_set_config | ( | struct adc_pdca_config * | cfg | ) |
Configure ADC sequencer support multi-channel mode.
cfg | Pointer to ADC multi-channel mode configuration. |
References pdca_channel_config_t::addr, adc_pdca_config::buffer, adc_pdca_config::cdma_cfg, adc_pdca_config::nb_channels, adc_pdca_config::pdc_rx_channel, adc_pdca_config::pdc_tx_channel, pdca_channel_enable(), pdca_channel_set_config(), pdca_enable(), and adc_pdca_config::wm.
Referenced by run_adcife_multichannel_test().
void adc_set_callback | ( | struct adc_dev_inst *const | dev_inst, |
adc_interrupt_source_t | source, | ||
adc_callback_t | callback, | ||
uint8_t | irq_line, | ||
uint8_t | irq_level | ||
) |
Set callback for ADC.
dev_inst | Device structure pointer. |
source | interrupt source. |
callback | callback function pointer. |
irq_line | interrupt line. |
irq_level | interrupt level. |
References adc_enable_interrupt(), and irq_register_handler.
Referenced by run_adcife_itimer_trig_test(), and run_adcife_wm_test().
void adc_set_config | ( | struct adc_dev_inst *const | dev_inst, |
struct adc_config * | cfg | ||
) |
Configure ADC with specified value.
dev_inst | Device structure pointer. |
cfg | Pointer to ADC configuration. |
References adc_config::clksel, CONFIG_ADC_GENERIC_DIV, CONFIG_ADC_GENERIC_SRC, genclk_enable_config(), adc_dev_inst::hw_dev, adc_config::prescal, adc_config::refsel, adc_config::speed, and adc_config::start_up.
Referenced by adc_init().
void ADCIFE_Handler | ( | void | ) |
Interrupt handler for ADCIFE interrupt.
References adc_interrupt().
adc_callback_t adc_callback_pointer |
Referenced by adc_interrupt().