State Machine Configuration
You can configure the behavior of a PIO state machine using the functions described in this page. These functions allow you to set up the pin assignments, clock divider, sideset configuration, wrap configuration, shift register behavior, FIFO join configuration, and other special configurations for the state machine. Properly configuring the state machine is essential for ensuring that it operates correctly and efficiently for your specific application.
These configurations are reflected when sm.init() is called.
Assignment of Pins
Clock Divider
Sideset Configuration
This function has the same effect as the .sideset directive.
Wrap Configuration
This function has the same effect as the .wrap_target and .wrap directives.
ISR (Input Shift Register) Configuration
A convenient shorthand for sm.config_set_in_shift(false, autopush, push_threshold).
A convenient shorthand for sm.config_set_in_shift(true, autopush, push_threshold).
OSR (Output Shift Register) Configuration
A convenient shorthand for sm.config_set_out_shift(false, autopull, pull_threshold).
A convenient shorthand for sm.config_set_out_shift(true, autopull, pull_threshold).
FIFO Join Configuration
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_NONE).
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_TX).
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_RX).
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_TXPUT).
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_TXGET).
A convenient shorthand for sm.config_set_fifo_join(PIO_FIFO_JOIN_PUTGET).