Go to the source code of this file.
◆ CURRENT_SENSE_AMPLIFIER_DT_SPEC_GET
#define CURRENT_SENSE_AMPLIFIER_DT_SPEC_GET |
( |
|
node_id | ) |
|
Value: { \
.sense_micro_ohms =
DT_PROP(node_id, sense_resistor_micro_ohms), \
.sense_gain_mult =
DT_PROP(node_id, sense_gain_mult), \
.sense_gain_div =
DT_PROP(node_id, sense_gain_div), \
}
#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
#define GPIO_DT_SPEC_GET_OR(node_id, prop, default_value)
Equivalent to GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, prop, 0, default_value).
Definition gpio.h:381
Get current sensor information from devicetree.
This returns a static initializer for a current_sense_amplifier_dt_spec
structure given a devicetree node.
- Parameters
-
node_id | Devicetree node identifier. |
- Returns
- Static initializer for an current_sense_amplifier_dt_spec structure.
◆ current_sense_amplifier_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. |