public class OdroidGpioProvider extends WiringPiGpioProviderBase implements GpioProvider, GpioInterruptListener, AnalogInputListener
GpioProvider
implementation.Modifier and Type | Field and Description |
---|---|
static int |
AIN_ADDRESS_OFFSET |
protected static double |
analogInputListenerChangeThreshold |
protected static int |
analogInputPollingRate |
static double |
DEFAULT_ANALOG_INPUT_LISTENER_CHANGE_THRESHOLD |
static int |
DEFAULT_ANALOG_INPUT_POLLING_RATE |
static String |
NAME |
MAX_PIN_CACHE, pinModeCache, pinSupportedCache
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners
Constructor and Description |
---|
OdroidGpioProvider()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
export(Pin pin,
PinMode mode,
PinState defaultState) |
static double |
getAnalogInputListenerChangeThreshold()
Get the analog input listener change value threshold.
|
static int |
getAnalogInputPollingRate()
Get the analog input monitor polling rate in milliseconds.
|
String |
getName() |
double |
getValue(Pin pin) |
boolean |
isExported(Pin pin) |
void |
pinValueChange(AnalogInputEvent event) |
static void |
setAnalogInputListenerChangeThreshold(double threshold)
Set the analog input listener change value threshold.
|
static void |
setAnalogInputPollingRate(int milliseconds)
Set the analog input monitor polling rate in milliseconds.
|
void |
setMode(Pin pin,
PinMode mode) |
void |
unexport(Pin pin) |
protected void |
updateInterruptListener(Pin pin) |
addListener, export, getMode, getPwm, getState, hasPin, pinStateChange, removeListener, setPullResistance, setPwm, setPwmRange, setState, setValue
dispatchPinAnalogValueChangeEvent, dispatchPinDigitalStateChangeEvent, getPinCache, getPullResistance, isShutdown, removeAllListeners, shutdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, export, getMode, getPullResistance, getPwm, getState, hasPin, isShutdown, removeAllListeners, removeListener, setPullResistance, setPwm, setPwmRange, setState, setValue, shutdown
pinStateChange
public static final String NAME
public static final int AIN_ADDRESS_OFFSET
public static final int DEFAULT_ANALOG_INPUT_POLLING_RATE
public static final double DEFAULT_ANALOG_INPUT_LISTENER_CHANGE_THRESHOLD
protected static int analogInputPollingRate
protected static double analogInputListenerChangeThreshold
public OdroidGpioProvider()
public static int getAnalogInputPollingRate()
public static double getAnalogInputListenerChangeThreshold()
public static void setAnalogInputPollingRate(int milliseconds)
milliseconds
- polling rate in milliseconds; this value must be a positive number
else a default polling rate is usedpublic static void setAnalogInputListenerChangeThreshold(double threshold)
threshold
- change threshold value; this value must be zero or greater. If the threshold value is set
to zero, then any change in value will dispatch a new analog input value event.public String getName()
getName
in interface GpioProvider
getName
in class WiringPiGpioProviderBase
public void export(Pin pin, PinMode mode, PinState defaultState)
export
in interface GpioProvider
export
in class WiringPiGpioProviderBase
public boolean isExported(Pin pin)
isExported
in interface GpioProvider
isExported
in class WiringPiGpioProviderBase
public void unexport(Pin pin)
unexport
in interface GpioProvider
unexport
in class WiringPiGpioProviderBase
public void setMode(Pin pin, PinMode mode)
setMode
in interface GpioProvider
setMode
in class WiringPiGpioProviderBase
public double getValue(Pin pin)
getValue
in interface GpioProvider
getValue
in class WiringPiGpioProviderBase
public void pinValueChange(AnalogInputEvent event)
pinValueChange
in interface AnalogInputListener
protected void updateInterruptListener(Pin pin)
updateInterruptListener
in class WiringPiGpioProviderBase
Copyright © 2012–2021 Pi4J. All rights reserved.