dt-bindings: sensor: ina230: add configuration properties
Add properties to replace the configuration register value. Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
This commit is contained in:
parent
19e44ae9a0
commit
f0f7f8b146
3 changed files with 51 additions and 7 deletions
|
@ -261,7 +261,11 @@ static const struct sensor_driver_api ina230_driver_api = {
|
|||
static struct ina230_data drv_data_##inst; \
|
||||
static const struct ina230_config drv_config_##inst = { \
|
||||
.bus = I2C_DT_SPEC_INST_GET(inst), \
|
||||
.config = DT_INST_PROP(inst, config), \
|
||||
.config = DT_INST_PROP(inst, config) | \
|
||||
(DT_INST_ENUM_IDX(inst, avg_count) << 9) | \
|
||||
(DT_INST_ENUM_IDX(inst, vbus_conversion_time_us) << 6) | \
|
||||
(DT_INST_ENUM_IDX(inst, vshunt_conversion_time_us) << 3) | \
|
||||
DT_INST_ENUM_IDX(inst, adc_mode), \
|
||||
.current_lsb = DT_INST_PROP(inst, current_lsb_microamps), \
|
||||
.cal = (uint16_t)((INA230_CAL_SCALING * 10000000ULL) / \
|
||||
((uint64_t)DT_INST_PROP(inst, current_lsb_microamps) * \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue