Package com.opensourcewithslu.utilities
Class DigitalInputConfiguration
java.lang.Object
com.opensourcewithslu.utilities.DigitalInputConfiguration
@Prototype
@EachProperty("pi4j.digital-input")
public class DigitalInputConfiguration
extends Object
This class handles the configuration of a digital input component.
-
Constructor Summary
ConstructorDescriptionConstructor for the DigitalInputConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the pin address for the component.Gets the current debounce value 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
getPull()
Gets the pull resistance for the component.void
setAddress
(int address) Sets the pin address.void
setDebounce
(Long debounce) Sets debounce of the component.void
Sets the name of the component.void
setProvider
(String provider) Sets the provider.void
setPull
(com.pi4j.io.gpio.digital.PullResistance pull) Sets the pull resistance for the component.
-
Constructor Details
-
DigitalInputConfiguration
Constructor for the DigitalInputConfiguration.- 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.
-
getDebounce
Gets the current debounce value for the component.- Returns:
- Long type representing debounce of the component.
-
setDebounce
Sets debounce of the component. Replaces existing debounce.- Parameters:
debounce
- New debounce of type Long,
-
getPull
public com.pi4j.io.gpio.digital.PullResistance getPull()Gets the pull resistance for the component.- Returns:
- The PullResistance enumeration.
-
setPull
public void setPull(com.pi4j.io.gpio.digital.PullResistance pull) Sets the pull resistance for the component.- Parameters:
pull
- The PullResistance enum that will become the new pull resistance for the component.
-
getAddress
public int getAddress()Gets the pin address for the component.- Returns:
- An array of the pin addresses.
-
setAddress
public void setAddress(int address) Sets the pin address.- Parameters:
address
- Integer representing the new pin address.
-
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.
-