Class NativeGpioInputDevice
java.lang.Object
com.diozero.internal.spi.AbstractDevice
com.diozero.internal.spi.AbstractInputDevice<DigitalInputEvent>
com.diozero.internal.provider.builtin.NativeGpioInputDevice
- All Implemented Interfaces:
DeviceInterface
,GpioLineEventListener
,GpioDeviceInterface
,GpioDigitalDeviceInterface
,GpioDigitalInputDeviceInterface
,InternalDeviceInterface
,AutoCloseable
public class NativeGpioInputDevice extends AbstractInputDevice<DigitalInputEvent> implements GpioDigitalInputDeviceInterface, GpioLineEventListener
-
Constructor Summary
Constructors Constructor Description NativeGpioInputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger, MmapGpioInterface mmapGpio)
-
Method Summary
Modifier and Type Method Description void
closeDevice()
protected void
disableListener()
protected void
enableListener()
void
event(int lineFd, int eventDataId, long timestampNanos)
int
getGpio()
boolean
getValue()
void
setDebounceTimeMillis(int debounceTime)
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.GpioDigitalInputDeviceInterface
getMode, removeListener, setListener
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isOpen
-
Constructor Details
-
NativeGpioInputDevice
public NativeGpioInputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger, MmapGpioInterface mmapGpio)
-
-
Method Details
-
getGpio
public int getGpio()- Specified by:
getGpio
in interfaceGpioDeviceInterface
-
getValue
- Specified by:
getValue
in interfaceGpioDigitalDeviceInterface
- Throws:
RuntimeIOException
-
setDebounceTimeMillis
public void setDebounceTimeMillis(int debounceTime)- Specified by:
setDebounceTimeMillis
in interfaceGpioDigitalInputDeviceInterface
-
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 lineFd, int eventDataId, long timestampNanos)- Specified by:
event
in interfaceGpioLineEventListener
-