libxr 1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
pwm.hpp
1#pragma once
2
3#include "libxr.hpp"
4
5namespace LibXR
6{
7
13class PWM
14{
15 public:
16 PWM() = default;
17
22 typedef struct
23 {
26
33 virtual ErrorCode SetDutyCycle(float value) = 0;
34
41 virtual ErrorCode SetConfig(Configuration config) = 0;
42
47 virtual ErrorCode Enable() = 0;
48
53 virtual ErrorCode Disable() = 0;
54};
55
56} // namespace LibXR
Abstract base class for PWM (Pulse Width Modulation) control. PWM(脉冲宽度调制)控制的抽象基类。
Definition pwm.hpp:14
virtual ErrorCode SetDutyCycle(float value)=0
Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。
virtual ErrorCode Disable()=0
Disables the PWM output. 禁用 PWM 输出。
virtual ErrorCode Enable()=0
Enables the PWM output. 启用 PWM 输出。
virtual ErrorCode SetConfig(Configuration config)=0
Configures the PWM settings. 配置 PWM 参数。
LibXR Color Control Library / LibXR终端颜色控制库
Definition esp_gpio.hpp:8
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值
Configuration parameters for PWM. PWM 配置参数。
Definition pwm.hpp:23
uint32_t frequency
PWM signal frequency in Hz. PWM 信号的频率(Hz)。
Definition pwm.hpp:24