13 #include <boost/exception/info.hpp> 18 namespace duds {
namespace hardware {
namespace interface {
namespace linux {
20 struct PwmError :
virtual std::exception,
virtual boost::exception { };
22 typedef boost::error_info<struct Info_SysPwmChip, int>
SysPwmChip;
23 typedef boost::error_info<struct Info_SysPwmChannel, int>
SysPwmChannel;
24 typedef boost::error_info<struct Info_SysPwmPeriodNs, long>
26 typedef boost::error_info<struct Info_SysPwmDutyNs, long>
43 SysPwm(
int chip,
int channel);
45 void enable(
bool state =
true);
55 void dutyPeriod(
const std::chrono::nanoseconds &ns);
57 dutyPeriod(std::chrono::nanoseconds(0));
62 double dutyCycle()
const;
63 void dutyCycle(
double ratio);
64 std::chrono::nanoseconds
period()
const {
67 void period(
const std::chrono::nanoseconds &ns);
68 void frequency(
unsigned int hz);
69 unsigned int frequency()
const;
std::chrono::nanoseconds dutyPeriod() const
boost::error_info< struct Info_SysPwmPeriodNs, long > SysPwmPeriodNs
boost::error_info< struct Info_SysPwmChannel, int > SysPwmChannel
This is a Linux-only PWM driver that I need for my eclipse project.
boost::error_info< struct Info_SysPwmChip, int > SysPwmChip
boost::error_info< struct Info_SysPwmDutyNs, long > SysPwmDutyNs
std::chrono::nanoseconds dutyNs
std::chrono::nanoseconds periodNs
std::chrono::nanoseconds period() const