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 | |
synchronized void | delete () |
Pwm (int pin, boolean owner, int chipid) | |
Pwm (int pin, boolean owner) | |
Pwm (int pin) | |
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 (boolean enable) |
int | max_period () |
int | min_period () |
Pwm | ( | int | pin, |
boolean | owner, | ||
int | chipid | ||
) |
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 |
Pwm | ( | int | pin | ) |
Pwm constructor, takes a pointer to the PWM context and initialises the class
pwm_context | void * to a PWM context |
Result enable | ( | boolean | enable | ) |
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 |
int max_period | ( | ) |
Get the maximum PWM period in us
int min_period | ( | ) |
Get the minimum PWM period in us
Result period | ( | float | period | ) |
Set the PWM period as seconds represented in a float
period | Period represented as a float in seconds |
Result period_ms | ( | int | ms | ) |
Result period_us | ( | int | us | ) |
Result pulsewidth | ( | float | seconds | ) |
Set pulsewidth, as represented by seconds in a float
seconds | The duration of a pulse |
Result pulsewidth_ms | ( | int | ms | ) |
Result pulsewidth_us | ( | int | us | ) |
float read | ( | ) |
Read the output duty-cycle percentage, as a float
Result write | ( | float | percentage | ) |
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 |