public abstract class DacGpioProviderBase extends GpioProviderBase implements DacGpioProvider
This base GPIO provider defined the required interfaces and implements the base functionality for DAC (digital to analog) expansion chips as native Pi4J GPIO pins.
Modifier and Type | Field and Description |
---|---|
protected Pin[] |
allPins |
protected Double[] |
shutdownValues |
cache, DEFAULT_CACHE_SIZE, isshutdown, listeners
Constructor and Description |
---|
DacGpioProviderBase(Pin[] pins)
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
Number |
getShutdownValue(GpioPinAnalogOutput pin)
Get the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
|
Number |
getShutdownValue(Pin pin)
Get the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
|
void |
setPercentValue(GpioPinAnalogOutput pin,
Number percent)
Set the current analog value as a percentage of the available range instead of a raw value.
|
void |
setPercentValue(Pin pin,
Number percent)
Set the current value in a percentage of the available range instead of a raw value.
|
void |
setShutdownValue(Number value,
GpioPinAnalogOutput... pin)
Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
|
void |
setShutdownValue(Number value,
Pin... pin)
Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
|
void |
setValue(Pin pin,
Number value)
Set the requested analog output pin's conversion value.
|
void |
shutdown()
This method is used by the framework to shutdown the
DAC instance and apply any configured shutdown values to the DAC pins.
|
addListener, dispatchPinAnalogValueChangeEvent, dispatchPinDigitalStateChangeEvent, export, export, getMode, getName, getPinCache, getPullResistance, getPwm, getState, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setMode, setPullResistance, setPwm, setPwmRange, setState, setValue, unexport
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxSupportedValue, getMinSupportedValue
addListener, export, export, getMode, getName, getPullResistance, getPwm, getState, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setMode, setPullResistance, setPwm, setPwmRange, setState, setValue, unexport
public DacGpioProviderBase(Pin[] pins)
pins
- the collection of all GPIO pins used with this ADC provider implementationpublic void setPercentValue(Pin pin, Number percent)
setPercentValue
in interface DacGpioProvider
pin
- percent
- percentage value between 0 and 100.public void setPercentValue(GpioPinAnalogOutput pin, Number percent)
setPercentValue
in interface DacGpioProvider
public void setValue(Pin pin, Number value)
setValue
in interface DacGpioProvider
pin
- to get conversion values forvalue
- analog output pin conversion valuepublic void shutdown()
shutdown
in interface GpioProvider
shutdown
in class GpioProviderBase
public void setShutdownValue(Number value, Pin... pin)
setShutdownValue
in interface DacGpioProvider
value
- the shutdown value to apply to the given pin(s)pin
- analog output pin (vararg: one or more pins)public Number getShutdownValue(Pin pin)
getShutdownValue
in interface DacGpioProvider
pin
- analog output pinpublic void setShutdownValue(Number value, GpioPinAnalogOutput... pin)
setShutdownValue
in interface DacGpioProvider
value
- the shutdown value to apply to the given pin(s)pin
- analog output pin (vararg: one or more pins)public Number getShutdownValue(GpioPinAnalogOutput pin)
getShutdownValue
in interface DacGpioProvider
pin
- analog output pinCopyright © 2012–2016 Pi4J. All rights reserved.