public class PiFaceGpioProvider extends GpioProviderBase implements GpioProvider
This GPIO provider implements the Pi-FACE GPIO expansion board as native Pi4J GPIO pins. More information about the board can be found here: * http://piface.openlx.org.uk/174770794
The Pi-FACE board used a MCP23S17 connected via SPI connection to the Raspberry Pi and provides 8 GPIO digital input pins and 8 GPIO digital output pins.
| Modifier and Type | Field and Description |
|---|---|
static byte |
ADDRESS_0 |
static byte |
ADDRESS_1 |
static byte |
ADDRESS_2 |
static byte |
ADDRESS_3 |
static byte |
DEFAULT_ADDRESS |
static String |
DESCRIPTION |
static String |
NAME |
static byte |
READ_FLAG |
protected SpiDevice |
spi |
static int |
SPI_SPEED |
static byte |
WRITE_FLAG |
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners| Constructor and Description |
|---|
PiFaceGpioProvider(byte spiAddress,
int spiChannel) |
PiFaceGpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed) |
PiFaceGpioProvider(byte spiAddress,
SpiChannel spiChannel) |
PiFaceGpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed) |
| 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) |
protected int |
read(byte register) |
void |
setMode(Pin pin,
PinMode mode) |
void |
setPullResistance(Pin pin,
PinPullResistance resistance) |
void |
setState(Pin pin,
PinState state) |
void |
shutdown() |
void |
unexport(Pin pin) |
protected void |
write(byte register,
byte data) |
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 byte ADDRESS_0
public static final byte ADDRESS_1
public static final byte ADDRESS_2
public static final byte ADDRESS_3
public static final byte DEFAULT_ADDRESS
public static final int SPI_SPEED
public static final byte WRITE_FLAG
public static final byte READ_FLAG
protected final SpiDevice spi
public PiFaceGpioProvider(byte spiAddress,
SpiChannel spiChannel)
throws IOException
IOExceptionpublic PiFaceGpioProvider(byte spiAddress,
int spiChannel)
throws IOException
IOExceptionpublic PiFaceGpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed)
throws IOException
IOExceptionpublic PiFaceGpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed)
throws IOException
IOExceptionprotected void write(byte register,
byte data)
throws IOException
IOExceptionprotected int read(byte register)
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 GpioProviderBaseCopyright © 2012–2018 Pi4J. All rights reserved.