@@ -357,23 +357,57 @@ class RMT():
357357 def clock_div (self ) -> int :
358358 """
359359 Return the clock divider. Note that the channel resolution is
360- ``1 / (source_freq / clock_div)``.
360+ ``1 / (source_freq / clock_div)``. (Method deprecated. The value may
361+ not be faithful if resolution was supplied as *resolution_hz*.)
361362 """
362363 ...
363364 def wait_done (self , * , timeout : int = 0 ) -> bool :
364365 """
365366 Returns ``True`` if the channel is idle or ``False`` if a sequence of
366367 pulses started with `RMT.write_pulses` is being transmitted. If the
367368 *timeout* keyword argument is given then block for up to this many
368- milliseconds for transmission to complete.
369+ milliseconds for transmission to complete. Timeout of -1 blocks until
370+ transmission is complete (and blocks forever if loop is enabled).
369371 """
370372 ...
371373 def loop (self , enable_loop : bool , / ) -> None :
372374 """
373375 Configure looping on the channel. *enable_loop* is bool, set to ``True`` to
374376 enable looping on the *next* call to `RMT.write_pulses`. If called with
375377 ``False`` while a looping sequence is currently being transmitted then the
376- current loop iteration will be completed and then transmission will stop.
378+ transmission will stop. (Method deprecated by `RMT.loop_count`.)
379+ """
380+ ...
381+ def loop_count (self , n ) -> None :
382+ """
383+ Configure looping on the channel. *n* is int. Affects the *next* call to
384+ `RMT.write_pulses`. Set to ``0`` to disable looping, ``-1`` to enable
385+ infinite looping, or a positive number to loop for a given number of times.
386+ If *n* is changed, the current transmission is stopped.
387+
388+ Note: looping for a finite number of times is not supported by all flavors
389+ of ESP32.
390+ """
391+ ...
392+ def active (self , boolean : Optional [Any ]= None ) -> Incomplete :
393+ """
394+ If called without parameters, returns *True* if there is an ongoing transmission.
395+
396+ If called with parameter *False*, stops the ongoing transmission.
397+ This is useful to stop an infinite transmission loop.
398+ The current loop is finished and transmission stops.
399+ The object is not invalidated, and the RMT channel is again enabled when a new
400+ transmission is started.
401+
402+ Calling with parameter *True* does not restart transmission. A new transmission
403+ should always be initiated by *write_pulses()*.
404+ """
405+ ...
406+ def deinit (self ) -> Incomplete :
407+ """
408+ Release all RMT resources and invalidate the object. All subsequent method
409+ calls will raise OSError. Useful to free RMT resources without having to wait
410+ for the object to be garbage-collected.
377411 """
378412 ...
379413
@@ -474,17 +508,30 @@ class RMT():
474508 supported by the hardware.
475509 """
476510 @staticmethod
511+ def bitstream_rmt (value : Optional [Any ]= None ) -> Incomplete :
512+ """
513+ Configure RMT usage in the `machine.bitstream` implementation.
514+
515+ If *value* is ``True``, bitstream tries to use RMT if possible. If *value*
516+ is ``False``, bitstream sticks to the bit-banging implementation.
517+
518+ If no parameter is supplied, it returns the current state. The default state
519+ is ``True``.
520+ """
521+ ...
522+ @staticmethod
477523 def bitstream_channel (value : Optional [Any ] = None ) -> int :
478524 """
479- Select which RMT channel is used by the `machine.bitstream` implementation.
480- *value* can be ``None`` or a valid RMT channel number. The default RMT
481- channel is the highest numbered one.
525+ *This function is deprecated and will be replaced by `RMT.bitstream_rmt()`.*
526+
527+ Passing in no argument will return ``1`` if RMT was enabled for the `machine.bitstream`
528+ feature, and ``None`` otherwise.
482529
483- Passing in ``None`` disables the use of RMT and instead selects a bit-banging
484- implementation for `machine.bitstream`.
530+ Passing any non-negative integer argument is equivalent to calling ``RMT.bitstream_rmt(True)``.
485531
486- Passing in no argument will not change the channel. This function returns
487- the current channel number.
532+ ``Note:`` In previous versions of MicroPython it was necessary to use this function to assign
533+ a specific RMT channel number for the bitstream, but the channel number is now assigned
534+ dynamically.
488535 """
489536 ...
490537class ULP ():
0 commit comments