|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Driver Operations ADC driver operations More...
#include <zephyr/drivers/adc.h>
Data Fields | |
| adc_api_channel_setup | channel_setup |
| REQ Configure an ADC channel. | |
| adc_api_read | read |
| REQ Set a read request. | |
| adc_api_read_async | read_async |
| REQ Set an asynchronous read request. | |
| adc_api_submit | submit |
| REQ Submit a stream request. | |
| adc_api_get_decoder | get_decoder |
| OPT Get decoder APIs for that device. | |
| uint16_t | ref_internal |
| REQ Internal reference voltage, in millivolts. | |
| adc_api_ref_get | ref_get |
| OPT Get the current voltage for a selected reference in millivolts. | |
Driver Operations ADC driver operations
This is the driver API structure any ADC driver needs to define. It contains function pointers to the operations the driver implements, as well as any other driver-specific constant data.
Members marked with REQ MUST be set by the driver, whereas those marked with OPT are optional.
| adc_api_channel_setup adc_driver_api::channel_setup |
REQ Configure an ADC channel.
| adc_api_get_decoder adc_driver_api::get_decoder |
OPT Get decoder APIs for that device.
CONFIG_ADC_STREAM. | adc_api_read adc_driver_api::read |
REQ Set a read request.
| adc_api_read_async adc_driver_api::read_async |
REQ Set an asynchronous read request.
CONFIG_ADC_ASYNC. | adc_api_ref_get adc_driver_api::ref_get |
OPT Get the current voltage for a selected reference in millivolts.
When NULL, adc_ref_get falls back to ref_internal for ADC_REF_INTERNAL and returns -ENOTSUP for other references. When implemented, return the live/runtime value (for example a cached measurement); return -ENODATA when the reference is supported but no millivolt value is known yet, or -ENOTSUP when the reference is not supported by the device.
| uint16_t adc_driver_api::ref_internal |
REQ Internal reference voltage, in millivolts.
Set to 0 if internal reference is not supported. Used as the fallback for ADC_REF_INTERNAL when ref_get is NULL.
| adc_api_submit adc_driver_api::submit |
REQ Submit a stream request.
CONFIG_ADC_STREAM.