public class MCP23017GpioProvider extends GpioProviderBase implements GpioProvider
This GPIO provider implements the MCP23017 I2C GPIO expansion board as native Pi4J GPIO pins. More information about the board can be found here: * http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf http://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pi/overview
The MCP23017 is connected via I2C connection to the Raspberry Pi and provides 16 GPIO pins that can be used for either digital input or digital output pins.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ADDRESS |
static int |
DEFAULT_POLLING_TIME |
static String |
DESCRIPTION |
static String |
NAME |
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners| Constructor and Description |
|---|
MCP23017GpioProvider(I2CBus bus,
int address) |
MCP23017GpioProvider(I2CBus bus,
int address,
int pollingTime) |
MCP23017GpioProvider(int busNumber,
int address) |
MCP23017GpioProvider(int busNumber,
int address,
int pollingTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
export(Pin pin,
PinMode mode) |
PinMode |
getMode(Pin pin) |
String |
getName() |
PinPullResistance |
getPullResistance(Pin pin) |
PinState |
getState(Pin pin) |
void |
setMode(Pin pin,
PinMode mode) |
void |
setPollingTime(int pollingTime) |
void |
setPullResistance(Pin pin,
PinPullResistance resistance) |
void |
setState(Pin pin,
PinState state) |
void |
shutdown() |
void |
unexport(Pin pin) |
addListener, dispatchPinAnalogValueChangeEvent, dispatchPinDigitalStateChangeEvent, export, getPinCache, getPwm, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setPwm, setPwmRange, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, export, getPwm, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setPwm, setPwmRange, setValuepublic static final String NAME
public static final String DESCRIPTION
public static final int DEFAULT_ADDRESS
public static final int DEFAULT_POLLING_TIME
public MCP23017GpioProvider(int busNumber,
int address)
throws I2CFactory.UnsupportedBusNumberException,
IOException
public MCP23017GpioProvider(int busNumber,
int address,
int pollingTime)
throws IOException,
I2CFactory.UnsupportedBusNumberException
public MCP23017GpioProvider(I2CBus bus, int address) throws IOException
IOExceptionpublic MCP23017GpioProvider(I2CBus bus, int address, int pollingTime) throws IOException
IOExceptionpublic String getName()
getName in interface GpioProvidergetName in class GpioProviderBasepublic void export(Pin pin, PinMode mode)
export in interface GpioProviderexport in class GpioProviderBasepublic void unexport(Pin pin)
unexport in interface GpioProviderunexport in class GpioProviderBasepublic void setMode(Pin pin, PinMode mode)
setMode in interface GpioProvidersetMode in class GpioProviderBasepublic PinMode getMode(Pin pin)
getMode in interface GpioProvidergetMode in class GpioProviderBasepublic void setState(Pin pin, PinState state)
setState in interface GpioProvidersetState in class GpioProviderBasepublic PinState getState(Pin pin)
getState in interface GpioProvidergetState in class GpioProviderBasepublic void setPullResistance(Pin pin, PinPullResistance resistance)
setPullResistance in interface GpioProvidersetPullResistance in class GpioProviderBasepublic PinPullResistance getPullResistance(Pin pin)
getPullResistance in interface GpioProvidergetPullResistance in class GpioProviderBasepublic void shutdown()
shutdown in interface GpioProvidershutdown in class GpioProviderBasepublic void setPollingTime(int pollingTime)
Copyright © 2012–2018 Pi4J. All rights reserved.