Go to the source code of this file.
◆ VOLTAGE_DIVIDER_DT_SPEC_GET
#define VOLTAGE_DIVIDER_DT_SPEC_GET |
( |
|
node_id | ) |
|
Value: { \
.output_ohms =
DT_PROP(node_id, output_ohms), \
}
#define ADC_DT_SPEC_GET(node_id)
Equivalent to ADC_DT_SPEC_GET_BY_IDX(node_id, 0).
Definition adc.h:516
#define DT_PROP_OR(node_id, prop, default_value)
Like DT_PROP(), but with a fallback to default_value.
Definition devicetree.h:825
#define DT_PROP(node_id, prop)
Get a devicetree property value.
Definition devicetree.h:663
Get voltage divider information from devicetree.
This returns a static initializer for a voltage_divider_dt_spec
structure given a devicetree node.
- Parameters
-
node_id | Devicetree node identifier. |
- Returns
- Static initializer for an voltage_divider_dt_spec structure.
◆ voltage_divider_scale_dt()
Calculates the actual voltage from the measured voltage.
- Parameters
-
[in] | spec | voltage divider specification from Devicetree. |
[in,out] | v_to_v | Pointer to the measured voltage on input, and the corresponding scaled voltage value on output. |
- Return values
-
0 | on success |
-ENOTSUP | if "full_ohms" is not specified |