@@ -177,11 +177,11 @@ used to transmit or receive many other types of digital signals::
177
177
import esp32
178
178
from machine import Pin
179
179
180
- r = esp32.RMT(0, pin=Pin(18), clock_div=8)
181
- r # RMT(channel=0, pin=18, source_freq=80000000, clock_div=8, idle_level=0)
180
+ r = esp32.RMT(pin=Pin(18), clock_div=8)
181
+ r # RMT(pin=18, source_freq=80000000, clock_div=8, idle_level=0)
182
182
183
183
# To apply a carrier frequency to the high output
184
- r = esp32.RMT(0, pin=Pin(18), clock_div=8, tx_carrier=(38000, 50, 1))
184
+ r = esp32.RMT(pin=Pin(18), clock_div=8, tx_carrier=(38000, 50, 1))
185
185
186
186
# The channel resolution is 100ns (1/(source_freq/clock_div)).
187
187
r.write_pulses((1, 20, 2, 40), 0) # Send 0 for 100ns, 1 for 2000ns, 0 for 200ns, 1 for 4000ns
@@ -210,13 +210,17 @@ For more details see Espressif's `ESP-IDF RMT documentation.
210
210
*beta feature * and the interface may change in the future.
211
211
212
212
213
- .. class :: RMT(channel, *, pin=None, clock_div=8, idle_level=False, tx_carrier=None)
213
+ .. class :: RMT(channel, *, pin=None, clock_div=8, idle_level=False, num_symbols=64, tx_carrier=None)
214
214
215
215
This class provides access to one of the eight RMT channels. *channel * is
216
- required and identifies which RMT channel (0-7) will be configured . *pin *,
217
- also required, configures which Pin is bound to the RMT channel. *clock_div *
216
+ optional and a dummy parameter for backward compatibility . *pin * is required
217
+ and configures which Pin is bound to the RMT channel. *clock_div *
218
218
is an 8-bit clock divider that divides the source clock (80MHz) to the RMT
219
- channel allowing the resolution to be specified. *idle_level * specifies
219
+ channel allowing the resolution to be specified. *num_symbols * specifies the
220
+ RMT buffer allocated for this channel (minimum 64), from a small pool of
221
+ 512 symbols that are shared by all channels. This buffer does not limit the
222
+ size of the pulse train that you can send, but bigger buffers reduce the
223
+ CPU load and the potential of glitches/imprecise pulse lengths. *idle_level * specifies
220
224
what level the output will be when no transmission is in progress and can
221
225
be any value that converts to a boolean, with ``True `` representing high
222
226
voltage and ``False `` representing low.
@@ -241,7 +245,8 @@ For more details see Espressif's `ESP-IDF RMT documentation.
241
245
Returns ``True `` if the channel is idle or ``False `` if a sequence of
242
246
pulses started with `RMT.write_pulses ` is being transmitted. If the
243
247
*timeout * keyword argument is given then block for up to this many
244
- milliseconds for transmission to complete.
248
+ milliseconds for transmission to complete. Timeout of -1 blocks until
249
+ transmission is complete (and blocks forever if loop is enabled).
245
250
246
251
.. method :: RMT.loop(enable_loop)
247
252
@@ -278,18 +283,6 @@ For more details see Espressif's `ESP-IDF RMT documentation.
278
283
new sequence of pulses. Looping sequences longer than 126 pulses is not
279
284
supported by the hardware.
280
285
281
- .. staticmethod :: RMT.bitstream_channel([value])
282
-
283
- Select which RMT channel is used by the `machine.bitstream ` implementation.
284
- *value * can be ``None `` or a valid RMT channel number. The default RMT
285
- channel is the highest numbered one.
286
-
287
- Passing in ``None `` disables the use of RMT and instead selects a bit-banging
288
- implementation for `machine.bitstream `.
289
-
290
- Passing in no argument will not change the channel. This function returns
291
- the current channel number.
292
-
293
286
Constants
294
287
---------
295
288
0 commit comments