SRA Board Components
ESP-IDF component for SRA Board
Functions
adc.c File Reference
#include "adc.h"
Include dependency graph for adc.c:

Functions

esp_err_t config_adc1 (adc_obj_t *adc_obj)
 
esp_err_t calib_init (adc_obj_t *adc_obj)
 
esp_err_t enable_adc1 (adc_obj_t **adc_obj)
 call function config_adc1() and characterize_adc1(). More...
 
int read_adc (adc_handle_t adc_handle, int gpio)
 Reads the adc value from the GPIO(channel) specified. More...
 

Function Documentation

◆ calib_init()

esp_err_t calib_init ( adc_obj_t adc_obj)

◆ config_adc1()

esp_err_t config_adc1 ( adc_obj_t adc_obj)

◆ enable_adc1()

esp_err_t enable_adc1 ( adc_obj_t **  adc_obj)

call function config_adc1() and characterize_adc1().

Returns
esp_err_t - returns ESP_OK if Configuration and Characterization of adc1 is successful, else it returns ESP_ERR_INVALID_ARG.

◆ read_adc()

int read_adc ( adc_handle_t  adc_handle,
int  gpio 
)

Reads the adc value from the GPIO(channel) specified.

Parameters
adc_handle_tadc_handle - pointer to adc object.
intgpio - gpio pin number of the channel to be read.
Returns
int - returns the adc value read from the channel.