drivers: Remove high speed mode from LEDC docs for ESP32-S2, update headers to match

This commit is contained in:
Angus Gratton
2020-02-10 10:33:27 +11:00
committed by Angus Gratton
parent 966f4227ad
commit ea34f3bb27
3 changed files with 44 additions and 31 deletions

View File

@@ -10,11 +10,11 @@ Introduction
The LED control (LEDC) peripheral is primarily designed to control the intensity of LEDs, although it can also be used to generate PWM signals for other purposes as well. It has 16 channels which can generate independent waveforms that can be used, for example, to drive RGB LED devices.
A half of LEDC's channels operate in high speed mode. This mode is implemented in hardware and offers automatic and glitch-free changing of the PWM duty cycle. The other half of channels operate in low speed mode, where the moment of change depends on the application software. Each group of channels is also able to use different clock sources, but this feature is not yet supported in the LEDC driver.
LEDC channels are divided into two groups of 8 channels each. One group of LEDC channels operates in high speed mode. This mode is implemented in hardware and offers automatic and glitch-free changing of the PWM duty cycle. The other group of channels operate in low speed mode, the PWM duty cycle must be changed by the driver in software. Each group of channels is also able to use different clock sources.
.. only:: esp32s2
A half of LEDC's channels operate in high speed mode. This mode is implemented in hardware and offers automatic and glitch-free changing of the PWM duty cycle. The other half of channels operate in low speed mode, where the moment of change depends on the application software. Each group of channels is also able to use different clock sources.
The LED control (LEDC) peripheral is primarily designed to control the intensity of LEDs, although it can also be used to generate PWM signals for other purposes as well. It has 8 channels which can generate independent waveforms that can be used, for example, to drive RGB LED devices.
The PWM controller can automatically increase or decrease the duty cycle gradually, allowing for fades without any processor interference.
@@ -22,7 +22,14 @@ The PWM controller can automatically increase or decrease the duty cycle gradual
Functionality Overview
----------------------
Getting LEDC to work on a specific channel in either :ref:`high or low speed mode <ledc-api-high_low_speed_mode>` is done in three steps:
.. only:: esp32
Getting LEDC to work on a specific channel in either :ref:`high or low speed mode <ledc-api-high_low_speed_mode>` is done in three steps:
.. only:: esp32s2
Getting LEDC to work on a specific channel is done in three steps. Note that unlike ESP32, ESP32-S2 only supports configuring channels in "low speed" mode.
1. :ref:`ledc-api-configure-timer` by specifying the PWM signal's frequency and duty cycle resolution.
2. :ref:`ledc-api-configure-channel` by associating it with the timer and GPIO to output the PWM signal.
@@ -45,8 +52,17 @@ Configure Timer
Setting the timer is done by calling the function :cpp:func:`ledc_timer_config` and passing to it a data structure :cpp:type:`ledc_timer_config_t` that contains the following configuration settings:
- Timer number :cpp:type:`ledc_timer_t`
.. only:: esp32
- Speed mode :cpp:type:`ledc_mode_t`
- Timer number :cpp:type:`ledc_timer_t`
- PWM signal frequency
- Resolution of PWM duty
.. only:: esp32s2
- Speed mode (value must be ``LEDC_LOW_SPEED_MODE``)
- Timer number :cpp:type:`ledc_timer_t`
- PWM signal frequency
- Resolution of PWM duty
@@ -139,10 +155,7 @@ LEDC High and Low Speed Mode
.. only:: esp32
The advantage of high speed mode is glitch-free changeover of the 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.
The advantage of high speed mode is hardware-supported, glitch-free changeover of the 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.
The advantage of high speed mode is glitch-free changeover of the 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.
For additional details regarding speed modes, refer to `{IDF_TARGET_NAME} Technical Reference Manual <{IDF_TARGET_TRM_EN_URL}>`_ (PDF). Please note that the support for ``SLOW_CLOCK`` mentioned in this manual is not yet supported in the LEDC driver.
@@ -150,7 +163,7 @@ The advantage of high speed mode is glitch-free changeover of the timer settings
.. note::
All the timers and channels in the {IDF_TARGET_NAME}'s LED PWM Controller only support low speed mode.
All the timers and channels in the {IDF_TARGET_NAME}'s LED PWM Controller only support low speed mode. Any change of PWM settings must be explicitly triggered by software.
.. _ledc-api-supported-range-frequency-duty-resolution: