Class SysFsDigitalInputOutputDevice
java.lang.Object
com.diozero.internal.provider.AbstractDevice
com.diozero.internal.provider.AbstractInputDevice<DigitalInputEvent>
com.diozero.internal.provider.sysfs.SysFsDigitalInputOutputDevice
- All Implemented Interfaces:
DeviceInterface
,GpioDeviceInterface
,GpioDigitalDeviceInterface
,GpioDigitalInputOutputDeviceInterface
,GpioDigitalOutputDeviceInterface
,PollEventListener
,java.io.Closeable
,java.lang.AutoCloseable
public class SysFsDigitalInputOutputDevice extends AbstractInputDevice<DigitalInputEvent> implements GpioDigitalInputOutputDeviceInterface, PollEventListener
-
Field Summary
Fields Modifier and Type Field Description protected int
gpio
protected DeviceMode
mode
-
Constructor Summary
Constructors Constructor Description SysFsDigitalInputOutputDevice(SysFsDeviceFactory deviceFactory, java.lang.String key, PinInfo pinInfo, DeviceMode mode)
-
Method Summary
Modifier and Type Method Description protected void
closeDevice()
protected void
disableListener()
protected void
enableListener()
int
getGpio()
DeviceMode
getMode()
boolean
getValue()
void
notify(long epochTime, long nanoTime, char value)
void
setMode(DeviceMode mode)
void
setValue(boolean value)
Methods inherited from class com.diozero.internal.provider.AbstractInputDevice
generatesEvents, removeListener, setListener, valueChanged
Methods inherited from class com.diozero.internal.provider.AbstractDevice
close, getDeviceFactory, getKey, isOpen
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.DeviceInterface
close, getKey, isOpen
Methods inherited from interface com.diozero.internal.provider.GpioDigitalInputOutputDeviceInterface
removeListener, setListener
-
Field Details
-
Constructor Details
-
SysFsDigitalInputOutputDevice
public SysFsDigitalInputOutputDevice(SysFsDeviceFactory deviceFactory, java.lang.String key, PinInfo pinInfo, DeviceMode mode)
-
-
Method Details
-
getMode
- Specified by:
getMode
in interfaceGpioDeviceInterface
- Specified by:
getMode
in interfaceGpioDigitalOutputDeviceInterface
-
setMode
- Specified by:
setMode
in interfaceGpioDigitalInputOutputDeviceInterface
-
getGpio
public int getGpio()- Specified by:
getGpio
in interfaceGpioDeviceInterface
-
getValue
- Specified by:
getValue
in interfaceGpioDigitalDeviceInterface
- Throws:
RuntimeIOException
-
setValue
- Specified by:
setValue
in interfaceGpioDigitalOutputDeviceInterface
- Throws:
RuntimeIOException
-
enableListener
protected void enableListener()- Overrides:
enableListener
in classAbstractInputDevice<DigitalInputEvent>
-
disableListener
protected void disableListener()- Overrides:
disableListener
in classAbstractInputDevice<DigitalInputEvent>
-
closeDevice
- Specified by:
closeDevice
in classAbstractDevice
- Throws:
RuntimeIOException
-
notify
public void notify(long epochTime, long nanoTime, char value)- Specified by:
notify
in interfacePollEventListener
-