Zephyr API Documentation 4.0.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
85int adc_emul_const_raw_value_set(const struct device *dev, unsigned int chan, uint32_t raw_value);
86
99int adc_emul_value_func_set(const struct device *dev, unsigned int chan,
100 adc_emul_value_func func, void *data);
101
114int adc_emul_raw_value_func_set(const struct device *dev, unsigned int chan,
115 adc_emul_value_func func, void *data);
116
127int adc_emul_ref_voltage_set(const struct device *dev, enum adc_reference ref,
128 uint16_t value);
133#ifdef __cplusplus
134}
135#endif
136
137#endif /* ZEPHYR_INCLUDE_DRIVERS_ADC_ADC_EMUL_H_ */
ADC public API header file.
int adc_emul_const_raw_value_set(const struct device *dev, unsigned int chan, uint32_t raw_value)
Set constant raw value input for emulated ADC chan.
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_raw_value_func_set(const struct device *dev, unsigned int chan, adc_emul_value_func func, void *data)
Set function used to obtain voltage for raw input value of emulated ADC chan.
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:411
void * data
Address of the device instance private data.
Definition device.h:421