Skip to content

Commit 9945e1d

Browse files
authored
Correct LC709023F to LC709203F (#8)
1 parent d641bf6 commit 9945e1d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

adafruit_lc709203f.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
__version__ = "0.0.0-auto.0"
3434
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LC709203F.git"
3535

36-
LC709023F_I2CADDR_DEFAULT = const(0x0B)
36+
LC709203F_I2CADDR_DEFAULT = const(0x0B)
3737
LC709203F_CMD_ICVERSION = const(0x11)
3838
LC709203F_CMD_BATTPROF = const(0x12)
3939
LC709203F_CMD_POWERMODE = const(0x15)
@@ -93,10 +93,10 @@ class PackSize(CV):
9393
)
9494

9595

96-
class LC709023F:
97-
"""Interface library for LC709023F battery monitoring and fuel gauge sensors"""
96+
class LC709203F:
97+
"""Interface library for LC709203F battery monitoring and fuel gauge sensors"""
9898

99-
def __init__(self, i2c_bus, address=LC709023F_I2CADDR_DEFAULT):
99+
def __init__(self, i2c_bus, address=LC709203F_I2CADDR_DEFAULT):
100100
self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
101101
self._buf = bytearray(10)
102102
self.power_mode = PowerMode.OPERATE # pylint: disable=no-member
@@ -171,7 +171,7 @@ def _generate_crc(self, data):
171171
return crc & 0xFF
172172

173173
def _read_word(self, command):
174-
self._buf[0] = LC709023F_I2CADDR_DEFAULT * 2 # write byte
174+
self._buf[0] = LC709203F_I2CADDR_DEFAULT * 2 # write byte
175175
self._buf[1] = command # command / register
176176
self._buf[2] = self._buf[0] | 0x1 # read byte
177177

@@ -185,7 +185,7 @@ def _read_word(self, command):
185185
return (self._buf[4] << 8) | self._buf[3]
186186

187187
def _write_word(self, command, data):
188-
self._buf[0] = LC709023F_I2CADDR_DEFAULT * 2 # write byte
188+
self._buf[0] = LC709203F_I2CADDR_DEFAULT * 2 # write byte
189189
self._buf[1] = command # command / register
190190
self._buf[2] = data & 0xFF
191191
self._buf[3] = (data >> 8) & 0xFF

examples/lc709203f_simpletest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
import time
66
import board
7-
from adafruit_lc709203f import LC709023F
7+
from adafruit_lc709203f import LC709203F
88

9-
print("LC709023F simple test")
9+
print("LC709203F simple test")
1010
print("Make sure LiPoly battery is plugged into the board!")
1111

12-
sensor = LC709023F(board.I2C())
12+
sensor = LC709203F(board.I2C())
1313

1414
print("IC version:", hex(sensor.ic_version))
1515
while True:

0 commit comments

Comments
 (0)