Skip to content

Commit

Permalink
Merge pull request #23 from TonyLHansen/main
Browse files Browse the repository at this point in the history
Update adafruit_24lc32.py to add max_size parameter to EEPROM_I2C
  • Loading branch information
FoamyGuy committed Jan 8, 2024
2 parents 65d6b7a + 303349b commit 6456cad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_24lc32.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ class EEPROM_I2C(EEPROM):
Default is ``False``.
:param wp_pin: (Optional) Physical pin connected to the ``WP`` breakout pin.
Must be a ``DigitalInOut`` object.
:param max_int: (Optional) Maximum # bytes stored in the EEPROM.
Default is ``_MAX_SIZE_I2C``
"""

# pylint: disable=too-many-arguments
Expand All @@ -232,13 +234,14 @@ def __init__(
address: int = 0x50,
write_protect: bool = False,
wp_pin: Optional[DigitalInOut] = None,
max_size: int = _MAX_SIZE_I2C,
) -> None:
from adafruit_bus_device.i2c_device import ( # pylint: disable=import-outside-toplevel
I2CDevice as i2cdev,
)

self._i2c = i2cdev(i2c_bus, address)
super().__init__(_MAX_SIZE_I2C, write_protect, wp_pin)
super().__init__(max_size, write_protect, wp_pin)

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

0 comments on commit 6456cad

Please sign in to comment.