#include <pas-co2-pal-pwm.hpp>
◆ init()
virtual Error_t pasco2::PWM::init |
( |
| ) |
|
|
pure virtual |
Initializes the PWM.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::PWMSW.
◆ deinit()
virtual Error_t pasco2::PWM::deinit |
( |
| ) |
|
|
pure virtual |
Deinitializes the PWM.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::PWMSW.
◆ getDuty()
virtual Error_t pasco2::PWM::getDuty |
( |
double & |
duty | ) |
|
|
pure virtual |
Gets the PWM input duty cycle in percentage.
The duty will return 0.00 if no duty is read (e.g. polling mode). In case of error, the duty value will be -1.00, and the function will return the corresponding return code for diagnosis.
- Note
- The read out of PWM pulses needs to be synched with the incoming PWM signals. This synchronization needs to be handled in the PAL.
- Parameters
-
[out] | duty | PWM input duty cycle value from PWM single or train pulse average (00.00 % to 100.00 %) |
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implemented in pasco2::PWMSW.
The documentation for this class was generated from the following file: