Class NativeGpioInputOutputDevice
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDevice
-
- com.diozero.internal.spi.AbstractInputDevice<DigitalInputEvent>
-
- com.diozero.internal.provider.builtin.NativeGpioInputOutputDevice
-
- All Implemented Interfaces:
DeviceInterface
,GpioLineEventListener
,GpioDeviceInterface
,GpioDigitalDeviceInterface
,GpioDigitalInputOutputDeviceInterface
,GpioDigitalOutputDeviceInterface
,InternalDeviceInterface
,AutoCloseable
public class NativeGpioInputOutputDevice extends AbstractInputDevice<DigitalInputEvent> implements GpioDigitalInputOutputDeviceInterface, GpioLineEventListener
-
-
Constructor Summary
Constructors Constructor Description NativeGpioInputOutputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, DeviceMode mode, MmapGpioInterface mmapGpio)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeDevice()
protected void
disableListener()
protected void
enableListener()
void
event(int gpioOffset, int eventDataId, long epochTimeMs, long timestampNanos)
int
getGpio()
DeviceMode
getMode()
boolean
getValue()
void
setMode(DeviceMode mode)
void
setValue(boolean value)
-
Methods inherited from class com.diozero.internal.spi.AbstractInputDevice
accept, generatesEvents, removeListener, setListener
-
Methods inherited from class com.diozero.internal.spi.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.api.DeviceInterface
close
-
Methods inherited from interface com.diozero.internal.spi.GpioDigitalInputOutputDeviceInterface
removeListener, setListener
-
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isOpen
-
-
-
-
Constructor Detail
-
NativeGpioInputOutputDevice
public NativeGpioInputOutputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, DeviceMode mode, MmapGpioInterface mmapGpio)
-
-
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
public void closeDevice()
- Specified by:
closeDevice
in classAbstractDevice
-
event
public void event(int gpioOffset, int eventDataId, long epochTimeMs, long timestampNanos)
- Specified by:
event
in interfaceGpioLineEventListener
-
-