Skip to content

feat(LEDC): Adds the ability to set the clock source for the LEDC #10171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(ledc): Document ledc set and get clock source
  • Loading branch information
P-R-O-C-H-Y committed Aug 28, 2024
commit becf54bb622e72b211ee1bf5fd32ffdbe0400cf7
2 changes: 2 additions & 0 deletions cores/esp32/esp32-hal-ledc.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ ledc_clk_cfg_t ledcGetClockSource(void);

/**
* @brief Set the LEDC clock source.
*
* @param source LEDC clock source to set.
*
* @return true if LEDC clock source was successfully set, false otherwise.
*/
Expand Down
28 changes: 28 additions & 0 deletions docs/en/api/ledc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,34 @@ ESP32-H2 6
Arduino-ESP32 LEDC API
----------------------

ledcSetCLockSource
******************

This function is used to set the LEDC peripheral clock source. The default clock source is XTAL clock (``LEDC_USE_XTAL_CLK``) if supported by the SoC,
otherwise it is AUTO clock (``LEDC_AUTO_CLK``).

.. code-block:: arduino

bool ledcSetClockSource(ledc_clk_cfg_t source);

* ``source`` select the clock source for LEDC peripheral.

* ``LEDC_APB_CLK`` - APB clock.
* ``LEDC_REF_CLK`` - REF clock.

This function will return ``true`` if setting the clock source is successful, otherwise it will return ``false``.

ledcGetClockSource
******************

This function is used to get the LEDC peripheral clock source.

.. code-block:: arduino

ledc_clk_cfg_t ledcGetClockSource(void);

This function will return the clock source for the LEDC peripheral.

ledcAttach
**********

Expand Down
Loading