DHCOM_HAL
Hardware-abstraction library (HAL) for multiple targets, including DHCOM modules
 All Data Structures Files Functions Enumerations Macros Groups
Public Member Functions
PWM Class Reference

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>

Public Member Functions

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.
 

Detailed Description

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).

Member Function Documentation

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: