VSF Documented
Data Structures | Macros | Typedefs | Functions
driver_adc_port.c File Reference
#include "../vsf_espidf_cfg.h"
#include "driver/adc_oneshot.h"
#include "../vsf_espidf.h"
#include "kernel/vsf_kernel.h"
#include "hal/driver/driver.h"
#include "service/heap/vsf_heap.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
#include <string.h>

Data Structures

struct  __adc_chan_ctx_t
 
struct  adc_oneshot_unit_ctx_t
 

Macros

#define __ADC_MAX_CHANNELS   10 /* matches adc_channel_t range */
 

Typedefs

typedef struct __adc_chan_ctx_t __adc_chan_ctx_t
 
typedef struct adc_oneshot_unit_ctx_t adc_oneshot_unit_ctx_t
 

Functions

void vsf_espidf_adc_init (const vsf_espidf_adc_cfg_t *cfg)
 
esp_err_t adc_oneshot_new_unit (const adc_oneshot_unit_init_cfg_t *init_config, adc_oneshot_unit_handle_t *ret_unit)
 Allocate an ADC oneshot unit handle from the pool entry matching init_config->unit_id.
 
esp_err_t adc_oneshot_del_unit (adc_oneshot_unit_handle_t handle)
 Release an ADC oneshot unit handle allocated by adc_oneshot_new_unit().
 
esp_err_t adc_oneshot_config_channel (adc_oneshot_unit_handle_t handle, adc_channel_t channel, const adc_oneshot_chan_cfg_t *config)
 Cache a channel configuration on the handle. The actual vsf_adc channel_request_once call happens in adc_oneshot_read().
 
esp_err_t adc_oneshot_read (adc_oneshot_unit_handle_t handle, adc_channel_t channel, int *out_raw)
 Perform one blocking conversion on a channel and return the raw result.
 

Macro Definition Documentation

◆ __ADC_MAX_CHANNELS

#define __ADC_MAX_CHANNELS   10 /* matches adc_channel_t range */

Typedef Documentation

◆ __adc_chan_ctx_t

◆ adc_oneshot_unit_ctx_t

Function Documentation

◆ vsf_espidf_adc_init()

void vsf_espidf_adc_init ( const vsf_espidf_adc_cfg_t cfg)
extern

◆ adc_oneshot_new_unit()

esp_err_t adc_oneshot_new_unit ( const adc_oneshot_unit_init_cfg_t init_config,
adc_oneshot_unit_handle_t ret_unit 
)

Allocate an ADC oneshot unit handle from the pool entry matching init_config->unit_id.

◆ adc_oneshot_del_unit()

esp_err_t adc_oneshot_del_unit ( adc_oneshot_unit_handle_t  handle)

Release an ADC oneshot unit handle allocated by adc_oneshot_new_unit().

◆ adc_oneshot_config_channel()

esp_err_t adc_oneshot_config_channel ( adc_oneshot_unit_handle_t  handle,
adc_channel_t  channel,
const adc_oneshot_chan_cfg_t config 
)

Cache a channel configuration on the handle. The actual vsf_adc channel_request_once call happens in adc_oneshot_read().

◆ adc_oneshot_read()

esp_err_t adc_oneshot_read ( adc_oneshot_unit_handle_t  handle,
adc_channel_t  channel,
int *  out_raw 
)

Perform one blocking conversion on a channel and return the raw result.

Variable Documentation

◆ inited

bool inited

◆ pool_count

uint16_t pool_count

◆ pool

vsf_adc_t* const* pool

◆ units

Generated from commit: vsfteam/vsf@015f4d1