← index #15521PR #12784
Off-topic · high · value 3.215
QUERY · ISSUE

RMT read pulses?

openby MarkHmnvopened 2024-07-22updated 2025-12-09
enhancementport-esp32

Description

The esp32.RMT has a method for sending pulses, but no method for reading them. I would like to know if there are plans to implement this functionality in the future?

Code Size

No response

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

Change esp32.RMT.source_freq() to class method

mergedby bulletmarkopened 2023-10-24updated 2023-11-09
port-esp32

To create a esp32.RMT() instance with an optimum (i.e. highest resolution) clock_div is currently awkward because you need to know the source clock frequency to calculate the best clock_div but unfortunately that is only currently available as an source_freq() method on the instance after you have already created it, i.e. we have a chicken and egg problem. So RMT.source_freq() should really be a class method, not an instance method and this PR changes that in the code and documentation. Of course this change is backwards compatible for existing code because you can still reference that function from an instance, or now also, from the class, i.e.

from esp32 import RMT
rmt = RMT(0, pin)

assert rmt.source_freq() == RMT.source_freq()

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied