Package com.diozero.devices
Class PCF8574
java.lang.Object
com.diozero.internal.provider.AbstractDeviceFactory
com.diozero.devices.PCF8574
- All Implemented Interfaces:
GpioExpander
,DeviceFactoryInterface
,GpioDeviceFactoryInterface
,Closeable
,AutoCloseable
public class PCF8574 extends AbstractDeviceFactory implements GpioDeviceFactoryInterface, GpioExpander
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PCF8574.PCF8574BoardPinInfo
-
Field Summary
Fields inherited from class com.diozero.internal.provider.AbstractDeviceFactory
closed, deviceStates
-
Constructor Summary
Constructors Constructor Description PCF8574(int controller, int address, int addressSize)
PCF8574(I2CDeviceFactoryInterface deviceFactory, int controller, int address, int addressSize)
-
Method Summary
Modifier and Type Method Description void
close()
void
closePin(int gpio)
GpioDigitalInputDeviceInterface
createDigitalInputDevice(String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger)
GpioDigitalInputOutputDeviceInterface
createDigitalInputOutputDevice(String key, PinInfo pinInfo, DeviceMode mode)
GpioDigitalOutputDeviceInterface
createDigitalOutputDevice(String key, PinInfo pinInfo, boolean initialValue)
BoardPinInfo
getBoardPinInfo()
String
getName()
boolean
getValue(int gpio)
byte
getValues(int port)
void
setDirections(int port, byte directions)
void
setInputMode(int gpio)
void
setOutputMode(int gpio)
void
setValue(int gpio, boolean value)
void
setValues(int port, byte values)
Methods inherited from class com.diozero.internal.provider.AbstractDeviceFactory
createI2CKey, createPinKey, createSerialKey, createSpiKey, deviceClosed, deviceOpened, getDevice, getDevice, isClosed, isDeviceOpened
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.provider.DeviceFactoryInterface
createI2CKey, createPinKey, createSerialKey, createSpiKey, deviceClosed, deviceOpened, getDevice, getDevice, isClosed, isDeviceOpened, start
Methods inherited from interface com.diozero.internal.provider.GpioDeviceFactoryInterface
provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDevice
-
Constructor Details
-
PCF8574
public PCF8574(int controller, int address, int addressSize) -
PCF8574
public PCF8574(I2CDeviceFactoryInterface deviceFactory, int controller, int address, int addressSize)
-
-
Method Details
-
createDigitalInputDevice
public GpioDigitalInputDeviceInterface createDigitalInputDevice(String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger) throws RuntimeIOException- Specified by:
createDigitalInputDevice
in interfaceGpioDeviceFactoryInterface
- Throws:
RuntimeIOException
-
createDigitalOutputDevice
public GpioDigitalOutputDeviceInterface createDigitalOutputDevice(String key, PinInfo pinInfo, boolean initialValue) throws RuntimeIOException- Specified by:
createDigitalOutputDevice
in interfaceGpioDeviceFactoryInterface
- Throws:
RuntimeIOException
-
createDigitalInputOutputDevice
public GpioDigitalInputOutputDeviceInterface createDigitalInputOutputDevice(String key, PinInfo pinInfo, DeviceMode mode) throws RuntimeIOException- Specified by:
createDigitalInputOutputDevice
in interfaceGpioDeviceFactoryInterface
- Throws:
RuntimeIOException
-
setDirections
public void setDirections(int port, byte directions)- Specified by:
setDirections
in interfaceGpioExpander
-
getValues
public byte getValues(int port) -
setValues
public void setValues(int port, byte values)- Specified by:
setValues
in interfaceGpioExpander
-
getValue
public boolean getValue(int gpio) -
setValue
public void setValue(int gpio, boolean value) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceDeviceFactoryInterface
- Specified by:
close
in interfaceGpioExpander
- Overrides:
close
in classAbstractDeviceFactory
-
setInputMode
public void setInputMode(int gpio) -
setOutputMode
public void setOutputMode(int gpio) -
getName
- Specified by:
getName
in interfaceDeviceFactoryInterface
-
closePin
public void closePin(int gpio) -
getBoardPinInfo
- Specified by:
getBoardPinInfo
in interfaceDeviceFactoryInterface
-