mikroSDK Reference Manual
hal_adc_config_t Struct Reference

ADC HAL initialization configuration structure, consisted of the following fields : More...

Data Fields

hal_pin_name_t pin
 
hal_adc_resolution_t resolution
 
hal_adc_vref_t vref_input
 
float vref_value
 

Detailed Description

User needs to specifiy values herein.

Note
Take into consideration that any value can be changed explicitly by the user.

Example

// ADC HAL configuration structure
static hal_adc_config_t hal_adc_cfg;
// Fill structure with default values
// Specify desired ADC pin
hal_adc_cfg.pin = MIKROBUS_1_AN;
// Set 12 bit ADC resolution
// Set external voltage reference source

Field Documentation

◆ pin

hal_pin_name_t hal_adc_config_t::pin

ADC HAL pin name.

◆ resolution

hal_adc_resolution_t hal_adc_config_t::resolution

ADC HAL resolution. See hal_adc_resolution_t for valid resolution values.

◆ vref_input

hal_adc_vref_t hal_adc_config_t::vref_input

ADC HAL voltage reference voltage source. See hal_adc_vref_t for valid voltage reference source values.

◆ vref_value

float hal_adc_config_t::vref_value

ADC HAL voltage reference voltage value.

ANALOG_IN_RESOLUTION_12_BIT
Definition: drv_analog_in.h:81
ANALOG_IN_VREF_EXTERNAL
Definition: drv_analog_in.h:68
hal_adc_config_t
ADC HAL initialization configuration structure, consisted of the following fields :
Definition: hal_adc.h:131
hal_adc_config_t::resolution
hal_adc_resolution_t resolution
Definition: hal_adc.h:134
hal_adc_configure_default
void hal_adc_configure_default(hal_adc_config_t *config)
Configure ADC HAL configuration structure..
hal_adc_config_t::pin
hal_pin_name_t pin
Definition: hal_adc.h:133
hal_adc_config_t::vref_input
hal_adc_vref_t vref_input
Definition: hal_adc.h:135