|
Open Model Railroad Network (OpenMRN)
|
Abstract interface for a PWM driver. More...
#include <PWM.hxx>
Public Member Functions | |
| virtual void | set_period (uint32_t counts)=0 |
| Set PWM period. | |
| virtual uint32_t | get_period ()=0 |
| Get PWM period. | |
| virtual void | set_duty (uint32_t counts)=0 |
| Sets the duty cycle. | |
| virtual uint32_t | get_duty ()=0 |
| Gets the duty cycle. | |
| void | set_duty_percent (uint8_t percent) |
| Sets the duty cycle. | |
| uint8_t | get_duty_percent () |
| Gets the duty cycle. | |
| virtual uint32_t | get_period_max ()=0 |
| Get max period supported. | |
| virtual uint32_t | get_period_min ()=0 |
| Get min period supported. | |
Protected Member Functions | |
| constexpr | PWM ()=default |
| Constructor. | |
| ~PWM ()=default | |
| Destructor. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (PWM) | |
|
protecteddefault |
Destructor.
This is protected, because only child classes should be allowed to destruct a PWM; but no implementation exists in order to make the the destructor trivial for C++. A trivial destructor is required for a constexpr class.
|
pure virtual |
Gets the duty cycle.
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.
|
inline |
|
pure virtual |
Get PWM period.
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.
|
pure virtual |
Get max period supported.
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.
|
pure virtual |
Get min period supported.
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.
|
pure virtual |
Sets the duty cycle.
| counts | duty cycle in counts |
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.
|
inline |
|
pure virtual |
Set PWM period.
| PWM | period in counts |
Implemented in PCA9685PWMBit, openmrn_arduino::Esp32Ledc::Channel, Stm32PWMGroup::Channel, TivaPWM, and LinuxPWM.