|
RADLib
RADical C++ application framework
|
PWM sysfs channel helper. More...
#include <RADDevice.h>
Public Member Functions | |
| PwmChannel (int chip, int channel, DevicePaths paths={}) | |
| Creates a PWM channel wrapper. More... | |
| bool | exportChannel (std::string *error=nullptr) const |
| Exports the PWM channel. More... | |
| bool | setEnabled (bool enabled, std::string *error=nullptr) const |
| Enables or disables output. More... | |
| bool | setPeriodNs (uint64_t periodNs, std::string *error=nullptr) const |
| Sets period in nanoseconds. More... | |
| bool | setDutyCycleNs (uint64_t dutyNs, std::string *error=nullptr) const |
| Sets duty cycle in nanoseconds. More... | |
| std::string | channelPath () const |
| Returns sysfs PWM path. More... | |
PWM sysfs channel helper.
| RADDevice::PwmChannel::PwmChannel | ( | int | chip, |
| int | channel, | ||
| DevicePaths | paths = {} |
||
| ) |
Creates a PWM channel wrapper.
| std::string RADDevice::PwmChannel::channelPath | ( | ) | const |
Returns sysfs PWM path.
| bool RADDevice::PwmChannel::exportChannel | ( | std::string * | error = nullptr | ) | const |
Exports the PWM channel.
| bool RADDevice::PwmChannel::setDutyCycleNs | ( | uint64_t | dutyNs, |
| std::string * | error = nullptr |
||
| ) | const |
Sets duty cycle in nanoseconds.
| bool RADDevice::PwmChannel::setEnabled | ( | bool | enabled, |
| std::string * | error = nullptr |
||
| ) | const |
Enables or disables output.
| bool RADDevice::PwmChannel::setPeriodNs | ( | uint64_t | periodNs, |
| std::string * | error = nullptr |
||
| ) | const |
Sets period in nanoseconds.