Class for GPIO manipulations.
More...
#include <gpio.h>
|
| int | setDirection (const char *pin, int direction) |
| | Set direction. More...
|
| |
| void | setDirections (int lsbPins, int msbPins, int lsbDirs, int msbDirs) |
| | Set directions for all pins simultaneously (see bit arithmetic) More...
|
| |
| int | getDirection (const char *pin) |
| | Get direction. More...
|
| |
| void | getDirections (int &lsbDirs, int &msbDirs) |
| | Get directions for all pins simultaneously (see bit arithmetic) More...
|
| |
| GpioReturn | getDirections () |
| | Get directions for all pins simultaneously. More...
|
| |
| int | setValue (const char *pin, unsigned int value) |
| | Set value. More...
|
| |
| void | setValues (int lsbPins, int msbPins, int lsbValues, int msbValues) |
| | Set values for all pins simultaneously (see bit arithmetic) More...
|
| |
| unsigned int | getValue (const char *pin) |
| | Get value. More...
|
| |
| void | getValues (int &lsbValues, int &msbValues) |
| | Get values for all pins simultaneously (see bit arithmetic) More...
|
| |
| GpioReturn | getValues () |
| | Get directions for all pins simultaneously. More...
|
| |
| unsigned int | getPinNumber (const char *pin) |
| | Get CPU pin number. More...
|
| |
Class for GPIO manipulations.
- Examples:
- gpio.cpp.
| int Gpio::getDirection |
( |
const char * |
pin | ) |
|
Get direction.
- Parameters
-
| pin | String name of pin (eg: S1A, S9D) |
- Returns
- Pin direction (0 for input, 1 for output)
- Examples:
- gpio.cpp.
| void Gpio::getDirections |
( |
int & |
lsbDirs, |
|
|
int & |
msbDirs |
|
) |
| |
Get directions for all pins simultaneously (see bit arithmetic)
- Parameters
-
| lsbDirs | Directions for first group: pins S1A...S15D (0 for input, 1 for output) |
| msbDirs | Directions for second group: pins S17A...S25D (0 for input, 1 for output) |
Get directions for all pins simultaneously.
- Returns
- GpioReturn structure
| unsigned int Gpio::getPinNumber |
( |
const char * |
pin | ) |
|
Get CPU pin number.
- Parameters
-
| pin | String name of pin (eg: S1A, S9D) |
- Returns
- CPU pin number
| unsigned int Gpio::getValue |
( |
const char * |
pin | ) |
|
Get value.
- Parameters
-
| pin | String name of pin (eg: S1A, S9D) |
- Returns
- Pin value (0 or 1)
- Examples:
- gpio.cpp.
| void Gpio::getValues |
( |
int & |
lsbValues, |
|
|
int & |
msbValues |
|
) |
| |
Get values for all pins simultaneously (see bit arithmetic)
- Parameters
-
| lsbValues | Values for first group: pins S1A...S15D (0 for input, 1 for output) |
| msbValues | Values for second group: pins S17A...S25D (0 for input, 1 for output) |
Get directions for all pins simultaneously.
- Returns
- GpioReturn structure
| int Gpio::setDirection |
( |
const char * |
pin, |
|
|
int |
direction |
|
) |
| |
Set direction.
- Parameters
-
| pin | String name of pin (eg: S1A, S9D) |
| direction | Pin direction (0 for input, 1 for output) |
- Returns
- Result (0 on success)
- Examples:
- gpio.cpp.
| void Gpio::setDirections |
( |
int |
lsbPins, |
|
|
int |
msbPins, |
|
|
int |
lsbDirs, |
|
|
int |
msbDirs |
|
) |
| |
Set directions for all pins simultaneously (see bit arithmetic)
- Parameters
-
| lsbPins | Applicable bits: pins S1A...S15D (LSB bit 0 - pin S1A, bit 1 - pin S1B,.., MSB bit 31 - pin S15D) |
| msbPins | Applicable bits: pins S17A..S25C (LSB bit 0 - pin S17A, bit 1 - pin S17B,..., MSB bit 18 - pin S25D) |
| lsbDirs | Directions for first group: pins S1A...S15D (0 for input, 1 for output) |
| msbDirs | Directions for second group: pins S17A...S25D (0 for input, 1 for output) |
| int Gpio::setValue |
( |
const char * |
pin, |
|
|
unsigned int |
value |
|
) |
| |
Set value.
- Parameters
-
| pin | String name of pin (eg: S1A, S9D) |
| value | Pin value (0 or 1) |
- Returns
- Result (< 0 on error)
- Examples:
- gpio.cpp.
| void Gpio::setValues |
( |
int |
lsbPins, |
|
|
int |
msbPins, |
|
|
int |
lsbValues, |
|
|
int |
msbValues |
|
) |
| |
Set values for all pins simultaneously (see bit arithmetic)
- Parameters
-
| lsbPins | Applicable bits: pins S1A...S15D (LSB bit 0 - pin S1A, bit 1 - pin S1B,.., MSB bit 31 - pin S15D) |
| msbPins | Applicable bits: pins S17A..S25C (LSB bit 0 - pin S17A, bit 1 - pin S17B,..., MSB bit 18 - pin S25D) |
| lsbValues | Values for first group: pins S1A...S15D (0 or 1) |
| msbValues | Values for second group: pins S17A...S25D (0 or 1) |
The documentation for this class was generated from the following file: