IoAbstraction
Classes | Enumerations | Functions
IoAbstractionWire.h File Reference

Contains the versions of BasicIoAbstraction that use i2c communication. Including PCF8574 and MCP23017. More...

Go to the source code of this file.

Classes

class  PCF8574IoAbstraction
 
class  Standard16BitDevice
 
class  MCP23017IoAbstraction
 
class  AW9523IoAbstraction
 
class  AW9523AnalogAbstraction
 
class  MPR121IoAbstraction
 
class  MPR121AnalogAbstraction
 

Enumerations

enum  Mcp23xInterruptMode {
  NOT_ENABLED = 0 , ACTIVE_HIGH_OPEN = 0b110 , ACTIVE_LOW_OPEN = 0b100 , ACTIVE_HIGH = 0b010 ,
  ACTIVE_LOW = 0b000
}
 
enum  MPR121ConfigType : uint8_t { MPR121_MANUAL_CONFIG , MPR121_AUTO_CONFIG }
 

Functions

IoAbstractionRef ioFrom8574 (uint8_t addr, pinid_t interruptPin, WireType wireImpl, bool invertedLogic=false)
 
IoAbstractionRef ioFrom8575 (uint8_t addr, pinid_t interruptPin, WireType wireImpl, bool invertedLogic=false)
 
IoAbstractionRef ioFrom23017 (pinid_t addr, WireType wireImpl)
 
IoAbstractionRef ioFrom23017 (uint8_t addr, Mcp23xInterruptMode intMode, pinid_t interruptPin, WireType wireImpl)
 
IoAbstractionRef ioFrom23017IntPerPort (pinid_t addr, Mcp23xInterruptMode intMode, pinid_t interruptPinA, pinid_t interruptPinB, WireType wireImpl)
 
IoAbstractionRef ioFrom8574 (uint8_t addr, pinid_t interruptPin=0xff, bool invertedLogic=false)
 
IoAbstractionRef ioFrom8575 (uint8_t addr, pinid_t interruptPin=0xff, bool invertedLogic=false)
 
IoAbstractionRef ioFrom23017IntPerPort (uint8_t addr, Mcp23xInterruptMode intMode, pinid_t interruptPinA, pinid_t interruptPinB)
 
IoAbstractionRef ioFrom23017 (uint8_t addr, Mcp23xInterruptMode intMode, pinid_t interruptPin)
 
IoAbstractionRef ioFrom23017 (pinid_t addr)
 

Detailed Description

Contains the versions of BasicIoAbstraction that use i2c communication. Including PCF8574 and MCP23017.

Enumeration Type Documentation

◆ Mcp23xInterruptMode

The interrupt mode in which the 23x17 device is going to operate. See the device datasheet for more information. Using the ACTIVE_LOW_OPEN the library will ensure INPUT_PULLUP is used on the Arduino side.

◆ MPR121ConfigType

enum MPR121ConfigType : uint8_t

The MPR121 device touch configuration mode, either manual or auto as per datasheet

Function Documentation

◆ ioFrom8574()

IoAbstractionRef ioFrom8574 ( uint8_t  addr,
pinid_t  interruptPin,
WireType  wireImpl,
bool  invertedLogic = false 
)

Creates an instance of an IoAbstraction that works with a PCF8574 chip over i2c, which optionally has support for interrupts should it be needed. Note that only interrupt mode CHANGE is support, and a change on any pin raises an interrupt. All inputs are by default INPUT_PULLUP by device design. In new code prefer using the constructor.

Parameters
addrthe i2c address of the device
interruptPin(optional default = 0xff) the pin on the Arduino side that is used for interrupt handling if needed.
wireImpl(optional defaults to Wire) pointer to a TwoWire class to use if not using Wire
invertedLogicinvert bits sent and received from the expander.
Returns
an IoAbstactionRef for the device

◆ ioFrom8575()

IoAbstractionRef ioFrom8575 ( uint8_t  addr,
pinid_t  interruptPin,
WireType  wireImpl,
bool  invertedLogic = false 
)

Creates an instance of an IoAbstraction that works with a PCF8575 16 bit chip over i2c, which optionally has support for interrupts should it be needed. Note that only interrupt mode CHANGE is support, and a change on any pin raises an interrupt. All inputs are by default INPUT_PULLUP by device design. In new code prefer using the constructor.

Parameters
addrthe i2c address of the device
interruptPin(optional default = 0xff) the pin on the Arduino side that is used for interrupt handling if needed.
wireImpl(optional defaults to Wire) pointer to a TwoWire class to use if not using Wire
invertedLogicinvert bits sent and received from the expander.
Returns
an IoAbstactionRef for the device

◆ ioFrom23017() [1/2]

IoAbstractionRef ioFrom23017 ( pinid_t  addr,
WireType  wireImpl 
)

Perform digital read and write functions using 23017 expanders. These expanders are the closest in terms of functionality to regular Arduino pins, supporting most interrupt modes and very similar GPIO capabilities. See the other helper methods if you want interrupts. In new code prefer using the constructor.

Parameters
addrthe i2c address of the device
wireImpl(defaults to using Wire) can be overriden to any pointer to another Wire/I2C
Returns
an IoAbstactionRef for the device

◆ ioFrom23017() [2/2]

IoAbstractionRef ioFrom23017 ( uint8_t  addr,
Mcp23xInterruptMode  intMode,
pinid_t  interruptPin,
WireType  wireImpl 
)

Perform digital read and write functions using 23017 expanders. These expanders are the closest in terms of functionality to regular Arduino pins, supporting most interrupt modes and very similar GPIO capabilities. This uses one Arduino interrupt pin for BOTH ports on the device. In new code prefer using the constructor.

Parameters
addrthe i2c address of the device
intModethe interrupt mode the device will operate in
interruptPinthe pin on the Arduino that will be used to detect the interrupt condition.
wireImpl(defaults to using Wire) can be overriden to any pointer to another Wire/I2C
Returns
an IoAbstactionRef for the device

◆ ioFrom23017IntPerPort()

IoAbstractionRef ioFrom23017IntPerPort ( pinid_t  addr,
Mcp23xInterruptMode  intMode,
pinid_t  interruptPinA,
pinid_t  interruptPinB,
WireType  wireImpl 
)

Perform digital read and write functions using 23017 expanders. These expanders are the closest include terms of functionality to regular Arduino pins, supporting most interrupt modes and very similar GPIO capabilities. If interrupts are needed, this uses one Arduino pin for EACH port on the device. In new code prefer using the constructor.

Parameters
addrthe i2c address of the device
intModethe interrupt mode the device will operate in
interruptPinAthe pin on the Arduino that will be used to detect the PORTA interrupt condition.
interruptPinBthe pin on the Arduino that will be used to detect the PORTB interrupt condition.
wireImpl(defaults to using Wire) can be overriden to any pointer to another Wire/I2C
Returns
an IoAbstactionRef for the device