53 Pwm(
int pin,
bool owner =
true,
int chipid = -1)
62 throw std::invalid_argument(
"Error initialising PWM on pin");
76 Pwm(
void* pwm_context)
80 throw std::invalid_argument(
"Invalid PWM context");
Result
Definition: types.hpp:204
mraa_result_t mraa_pwm_period(mraa_pwm_context dev, float seconds)
Result period_ms(int ms)
Definition: pwm.hpp:135
mraa_pwm_context mraa_pwm_init(int pin)
Pulse Width Modulation module.
mraa_pwm_context mraa_pwm_init_raw(int chipid, int pin)
Result period(float period)
Definition: pwm.hpp:124
mraa_result_t mraa_pwm_period_ms(mraa_pwm_context dev, int ms)
int max_period()
Definition: pwm.hpp:201
int min_period()
Definition: pwm.hpp:211
Result period_us(int us)
Definition: pwm.hpp:146
int mraa_pwm_get_min_period(mraa_pwm_context dev)
mraa_result_t mraa_pwm_pulsewidth_ms(mraa_pwm_context dev, int ms)
mraa_result_t mraa_pwm_pulsewidth_us(mraa_pwm_context dev, int us)
mraa_result_t mraa_pwm_enable(mraa_pwm_context dev, int enable)
float mraa_pwm_read(mraa_pwm_context dev)
mraa_result_t mraa_pwm_period_us(mraa_pwm_context dev, int us)
mraa_result_t mraa_pwm_write(mraa_pwm_context dev, float percentage)
Result pulsewidth(float seconds)
Definition: pwm.hpp:157
Result write(float percentage)
Definition: pwm.hpp:100
int mraa_pwm_get_max_period(mraa_pwm_context dev)
float read()
Definition: pwm.hpp:113
mraa_result_t mraa_pwm_pulsewidth(mraa_pwm_context dev, float seconds)
Result pulsewidth_us(int us)
Definition: pwm.hpp:179
Pwm(int pin, bool owner=true, int chipid=-1)
Definition: pwm.hpp:53
Result pulsewidth_ms(int ms)
Definition: pwm.hpp:168
mraa_result_t mraa_pwm_close(mraa_pwm_context dev)
~Pwm()
Definition: pwm.hpp:86
Pwm(void *pwm_context)
Definition: pwm.hpp:76
Result enable(bool enable)
Definition: pwm.hpp:191
struct _pwm * mraa_pwm_context
Definition: pwm.h:49
mraa_result_t mraa_pwm_owner(mraa_pwm_context dev, mraa_boolean_t owner)
API to Pulse Width Modulation.
Definition: pwm.hpp:41