|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
Classes | |
| struct | Resources |
Public Member Functions | |
| MSPM0PWM (Resources res) | |
| ErrorCode | SetDutyCycle (float value) |
| 设置 PWM 信号的占空比 / Sets the duty cycle of the PWM signal. | |
| ErrorCode | SetConfig (Configuration config) |
| 配置 PWM 参数 / Configures the PWM settings. | |
| ErrorCode | Enable () |
| 启用 PWM 输出 / Enables the PWM output. | |
| ErrorCode | Disable () |
| 禁用 PWM 输出 / Disables the PWM output. | |
Public Member Functions inherited from LibXR::PWM | |
Static Public Member Functions | |
| static uint32_t | SourceClockFromSysCfg (GPTIMER_Regs *timer, uint32_t timer_clock_hz) |
| 由 SysConfig 的定时器时钟反推源时钟 / Source clock from SysConfig's timer clock. | |
Definition at line 9 of file mspm0_pwm.hpp.
| MSPM0PWM::MSPM0PWM | ( | MSPM0PWM::Resources | res | ) |
Definition at line 9 of file mspm0_pwm.cpp.
|
virtual |
禁用 PWM 输出 / Disables the PWM output.
Implements LibXR::PWM.
Definition at line 120 of file mspm0_pwm.cpp.
|
virtual |
启用 PWM 输出 / Enables the PWM output.
Implements LibXR::PWM.
Definition at line 114 of file mspm0_pwm.cpp.
|
virtual |
配置 PWM 参数 / Configures the PWM settings.
Implements LibXR::PWM.
Definition at line 64 of file mspm0_pwm.cpp.
|
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). |
Implements LibXR::PWM.
Definition at line 16 of file mspm0_pwm.cpp.
|
static |
由 SysConfig 的定时器时钟反推源时钟 / Source clock from SysConfig's timer clock.
| timer | 定时器实例 / Timer instance. |
| timer_clock_hz | SysConfig 的 NAME_INST_CLK_FREQ(分频后)/ SysConfig's NAME_INST_CLK_FREQ (after the dividers). |
Definition at line 56 of file mspm0_pwm.cpp.