diff options
| author | Mark Blakeney <mark.blakeney@bullet-systems.net> | 2023-10-31 14:24:43 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-11-09 13:51:52 +1100 |
| commit | 2888c5b23057b056bdeed6fcd2af414ddf2ef0c4 (patch) | |
| tree | 4d06e3d5db998665383c82af927cf78645007925 /docs/library/esp32.rst | |
| parent | fbb7c32040c407a60126a879dc2afe07a0ef6e5d (diff) | |
esp32/esp32_rmt: Add RMT.PULSE_MAX constant.
If you have a variable frequency and pulse width, and you want to optimize
pulse resolution, then you must do a calculation beforehand to ensure you
normalize the array to keep all list values within bound. That calculation
requires RMT.source_freq(), RMT.clock_div(), and this 32767 constant.
Signed-off-by: Mark Blakeney <mark.blakeney@bullet-systems.net>
Diffstat (limited to 'docs/library/esp32.rst')
| -rw-r--r-- | docs/library/esp32.rst | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/docs/library/esp32.rst b/docs/library/esp32.rst index 796dbbbc5..422329bf1 100644 --- a/docs/library/esp32.rst +++ b/docs/library/esp32.rst @@ -193,7 +193,7 @@ numbers specified in ``write_pulses`` are multiplied by the resolution to define the pulses. ``clock_div`` is an 8-bit divider (0-255) and each pulse can be defined by -multiplying the resolution by a 15-bit (0-32,768) number. There are eight +multiplying the resolution by a 15-bit (1-``PULSE_MAX``) number. There are eight channels (0-7) and each can have a different clock divider. So, in the example above, the 80MHz clock is divided by 8. Thus the @@ -264,10 +264,10 @@ For more details see Espressif's `ESP-IDF RMT documentation. **Mode 3:** *duration* and *data* are lists or tuples of equal length, specifying individual durations and the output level for each. - Durations are in integer units of the channel resolution (as described - above), between 1 and 32767 units. Output levels are any value that can - be converted to a boolean, with ``True`` representing high voltage and - ``False`` representing low. + Durations are in integer units of the channel resolution (as + described above), between 1 and ``PULSE_MAX`` units. Output levels + are any value that can be converted to a boolean, with ``True`` + representing high voltage and ``False`` representing low. If transmission of an earlier sequence is in progress then this method will block until that transmission is complete before beginning the new sequence. @@ -290,6 +290,13 @@ For more details see Espressif's `ESP-IDF RMT documentation. Passing in no argument will not change the channel. This function returns the current channel number. +Constants +--------- + +.. data:: RMT.PULSE_MAX + + Maximum integer that can be set for a pulse duration. + Ultra-Low-Power co-processor ---------------------------- |
