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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeDevice()
protected void
disableListener()
protected void
enableListener()
void
event(int lineFd, int eventDataId, long epochTimeMs, long timestampNanos)
int
getGpio()
boolean
getValue()
void
setDebounceTimeMillis(int debounceTime)
-
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.GpioDigitalInputDeviceInterface
getMode, removeListener, setListener
-
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isChild, isOpen, setChild
-
-
-
-
Constructor Detail
-
NativeGpioInputDevice
public NativeGpioInputDevice(DefaultDeviceFactory deviceFactory, String key, GpioChip chip, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger, MmapGpioInterface mmapGpio)
-
-
Method Detail
-
getGpio
public int getGpio()
- Specified by:
getGpio
in interfaceGpioDeviceInterface
-
getValue
public boolean getValue() throws RuntimeIOException
- 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()
- Overrides:
closeDevice
in classAbstractInputDevice<DigitalInputEvent>
-
event
public void event(int lineFd, int eventDataId, long epochTimeMs, long timestampNanos)
- Specified by:
event
in interfaceGpioLineEventListener
-
-