Package com.diozero.devices
Class MCP23S17
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDeviceFactory
-
- com.diozero.devices.mcp23xxx.MCP23xxx
-
- com.diozero.devices.mcp23xxx.MCP23x17
-
- com.diozero.devices.MCP23S17
-
- All Implemented Interfaces:
DeviceInterface
,DeviceEventConsumer<DigitalInputEvent>
,GpioExpander
,DeviceFactoryInterface
,GpioDeviceFactoryInterface
,PwmOutputDeviceFactoryInterface
,AutoCloseable
,Consumer<DigitalInputEvent>
public class MCP23S17 extends MCP23x17
- See Also:
MCP23x17
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.diozero.devices.mcp23xxx.MCP23x17
MCP23x17.MCP23x17BoardPinInfo
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_CLOCK_SPEED
static int
MAX_CLOCK_SPEED
-
Fields inherited from class com.diozero.devices.mcp23xxx.MCP23xxx
INTERRUPT_GPIO_NOT_SET
-
Fields inherited from class com.diozero.internal.spi.AbstractDeviceFactory
closed, deviceStates
-
Fields inherited from interface com.diozero.devices.GpioExpander
GPIOS_PER_PORT
-
-
Constructor Summary
Constructors Constructor Description MCP23S17(int boardAddress)
MCP23S17(int boardAddress, int interruptGpio)
MCP23S17(int boardAddress, int interruptGpioA, int interruptGpioB)
MCP23S17(int controller, int chipSelect, int boardAddress, int interruptGpio)
MCP23S17(int controller, int chipSelect, int address, int frequency, int interruptGpioA, int interruptGpioB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this device factory including all devices that have been provisioned by it.protected byte
readByte(int register)
protected void
writeByte(int register, byte value)
-
Methods inherited from class com.diozero.devices.mcp23xxx.MCP23x17
getBoardPinInfo, getDefValReg, getGPIntEnReg, getGPIOReg, getGPPullUpReg, getIntCapReg, getIntConReg, getIntFReg, getIOConReg, getIODirReg, getIPolReg, getOLatReg
-
Methods inherited from class com.diozero.devices.mcp23xxx.MCP23xxx
accept, closeGpio, createDigitalInputDevice, createDigitalInputOutputDevice, createDigitalOutputDevice, createPwmOutputDevice, getBoardPwmFrequency, getName, getValue, getValues, initialise, setBoardPwmFrequency, setDirections, setInputMode, setOutputMode, setValue, setValues
-
Methods inherited from class com.diozero.internal.spi.AbstractDeviceFactory
createI2CKey, createPinKey, createPwmPinKey, createSerialKey, createServoPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diozero.internal.spi.DeviceFactoryInterface
createI2CKey, createPinKey, createPwmPinKey, createSerialKey, createServoPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopen, start
-
Methods inherited from interface com.diozero.internal.spi.GpioDeviceFactoryInterface
provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDevice
-
Methods inherited from interface com.diozero.internal.spi.PwmOutputDeviceFactoryInterface
provisionPwmOutputDevice
-
-
-
-
Field Detail
-
MAX_CLOCK_SPEED
public static final int MAX_CLOCK_SPEED
- See Also:
- Constant Field Values
-
DEFAULT_CLOCK_SPEED
public static final int DEFAULT_CLOCK_SPEED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MCP23S17
public MCP23S17(int boardAddress) throws RuntimeIOException
- Throws:
RuntimeIOException
-
MCP23S17
public MCP23S17(int boardAddress, int interruptGpio) throws RuntimeIOException
- Throws:
RuntimeIOException
-
MCP23S17
public MCP23S17(int boardAddress, int interruptGpioA, int interruptGpioB) throws RuntimeIOException
- Throws:
RuntimeIOException
-
MCP23S17
public MCP23S17(int controller, int chipSelect, int boardAddress, int interruptGpio) throws RuntimeIOException
- Throws:
RuntimeIOException
-
MCP23S17
public MCP23S17(int controller, int chipSelect, int address, int frequency, int interruptGpioA, int interruptGpioB) throws RuntimeIOException
- Throws:
RuntimeIOException
-
-
Method Detail
-
close
public void close() throws RuntimeIOException
Description copied from interface:DeviceFactoryInterface
Close this device factory including all devices that have been provisioned by it.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceFactoryInterface
- Specified by:
close
in interfaceDeviceInterface
- Specified by:
close
in interfaceGpioExpander
- Overrides:
close
in classMCP23xxx
- Throws:
RuntimeIOException
-
-