Merge branch 'bugfix/ledc_get_freq_calc' into 'master'
fix(ledc): fix ledc_get_freq calculation err due to overflow Closes IDF-11714, IDF-11762, IDFGH-14067, and IDFGH-14070 See merge request espressif/esp-idf!35451
This commit is contained in:
@@ -319,14 +319,13 @@ The LEDC API provides several ways to change the PWM frequency "on the fly":
|
||||
More Control Over PWM
|
||||
"""""""""""""""""""""
|
||||
|
||||
There are several lower level timer-specific functions that can be used to change PWM settings:
|
||||
There are several individual timer-specific functions that can be used to change PWM output:
|
||||
|
||||
* :cpp:func:`ledc_timer_set`
|
||||
* :cpp:func:`ledc_timer_rst`
|
||||
* :cpp:func:`ledc_timer_pause`
|
||||
* :cpp:func:`ledc_timer_resume`
|
||||
|
||||
The first two functions are called "behind the scenes" by :cpp:func:`ledc_channel_config` to provide a startup of a timer after it is configured.
|
||||
The first function is called "behind the scenes" by :cpp:func:`ledc_timer_config` to provide a startup of a timer after it is configured.
|
||||
|
||||
|
||||
Use Interrupts
|
||||
@@ -356,7 +355,7 @@ If signal output needs to be maintained in Light-sleep, then select :cpp:enumera
|
||||
LEDC High and Low Speed Mode
|
||||
----------------------------
|
||||
|
||||
High speed mode enables a glitch-free changeover of timer settings. This means that if the timer settings are modified, the changes will be applied automatically on the next overflow interrupt of the timer. In contrast, when updating the low-speed timer, the change of settings should be explicitly triggered by software. The LEDC driver handles it in the background, e.g., when :cpp:func:`ledc_timer_config` or :cpp:func:`ledc_timer_set` is called.
|
||||
High speed mode enables a glitch-free changeover of timer settings. This means that if the timer settings are modified, the changes will be applied automatically on the next overflow interrupt of the timer. In contrast, when updating the low-speed timer, the change of settings should be explicitly triggered by software. The LEDC driver handles it in the background, e.g., when :cpp:func:`ledc_timer_config` is called.
|
||||
|
||||
For additional details regarding speed modes, see **{IDF_TARGET_NAME} Technical Reference Manual** > **LED PWM Controller (LEDC)** [`PDF <{IDF_TARGET_TRM_EN_URL}#ledpwm>`__].
|
||||
|
||||
|
||||
@@ -319,14 +319,13 @@ LED PWM 控制器 API 有多种方式即时改变 PWM 频率:
|
||||
控制 PWM 的更多方式
|
||||
"""""""""""""""""""""
|
||||
|
||||
有一些较底层的定时器特定函数可用于更改 PWM 设置:
|
||||
有一些较独立的定时器特定函数可用于更改 PWM 输出:
|
||||
|
||||
* :cpp:func:`ledc_timer_set`
|
||||
* :cpp:func:`ledc_timer_rst`
|
||||
* :cpp:func:`ledc_timer_pause`
|
||||
* :cpp:func:`ledc_timer_resume`
|
||||
|
||||
前两个功能可通过函数 :cpp:func:`ledc_channel_config` 在后台运行,在定时器配置后启动。
|
||||
第一个定时器复位函数在函数 :cpp:func:`ledc_timer_config` 内部完成所有定时器配置后会被调用一次。
|
||||
|
||||
|
||||
使用中断
|
||||
@@ -356,7 +355,7 @@ LEDC 驱动不使用电源管理锁来防止系统进入 Light-sleep 。相反
|
||||
LED PWM 控制器高速和低速模式
|
||||
----------------------------------
|
||||
|
||||
高速模式的优点是可平稳地改变定时器设置。也就是说,高速模式下如定时器设置改变,此变更会自动应用于定时器的下一次溢出中断。而更新低速定时器时,设置变更应由软件显式触发。LED PWM 驱动的设置将在硬件层面被修改,比如在调用函数 :cpp:func:`ledc_timer_config` 或 :cpp:func:`ledc_timer_set` 时。
|
||||
高速模式的优点是可平稳地改变定时器设置。也就是说,高速模式下如定时器设置改变,此变更会自动应用于定时器的下一次溢出中断。而更新低速定时器时,设置变更应由软件显式触发。LED PWM 驱动的设置将在硬件层面被修改,比如在调用函数 :cpp:func:`ledc_timer_config` 时。
|
||||
|
||||
更多关于速度模式的详细信息请参阅 **{IDF_TARGET_NAME} 技术参考手册** > **LED PWM 控制器 (LEDC)** [`PDF <{IDF_TARGET_TRM_EN_URL}#ledpwm>`__]。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user