Package com.opensourcewithslu.utilities
Class SpiConfiguration
java.lang.Object
com.opensourcewithslu.utilities.SpiConfiguration
This class handles the configuration of an SPI component.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getBaud()
Gets the baud rate for the component.int
Gets the channel for the component.getId()
Gets the id of the component.com.pi4j.io.spi.SpiMode
getMode()
Gets the SPI mode for the component.getName()
Gets the name of the component.void
setBaud
(int baud) Sets the baud rate for the component.void
setChannel
(int channel) Sets a new channel for the component.void
setMode
(com.pi4j.io.spi.SpiMode mode) Sets the SPI mode for the component.void
Sets the name of the component.
-
Constructor Details
-
SpiConfiguration
The SpiConfiguration 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.
-
getChannel
public int getChannel()Gets the channel for the component.- Returns:
- An integer representing the channel.
-
setChannel
public void setChannel(int channel) Sets a new channel for the component.- Parameters:
channel
- An integer representing the new channel.
-
getMode
public com.pi4j.io.spi.SpiMode getMode()Gets the SPI mode for the component.- Returns:
- A SpiMode enum.
-
setMode
public void setMode(com.pi4j.io.spi.SpiMode mode) Sets the SPI mode for the component.- Parameters:
mode
- An SpiMode object.
-
getBaud
public int getBaud()Gets the baud rate for the component.- Returns:
- the baud rate as an integer.
-
setBaud
public void setBaud(int baud) Sets the baud rate for the component.- Parameters:
baud
- Integer representing the new baud rate.
-