#include <pas-co2-pwm-sw.hpp>
◆ Mode_t
Measuring Mode.
Enumerator |
---|
MODE_POLLING | PWM Polling Mode
|
MODE_INTERRUPT | PWM Interrupt Mode
|
◆ PWMSW()
PAS CO2 Software PWM Constructor.
- Parameters
-
[in] | *pwmIn | Input GPIO instance reading the PWM sensor signal |
[in] | *timer | Timer instance |
- Precondition
- None
◆ ~PWMSW()
PAS CO2 Software PWM Destructor.
- Precondition
- None
◆ init()
Initializes the PWM.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implements pasco2::PWM.
◆ deinit()
Deinitializes the PWM.
- Returns
- PAS CO2 error code
- Return values
-
OK | if success |
INTF_ERROR | if error |
Implements pasco2::PWM.
◆ getDuty()
Error_t PWMSW::getDuty |
( |
double & |
duty | ) |
|
|
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 |
Implements pasco2::PWM.
◆ callback()
◆ int0Handler()
void PWMSW::int0Handler |
( |
| ) |
|
|
staticprotected |
◆ int1Handler()
void PWMSW::int1Handler |
( |
| ) |
|
|
staticprotected |
◆ int2Handler()
void PWMSW::int2Handler |
( |
| ) |
|
|
staticprotected |
◆ int3Handler()
void PWMSW::int3Handler |
( |
| ) |
|
|
staticprotected |
◆ isrRegister()
void * PWMSW::isrRegister |
( |
PWMSW * |
objPtr | ) |
|
|
staticprotected |
Register a hardware interrupt for the PWMSW object passed by argument.
- Parameters
-
[in] | *objPtr | PWMSW object pointer |
- Returns
- Pointer to allocate the interrupt function handler
The documentation for this class was generated from the following files: