Skip to content

Commit 6456cad

Browse files
authored
Merge pull request #23 from TonyLHansen/main
Update adafruit_24lc32.py to add max_size parameter to EEPROM_I2C
2 parents 65d6b7a + 303349b commit 6456cad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_24lc32.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ class EEPROM_I2C(EEPROM):
223223
Default is ``False``.
224224
:param wp_pin: (Optional) Physical pin connected to the ``WP`` breakout pin.
225225
Must be a ``DigitalInOut`` object.
226+
:param max_int: (Optional) Maximum # bytes stored in the EEPROM.
227+
Default is ``_MAX_SIZE_I2C``
226228
"""
227229

228230
# pylint: disable=too-many-arguments
@@ -232,13 +234,14 @@ def __init__(
232234
address: int = 0x50,
233235
write_protect: bool = False,
234236
wp_pin: Optional[DigitalInOut] = None,
237+
max_size: int = _MAX_SIZE_I2C,
235238
) -> None:
236239
from adafruit_bus_device.i2c_device import ( # pylint: disable=import-outside-toplevel
237240
I2CDevice as i2cdev,
238241
)
239242

240243
self._i2c = i2cdev(i2c_bus, address)
241-
super().__init__(_MAX_SIZE_I2C, write_protect, wp_pin)
244+
super().__init__(max_size, write_protect, wp_pin)
242245

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

0 commit comments

Comments
 (0)