RFC: Add RMT RX module. by elvis-epx · Pull Request #18454 · micropython/micropython · GitHub
Skip to content

RFC: Add RMT RX module. - #18454

Open
elvis-epx wants to merge 5 commits into
micropython:masterfrom
elvis-epx:rmtrx
Open

elvis-epx wants to merge 5 commits into
micropython:masterfrom
elvis-epx:rmtrx

Conversation

@elvis-epx

Copy link
Copy Markdown
Contributor

Summary

This is a proposal to add RX support to esp32 RMT, that currently supports TX only.

Testing

Tested on ESP32, ESP32-S3, ESP32-C3 and ESP32-C6 boards.

Trade-offs and Alternatives

A different class esp32.RMTRX was introduced. I feel it does not have much in common with esp32.RMT, and using TX and RX at the same time over the same pin is not usual in RMT. But someone may disagree.

@elvis-epx
elvis-epx force-pushed the rmtrx branch 2 times, most recently from 078969b to 84d4181 Compare November 21, 2025 15:27
This was referenced Dec 9, 2025
@projectgus
projectgus self-requested a review December 17, 2025 04:53

@projectgus projectgus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this PR, @elvis-epx. I think this will be a really useful feature to have in MicroPython.

I've left some comments, mostly minor style and nitpicky things. The main high-level question I have is about the software filtering features.

The other thing that would be great to have here would a test, in tests/ports/esp32. It would be new as we also don't have a test for RMT TX ( 😢 ) but you could use the same loopback wiring pattern from tests/target_wiring/esp32.py to connect two GPIOs and then measure output from one via RMTRX. Would you be up for implementing something like this?

Comment thread docs/library/esp32.rst Outdated
Comment thread ports/esp32/esp32_rmtrx.c Outdated
Comment thread ports/esp32/esp32_rmtrx.c Outdated
Comment thread docs/library/esp32.rst Outdated
Comment thread docs/library/esp32.rst Outdated
Comment thread docs/library/esp32.rst Outdated
Comment thread docs/library/esp32.rst Outdated
Comment thread docs/library/esp32.rst
Comment thread docs/library/esp32.rst
Comment thread docs/library/esp32.rst Outdated
@elvis-epx

Copy link
Copy Markdown
Contributor Author

@github-actions

github-actions Bot commented Jan 21, 2026

Copy link
Copy Markdown

Code size report:

Reference:  zephyr: Add support for RISC-V RV32IMC native code emitter. [9721955]
Comparison: esp32: Add RMT simple test. [merge of 2a4ec5c]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32: +5932 +0.340% ESP32_GENERIC[incl +1440(data)]
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

elvis-epx and others added 4 commits January 26, 2026 16:33
Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
Small fixes and style changes in RMT RX documentation.

Co-authored-by: Angus Gratton <gus@projectgus.com>
Signed-off-by: Elvis Pfützenreuter <elvis.pfutzenreuter@gmail.com>
Align the code style to esp32_rmt.c.

Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
Add comment to clarify where the 15-bit value comes from.

Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
@codecov

codecov Bot commented Jan 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.42%. Comparing base (25b400f) to head (2a4ec5c).
⚠️ Report is 77 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18454      +/-   ##
==========================================
+ Coverage   98.38%   98.42%   +0.04%     
==========================================
  Files         171      174       +3     
  Lines       22299    22333      +34     
==========================================
+ Hits        21938    21982      +44     
+ Misses        361      351      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elvis-epx

Copy link
Copy Markdown
Contributor Author

@projectgus projectgus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @elvis-epx,

I have one minor suggestion but the new test looks great, thank you! 😁

The only other request I have is to please name the new test esp32_rmt.py instead of check_rmt.py, that's the (rough) convention we use for the other tests.

Comment thread tests/target_wiring/esp32.py Outdated
@projectgus projectgus added this to the release-1.28.0 milestone Feb 3, 2026
Add simple end-to-end test for RMT RX, and TX.

Signed-off-by: Elvis Pfutzenreuter <elvis.pfutzenreuter@gmail.com>
ChrisDick pushed a commit to emfcamp/badge-2024-software that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants