public abstract class GpioProviderBase extends Object implements GpioProvider
GpioProvider
.Modifier and Type | Field and Description |
---|---|
protected Map<Pin,GpioProviderPinCache> |
cache |
protected boolean |
isshutdown |
protected Map<Pin,List<PinListener>> |
listeners |
Constructor and Description |
---|
GpioProviderBase() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Pin pin,
PinListener listener) |
protected void |
dispatchPinAnalogValueChangeEvent(Pin pin,
double value) |
protected void |
dispatchPinDigitalStateChangeEvent(Pin pin,
PinState state) |
void |
export(Pin pin,
PinMode mode) |
void |
export(Pin pin,
PinMode mode,
PinState defaultState) |
PinMode |
getMode(Pin pin) |
abstract String |
getName() |
protected GpioProviderPinCache |
getPinCache(Pin pin) |
PinPullResistance |
getPullResistance(Pin pin) |
int |
getPwm(Pin pin) |
PinState |
getState(Pin pin) |
double |
getValue(Pin pin) |
boolean |
hasPin(Pin pin) |
boolean |
isExported(Pin pin) |
boolean |
isShutdown()
This method returns TRUE if the GPIO provider has been shutdown.
|
void |
removeAllListeners() |
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 |
setState(Pin pin,
PinState state) |
void |
setValue(Pin pin,
double value) |
void |
shutdown() |
void |
unexport(Pin pin) |
protected final Map<Pin,List<PinListener>> listeners
protected final Map<Pin,GpioProviderPinCache> cache
protected boolean isshutdown
public GpioProviderBase()
public abstract String getName()
getName
in interface GpioProvider
public boolean hasPin(Pin pin)
hasPin
in interface GpioProvider
protected GpioProviderPinCache getPinCache(Pin pin)
public void export(Pin pin, PinMode mode, PinState defaultState)
export
in interface GpioProvider
public void export(Pin pin, PinMode mode)
export
in interface GpioProvider
public boolean isExported(Pin pin)
isExported
in interface GpioProvider
public void unexport(Pin pin)
unexport
in interface GpioProvider
public void setMode(Pin pin, PinMode mode)
setMode
in interface GpioProvider
public PinMode getMode(Pin pin)
getMode
in interface GpioProvider
public void setPullResistance(Pin pin, PinPullResistance resistance)
setPullResistance
in interface GpioProvider
public PinPullResistance getPullResistance(Pin pin)
getPullResistance
in interface GpioProvider
public void setState(Pin pin, PinState state)
setState
in interface GpioProvider
public PinState getState(Pin pin)
getState
in interface GpioProvider
public void setValue(Pin pin, double value)
setValue
in interface GpioProvider
public double getValue(Pin pin)
getValue
in interface GpioProvider
public void setPwm(Pin pin, int value)
setPwm
in interface GpioProvider
public int getPwm(Pin pin)
getPwm
in interface GpioProvider
public void addListener(Pin pin, PinListener listener)
addListener
in interface GpioProvider
public void removeListener(Pin pin, PinListener listener)
removeListener
in interface GpioProvider
public void removeAllListeners()
removeAllListeners
in interface GpioProvider
protected void dispatchPinDigitalStateChangeEvent(Pin pin, PinState state)
protected void dispatchPinAnalogValueChangeEvent(Pin pin, double value)
public void shutdown()
shutdown
in interface GpioProvider
public boolean isShutdown()
isShutdown
in interface GpioProvider
Copyright © 2012–2019 Pi4J. All rights reserved.