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, 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 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
IOException
public PiFaceGpioProvider(byte spiAddress, int spiChannel) throws IOException
IOException
public PiFaceGpioProvider(byte spiAddress, int spiChannel, int spiSpeed) throws IOException
IOException
public PiFaceGpioProvider(byte spiAddress, SpiChannel spiChannel, int spiSpeed) throws IOException
IOException
protected void write(byte register, byte data) throws IOException
IOException
protected int read(byte register) 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.