Package com.opensourcewithslu.utilities
Class i2cConfiguration
java.lang.Object
com.opensourcewithslu.utilities.i2cConfiguration
This class handles the configuration of an I2C components.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getBus()
Gets the bus pin for the component.int
Gets the devicegetId()
Gets the id of the component.getName()
Gets the name of the component.void
setBus
(int bus) Sets the bus pinvoid
setDevice
(int device) Sets the devicevoid
Sets the name of the component.
-
Constructor Details
-
i2cConfiguration
The i2cConfiguration 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.
-
getBus
public int getBus()Gets the bus pin for the component.- Returns:
- integer representing the bus.
-
setBus
public void setBus(int bus) Sets the bus pin- Parameters:
bus
- integer representing the bus pin.
-
getDevice
public int getDevice()Gets the device- Returns:
- the device represented by an integer.
-
setDevice
public void setDevice(int device) Sets the device- Parameters:
device
- The device as an integer.
-