mraa
0.4.5
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the PWM interface for libmraa
Public Member Functions | |
Pwm (int pin, int chipid=-1, bool owner=true) | |
~Pwm () | |
mraa_result_t | write (float percentage) |
float | read () |
mraa_result_t | period (float period) |
mraa_result_t | period_ms (int ms) |
mraa_result_t | period_us (int us) |
mraa_result_t | pulsewidth (float seconds) |
mraa_result_t | pulsewidth_ms (int ms) |
mraa_result_t | pulsewidth_us (int us) |
mraa_result_t | enable (bool enable) |
mraa_result_t | config_ms (int period, float duty) |
mraa_result_t | config_percent (int period, float duty) |
|
inline |
instanciates a PWM object on a pin
pin | the pin number used on your board |
chipid | the pwmchip to use, use only in raw mode |
owner | if you are the owner of the pin the destructor will unexport the pin from sysfs, default behaviour is you are the owner if the pinmapper exported it |
|
inline |
Set the output duty-cycle percentage, as a float
percentage | A floating-point value representing percentage of output. The value should lie between 0.0f (representing on 0%) and 1.0f Values above or below this range will be set at either 0.0f or 1.0f |
|
inline |
Read the ouput duty-cycle percentage, as a float
|
inline |
Set the PWM period as seconds represented in a float
period | Period represented as a float in seconds |
|
inline |
Set period, milliseconds
ms | milliseconds for period |
|
inline |
Set period, microseconds
us | microseconds as period |
|
inline |
Set pulsewidth, As represnted by seconds in a (float)
seconds | The duration of a pulse |
|
inline |
Set pulsewidth, milliseconds
ms | milliseconds for pulsewidth |
|
inline |
The pulsewidth, microseconds
us | microseconds for pulsewidth |
|
inline |
Set the enable status of the PWM pin. None zero will assume on with output being driven and 0 will disable the output
enable | enable status of pin |
|
inline |
Set the period and duty of a PWM object.
period | represented in ms. |
duty | represnted in ms as float. |
|
inline |
Set the period and duty (percent) of a PWM object.
period | as represented in ms. |
duty | percentage i.e. 50% = 0.5f |