|
RADLib
RADical C++ application framework
|
GPIO sysfs helper. More...
#include <RADDevice.h>
Public Member Functions | |
| GpioPin (int number, DevicePaths paths={}) | |
| Creates a GPIO pin wrapper. More... | |
| bool | exportPin (std::string *error=nullptr) const |
| Exports the pin through sysfs. More... | |
| bool | unexportPin (std::string *error=nullptr) const |
| Unexports the pin through sysfs. More... | |
| bool | setDirection (GpioDirection direction, std::string *error=nullptr) const |
| Sets pin direction. More... | |
| bool | setEdge (GpioEdge edge, std::string *error=nullptr) const |
| Sets pin edge mode. More... | |
| bool | writeValue (bool high, std::string *error=nullptr) const |
| Writes 0 or 1. More... | |
| RADCore::RADResult< bool > | readValue () const |
| Reads current value. More... | |
| std::string | pinPath () const |
| Returns sysfs pin directory. More... | |
GPIO sysfs helper.
| RADDevice::GpioPin::GpioPin | ( | int | number, |
| DevicePaths | paths = {} |
||
| ) |
Creates a GPIO pin wrapper.
| bool RADDevice::GpioPin::exportPin | ( | std::string * | error = nullptr | ) | const |
Exports the pin through sysfs.
| std::string RADDevice::GpioPin::pinPath | ( | ) | const |
Returns sysfs pin directory.
| RADCore::RADResult<bool> RADDevice::GpioPin::readValue | ( | ) | const |
Reads current value.
| bool RADDevice::GpioPin::setDirection | ( | GpioDirection | direction, |
| std::string * | error = nullptr |
||
| ) | const |
Sets pin direction.
| bool RADDevice::GpioPin::setEdge | ( | GpioEdge | edge, |
| std::string * | error = nullptr |
||
| ) | const |
Sets pin edge mode.
| bool RADDevice::GpioPin::unexportPin | ( | std::string * | error = nullptr | ) | const |
Unexports the pin through sysfs.
| bool RADDevice::GpioPin::writeValue | ( | bool | high, |
| std::string * | error = nullptr |
||
| ) | const |
Writes 0 or 1.