Package com.diozero.devices
Class MCP23008
java.lang.Object
com.diozero.internal.spi.AbstractDeviceFactory
com.diozero.devices.mcp23xxx.MCP23xxx
com.diozero.devices.mcp23xxx.MCP23x08
com.diozero.devices.MCP23008
- All Implemented Interfaces:
DeviceInterface
,DeviceEventConsumer<DigitalInputEvent>
,GpioExpander
,DeviceFactoryInterface
,GpioDeviceFactoryInterface
,PwmOutputDeviceFactoryInterface
,AutoCloseable
,Consumer<DigitalInputEvent>
public class MCP23008 extends MCP23x08
-
Nested Class Summary
Nested classes/interfaces inherited from class com.diozero.devices.mcp23xxx.MCP23x08
MCP23x08.MCP23x08BoardPinInfo
-
Field Summary
Fields Modifier and Type Field Description static int
DEVICE_ADDRESS
Fields inherited from class com.diozero.devices.mcp23xxx.MCP23xxx
INTERRUPT_GPIO_NOT_SET
Fields inherited from class com.diozero.internal.spi.AbstractDeviceFactory
closed, deviceStates
-
Constructor Summary
-
Method Summary
Methods inherited from class com.diozero.devices.mcp23xxx.MCP23x08
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, createSerialKey, 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, createSerialKey, 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 Details
-
DEVICE_ADDRESS
public static final int DEVICE_ADDRESS- See Also:
- Constant Field Values
-
-
Constructor Details
-
MCP23008
- Throws:
RuntimeIOException
-
MCP23008
- Throws:
RuntimeIOException
-
MCP23008
- Throws:
RuntimeIOException
-
MCP23008
- Throws:
RuntimeIOException
-
MCP23008
public MCP23008(int controller, int address, int interruptGpioA, int interruptGpioB) throws RuntimeIOException- Throws:
RuntimeIOException
-
-
Method Details
-
close
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
-
readByte
protected byte readByte(int register) -
writeByte
protected void writeByte(int register, byte value)
-