{
  "id": "howmanyoliversarethere/micropython-fxl6408",
  "name": "micropython-fxl6408",
  "prettyName": "micropython-fxl6408",
  "description": "MicroPython driver for the onsemi FXL6408 8-bit I2C GPIO expander",
  "version": "",
  "author": "howmanyoliversarethere",
  "license": "MIT",
  "tags": [],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/howmanyoliversarethere/micropython-fxl6408",
  "updatedAt": "2026-10-28T08:53:26.346Z",
  "page": "https://checkmim.com/packages/howmanyoliversarethere+micropython-fxl6408",
  "createdAt": "2026-10-28T08:53:23.678Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:howmanyoliversarethere/micropython-fxl6408",
    "mip": "import mip; mip.install(\"github:howmanyoliversarethere/micropython-fxl6408\")"
  },
  "readme": "# FXL6408 GPIO expander\n\nA MicroPython driver for the onsemi (formerly Fairchild) **FXL6408**, an\n8-bit I2C GPIO expander. Every pin can be an input or a push-pull output,\nwith optional pull-up or pull-down resistors and per-pin interrupts on the\nchip's open-drain `INT` output.\n\nCopy `fxl6408.py` onto your board, or install it with `mip`:\n\n```python\nimport mip\nmip.install(\"github:HowManyOliversAreThere/micropython-fxl6408\")\n```\n\n## Usage\n\n```python\nfrom machine import I2C, Pin\nimport fxl6408\n\ni2c = I2C(0, sda=Pin(19), scl=Pin(20), freq=400_000)\nio = fxl6408.FXL6408(i2c, address=fxl6408.ADDR_LOW)   # 0x43, ADDR pin low\n\nio.setup(0, fxl6408.OUT, value=1)                  # P0: output, high\nio.setup(1, fxl6408.IN, pull=fxl6408.PULL_UP)      # P1: input with pull-up\nio.write(0, 0)\nprint(io.read(1))\n\nled = io.pin(2, fxl6408.OUT)                       # machine.Pin-style handle\nled.toggle()\n\nio.enable_interrupt(1)          # INT asserts when P1 changes from its level now\nflags = io.read_interrupts()    # bitmask of pins that triggered; reading clears INT\n```\n\nSee [examples/buttons_and_led.py](examples/buttons_and_led.py) for a fuller\nexample that uses the `INT` pin.\n\n## Notes\n\n- The I2C address is `0x43` with the `ADDR` pin low and `0x44` with it high\n  (`ADDR_LOW` / `ADDR_HIGH`).\n- By default the constructor checks the manufacturer ID bits and then does a\n  software reset, which puts every pin back to an input with its pull-down\n  on. Pass `reset=False` to keep the chip's current state, for example after\n  a microcontroller reset where outputs should not glitch.\n- If the chip's active-low `RESET` pin is wired to a GPIO, pass it as\n  `reset_pin` to pulse it at start-up.\n- The chip has no real open-drain output mode. `OPEN_DRAIN` is emulated by\n  switching a pin between driving low and high-impedance.\n- The driver keeps shadow copies of the configuration registers, so\n  changing one pin never disturbs the others. If something else on the bus\n  also writes to the chip, construct the driver with `reset=False` to sync\n  from the device.\n\n## License\n\nMIT - see [LICENSE](LICENSE).\n"
}