5#ifdef HAL_TIM_MODULE_ENABLED
21 STM32PWM(TIM_HandleTypeDef* htim, uint32_t channel,
bool complementary =
false);
27 ErrorCode
Enable()
override;
32 TIM_HandleTypeDef* htim_;
Abstract base class for PWM (Pulse Width Modulation) control. PWM(脉冲宽度调制)控制的抽象基类。
STM32 PWM 驱动实现 / STM32 PWM driver implementation.
ErrorCode SetConfig(Configuration config) override
Configures the PWM settings. 配置 PWM 参数。
ErrorCode Disable() override
Disables the PWM output. 禁用 PWM 输出。
STM32PWM(TIM_HandleTypeDef *htim, uint32_t channel, bool complementary=false)
构造 PWM 对象 / Construct PWM object
ErrorCode SetDutyCycle(float value) override
Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。
ErrorCode Enable() override
Enables the PWM output. 启用 PWM 输出。
Configuration parameters for PWM. PWM 配置参数。