java.lang.Object
com.diozero.internal.spi.AbstractDeviceFactory
com.diozero.devices.mcp23xxx.MCP23xxx
com.diozero.devices.mcp23xxx.MCP23x17
- All Implemented Interfaces:
DeviceInterface
,DeviceEventConsumer<DigitalInputEvent>
,GpioExpander
,DeviceFactoryInterface
,GpioDeviceFactoryInterface
,PwmOutputDeviceFactoryInterface
,AutoCloseable
,Consumer<DigitalInputEvent>
https://www.instructables.com/Arduino-NANO-Tests-2-MCP23S17-IO-Xpanders
I2C | SPI | Notch | SPI/I2C | GPB0 | 1 28 | GPA7 | GPB1 | 2 27 | GPA6 | GPB2 | 3 26 | GPA5 | GPB3 | 4 25 | GPA4 | GPB4 | 5 24 | GPA3 | GPB5 | 6 23 | GPA2 | GPB6 | 7 22 | GPA1 | GPB7 | 8 21 | GPA0 | 3v3 | 9 20 | INT A | GND | 10 19 | INT B NC | CS | 11 18 | 3v3 (via 1KOhm resister) SCK | SCK | 12 17 | GND SDA | MOSI | 13 16 | GND NC | MISO | 14 15 | GND
-
Nested Class Summary
-
Field Summary
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
ALL_INPUT, ALL_OUTPUT, GPIOS_PER_PORT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet information about pins that can be provisioned by this device factory.protected int
getDefValReg
(int port) protected int
getGPIntEnReg
(int port) protected int
getGPIOReg
(int port) protected int
getGPPullUpReg
(int port) protected int
getIntCapReg
(int port) protected int
getIntConReg
(int port) protected int
getIntFReg
(int port) protected int
getIOConReg
(int port) protected int
getIODirReg
(int port) protected int
getIPolReg
(int port) protected int
getOLatReg
(int port) Methods inherited from class com.diozero.devices.mcp23xxx.MCP23xxx
accept, close, closeGpio, createDigitalInputDevice, createDigitalInputOutputDevice, createDigitalOutputDevice, createPwmOutputDevice, getBoardPwmFrequency, getName, getValue, getValues, initialise, readByte, setBoardPwmFrequency, setDirections, setInputMode, setOutputMode, setValue, setValues, writeByte
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, registerDevice, registerPinDevice, reopen, start
Methods inherited from interface com.diozero.internal.spi.GpioDeviceFactoryInterface
provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDevice
Methods inherited from interface com.diozero.internal.spi.PwmOutputDeviceFactoryInterface
provisionPwmOutputDevice
-
Constructor Details
-
MCP23x17
-
MCP23x17
-
MCP23x17
-
-
Method Details
-
getIODirReg
protected int getIODirReg(int port) - Specified by:
getIODirReg
in classMCP23xxx
-
getIPolReg
protected int getIPolReg(int port) - Specified by:
getIPolReg
in classMCP23xxx
-
getGPIntEnReg
protected int getGPIntEnReg(int port) - Specified by:
getGPIntEnReg
in classMCP23xxx
-
getDefValReg
protected int getDefValReg(int port) - Specified by:
getDefValReg
in classMCP23xxx
-
getIntConReg
protected int getIntConReg(int port) - Specified by:
getIntConReg
in classMCP23xxx
-
getIOConReg
protected int getIOConReg(int port) - Specified by:
getIOConReg
in classMCP23xxx
-
getGPPullUpReg
protected int getGPPullUpReg(int port) - Specified by:
getGPPullUpReg
in classMCP23xxx
-
getIntFReg
protected int getIntFReg(int port) - Specified by:
getIntFReg
in classMCP23xxx
-
getIntCapReg
protected int getIntCapReg(int port) - Specified by:
getIntCapReg
in classMCP23xxx
-
getGPIOReg
protected int getGPIOReg(int port) - Specified by:
getGPIOReg
in classMCP23xxx
-
getOLatReg
protected int getOLatReg(int port) - Specified by:
getOLatReg
in classMCP23xxx
-
getBoardPinInfo
Description copied from interface:DeviceFactoryInterface
Get information about pins that can be provisioned by this device factory.- Returns:
- board pin info instance for this device factory
-