Skip to content

Commit 481d392

Browse files
authored
feat(ledc): Specify maximum duty value for LEDC functions
Added maximum value constraints for duty parameters in LEDC functions.
1 parent 5b29c68 commit 481d392

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/en/api/ledc.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ This function is used to set duty for the LEDC pin.
100100
bool ledcWrite(uint8_t pin, uint32_t duty);
101101
102102
* ``pin`` select LEDC pin.
103-
* ``duty`` select duty to be set for selected LEDC pin.
103+
* ``duty`` select duty to be set for selected LEDC pin. Maximum value is 2 ^ ``resolution`` (number of bits).
104104

105105
This function will return ``true`` if setting duty is successful.
106106
If ``false`` is returned, error occurs and duty was not set.
@@ -115,7 +115,7 @@ This function is used to set duty for the LEDC channel.
115115
bool ledcWriteChannel(uint8_t channel, uint32_t duty);
116116
117117
* ``channel`` select LEDC channel.
118-
* ``duty`` select duty to be set for selected LEDC channel.
118+
* ``duty`` select duty to be set for selected LEDC channel. Maximum value is 2 ^ ``resolution`` (number of bits).
119119

120120
This function will return ``true`` if setting duty is successful.
121121
If ``false`` is returned, error occurs and duty was not set.
@@ -240,8 +240,8 @@ This function is used to setup and start fade for the LEDC pin.
240240
bool ledcFade(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms);
241241
242242
* ``pin`` select LEDC pin.
243-
* ``start_duty`` select starting duty of fade.
244-
* ``target_duty`` select target duty of fade.
243+
* ``start_duty`` select starting duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
244+
* ``target_duty`` select target duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
245245
* ``max_fade_time_ms`` select maximum time for fade.
246246

247247
This function will return ``true`` if configuration is successful.
@@ -257,8 +257,8 @@ This function is used to setup and start fade for the LEDC pin with interrupt.
257257
bool ledcFadeWithInterrupt(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void));
258258
259259
* ``pin`` select LEDC pin.
260-
* ``start_duty`` select starting duty of fade.
261-
* ``target_duty`` select target duty of fade.
260+
* ``start_duty`` select starting duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
261+
* ``target_duty`` select target duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
262262
* ``max_fade_time_ms`` select maximum time for fade.
263263
* ``userFunc`` function to be called when interrupt is triggered.
264264

@@ -275,8 +275,8 @@ This function is used to setup and start fade for the LEDC pin with interrupt us
275275
bool ledcFadeWithInterruptArg(uint8_t pin, uint32_t start_duty, uint32_t target_duty, int max_fade_time_ms, void (*userFunc)(void*), void * arg);
276276
277277
* ``pin`` select LEDC pin.
278-
* ``start_duty`` select starting duty of fade.
279-
* ``target_duty`` select target duty of fade.
278+
* ``start_duty`` select starting duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
279+
* ``target_duty`` select target duty of fade. Maximum value is 2 ^ ``resolution`` (number of bits).
280280
* ``max_fade_time_ms`` select maximum time for fade.
281281
* ``userFunc`` function to be called when interrupt is triggered.
282282
* ``arg`` pointer to the interrupt arguments.

0 commit comments

Comments
 (0)