Package com.pi4j.io.gpio
Class GpioProviderBase
- java.lang.Object
- 
- com.pi4j.io.gpio.GpioProviderBase
 
- 
- All Implemented Interfaces:
- GpioProvider
 - Direct Known Subclasses:
- SimulatedGpioProvider,- WiringPiGpioProviderBase
 
 public abstract class GpioProviderBase extends Object implements GpioProvider Abstract base implementation ofGpioProvider.- Author:
- Robert Savage (http://www.savagehomeautomation.com)
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected GpioProviderPinCache[]cachestatic intDEFAULT_CACHE_SIZEprotected booleanisshutdownprotected Map<Pin,List<PinListener>>listeners
 - 
Constructor SummaryConstructors Constructor Description GpioProviderBase()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddListener(Pin pin, PinListener listener)protected voiddispatchPinAnalogValueChangeEvent(Pin pin, double value)protected voiddispatchPinDigitalStateChangeEvent(Pin pin, PinState state)voidexport(Pin pin, PinMode mode)voidexport(Pin pin, PinMode mode, PinState defaultState)PinModegetMode(Pin pin)abstract StringgetName()protected GpioProviderPinCachegetPinCache(Pin pin)PinPullResistancegetPullResistance(Pin pin)intgetPwm(Pin pin)PinStategetState(Pin pin)doublegetValue(Pin pin)booleanhasPin(Pin pin)booleanisExported(Pin pin)booleanisShutdown()This method returns TRUE if the GPIO provider has been shutdown.voidremoveAllListeners()voidremoveListener(Pin pin, PinListener listener)voidsetMode(Pin pin, PinMode mode)voidsetPullResistance(Pin pin, PinPullResistance resistance)voidsetPwm(Pin pin, int value)voidsetPwmRange(Pin pin, int range)voidsetState(Pin pin, PinState state)voidsetValue(Pin pin, double value)voidshutdown()voidunexport(Pin pin)
 
- 
- 
- 
Field Detail- 
DEFAULT_CACHE_SIZEpublic static final int DEFAULT_CACHE_SIZE - See Also:
- Constant Field Values
 
 - 
listenersprotected final Map<Pin,List<PinListener>> listeners 
 - 
cacheprotected GpioProviderPinCache[] cache 
 - 
isshutdownprotected boolean isshutdown 
 
- 
 - 
Method Detail- 
getNamepublic abstract String getName() - Specified by:
- getNamein interface- GpioProvider
 
 - 
hasPinpublic boolean hasPin(Pin pin) - Specified by:
- hasPinin interface- GpioProvider
 
 - 
getPinCacheprotected GpioProviderPinCache getPinCache(Pin pin) 
 - 
exportpublic void export(Pin pin, PinMode mode, PinState defaultState) - Specified by:
- exportin interface- GpioProvider
 
 - 
exportpublic void export(Pin pin, PinMode mode) - Specified by:
- exportin interface- GpioProvider
 
 - 
isExportedpublic boolean isExported(Pin pin) - Specified by:
- isExportedin interface- GpioProvider
 
 - 
unexportpublic void unexport(Pin pin) - Specified by:
- unexportin interface- GpioProvider
 
 - 
setModepublic void setMode(Pin pin, PinMode mode) - Specified by:
- setModein interface- GpioProvider
 
 - 
getModepublic PinMode getMode(Pin pin) - Specified by:
- getModein interface- GpioProvider
 
 - 
setPullResistancepublic void setPullResistance(Pin pin, PinPullResistance resistance) - Specified by:
- setPullResistancein interface- GpioProvider
 
 - 
getPullResistancepublic PinPullResistance getPullResistance(Pin pin) - Specified by:
- getPullResistancein interface- GpioProvider
 
 - 
setStatepublic void setState(Pin pin, PinState state) - Specified by:
- setStatein interface- GpioProvider
 
 - 
getStatepublic PinState getState(Pin pin) - Specified by:
- getStatein interface- GpioProvider
 
 - 
setValuepublic void setValue(Pin pin, double value) - Specified by:
- setValuein interface- GpioProvider
 
 - 
getValuepublic double getValue(Pin pin) - Specified by:
- getValuein interface- GpioProvider
 
 - 
setPwmpublic void setPwm(Pin pin, int value) - Specified by:
- setPwmin interface- GpioProvider
 
 - 
setPwmRangepublic void setPwmRange(Pin pin, int range) - Specified by:
- setPwmRangein interface- GpioProvider
 
 - 
getPwmpublic int getPwm(Pin pin) - Specified by:
- getPwmin interface- GpioProvider
 
 - 
addListenerpublic void addListener(Pin pin, PinListener listener) - Specified by:
- addListenerin interface- GpioProvider
 
 - 
removeListenerpublic void removeListener(Pin pin, PinListener listener) - Specified by:
- removeListenerin interface- GpioProvider
 
 - 
removeAllListenerspublic void removeAllListeners() - Specified by:
- removeAllListenersin interface- GpioProvider
 
 - 
dispatchPinDigitalStateChangeEventprotected void dispatchPinDigitalStateChangeEvent(Pin pin, PinState state) 
 - 
dispatchPinAnalogValueChangeEventprotected void dispatchPinAnalogValueChangeEvent(Pin pin, double value) 
 - 
shutdownpublic void shutdown() - Specified by:
- shutdownin interface- GpioProvider
 
 - 
isShutdownpublic boolean isShutdown() This method returns TRUE if the GPIO provider has been shutdown.- Specified by:
- isShutdownin interface- GpioProvider
- Returns:
- shutdown state
 
 
- 
 
-