@@ -360,6 +360,13 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop
360
360
//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None:
361
361
//| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens.
362
362
//|
363
+ //| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements
364
+ //| will perform 8 bit writes to the PIO FIFO. The RP2040's memory bus will duplicate the value into
365
+ //| the other byte positions. So, pulling more data in the PIO assembly will read the duplicated values.
366
+ //|
367
+ //| To perform 16 or 32 bits writes into the FIFO use an `array.array` with a type code of the desired
368
+ //| size.
369
+ //|
363
370
//| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer
364
371
//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]``
365
372
//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``"""
@@ -408,6 +415,14 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine
408
415
//| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer
409
416
//| includes any data added to the fifo even if it was added before this was called.
410
417
//|
418
+ //| Reads from the FIFO will match the input buffer's element size. For example, bytearray elements
419
+ //| will perform 8 bit reads from the PIO FIFO. The alignment within the 32 bit value depends on
420
+ //| ``in_shift_right``. When ``in_shift_right`` is True, the upper N bits will be read. The lower
421
+ //| bits will be read when ``in_shift_right`` is False.
422
+ //|
423
+ //| To perform 16 or 32 bits writes into the FIFO use an `array.array` with a type code of the desired
424
+ //| size.
425
+ //|
411
426
//| :param ~circuitpython_typing.WriteableBuffer buffer: Read data into this buffer
412
427
//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]``
413
428
//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``"""
@@ -456,6 +471,12 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach
456
471
//| may be different. The function will return once both are filled.
457
472
//| If buffer slice lengths are both 0, nothing happens.
458
473
//|
474
+ //| Data transfers to and from the FIFOs will match the corresponding buffer's element size. See
475
+ //| `write` and `readinto` for details.
476
+ //|
477
+ //| To perform 16 or 32 bits writes into the FIFO use an `array.array` with a type code of the desired
478
+ //| size.
479
+ //|
459
480
//| :param ~circuitpython_typing.ReadableBuffer buffer_out: Write out the data in this buffer
460
481
//| :param ~circuitpython_typing.WriteableBuffer buffer_in: Read data into this buffer
461
482
//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]``
0 commit comments