|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
PWM(脉冲宽度调制)控制的抽象基类。 Abstract base class for PWM (Pulse Width Modulation) control. More...
#include <pwm.hpp>
Classes | |
| struct | Configuration |
| PWM 配置参数 / Configuration parameters for PWM. More... | |
Public Member Functions | |
| virtual ErrorCode | SetDutyCycle (float value)=0 |
| 设置 PWM 信号的占空比 / Sets the duty cycle of the PWM signal. | |
| virtual ErrorCode | SetConfig (Configuration config)=0 |
| 配置 PWM 参数 / Configures the PWM settings. | |
| virtual ErrorCode | Enable ()=0 |
| 启用 PWM 输出 / Enables the PWM output. | |
| virtual ErrorCode | Disable ()=0 |
| 禁用 PWM 输出 / Disables the PWM output. | |
PWM(脉冲宽度调制)控制的抽象基类。 Abstract base class for PWM (Pulse Width Modulation) control.
|
pure virtual |
禁用 PWM 输出 / Disables the PWM output.
Implemented in LibXR::CH32PWM, LibXR::ESP32PWM, LibXR::HPMPWM, LibXR::MSPM0PWM, and LibXR::STM32PWM.
|
pure virtual |
启用 PWM 输出 / Enables the PWM output.
Implemented in LibXR::CH32PWM, LibXR::ESP32PWM, LibXR::HPMPWM, LibXR::MSPM0PWM, and LibXR::STM32PWM.
|
pure virtual |
配置 PWM 参数 / Configures the PWM settings.
Implemented in LibXR::CH32PWM, LibXR::ESP32PWM, LibXR::HPMPWM, LibXR::MSPM0PWM, and LibXR::STM32PWM.
|
pure virtual |
设置 PWM 信号的占空比 / Sets the duty cycle of the PWM signal.
| value | 占空比,浮点值(0.0 到 1.0)。 The duty cycle as a floating-point value (0.0 to 1.0). |
Implemented in LibXR::CH32PWM, LibXR::ESP32PWM, LibXR::HPMPWM, LibXR::MSPM0PWM, and LibXR::STM32PWM.