Description
An rp2pio.StateMachine
has .background_write()
which lets the user queue up large quantities of data to be sent to the Statemachine automatically, refilling in the small FIFO buffer as the data is consumed.
However, there is no equivalent capability to read the FIFO in the background, so after the StateMachine generates 4 (or 8) data values, it is blocked or loses data. Therefore, the user program must constantly poll the input to see if there is anything available to read.
It would be nice to be able to set up an input buffer that is fed by the FIFO, either on interrupt or via a DMA channel. That way, when the PIO generates large amounts of data, it is not lost. (Similar to how Serial ports read into a buffer until the CircuitPython program is ready to read input.)