The PWM object controls PWM output of the DHCOM module. The class is virtualized to enable many mockups when testing. The class does not provide exclusive control of the PWM avoid instantiating it several times (in the tests it is allowed, though).
More...
#include <pwm.h>
|
virtual bool | setDivisorAndLimit (unsigned int divisor, unsigned int limit) |
| setting the frequency divisor of the PWM and the counting limit.
|
|
virtual bool | setComparisonValue (unsigned int value) |
| setting the comparison value of the PWM.
|
|
virtual void | enable (bool enabled) |
| Enabling or disabling the PWM output.
|
|
The PWM object controls PWM output of the DHCOM module. The class is virtualized to enable many mockups when testing. The class does not provide exclusive control of the PWM avoid instantiating it several times (in the tests it is allowed, though).
void PWM::enable |
( |
bool |
enabled | ) |
|
|
virtual |
Enabling or disabling the PWM output.
- Parameters
-
enabled | - if true the output is enabled. |
bool PWM::setComparisonValue |
( |
unsigned int |
value | ) |
|
|
virtual |
setting the comparison value of the PWM.
- Parameters
-
value | - the value, which must lie between 0 and the counter limit. |
- Returns
- true - the value is accepted and set. The value directly influences the PWM pulse width.
bool PWM::setDivisorAndLimit |
( |
unsigned int |
divisor, |
|
|
unsigned int |
limit |
|
) |
| |
|
virtual |
setting the frequency divisor of the PWM and the counting limit.
- Parameters
-
divisor | - the value of the divisor |
limit | - the counted value after which the counter is reset |
- Returns
- - true if the parameters are valid, and enabled. Both parameters directly control the frequency of the PWM output.
The documentation for this class was generated from the following file: