mraa
2.0.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the PWM interface for libmraa
Public Member Functions | |
Pwm (int pin, bool owner=true, int chipid=-1) | |
Pwm (void *pwm_context) | |
~Pwm () | |
Result | write (float percentage) |
float | read () |
Result | period (float period) |
Result | period_ms (int ms) |
Result | period_us (int us) |
Result | pulsewidth (float seconds) |
Result | pulsewidth_ms (int ms) |
Result | pulsewidth_us (int us) |
Result | enable (bool enable) |
int | max_period () |
int | min_period () |
|
inline |
instanciates a PWM object on a pin
pin | the pin number used on your board |
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 |
chipid | the pwmchip to use, use only in raw mode |
|
inline |
Pwm constructor, takes a pointer to the PWM context and initialises the class
pwm_context | void * to a PWM context |
|
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 0%) and 1.0f Values above or below this range will be set at either 0.0f or 1.0f |
|
inline |
Read the output 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 represented 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 |
Get the maximum PWM period in us
|
inline |
Get the minimum PWM period in us