Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
adc_emul.h
Go to the documentation of this file.
1
7/*
8 * Copyright 2021 Google LLC
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12#ifndef ZEPHYR_INCLUDE_DRIVERS_ADC_ADC_EMUL_H_
13#define ZEPHYR_INCLUDE_DRIVERS_ADC_ADC_EMUL_H_
14
15#include <zephyr/types.h>
16#include <zephyr/drivers/adc.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
59typedef int (*adc_emul_value_func)(const struct device *dev, unsigned int chan,
60 void *data, uint32_t *result);
61
72int adc_emul_const_value_set(const struct device *dev, unsigned int chan,
73 uint32_t value);
74
87int adc_emul_value_func_set(const struct device *dev, unsigned int chan,
88 adc_emul_value_func func, void *data);
89
100int adc_emul_ref_voltage_set(const struct device *dev, enum adc_reference ref,
101 uint16_t value);
106#ifdef __cplusplus
107}
108#endif
109
110#endif /* ZEPHYR_INCLUDE_DRIVERS_ADC_ADC_EMUL_H_ */
ADC public API header file.
int adc_emul_ref_voltage_set(const struct device *dev, enum adc_reference ref, uint16_t value)
Set reference voltage.
int adc_emul_const_value_set(const struct device *dev, unsigned int chan, uint32_t value)
Set constant mV value input for emulated ADC chan.
int(* adc_emul_value_func)(const struct device *dev, unsigned int chan, void *data, uint32_t *result)
Type definition of the function which is used to obtain ADC mV input values.
Definition: adc_emul.h:59
int adc_emul_value_func_set(const struct device *dev, unsigned int chan, adc_emul_value_func func, void *data)
Set function used to obtain voltage for input of emulated ADC chan.
adc_reference
ADC references.
Definition: adc.h:77
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
void * data
Address of the device instance private data.
Definition: device.h:409