SPI 2840X Bus settings.
More...
#include <bussettings.h>
◆ BusSettings() [1/3]
SpaIot::BusSettings::BusSettings |
( |
const int |
dataPin, |
|
|
const int |
clkPin, |
|
|
const int |
holdPin |
|
) |
| |
The constructor for the BusSettings class takes three parameters, and stores them in the private member variables
- Parameters
-
dataPin | The pin number of the data pin of the MCP23017 chip. |
clkPin | The pin number of the clock pin. |
holdPin | The pin that is used to hold the data line high. |
◆ BusSettings() [2/3]
SpaIot::BusSettings::BusSettings |
( |
const std::initializer_list< int > & |
pins | ) |
|
The constructor takes a list of pins and stores them in the member variable m_pin
- Parameters
-
pins | A list of pins to use for the bus. |
◆ BusSettings() [3/3]
SpaIot::BusSettings::BusSettings |
( |
| ) |
|
The default constructor creates a BusSettings object and initializes the m_pin member to (3, -1)
◆ clkPin()
int SpaIot::BusSettings::clkPin |
( |
| ) |
const |
This function returns the clock pin number
- Returns
- The pin number of the GPIO pin that the bus is connected to.
◆ dataPin()
int SpaIot::BusSettings::dataPin |
( |
| ) |
const |
This function returns the data pin number
- Returns
- The pin number of the GPIO pin that the bus is connected to.
◆ holdPin()
int SpaIot::BusSettings::holdPin |
( |
| ) |
const |
This function returns the pin number of the hold pin
- Returns
- The pin number of the GPIO pin that the bus is connected to.
◆ isNull()
bool SpaIot::BusSettings::isNull |
( |
| ) |
const |
This function returns true if any of the pins are set to -1
- Returns
- The return value is a boolean.
◆ operator!=()
bool SpaIot::BusSettings::operator!= |
( |
const BusSettings & |
other | ) |
const |
The function returns true if the two objects are not equal
- Parameters
-
- Returns
- The return value is a boolean value. It is true if the two objects are not equal, and false if they are equal.
◆ operator==()
bool SpaIot::BusSettings::operator== |
( |
const BusSettings & |
other | ) |
const |
The function returns true if the two objects are equal
- Parameters
-
- Returns
- The return value is a boolean value. It is true if the two objects are equal, and false if they are not equal.
◆ setClkPin()
void SpaIot::BusSettings::setClkPin |
( |
int |
pin | ) |
|
Set the clock pin to the given value.
- Parameters
-
pin | The pin number of the GPIO pin that the bus is connected to. |
◆ setDataPin()
void SpaIot::BusSettings::setDataPin |
( |
int |
pin | ) |
|
Set the data pin to the given value.
- Parameters
-
pin | The pin number of the GPIO pin that the bus is connected to. |
◆ setHoldPin()
void SpaIot::BusSettings::setHoldPin |
( |
int |
pin | ) |
|
Set the pin number for the hold pin.
- Parameters
-
pin | The pin number of the GPIO pin that the bus is connected to. |