Class DigitalInputMultiPinConfiguration
java.lang.Object
com.opensourcewithslu.utilities.MultiPinConfigs.DigitalInputMultiPinConfiguration
@Prototype
@EachProperty("pi4j.multi-digital-input")
public class DigitalInputMultiPinConfiguration
extends Object
This class handles the configuration of a digital input component that has multiple pins.
-
Constructor Summary
ConstructorDescriptionThe DigitalInputMultiPinConfiguration constructor. -
Method Summary
Modifier and TypeMethodDescriptionint[]
Gets the pin addresses for the component.long[]
Gets the current debounce values for the component.getId()
Gets the id of the component.getName()
Gets the name of the component.Gets the provider for the component.com.pi4j.io.gpio.digital.PullResistance[]
getPulls()
Gets the pull resistance for the component.void
setAddresses
(String addresses) Sets the pin addresses for the component.void
setDebounces
(String debounces) Sets the debounces for the component.void
Sets the name of the component.void
setProvider
(String provider) Sets the provider.void
Sets all the pull resistance for the components.
-
Constructor Details
-
DigitalInputMultiPinConfiguration
The DigitalInputMultiPinConfiguration constructor.- Parameters:
id
- The configuration id as defined in the application.yml
-
-
Method Details
-
getId
Gets the id of the component.- Returns:
- The id of the component.
-
getName
Gets the name of the component.- Returns:
- The name of the component.
-
setName
Sets the name of the component.- Parameters:
name
- The string name to replace the existing name.
-
getAddresses
public int[] getAddresses()Gets the pin addresses for the component.- Returns:
- An array of the pin addresses.
-
setAddresses
Sets the pin addresses for the component. All previously existing address are replaced.- Parameters:
addresses
- Pin addresses separated by a comma.
-
getPulls
public com.pi4j.io.gpio.digital.PullResistance[] getPulls()Gets the pull resistance for the component.- Returns:
- The PullResistance enumerations.
-
setPulls
Sets all the pull resistance for the components.- Parameters:
all_pulls
- String of pull resistances separated by commas. Pull down resistance should be formatted as PULL_DOWN. Pull up as PULL_UP.
-
getDebounces
public long[] getDebounces()Gets the current debounce values for the component.- Returns:
- The array of debounce values of type long.
-
setDebounces
Sets the debounces for the component. Replaces all the existing debounces.- Parameters:
debounces
- String representing the debounces for the component. Each debounce seperated by a comma.
-
getProvider
Gets the provider for the component.- Returns:
- A String representation of the provider.
-
setProvider
Sets the provider.- Parameters:
provider
- The new provider for the component.
-