public interface DigitalInput extends PinFeature
| Modifier and Type | Method and Description |
|---|---|
void |
addInterruptListener(InterruptListener listener)
Adds an interrupt listener to the digital input.
|
boolean |
areInterruptsEnabled()
This method checks whether interrupts are currently enabled.
|
void |
clearInterruptListeners()
Removes all interrupt listeners that are currently registered.
|
void |
disableInterrupts()
This method disables interrupt events on this input.
|
void |
enableInterrupts()
This method enables interrupt events on this input.
|
void |
fireInterruptEvent(InterruptEventArgs args)
Fire interrupt event.
|
int |
getInterruptDebounceMs()
Returns the maximum time that is used for debouncing
interrupts.
|
List<InterruptListener> |
getInterruptListeners()
Gets a list of all the registered interrupt listeners.
|
Edge |
getInterruptTrigger()
Gets the interrupt trigger that is currently set.
|
Signal |
read()
Reads the current signal on the pin.
|
Signal |
readDebounced(int debounceMilliseconds)
Reads the signal on the pin debounced.
|
void |
removeInterruptListener(InterruptListener listener)
Removes an interrupt listener from the digital input.
|
void |
setInterruptDebounceMs(int milliSeconds)
If the edges of interrupts should be debounced before calling
the interrupt event handlers, then the maximum time that
should be used for debouncing can be specified here.
|
void |
setInterruptTrigger(Edge edge)
Sets the interrupt trigger.
|
activate, blockPin, getName, getPin, isActivatedFeature, isBlocking, isSetup, isTorndownOnShutdown, setTeardownOnShutdown, setup, teardown, unblockPinSignal read()
Signal readDebounced(int debounceMilliseconds)
debounceMilliseconds - this is the time that is used for debouncing
in the worst case. When the input is still bouncing after the
specified period, then the return value will not be reliable.void disableInterrupts()
InterruptListener's
interruptRequest
method.void enableInterrupts()
boolean areInterruptsEnabled()
disableInterrupts() to disable
interrupts and enableInterrupts() to enable them.void setInterruptDebounceMs(int milliSeconds)
milliSeconds - The maximum time that is used for debouncingint getInterruptDebounceMs()
void setInterruptTrigger(Edge edge)
Edge that is
used for interrupt detection. Interrupts can either trigger on a
rising edge, a falling edge,
or on both edges.
The default value is both edges.edge - the edge that is used for triggering interrupts on this input.Edge getInterruptTrigger()
void fireInterruptEvent(InterruptEventArgs args)
args - the argsvoid addInterruptListener(InterruptListener listener)
listener - the listener that is to be added.void removeInterruptListener(InterruptListener listener)
listener - the listener that is to be removed.void clearInterruptListeners()
List<InterruptListener> getInterruptListeners()
Copyright © 2015 silverspoon.io. All rights reserved.