File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ enum SmartBatReg {
1717 /// String
1818 ManufacturerName = 0x20 ,
1919 DeviceName = 0x21 ,
20- Soh = 0x4F ,
2120 CellVoltage1 = 0x3C ,
2221 CellVoltage2 = 0x3D ,
2322 CellVoltage3 = 0x3E ,
@@ -118,6 +117,30 @@ impl SmartBattery {
118117 voltage / 1000 ,
119118 voltage % 1000
120119 ) ;
120+ let cell1_v = self . read_i16 ( ec, SmartBatReg :: CellVoltage1 as u16 ) ?;
121+ println ! (
122+ " Cell 1: {}.{}V" ,
123+ cell1_v / 1000 ,
124+ cell1_v % 1000
125+ ) ;
126+ let cell2_v = self . read_i16 ( ec, SmartBatReg :: CellVoltage2 as u16 ) ?;
127+ println ! (
128+ " Cell 2: {}.{}V" ,
129+ cell2_v / 1000 ,
130+ cell2_v % 1000
131+ ) ;
132+ let cell3_v = self . read_i16 ( ec, SmartBatReg :: CellVoltage3 as u16 ) ?;
133+ println ! (
134+ " Cell 3: {}.{}V" ,
135+ cell3_v / 1000 ,
136+ cell3_v % 1000
137+ ) ;
138+ let cell4_v = self . read_i16 ( ec, SmartBatReg :: CellVoltage4 as u16 ) ?;
139+ println ! (
140+ " Cell 4: {}.{}V" ,
141+ cell4_v / 1000 ,
142+ cell4_v % 1000
143+ ) ;
121144 println ! (
122145 "Cycle Count: {:?}" ,
123146 self . read_i16( ec, SmartBatReg :: CycleCount as u16 ) ?
You can’t perform that action at this time.
0 commit comments