mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
add options for INA3221 driver (#21310)
* Add files via upload * Add files via upload * Add files via upload * Delete tasmota/xsns_100_ina3221.ino --------- Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
This commit is contained in:
parent
d469f2a565
commit
0d6baa00e4
@ -737,6 +737,9 @@ https://rya.nc/tasmota-fingerprint.html"
|
||||
// // Both settings together allow to limit searching for INA3221 to only a subset of addresses
|
||||
// #define INA3221_CALC_CHARGE_AH // calculate charge in Ah
|
||||
// #define INA3221_CALC_ENERGY_WH // calculate energy in Wh
|
||||
// #define INA3221_SUPPLY_SIDE 0x7777 // the driver adds the measured Shunt Voltage to the Bus Voltage
|
||||
// for the cannel with a negativ shunt (shunt <0) thus showing the values of the supply side (IN+)
|
||||
// additionaly the bits set (bit 0,1,2) enable the scanning of the voltage in the according channel
|
||||
// #define USE_PMSA003I // [I2cDriver78] Enable PMSA003I Air Quality Sensor (I2C address 0x12) (+1k8 code)
|
||||
// #define USE_GDK101 // [I2cDriver79] Enable GDK101 sensor (I2C addresses 0x18 - 0x1B) (+1k2 code)
|
||||
// #define GDK101_SHOW_FW_VERSION
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
xsns_100_ina3221.ino - INA3221 3-channels Current Sensor support for Tasmota
|
||||
|
||||
Copyright (C) 2021 Barbudor and Theo Arends + fb-pilot 2024-4-4, 2024-4-20
|
||||
Copyright (C) 2021 Barbudor and Theo Arends + fb-pilot
|
||||
Based on Barbudor's CircuitPython_INA3221
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -472,12 +472,14 @@ bool Ina3221CmndSensor(void)
|
||||
float shunt = CharToFloat(ArgV(argument,2+channel));
|
||||
Ina3221SetShunt(device, channel, shunt);
|
||||
}
|
||||
#ifdef INA3221_SUPPLY_SIDE
|
||||
if (!Ina3221WriteConfig(device)){
|
||||
#ifdef DEBUG_TASMOTA_SENSOR
|
||||
DEBUG_SENSOR_LOG(D_INA3221 "error write configuration %d", device+1);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Response_P(INA3221_SENSORCMND_START, XSNS_100, device +1, Ina3221Data[device].i2caddr);
|
||||
for (int channel = 0 ; channel < INA3221_NB_CHAN ; channel++ ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user