Package com.pi4j.io.gpio
Class WiringPiGpioProviderBase
- java.lang.Object
-
- com.pi4j.io.gpio.GpioProviderBase
-
- com.pi4j.io.gpio.WiringPiGpioProviderBase
-
- All Implemented Interfaces:
GpioProvider
,GpioInterruptListener
,EventListener
- Direct Known Subclasses:
RaspiGpioProvider
public abstract class WiringPiGpioProviderBase extends GpioProviderBase implements GpioProvider, GpioInterruptListener
WiringPiGpioProviderBaseGpioProvider
implementation.- Author:
- Robert Savage (http://www.savagehomeautomation.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected static short
MAX_PIN_CACHE
protected static PinMode[]
pinModeCache
protected static short[]
pinSupportedCache
-
Fields inherited from class com.pi4j.io.gpio.GpioProviderBase
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners
-
-
Constructor Summary
Constructors Constructor Description WiringPiGpioProviderBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addListener(Pin pin, PinListener listener)
void
export(Pin pin, PinMode mode)
void
export(Pin pin, PinMode mode, PinState defaultState)
PinMode
getMode(Pin pin)
abstract String
getName()
int
getPwm(Pin pin)
PinState
getState(Pin pin)
double
getValue(Pin pin)
boolean
hasPin(Pin pin)
boolean
isExported(Pin pin)
void
pinStateChange(GpioInterruptEvent event)
void
removeListener(Pin pin, PinListener listener)
void
setMode(Pin pin, PinMode mode)
void
setPullResistance(Pin pin, PinPullResistance resistance)
void
setPwm(Pin pin, int value)
void
setPwmRange(Pin pin, int range)
void
setState(Pin pin, PinState state)
void
setValue(Pin pin, double value)
void
unexport(Pin pin)
protected void
updateInterruptListener(Pin pin)
-
Methods inherited from class com.pi4j.io.gpio.GpioProviderBase
dispatchPinAnalogValueChangeEvent, dispatchPinDigitalStateChangeEvent, getPinCache, getPullResistance, isShutdown, removeAllListeners, shutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pi4j.io.gpio.GpioProvider
getPullResistance, isShutdown, removeAllListeners, shutdown
-
-
-
-
Field Detail
-
MAX_PIN_CACHE
protected static short MAX_PIN_CACHE
-
pinSupportedCache
protected static short[] pinSupportedCache
-
pinModeCache
protected static PinMode[] pinModeCache
-
-
Method Detail
-
getName
public abstract String getName()
- Specified by:
getName
in interfaceGpioProvider
- Specified by:
getName
in classGpioProviderBase
-
hasPin
public boolean hasPin(Pin pin)
- Specified by:
hasPin
in interfaceGpioProvider
- Overrides:
hasPin
in classGpioProviderBase
-
export
public void export(Pin pin, PinMode mode)
- Specified by:
export
in interfaceGpioProvider
- Overrides:
export
in classGpioProviderBase
-
export
public void export(Pin pin, PinMode mode, PinState defaultState)
- Specified by:
export
in interfaceGpioProvider
- Overrides:
export
in classGpioProviderBase
-
isExported
public boolean isExported(Pin pin)
- Specified by:
isExported
in interfaceGpioProvider
- Overrides:
isExported
in classGpioProviderBase
-
unexport
public void unexport(Pin pin)
- Specified by:
unexport
in interfaceGpioProvider
- Overrides:
unexport
in classGpioProviderBase
-
setMode
public void setMode(Pin pin, PinMode mode)
- Specified by:
setMode
in interfaceGpioProvider
- Overrides:
setMode
in classGpioProviderBase
-
getMode
public PinMode getMode(Pin pin)
- Specified by:
getMode
in interfaceGpioProvider
- Overrides:
getMode
in classGpioProviderBase
-
setPullResistance
public void setPullResistance(Pin pin, PinPullResistance resistance)
- Specified by:
setPullResistance
in interfaceGpioProvider
- Overrides:
setPullResistance
in classGpioProviderBase
-
setState
public void setState(Pin pin, PinState state)
- Specified by:
setState
in interfaceGpioProvider
- Overrides:
setState
in classGpioProviderBase
-
getState
public PinState getState(Pin pin)
- Specified by:
getState
in interfaceGpioProvider
- Overrides:
getState
in classGpioProviderBase
-
setValue
public void setValue(Pin pin, double value)
- Specified by:
setValue
in interfaceGpioProvider
- Overrides:
setValue
in classGpioProviderBase
-
getValue
public double getValue(Pin pin)
- Specified by:
getValue
in interfaceGpioProvider
- Overrides:
getValue
in classGpioProviderBase
-
setPwm
public void setPwm(Pin pin, int value)
- Specified by:
setPwm
in interfaceGpioProvider
- Overrides:
setPwm
in classGpioProviderBase
-
setPwmRange
public void setPwmRange(Pin pin, int range)
- Specified by:
setPwmRange
in interfaceGpioProvider
- Overrides:
setPwmRange
in classGpioProviderBase
-
getPwm
public int getPwm(Pin pin)
- Specified by:
getPwm
in interfaceGpioProvider
- Overrides:
getPwm
in classGpioProviderBase
-
pinStateChange
public void pinStateChange(GpioInterruptEvent event)
- Specified by:
pinStateChange
in interfaceGpioInterruptListener
-
addListener
public void addListener(Pin pin, PinListener listener)
- Specified by:
addListener
in interfaceGpioProvider
- Overrides:
addListener
in classGpioProviderBase
-
removeListener
public void removeListener(Pin pin, PinListener listener)
- Specified by:
removeListener
in interfaceGpioProvider
- Overrides:
removeListener
in classGpioProviderBase
-
updateInterruptListener
protected void updateInterruptListener(Pin pin)
-
-