adafruit_24lc32

CircuitPython driver for Adafruit 24LC32 I2C EEPROM Breakout

  • Author(s): Tim Cocks

Implementation Notes

Hardware:

Software and Dependencies:

# * Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice # * Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register

class adafruit_24lc32.EEPROM(max_size: int, write_protect: bool = False, wp_pin: DigitalInOut | None = None)

Driver base for the EEPROM Breakout.

Parameters:
  • max_size (int) – The maximum size of the EEPROM

  • write_protect (bool) – Turns on/off initial write protection

  • wp_pin (DigitalInOut) – (Optional) Physical pin connected to the WP breakout pin. Must be a DigitalInOut object.

property write_protected: bool

The status of write protection. Default value on initialization is False.

When a WP pin is supplied during initialization, or using write_protect_pin, the status is tied to that pin and enables hardware-level protection.

When no WP pin is supplied, protection is only at the software level in this library.

property write_wraparound: bool

Determines if sequential writes will wrapaound highest memory address (len(EEPROM) - 1) address. If False, and a requested write will extend beyond the maximum size, an exception is raised.

class adafruit_24lc32.EEPROM_I2C(i2c_bus: busio.I2C, address: int = 80, write_protect: bool = False, wp_pin: DigitalInOut | None = None, max_size: int = 4096)

I2C class for EEPROM.

Parameters:
  • i2c_bus (I2C) – The I2C bus the EEPROM is connected to.

  • address (int) – I2C address of EEPROM. Default address is 0x50.

  • write_protect (bool) – Turns on/off initial write protection. Default is False.

  • wp_pin – (Optional) Physical pin connected to the WP breakout pin. Must be a DigitalInOut object.

  • max_int – (Optional) Maximum # bytes stored in the EEPROM. Default is _MAX_SIZE_I2C

property write_protected: bool

The status of write protection. Default value on initialization is False.

When a WP pin is supplied during initialization, or using write_protect_pin, the status is tied to that pin and enables hardware-level protection.

When no WP pin is supplied, protection is only at the software level in this library.