XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
Loading...
Searching...
No Matches
MCP23017Driver.h File Reference

Driver for the MCP23017 16-bit I2C GPIO expander. More...

#include "I2CInterface.h"
#include "XPointDriver.h"
#include <stdint.h>

Go to the source code of this file.

Classes

class  MCP23017Driver
 XPointDriver implementation for the MCP23017 16-bit I2C GPIO expander. More...
 

Detailed Description

Driver for the MCP23017 16-bit I2C GPIO expander.

The MCP23017 provides two 8-bit GPIO ports (GPA and GPB):

  • GPA0–GPA7 → pin indices 0–7
  • GPB0–GPB7 → pin indices 8–15

The mapper function must return a pin index in [0, 15].

begin() writes IODIRA = IODIRB = 0x00 (all outputs) before driving OLAT, overriding the device's power-on default of all-inputs.

Up to eight MCP23017s can share one I2C bus; address pins A0–A2 select addresses 0x20–0x27. Drive relay coils via transistors — MCP23017 output current is limited to 25 mA per pin.

Note
commitPhysicalUpdates() is a no-op because MCP23017 writes commit immediately inside setNodeHardware().