Class PwmMultiPinConfiguration
java.lang.Object
com.opensourcewithslu.utilities.MultiPinConfigs.PwmMultiPinConfiguration
This class handles the configuration of a PWM device that has multiple pins.
-
Constructor Summary
ConstructorDescriptionThe PwmMultiPinConfiguration constructor. -
Method Summary
Modifier and TypeMethodDescriptionint[]
Gets the pin address for the component.getId()
Gets the id of the component.int[]
Gets the initial states that the component is in when first initialized.getName()
Gets the name of the component.Gets the provider for the component.com.pi4j.io.pwm.PwmType[]
Gets the PWM types of the component.int[]
Gets the shutdown states for the component.void
setAddresses
(String addresses) Sets the pin addresses for the component.void
setInitials
(String initials) Sets the initial states for the component.void
Sets the name of the component.void
setProvider
(String provider) Sets the provider.void
setPwmTypes
(String pwmTypes) Sets the PWM types for the component.void
setShutdowns
(String shutdowns) Sets the shutdown states for the component.
-
Constructor Details
-
PwmMultiPinConfiguration
The PwmMultiPinConfiguration 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 address 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.
-
getPwmTypes
public com.pi4j.io.pwm.PwmType[] getPwmTypes()Gets the PWM types of the component.- Returns:
- PWMType enum.
-
setPwmTypes
Sets the PWM types for the component.- Parameters:
pwmTypes
- String of PWM types separated by commas. Software should be formatted as SOFTWARE. Hardware as HARDWARE.
-
getInitials
public int[] getInitials()Gets the initial states that the component is in when first initialized.- Returns:
- Array of integers representing the initial state for each pin.
-
setInitials
Sets the initial states for the component.- Parameters:
initials
- String of states separated by commas.
-
getShutdowns
public int[] getShutdowns()Gets the shutdown states for the component.- Returns:
- Array of integers representing the shutdowns.
-
setShutdowns
Sets the shutdown states for the component. Existing shutdowns are replaced.- Parameters:
shutdowns
- String of shutdowns separated by commas.
-
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.
-