public class GpioPropertyConfig
extends net.solarnetwork.domain.datum.NumberDatumSamplePropertyConfig<java.lang.Integer>
The DatumSamplePropertyConfig.getConfig() value represents the GPIO address to read from,
starting from 0.
| Modifier and Type | Field and Description |
|---|---|
static GpioDirection |
DEFAULT_GPIO_DIRECTION
The
gpioDirection property default value. |
static GpioType |
DEFAULT_GPIO_TYPE
The
gpioType property default value. |
| Constructor and Description |
|---|
GpioPropertyConfig()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
getAddress()
Get the GPIO address to control.
|
java.lang.String |
getControlId()
Get the control ID.
|
GpioDirection |
getGpioDirection()
Get the GPIO direction.
|
int |
getGpioDirectionCode()
Get the GPIO direction code value.
|
GpioType |
getGpioType()
Get the GPIO type.
|
int |
getGpioTypeCode()
Get the GPIO type code value.
|
static java.util.BitSet |
ioDirectionBitSet(GpioPropertyConfig[] configs)
Create a new bit set suitable for using to configure the IO direction of
all GPIO addresses based on a set of configurations.
|
boolean |
isValid()
Test if this instance has a valid configuration.
|
static GpioPropertyConfig |
of(java.lang.String controlId,
java.lang.Integer address)
Create a new configuration instance.
|
void |
setAddress(java.lang.Integer address)
Set the GPIO address to control.
|
void |
setControlId(java.lang.String controlId)
Set the control ID.
|
void |
setGpioDirection(GpioDirection gpioDirection)
Set the GPIO direction.
|
void |
setGpioDirectionCode(int code)
Set the GPIO direction as a code value.
|
void |
setGpioType(GpioType gpioType)
Set the GPIO type code value.
|
void |
setGpioTypeCode(int code)
Set the GPIO type as a code value.
|
static java.util.List<net.solarnetwork.settings.SettingSpecifier> |
settings(java.lang.String prefix)
Get settings suitable for configuring an instance of this class.
|
applyTransformations, getDecimalScale, getIntercept, getSlope, getUnitIntercept, getUnitSlope, numberTransformSettings, setDecimalScale, setIntercept, setSlope, setUnitIntercept, setUnitSlopepublic static final GpioType DEFAULT_GPIO_TYPE
gpioType property default value.public static final GpioDirection DEFAULT_GPIO_DIRECTION
gpioDirection property default value.public static java.util.List<net.solarnetwork.settings.SettingSpecifier> settings(java.lang.String prefix)
prefix - a setting key prefix to usepublic static java.util.BitSet ioDirectionBitSet(GpioPropertyConfig[] configs)
Only valid configurations are considered (those that return
true from isValid().
configs - the configurations to generate the bit set frompublic static GpioPropertyConfig of(java.lang.String controlId, java.lang.Integer address)
controlId - the control IDaddress - the GPIO addresspublic boolean isValid()
This method simply verifies the minimum level of configuration is available for the control to be used.
public java.lang.String getControlId()
public void setControlId(java.lang.String controlId)
controlId - the control ID to setpublic java.lang.Integer getAddress()
This is an alias for DatumSamplePropertyConfig.getConfig().
public void setAddress(java.lang.Integer address)
This is an alias for DatumSamplePropertyConfig.setConfig(Object).
address - the GPIO address to setpublic GpioType getGpioType()
public void setGpioType(GpioType gpioType)
gpioType - the type; if null then DEFAULT_GPIO_TYPE will
be setpublic int getGpioTypeCode()
public void setGpioTypeCode(int code)
code - the code value to set; if not a valid GpioType code value
the DEFAULT_GPIO_TYPE will be setpublic GpioDirection getGpioDirection()
public void setGpioDirection(GpioDirection gpioDirection)
gpioDirection - the direction to set; if null then
DEFAULT_GPIO_DIRECTION will be setpublic int getGpioDirectionCode()
public void setGpioDirectionCode(int code)
code - the code value to set; if not a valid GpioDirection code
value the DEFAULT_GPIO_DIRECTION will be set