Skip to content

Commit 9dba90f

Browse files
authored
Update adafruit_24lc32.py to add max_size parameter to EEPROM_I2C
I would like to use this library with other EEPROMs in the 24C series or other EEPROMs that use the same I2C protocol. The only real difference is that they have different maximum sizes. The minimal change is to add a parameter to specify that maximum size.
1 parent 65d6b7a commit 9dba90f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_24lc32.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,14 @@ def __init__(
232232
address: int = 0x50,
233233
write_protect: bool = False,
234234
wp_pin: Optional[DigitalInOut] = None,
235+
max_size: in = _MAX_SIZE_I2C
235236
) -> None:
236237
from adafruit_bus_device.i2c_device import ( # pylint: disable=import-outside-toplevel
237238
I2CDevice as i2cdev,
238239
)
239240

240241
self._i2c = i2cdev(i2c_bus, address)
241-
super().__init__(_MAX_SIZE_I2C, write_protect, wp_pin)
242+
super().__init__(max_size, write_protect, wp_pin)
242243

243244
def _read_address(self, address: int, read_buffer: bytearray) -> bytearray:
244245
write_buffer = bytearray(2)

0 commit comments

Comments
 (0)