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
Modifier and Type Method Description void
closeDevice()
protected void
disableListener()
protected void
enableListener()
void
event(int gpioOffset, int eventDataId, 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 Details
-
NativeGpioInputOutputDevice
public NativeGpioInputOutputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, DeviceMode mode, MmapGpioInterface mmapGpio)
-
-
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
public void closeDevice()- Specified by:
closeDevice
in classAbstractDevice
-
event
public void event(int gpioOffset, int eventDataId, long timestampNanos)- Specified by:
event
in interfaceGpioLineEventListener
-