mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-15 15:00:02 +01:00
fix(ledc): fix ledc driver 100% duty cycle configuration
Update ledc duty cycle value range in doxygen. Fix duty configuration error at 100% duty cycle for ESP32. Improve LEDC API doxygen. Closes https://github.com/espressif/esp-idf/pull/11516 Closes https://github.com/espressif/esp-idf/issues/12593 Closes https://github.com/espressif/esp-idf/issues/12083
This commit is contained in:
@@ -215,7 +215,13 @@ To set the duty cycle, use the dedicated function :cpp:func:`ledc_set_duty`. Aft
|
||||
|
||||
Another way to set the duty cycle, as well as some other channel parameters, is by calling :cpp:func:`ledc_channel_config` covered in Section :ref:`ledc-api-configure-channel`.
|
||||
|
||||
The range of the duty cycle values passed to functions depends on selected ``duty_resolution`` and should be from ``0`` to ``(2 ** duty_resolution) - 1``. For example, if the selected duty resolution is 10, then the duty cycle values can range from 0 to 1023. This provides the resolution of ~0.1%.
|
||||
The range of the duty cycle values passed to functions depends on selected ``duty_resolution`` and should be from ``0`` to ``(2 ** duty_resolution)``. For example, if the selected duty resolution is 10, then the duty cycle values can range from 0 to 1024. This provides the resolution of ~ 0.1%.
|
||||
|
||||
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3 or esp32c2 or esp32h2
|
||||
|
||||
.. warning::
|
||||
|
||||
On {IDF_TARGET_NAME}, when channel's binded timer selects its maximum duty resolution, the duty cycle value cannot be set to ``(2 ** duty_resolution)``. Otherwise, the internal duty counter in the hardware will overflow and be messed up.
|
||||
|
||||
|
||||
Change PWM Duty Cycle using Hardware
|
||||
|
||||
Reference in New Issue
Block a user