diff options
| author | Elvis Pfutzenreuter <epxx@epxx.co> | 2024-11-22 20:38:58 -0300 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-17 10:45:19 +1100 |
| commit | 2a3b9b0b4bed6ea51f1053e224278e9dbb266c35 (patch) | |
| tree | 7f87b28423868f94b5960202add77af51b8614d0 /docs/esp32 | |
| parent | 27544a2d81da5b0d804a932d98d680f121a22b8f (diff) | |
esp32/esp32_rmt: Update RMT module to use the new RMT API.
The current `esp32.RMT` class uses a legacy API from ESP-IDF 4.x. The
ESP-IDF 5.x offers a new API, which is overall better, and easier to
implement the RX side in the future. This commit updates the module and
the documentation, preserving the current MicroPython RMT API as much as
possible.
The bitstream RMT implementation was updated as well, since ESP-IDF does
not allow firmware to reference legacy and new APIs at the same time (it
resets right after boot with an error message, even if neither module is
imported).
The documentation is updated accordingly.
Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
Diffstat (limited to 'docs/esp32')
| -rw-r--r-- | docs/esp32/quickref.rst | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 25e52ec32..0cf7d81a7 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -837,9 +837,9 @@ The RMT is ESP32-specific and allows generation of accurate digital pulses with import esp32 from machine import Pin - r = esp32.RMT(0, pin=Pin(18), clock_div=8) - r # RMT(channel=0, pin=18, source_freq=80000000, clock_div=8) - # The channel resolution is 100ns (1/(source_freq/clock_div)). + r = esp32.RMT(pin=Pin(18), resolution_hz=10000000) + r # RMT(pin=18, source_freq=80000000, resolution_hz=10000000) + # The channel resolution is based on resolution_hz, i.e. 100ns for 10000000 r.write_pulses((1, 20, 2, 40), 0) # Send 0 for 100ns, 1 for 2000ns, 0 for 200ns, 1 for 4000ns The ESP32-C2 family does not include any RMT peripheral, so this class is @@ -903,8 +903,7 @@ The APA106 driver extends NeoPixel, but internally uses a different colour order ``NeoPixel`` object. For low-level driving of a NeoPixel see `machine.bitstream`. -This low-level driver uses an RMT channel by default. To configure this see -`RMT.bitstream_channel`. +This low-level driver uses an RMT channel by default. APA102 (DotStar) uses a different driver as it has an additional clock pin. |
