Class SysFsDigitalInputOutputDevice
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDevice
-
- com.diozero.internal.spi.AbstractInputDevice<DigitalInputEvent>
-
- com.diozero.internal.provider.builtin.SysFsDigitalInputOutputDevice
-
- All Implemented Interfaces:
DeviceInterface
,GpioDeviceInterface
,GpioDigitalDeviceInterface
,GpioDigitalInputOutputDeviceInterface
,GpioDigitalOutputDeviceInterface
,InternalDeviceInterface
,PollEventListener
,AutoCloseable
public class SysFsDigitalInputOutputDevice extends AbstractInputDevice<DigitalInputEvent> implements GpioDigitalInputOutputDeviceInterface, PollEventListener
-
-
Constructor Summary
Constructors Constructor Description SysFsDigitalInputOutputDevice(DefaultDeviceFactory deviceFactory, String key, PinInfo pinInfo, DeviceMode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods 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.spi.AbstractInputDevice
accept, generatesEvents, isListenerEnabled, removeListener, setListener
-
Methods inherited from class com.diozero.internal.spi.AbstractDevice
close, getDeviceFactory, getKey, isChild, isOpen, setChild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diozero.api.DeviceInterface
close
-
Methods inherited from interface com.diozero.internal.spi.GpioDigitalInputOutputDeviceInterface
removeListener, setListener
-
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isChild, isOpen, setChild
-
-
-
-
Constructor Detail
-
SysFsDigitalInputOutputDevice
public SysFsDigitalInputOutputDevice(DefaultDeviceFactory deviceFactory, String key, PinInfo pinInfo, DeviceMode mode)
-
-
Method Detail
-
getMode
public DeviceMode getMode()
- Specified by:
getMode
in interfaceGpioDeviceInterface
- Specified by:
getMode
in interfaceGpioDigitalOutputDeviceInterface
-
setMode
public void setMode(DeviceMode mode)
- Specified by:
setMode
in interfaceGpioDigitalInputOutputDeviceInterface
-
getGpio
public int getGpio()
- Specified by:
getGpio
in interfaceGpioDeviceInterface
-
getValue
public boolean getValue() throws RuntimeIOException
- Specified by:
getValue
in interfaceGpioDigitalDeviceInterface
- Throws:
RuntimeIOException
-
setValue
public void setValue(boolean value) throws RuntimeIOException
- 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
protected void closeDevice() throws RuntimeIOException
- Overrides:
closeDevice
in classAbstractInputDevice<DigitalInputEvent>
- Throws:
RuntimeIOException
-
notify
public void notify(long epochTime, long nanoTime, char value)
- Specified by:
notify
in interfacePollEventListener
-
-