public class MCP23S17GpioProvider extends GpioProviderBase implements GpioProvider
This GPIO provider implements the MCP23S17 SPI 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
The MCP23S17 is connected via SPI 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 byte |
ADDRESS_0 |
static byte |
ADDRESS_1 |
static byte |
ADDRESS_2 |
static byte |
ADDRESS_3 |
static byte |
ADDRESS_4 |
static byte |
ADDRESS_5 |
static byte |
ADDRESS_6 |
static byte |
ADDRESS_7 |
static byte |
DEFAULT_ADDRESS |
static String |
DESCRIPTION |
static String |
NAME |
static byte |
READ_FLAG |
static int |
SPI_SPEED |
static byte |
WRITE_FLAG |
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners| Constructor and Description |
|---|
MCP23S17GpioProvider(byte spiAddress,
int spiChannel) |
MCP23S17GpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed) |
MCP23S17GpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed,
byte iocon) |
MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel) |
MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed) |
MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed,
byte iocon) |
| 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 ADDRESS_4
public static final byte ADDRESS_5
public static final byte ADDRESS_6
public static final byte ADDRESS_7
public static final byte DEFAULT_ADDRESS
public static final int SPI_SPEED
public static final byte WRITE_FLAG
public static final byte READ_FLAG
public MCP23S17GpioProvider(byte spiAddress,
int spiChannel)
throws IOException
IOExceptionpublic MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel)
throws IOException
IOExceptionpublic MCP23S17GpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed)
throws IOException
IOExceptionpublic MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed)
throws IOException
IOExceptionpublic MCP23S17GpioProvider(byte spiAddress,
int spiChannel,
int spiSpeed,
byte iocon)
throws IOException
IOExceptionpublic MCP23S17GpioProvider(byte spiAddress,
SpiChannel spiChannel,
int spiSpeed,
byte iocon)
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.