mikroSDK Reference Manual
hal_adc.h File Reference

Go to the source code of this file.

Data Structures

struct  hal_adc_handle_register_t
 ADC HAL level handle. More...
 
struct  hal_adc_config_t
 ADC HAL initialization configuration structure, consisted of the following fields : More...
 
struct  hal_adc_t
 ADC HAL context structure, consisted of the following fields : More...
 

Enumerations

enum  hal_adc_err_t
 
enum  hal_adc_resolution_t
 
enum  hal_adc_vref_t
 

Functions

void hal_adc_configure_default (hal_adc_config_t *config)
 Configure ADC HAL configuration structure.. More...
 
err_t hal_adc_open (handle_t *handle, bool hal_obj_open_state)
 Open the ADC HAL layer object on selected pin. More...
 
err_t hal_adc_set_resolution (handle_t *handle, hal_adc_config_t *config)
 Set ADC HAL sample resolution. More...
 
err_t hal_adc_set_vref_input (handle_t *handle, hal_adc_config_t *config)
 Set ADC HAL reference voltage source to desired value. More...
 
void hal_adc_set_vref_value (handle_t *handle, hal_adc_config_t *config)
 Set ADC HAL reference voltage value to desired value. More...
 
err_t hal_adc_read (handle_t *handle, uint16_t *readDatabuf)
 Read analog value on pin. More...
 
err_t hal_adc_read_voltage (handle_t *handle, float *readDatabuf)
 Read analog voltage value on pin. More...
 
err_t hal_adc_close (handle_t *handle)
 Close ADC HAL layer object. More...
 

Enumeration Type Documentation

◆ hal_adc_err_t

Return values.

Enumerator
HAL_ADC_SUCCESS 

Success.

HAL_ADC_WRONG_PIN 

Wrong pin selected.

HAL_ADC_MODULE_ERROR 

Object wasn't closed.

HAL_ADC_UNSUPPORTED_RESOLUTION 

Wrong resolution error.

HAL_ADC_UNSUPPORTED_VREF 

Wrong voltage referebnce source error.

HAL_ADC_WRONG_CHANNEL 

Wrong channel error.

HAL_ADC_ERROR 

Error.

◆ hal_adc_resolution_t

Predefined enum values for ADC resolution.

Enumerator
HAL_ADC_RESOLUTION_NOT_SET 

Resolution not set.

HAL_ADC_RESOLUTION_6_BIT 

6 bit resolution.

HAL_ADC_RESOLUTION_8_BIT 

8 bit resolution.

HAL_ADC_RESOLUTION_10_BIT 

10 bit resolution.

HAL_ADC_RESOLUTION_12_BIT 

12 bit resolution.

HAL_ADC_RESOLUTION_14_BIT 

14 bit resolution.

HAL_ADC_RESOLUTION_16_BIT 

16 bit resolution.

HAL_ADC_RESOLUTION_DEFAULT 

Default resolution.

◆ hal_adc_vref_t

Predefined enum values for ADC voltage reference source.

Enumerator
HAL_ADC_VREF_EXTERNAL 

External voltage reference source.

HAL_ADC_VREF_INTERNAL 

Internal voltage reference source.

HAL_ADC_VREF_DEFAULT 

Default (external voltage reference source)