Model Railroad System
2.2.2
|
Base generic GPIO interface class. More...
Public Member Functions | |
LinuxGpio (name,...) | |
Constructor, used to set up the GPIO pin. More... | |
read () | |
Read the value of the pin. More... | |
write (value) | |
Write value to the pin. More... | |
is_output () | |
Returns a boolean value indicating whether the pin is an output pin or not. More... | |
~LinuxGpio () | |
Destructor. More... | |
Set () | |
Set the pin to logic true. More... | |
Clr () | |
Set the pin to logic false. More... | |
Get () | |
Get the pin's logic state. More... | |
Static Private Attributes | |
static | EXPORT |
The name of the export control file. More... | |
static | UNEXPORT |
The name of the unexport control file. More... | |
static | DIRECTIONFMT |
The format string to generate the name of the direction control file. More... | |
static | VALUEFMT |
The format string to generate the name of the value file. More... | |
Base generic GPIO interface class.
(Use one of the specialized classes.)
This class implements the basic interface for a GPIO pin. The pin is set up, its direction configured and its value is optionally initialized.
linuxgpio::LinuxGpio::LinuxGpio | ( | name | , |
... | |||
) |
Constructor, used to set up the GPIO pin.
The pin number is written to the export control file and then the pin's diection control file is computed and the pin's direction is written.
name | The name of the pin. |
... | Options:
|
linuxgpio::LinuxGpio::~LinuxGpio | ( | ) |
Destructor.
Unexport the pin.
linuxgpio::LinuxGpio::Clr | ( | ) |
Set the pin to logic false.
linuxgpio::LinuxGpio::Get | ( | ) |
Get the pin's logic state.
linuxgpio::LinuxGpio::is_output | ( | ) |
Returns a boolean value indicating whether the pin is an output pin or not.
linuxgpio::LinuxGpio::read | ( | ) |
Read the value of the pin.
linuxgpio::LinuxGpio::Set | ( | ) |
Set the pin to logic true.
linuxgpio::LinuxGpio::write | ( | value | ) |
Write value to the pin.
value | The value to write, either 1 or any non-zero value for high or 0 for low. |
|
staticprivate |
The format string to generate the name of the direction control file.
|
staticprivate |
The name of the export control file.
|
staticprivate |
The name of the unexport control file.
|
staticprivate |
The format string to generate the name of the value file.