libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::PWM Class Referenceabstract

Abstract base class for PWM (Pulse Width Modulation) control. PWM(脉冲宽度调制)控制的抽象基类。 More...

#include <pwm.hpp>

Inheritance diagram for LibXR::PWM:
[legend]

Data Structures

struct  Configuration
 Configuration parameters for PWM. PWM 配置参数。 More...
 

Public Member Functions

virtual ErrorCode SetDutyCycle (float value)=0
 Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。
 
virtual ErrorCode SetConfig (Configuration config)=0
 Configures the PWM settings. 配置 PWM 参数。
 
virtual ErrorCode Enable ()=0
 Enables the PWM output. 启用 PWM 输出。
 
virtual ErrorCode Disable ()=0
 Disables the PWM output. 禁用 PWM 输出。
 

Detailed Description

Abstract base class for PWM (Pulse Width Modulation) control. PWM(脉冲宽度调制)控制的抽象基类。

Definition at line 13 of file pwm.hpp.

Member Function Documentation

◆ Disable()

virtual ErrorCode LibXR::PWM::Disable ( )
pure virtual

Disables the PWM output. 禁用 PWM 输出。

Returns
ErrorCode indicating success or failure. 返回操作结果的错误码。

Implemented in LibXR::ESP32PWM, and LibXR::STM32PWM.

◆ Enable()

virtual ErrorCode LibXR::PWM::Enable ( )
pure virtual

Enables the PWM output. 启用 PWM 输出。

Returns
ErrorCode indicating success or failure. 返回操作结果的错误码。

Implemented in LibXR::ESP32PWM, and LibXR::STM32PWM.

◆ SetConfig()

virtual ErrorCode LibXR::PWM::SetConfig ( Configuration config)
pure virtual

Configures the PWM settings. 配置 PWM 参数。

Parameters
configThe configuration structure containing PWM settings. 配置结构体,包含 PWM 设置。
Returns
ErrorCode indicating success or failure. 返回操作结果的错误码。

Implemented in LibXR::ESP32PWM, and LibXR::STM32PWM.

◆ SetDutyCycle()

virtual ErrorCode LibXR::PWM::SetDutyCycle ( float value)
pure virtual

Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。

Parameters
valueThe duty cycle as a floating-point value (0.0 to 1.0). 占空比,浮点值(0.0 到 1.0)。
Returns
ErrorCode indicating success or failure. 返回操作结果的错误码。

Implemented in LibXR::ESP32PWM, and LibXR::STM32PWM.


The documentation for this class was generated from the following file: