Go to the source code of this file.
◆ CURRENT_SENSE_SHUNT_DT_SPEC_GET
#define CURRENT_SENSE_SHUNT_DT_SPEC_GET |
( |
| node_id | ) |
|
Value: { \
.shunt_micro_ohms =
DT_PROP(node_id, shunt_resistor_micro_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(node_id, prop)
Get a devicetree property value.
Definition devicetree.h:663
Get current sensor information from devicetree.
This returns a static initializer for a current_sense_shunt_dt_spec
structure given a devicetree node.
- Parameters
-
node_id | Devicetree node identifier. |
- Returns
- Static initializer for an current_sense_shunt_dt_spec structure.
◆ current_sense_shunt_scale_dt()
Calculates the actual amperage from the measured voltage.
- Parameters
-
[in] | spec | current sensor specification from Devicetree. |
[in,out] | v_to_i | Pointer to the measured voltage in millivolts on input, and the corresponding scaled current value in milliamps on output. |