mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 11:03:11 +00:00
Merge branch 'feature/esp32s31_ledc_support' into 'master'
feat(ledc): add support for ESP32S31 Closes IDF-14709 and IDF-14710 See merge request espressif/esp-idf!47267
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
LED Control (LEDC)
|
||||
==================
|
||||
|
||||
{IDF_TARGET_LEDC_MAX_FADE_RANGE_NUM: default="1", esp32c6="16", esp32h2="16", esp32p4="16", esp32c5="16", esp32c61="16", esp32h21="16"}
|
||||
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
Introduction
|
||||
@@ -169,7 +167,7 @@ The source clock can also limit the PWM frequency. The higher the source clock f
|
||||
- 48 MHz
|
||||
- Dynamic Frequency Scaling compatible
|
||||
|
||||
.. only:: esp32c6 or esp32c61 or esp32p4
|
||||
.. only:: esp32c6 or esp32c61 or esp32p4 or esp32s31
|
||||
|
||||
.. list-table:: Characteristics of {IDF_TARGET_NAME} LEDC source clocks
|
||||
:widths: 15 15 30
|
||||
@@ -314,7 +312,7 @@ The LEDC hardware provides the means to gradually transition from one duty cycle
|
||||
|
||||
.. only:: SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED
|
||||
|
||||
On {IDF_TARGET_NAME}, the hardware additionally allows to perform up to {IDF_TARGET_LEDC_MAX_FADE_RANGE_NUM} consecutive linear fades without CPU intervention. This feature can be useful if you want to do a fade with gamma correction.
|
||||
On {IDF_TARGET_NAME}, the hardware additionally allows to perform consecutive linear fades without CPU intervention. This feature can be useful if you want to do a fade with gamma correction.
|
||||
|
||||
The luminance perceived by human eyes does not have a linear relationship with the PWM duty cycle. In order to make human feel the LED is dimming or lighting linearly, the change in duty cycle should be non-linear, which is the so-called gamma correction. The LED controller can simulate a gamma curve fading by piecewise linear approximation. :cpp:func:`ledc_fill_multi_fade_param_list` is a function that can help to construct the parameters for the piecewise linear fades. First, you need to allocate a memory block for saving the fade parameters, then by providing start/end PWM duty cycle values, gamma correction function, and the total number of desired linear segments to the helper function, it will fill the calculation results into the allocated space. You can also construct the array of :cpp:type:`ledc_fade_param_config_t` manually. Once the fade parameter structs are prepared, a consecutive fading can be configured by passing the pointer to the prepared :cpp:type:`ledc_fade_param_config_t` list and the total number of fade ranges to :cpp:func:`ledc_set_multi_fade`.
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
LED PWM 控制器
|
||||
==============
|
||||
|
||||
{IDF_TARGET_LEDC_MAX_FADE_RANGE_NUM: default="1", esp32c6="16", esp32h2="16", esp32p4="16", esp32c5="16", esp32c61="16", esp32h21="16"}
|
||||
|
||||
:link_to_translation:`en:[English]`
|
||||
|
||||
概述
|
||||
@@ -169,7 +167,7 @@ LED PWM 控制器可在无需 CPU 干预的情况下自动改变占空比,实
|
||||
- 48 MHz
|
||||
- 支持动态调频 (DFS) 功能
|
||||
|
||||
.. only:: esp32c6 or esp32c61 or esp32p4
|
||||
.. only:: esp32c6 or esp32c61 or esp32p4 or esp32s31
|
||||
|
||||
.. list-table:: {IDF_TARGET_NAME} LEDC 时钟源特性
|
||||
:widths: 10 10 30
|
||||
@@ -314,7 +312,7 @@ LED PWM 控制器硬件可逐渐改变占空比的数值。要使用此功能,
|
||||
|
||||
.. only:: SOC_LEDC_GAMMA_CURVE_FADE_SUPPORTED
|
||||
|
||||
{IDF_TARGET_NAME} 的硬件额外支持多达 {IDF_TARGET_LEDC_MAX_FADE_RANGE_NUM} 次,无需 CPU 介入的连续渐变。此功能可以更加有效便捷得实现一个带伽马校正的渐变。
|
||||
{IDF_TARGET_NAME} 的硬件额外支持无需 CPU 介入的连续渐变。此功能可以更加有效便捷得实现一个带伽马校正的渐变。
|
||||
|
||||
众所周知,人眼所感知的亮度与 PWM 占空比并非成线性关系。为了能使人感观上认为一盏灯明暗的变化是线性的,我们对其 PWM 信号的占空比控制必须为非线性的,俗称伽马校正。LED PWM 控制器可以通过多段线型拟合来模仿伽马曲线渐变。 你需要自己在应用程序中分配一段用以保存渐变参数的内存块,并提供开始和结束的占空比,伽马校正公式,以及期望的线性渐变段数信息,:cpp:func:`ledc_fill_multi_fade_param_list` 就能快速生成所有分段线性渐变的参数。或者你也可以自己直接构造一个 :cpp:type:`ledc_fade_param_config_t` 的数组。在获得所有渐变参数后,通过将 :cpp:type:`ledc_fade_param_config_t` 数组的指针和渐变区间数传入 :cpp:func:`ledc_set_multi_fade`,一次连续渐变的配置就完成了。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user