public class GpioPinImpl extends Object implements GpioPin, GpioPinDigitalInput, GpioPinDigitalOutput, GpioPinDigitalMultipurpose, GpioPinAnalogInput, GpioPinAnalogOutput, GpioPinPwmOutput, GpioPinInput, GpioPinOutput
| Modifier and Type | Field and Description |
|---|---|
protected int |
NO_DEBOUCE |
| Constructor and Description |
|---|
GpioPinImpl(GpioController gpio,
GpioProvider provider,
Pin pin) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(GpioPinListener... listener) |
void |
addListener(List<? extends GpioPinListener> listeners) |
void |
addTrigger(GpioTrigger... trigger) |
void |
addTrigger(List<? extends GpioTrigger> triggers) |
Future<?> |
blink(long delay) |
Future<?> |
blink(long delay,
long duration) |
Future<?> |
blink(long delay,
long duration,
PinState blinkState) |
Future<?> |
blink(long delay,
long duration,
PinState blinkState,
TimeUnit timeUnit) |
Future<?> |
blink(long delay,
long duration,
TimeUnit timeUnit) |
Future<?> |
blink(long delay,
PinState blinkState) |
Future<?> |
blink(long delay,
PinState blinkState,
TimeUnit timeUnit) |
Future<?> |
blink(long delay,
TimeUnit timeUnit) |
void |
clearProperties() |
void |
export(PinMode mode) |
void |
export(PinMode mode,
PinState defaultState) |
int |
getDebounce(PinState state)
Gets the configured debounce delay interval (in milliseconds) for the given pin state.
|
Collection<GpioPinListener> |
getListeners() |
PinMode |
getMode() |
String |
getName() |
Pin |
getPin() |
Map<String,String> |
getProperties() |
String |
getProperty(String key) |
String |
getProperty(String key,
String defaultValue) |
GpioProvider |
getProvider() |
PinPullResistance |
getPullResistance() |
int |
getPwm()
If this is a hardware PWM pin, the value will be between a range of 0 to 1024.
|
GpioPinShutdown |
getShutdownOptions() |
PinState |
getState() |
Object |
getTag() |
Collection<GpioTrigger> |
getTriggers() |
double |
getValue() |
boolean |
hasDebounce(PinState state)
Determines if a debounce delay interval has been configured for the given pin state.
|
boolean |
hasListener(GpioPinListener... listener) |
boolean |
hasProperty(String key) |
void |
high() |
boolean |
isExported() |
boolean |
isHigh() |
boolean |
isLow() |
boolean |
isMode(PinMode mode) |
boolean |
isPullResistance(PinPullResistance resistance) |
boolean |
isState(PinState state) |
void |
low() |
Future<?> |
pulse(long duration) |
Future<?> |
pulse(long duration,
boolean blocking) |
Future<?> |
pulse(long duration,
boolean blocking,
Callable<Void> callback) |
Future<?> |
pulse(long duration,
boolean blocking,
Callable<Void> callback,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
boolean blocking,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
Callable<Void> callback) |
Future<?> |
pulse(long duration,
Callable<Void> callback,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
PinState pulseState) |
Future<?> |
pulse(long duration,
PinState pulseState,
boolean blocking) |
Future<?> |
pulse(long duration,
PinState pulseState,
boolean blocking,
Callable<Void> callback) |
Future<?> |
pulse(long duration,
PinState pulseState,
boolean blocking,
Callable<Void> callback,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
PinState pulseState,
boolean blocking,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
PinState pulseState,
Callable<Void> callback) |
Future<?> |
pulse(long duration,
PinState pulseState,
Callable<Void> callback,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
PinState pulseState,
TimeUnit timeUnit) |
Future<?> |
pulse(long duration,
TimeUnit timeUnit) |
void |
removeAllListeners() |
void |
removeAllTriggers() |
void |
removeListener(GpioPinListener... listener) |
void |
removeListener(List<? extends GpioPinListener> listeners) |
void |
removeProperty(String key) |
void |
removeTrigger(GpioTrigger... trigger) |
void |
removeTrigger(List<? extends GpioTrigger> triggers) |
void |
setDebounce(int debounce)
Sets the debounce delay interval (in milliseconds) for all pin states.
|
void |
setDebounce(int debounce,
PinState... state)
Sets the debounce delay interval (in milliseconds) for the specified pin state.
|
void |
setMode(PinMode mode) |
void |
setName(String name) |
void |
setProperty(String key,
String value) |
void |
setPullResistance(PinPullResistance resistance) |
void |
setPwm(int value)
Set the PWM value/rate to toggle the GPIO pin.
|
void |
setPwmRange(int range)
This sets the range register in the PWM generator.
|
void |
setShutdownOptions(Boolean unexport) |
void |
setShutdownOptions(Boolean unexport,
PinState state) |
void |
setShutdownOptions(Boolean unexport,
PinState state,
PinPullResistance resistance) |
void |
setShutdownOptions(Boolean unexport,
PinState state,
PinPullResistance resistance,
PinMode mode) |
void |
setShutdownOptions(GpioPinShutdown options) |
void |
setState(boolean state) |
void |
setState(PinState state) |
void |
setTag(Object tag) |
void |
setValue(double value) |
void |
setValue(Number value) |
void |
toggle() |
String |
toString() |
void |
unexport() |
protected final int NO_DEBOUCE
public GpioPinImpl(GpioController gpio, GpioProvider provider, Pin pin)
public GpioProvider getProvider()
getProvider in interface GpioPinpublic void setProperty(String key, String value)
setProperty in interface GpioPinpublic boolean hasProperty(String key)
hasProperty in interface GpioPinpublic String getProperty(String key, String defaultValue)
getProperty in interface GpioPinpublic String getProperty(String key)
getProperty in interface GpioPinpublic Map<String,String> getProperties()
getProperties in interface GpioPinpublic void removeProperty(String key)
removeProperty in interface GpioPinpublic void clearProperties()
clearProperties in interface GpioPinpublic boolean isExported()
isExported in interface GpioPinpublic void setPullResistance(PinPullResistance resistance)
setPullResistance in interface GpioPinpublic PinPullResistance getPullResistance()
getPullResistance in interface GpioPinpublic boolean isPullResistance(PinPullResistance resistance)
isPullResistance in interface GpioPinpublic void high()
high in interface GpioPinDigitalOutputpublic void low()
low in interface GpioPinDigitalOutputpublic void toggle()
toggle in interface GpioPinDigitalOutputpublic Future<?> blink(long delay)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, TimeUnit timeUnit)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, PinState blinkState)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, PinState blinkState, TimeUnit timeUnit)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, long duration)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, long duration, TimeUnit timeUnit)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, long duration, PinState blinkState)
blink in interface GpioPinDigitalOutputpublic Future<?> blink(long delay, long duration, PinState blinkState, TimeUnit timeUnit)
blink in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, Callable<Void> callback)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, Callable<Void> callback, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, Callable<Void> callback)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, Callable<Void> callback, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, boolean blocking)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, boolean blocking, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, boolean blocking, Callable<Void> callback)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, boolean blocking, Callable<Void> callback, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, boolean blocking)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, boolean blocking, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, boolean blocking, Callable<Void> callback, TimeUnit timeUnit)
pulse in interface GpioPinDigitalOutputpublic Future<?> pulse(long duration, PinState pulseState, boolean blocking, Callable<Void> callback)
pulse in interface GpioPinDigitalOutputpublic void setState(PinState state)
setState in interface GpioPinDigitalOutputpublic void setState(boolean state)
setState in interface GpioPinDigitalOutputpublic boolean isHigh()
isHigh in interface GpioPinDigitalpublic boolean isLow()
isLow in interface GpioPinDigitalpublic PinState getState()
getState in interface GpioPinDigitalpublic boolean isState(PinState state)
isState in interface GpioPinDigitalpublic boolean hasDebounce(PinState state)
GpioPinDigitalInputhasDebounce in interface GpioPinDigitalInputstate - the pin state to test for debounce delay.public int getDebounce(PinState state)
GpioPinDigitalInputgetDebounce in interface GpioPinDigitalInputstate - the pin state to get the configured debounce delay interval.public void setDebounce(int debounce, PinState... state)
GpioPinDigitalInputsetDebounce in interface GpioPinDigitalInputdebounce - The debounce delay interval in milliseconds.state - The pin states to apply the debounce delay interval to.public void setDebounce(int debounce)
GpioPinDigitalInputsetDebounce in interface GpioPinDigitalInputdebounce - The debounce delay interval in milliseconds.public void setValue(double value)
setValue in interface GpioPinAnalogOutputpublic void setValue(Number value)
setValue in interface GpioPinAnalogOutputpublic double getValue()
getValue in interface GpioPinAnalogpublic void setPwm(int value)
GpioPinPwmOutputsetPwm in interface GpioPinPwmOutputpublic void setPwmRange(int range)
GpioPinPwmOutputsetPwmRange in interface GpioPinPwmOutputpublic int getPwm()
GpioPinPwmgetPwm in interface GpioPinPwmpublic void addListener(GpioPinListener... listener)
addListener in interface GpioPinaddListener in interface GpioPinAnalogInputlistener - gpio pin listener interfacepublic void addListener(List<? extends GpioPinListener> listeners)
addListener in interface GpioPinaddListener in interface GpioPinAnalogInputpublic Collection<GpioPinListener> getListeners()
getListeners in interface GpioPingetListeners in interface GpioPinAnalogInputpublic boolean hasListener(GpioPinListener... listener)
hasListener in interface GpioPinhasListener in interface GpioPinAnalogInputpublic void removeListener(GpioPinListener... listener)
removeListener in interface GpioPinremoveListener in interface GpioPinAnalogInputpublic void removeListener(List<? extends GpioPinListener> listeners)
removeListener in interface GpioPinremoveListener in interface GpioPinAnalogInputpublic void removeAllListeners()
removeAllListeners in interface GpioPinremoveAllListeners in interface GpioPinAnalogInputpublic Collection<GpioTrigger> getTriggers()
getTriggers in interface GpioPinAnalogInputgetTriggers in interface GpioPinInputpublic void addTrigger(GpioTrigger... trigger)
addTrigger in interface GpioPinAnalogInputaddTrigger in interface GpioPinInputpublic void addTrigger(List<? extends GpioTrigger> triggers)
addTrigger in interface GpioPinAnalogInputaddTrigger in interface GpioPinInputpublic void removeTrigger(GpioTrigger... trigger)
removeTrigger in interface GpioPinAnalogInputremoveTrigger in interface GpioPinInputtrigger - GPIO trigger interfacepublic void removeTrigger(List<? extends GpioTrigger> triggers)
removeTrigger in interface GpioPinAnalogInputremoveTrigger in interface GpioPinInputpublic void removeAllTriggers()
removeAllTriggers in interface GpioPinAnalogInputremoveAllTriggers in interface GpioPinInputpublic GpioPinShutdown getShutdownOptions()
getShutdownOptions in interface GpioPinpublic void setShutdownOptions(GpioPinShutdown options)
setShutdownOptions in interface GpioPinpublic void setShutdownOptions(Boolean unexport)
setShutdownOptions in interface GpioPinpublic void setShutdownOptions(Boolean unexport, PinState state)
setShutdownOptions in interface GpioPinpublic void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance)
setShutdownOptions in interface GpioPinpublic void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, PinMode mode)
setShutdownOptions in interface GpioPinCopyright © 2012–2019 Pi4J. All rights reserved.