Skip to content

Commit becf54b

Browse files
committed
docs(ledc): Document ledc set and get clock source
1 parent 90a0d51 commit becf54b

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

cores/esp32/esp32-hal-ledc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ ledc_clk_cfg_t ledcGetClockSource(void);
6767

6868
/**
6969
* @brief Set the LEDC clock source.
70+
*
71+
* @param source LEDC clock source to set.
7072
*
7173
* @return true if LEDC clock source was successfully set, false otherwise.
7274
*/

docs/en/api/ledc.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,34 @@ ESP32-H2 6
2323
Arduino-ESP32 LEDC API
2424
----------------------
2525

26+
ledcSetCLockSource
27+
******************
28+
29+
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,
30+
otherwise it is AUTO clock (``LEDC_AUTO_CLK``).
31+
32+
.. code-block:: arduino
33+
34+
bool ledcSetClockSource(ledc_clk_cfg_t source);
35+
36+
* ``source`` select the clock source for LEDC peripheral.
37+
38+
* ``LEDC_APB_CLK`` - APB clock.
39+
* ``LEDC_REF_CLK`` - REF clock.
40+
41+
This function will return ``true`` if setting the clock source is successful, otherwise it will return ``false``.
42+
43+
ledcGetClockSource
44+
******************
45+
46+
This function is used to get the LEDC peripheral clock source.
47+
48+
.. code-block:: arduino
49+
50+
ledc_clk_cfg_t ledcGetClockSource(void);
51+
52+
This function will return the clock source for the LEDC peripheral.
53+
2654
ledcAttach
2755
**********
2856

0 commit comments

Comments
 (0)