{
  "id": "mattytrentini/micropython-at24c32",
  "name": "micropython-at24c32",
  "prettyName": "micropython-at24c32",
  "description": "Standalone MicroPython I2C driver for the AT24C32 EEPROM",
  "version": "",
  "author": "mattytrentini",
  "license": "MIT",
  "tags": [],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/mattytrentini/micropython-at24c32",
  "updatedAt": "2026-11-21T22:29:15.995Z",
  "page": "https://checkmim.com/packages/mattytrentini+micropython-at24c32",
  "createdAt": "2026-11-21T22:29:13.882Z",
  "submittedBy": "Matt",
  "install": {
    "mpremote": "mpremote mip install github:mattytrentini/micropython-at24c32",
    "mip": "import mip; mip.install(\"github:mattytrentini/micropython-at24c32\")"
  },
  "readme": "# AT24C32 for MicroPython\n\nMIT-licensed driver for the AT24C32 32-Kbit (4 KiB) I²C EEPROM. It is\nindependent of the [DS3231 clock driver](https://github.com/mattytrentini/micropython-ds3231),\neven when both chips are on the same module.\n\n## Install\n\n```sh\nmpremote mip install github:mattytrentini/micropython-at24c32\n```\n\nOn a network-connected board:\n\n```python\nimport mip\nmip.install(\"github:mattytrentini/micropython-at24c32\")\n```\n\n## Use\n\nPass an initialized `machine.I2C` or `machine.SoftI2C` bus. The EEPROM uses\n`0x50`–`0x57`, depending on its address straps. Some DS3231 modules use `0x57`\nfor the EEPROM; check your board or use `i2c.scan()`. For writes, the hardware\nwrite-protect pin must be low.\n\n```python\nfrom at24c32 import AT24C32\n\neeprom = AT24C32(i2c, addr=0x57)\nprint(eeprom.read(0, 8))\n\nbuf = bytearray(8)\neeprom.readinto(0, buf)\n# This overwrites EEPROM offsets 30–33, spanning two pages:\neeprom.write(30, b\"demo\")\n```\n\nOffsets are byte offsets from 0 to 4095. `write()` accepts `bytes` or\n`bytearray`; `readinto()` accepts a `bytearray`.\nReads and writes cannot wrap the end of memory. `write()` waits for each\n32-byte page's write cycle to finish before continuing or returning.\nThe bus must support 16-bit memory addresses (`addrsize=16`).\n\nReference: [Microchip AT24C32D datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/AT24C32D-I2C-Compatible-Serial-EEPROM-Data-Sheet-20006047A.pdf).\n"
}