Class SpiConfiguration

java.lang.Object
com.opensourcewithslu.utilities.SpiConfiguration

@Prototype @EachProperty("pi4j.spi") public class SpiConfiguration extends Object
This class handles the configuration of an SPI component.
  • Constructor Details

    • SpiConfiguration

      public SpiConfiguration(@Parameter String id)
      The SpiConfiguration constructor.
      Parameters:
      id - The configuration id as defined in the application.yml
  • Method Details

    • getId

      public String getId()
      Gets the id of the component.
      Returns:
      The id of the component.
    • getName

      public String getName()
      Gets the name of the component.
      Returns:
      The name of the component.
    • setName

      public void setName(String name)
      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.