public class MCP23008GpioProvider extends GpioProviderBase implements GpioProvider
This GPIO provider implements the MCP23008 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/21919e.pdf http://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pi/overview
The MCP23008 is connected via I2C connection to the Raspberry Pi and provides 8 GPIO pins that can be used for either digital input or digital output pins.
Modifier and Type | Field and Description |
---|---|
static String |
DESCRIPTION |
static String |
NAME |
static int |
REGISTER_GPIO |
static int |
REGISTER_IODIR |
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners
Constructor and Description |
---|
MCP23008GpioProvider(I2CBus bus,
int address) |
MCP23008GpioProvider(int busNumber,
int address) |
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 |
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, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, export, getPwm, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setPwm, setPwmRange, setValue
public static final String NAME
public static final String DESCRIPTION
public static final int REGISTER_IODIR
public static final int REGISTER_GPIO
public MCP23008GpioProvider(int busNumber, int address) throws I2CFactory.UnsupportedBusNumberException, IOException
public MCP23008GpioProvider(I2CBus bus, int address) throws IOException
IOException
public String getName()
getName
in interface GpioProvider
getName
in class GpioProviderBase
public void export(Pin pin, PinMode mode)
export
in interface GpioProvider
export
in class GpioProviderBase
public void unexport(Pin pin)
unexport
in interface GpioProvider
unexport
in class GpioProviderBase
public void setMode(Pin pin, PinMode mode)
setMode
in interface GpioProvider
setMode
in class GpioProviderBase
public PinMode getMode(Pin pin)
getMode
in interface GpioProvider
getMode
in class GpioProviderBase
public void setState(Pin pin, PinState state)
setState
in interface GpioProvider
setState
in class GpioProviderBase
public PinState getState(Pin pin)
getState
in interface GpioProvider
getState
in class GpioProviderBase
public void setPullResistance(Pin pin, PinPullResistance resistance)
setPullResistance
in interface GpioProvider
setPullResistance
in class GpioProviderBase
public PinPullResistance getPullResistance(Pin pin)
getPullResistance
in interface GpioProvider
getPullResistance
in class GpioProviderBase
public void shutdown()
shutdown
in interface GpioProvider
shutdown
in class GpioProviderBase
Copyright © 2012–2016 Pi4J. All rights reserved.