Package com.diozero.devices
Class PiconZero.PiconZeroDigitalInputDevice
java.lang.Object
com.diozero.internal.spi.AbstractDevice
com.diozero.devices.PiconZero.PiconZeroDigitalInputDevice
- All Implemented Interfaces:
DeviceInterface
,GpioDeviceInterface
,GpioDigitalDeviceInterface
,GpioDigitalInputDeviceInterface
,InternalDeviceInterface
,AutoCloseable
- Enclosing class:
- PiconZero
public static class PiconZero.PiconZeroDigitalInputDevice extends AbstractDevice implements GpioDigitalInputDeviceInterface
-
Constructor Summary
Constructors Constructor Description PiconZeroDigitalInputDevice(PiconZero piconZero, String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger)
-
Method Summary
Modifier and Type Method Description protected void
closeDevice()
int
getChannel()
int
getGpio()
boolean
getValue()
void
removeListener()
void
setDebounceTimeMillis(int debounceTime)
void
setListener(DeviceEventConsumer<DigitalInputEvent> listener)
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
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isOpen
-
Constructor Details
-
PiconZeroDigitalInputDevice
public PiconZeroDigitalInputDevice(PiconZero piconZero, String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger)
-
-
Method Details
-
closeDevice
protected void closeDevice()- Specified by:
closeDevice
in classAbstractDevice
-
getGpio
public int getGpio()- Specified by:
getGpio
in interfaceGpioDeviceInterface
-
getChannel
public int getChannel() -
getValue
- Specified by:
getValue
in interfaceGpioDigitalDeviceInterface
- Throws:
RuntimeIOException
-
setDebounceTimeMillis
public void setDebounceTimeMillis(int debounceTime)- Specified by:
setDebounceTimeMillis
in interfaceGpioDigitalInputDeviceInterface
-
setListener
- Specified by:
setListener
in interfaceGpioDigitalInputDeviceInterface
-
removeListener
public void removeListener()- Specified by:
removeListener
in interfaceGpioDigitalInputDeviceInterface
-