|
libxr
1.0
Want to be the best embedded framework
|
ESP32 PWM 驱动实现 / ESP32 PWM driver implementation. More...
#include <esp_pwm.hpp>
Public Member Functions | |
| ESP32PWM (int gpio_num, ledc_channel_t channel, ledc_timer_t timer=LEDC_TIMER_0, ledc_timer_bit_t resolution=static_cast< ledc_timer_bit_t >((static_cast< uint8_t >(LEDC_TIMER_BIT_MAX) - 1))) | |
| 构造 PWM 通道对象 / Construct PWM channel object | |
| ErrorCode | SetDutyCycle (float value) override |
| Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。 | |
| ErrorCode | SetConfig (Configuration config) override |
| Configures the PWM settings. 配置 PWM 参数。 | |
| ErrorCode | Enable () override |
| Enables the PWM output. 启用 PWM 输出。 | |
| ErrorCode | Disable () override |
| Disables the PWM output. 禁用 PWM 输出。 | |
Public Member Functions inherited from LibXR::PWM | |
Private Attributes | |
| int | gpio_num_ |
| ledc_channel_t | channel_ |
| ledc_timer_t | timer_ |
| ledc_timer_bit_t | resolution_ |
| uint32_t | max_duty_ |
ESP32 PWM 驱动实现 / ESP32 PWM driver implementation.
Definition at line 13 of file esp_pwm.hpp.
|
inline |
构造 PWM 通道对象 / Construct PWM channel object
| gpio_num | GPIO 编号 / GPIO number |
| channel | LEDC 通道 / LEDC channel |
| timer | LEDC 定时器 / LEDC timer |
| resolution | 占空比分辨率 / Duty resolution |
Definition at line 24 of file esp_pwm.hpp.
|
inlineoverridevirtual |
Disables the PWM output. 禁用 PWM 输出。
Implements LibXR::PWM.
Definition at line 95 of file esp_pwm.hpp.
|
inlineoverridevirtual |
Enables the PWM output. 启用 PWM 输出。
Implements LibXR::PWM.
Definition at line 89 of file esp_pwm.hpp.
|
inlineoverridevirtual |
Configures the PWM settings. 配置 PWM 参数。
Implements LibXR::PWM.
Definition at line 68 of file esp_pwm.hpp.
|
inlineoverridevirtual |
Sets the duty cycle of the PWM signal. 设置 PWM 信号的占空比。
| value | The duty cycle as a floating-point value (0.0 to 1.0). 占空比,浮点值(0.0 到 1.0)。 |
Implements LibXR::PWM.
Definition at line 49 of file esp_pwm.hpp.
|
private |
Definition at line 103 of file esp_pwm.hpp.
|
private |
Definition at line 102 of file esp_pwm.hpp.
|
private |
Definition at line 106 of file esp_pwm.hpp.
|
private |
Definition at line 105 of file esp_pwm.hpp.
|
private |
Definition at line 104 of file esp_pwm.hpp.