7#ifndef ZEPHYR_INCLUDE_DRIVERS_ADC_VOLTAGE_DIVIDER_H_
8#define ZEPHYR_INCLUDE_DRIVERS_ADC_VOLTAGE_DIVIDER_H_
28#define VOLTAGE_DIVIDER_DT_SPEC_GET(node_id) \
30 .port = ADC_DT_SPEC_GET(node_id), \
31 .full_ohms = DT_PROP_OR(node_id, full_ohms, 0), \
32 .output_ohms = DT_PROP(node_id, output_ohms), \
ADC public API header file.
#define ENOTSUP
Unsupported value.
Definition: errno.h:114
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__INT32_TYPE__ int32_t
Definition: stdint.h:74
__INT64_TYPE__ int64_t
Definition: stdint.h:75
Container for ADC channel information specified in devicetree.
Definition: adc.h:264
Definition: voltage_divider.h:12
uint32_t full_ohms
Definition: voltage_divider.h:14
const struct adc_dt_spec port
Definition: voltage_divider.h:13
uint32_t output_ohms
Definition: voltage_divider.h:15
static int voltage_divider_scale_dt(const struct voltage_divider_dt_spec *spec, int32_t *v_to_v)
Calculates the actual voltage from the measured voltage.
Definition: voltage_divider.h:45