module contains functions and classes specific to the RP2040, as used in the Raspberry Pi Pico.
PIO related functions ¶
module includes functions for assembling PIO programs.
For running PIO programs, see
asm_pio( * , out_init = None , set_init = None , sideset_init = None , in_shiftdir = 0 , out_shiftdir = 0 , autopush = False , autopull = False , push_thresh = 32 , pull_thresh = 32 , fifo_join = PIO.JOIN_NONE ) ¶
Assemble a PIO program.
The following parameters control the initial state of the GPIO pins, as one of
PIO.OUT_HIGH. If the program uses more than one pin, provide a tuple, e.g.
out_init configures the pins used for
set_init configures the pins used for
set()instructions. There can be at most 5.
sideset_init configures the pins used side-setting. There can be at most 5.
The following parameters are used by default, but can be overridden in
push_thresh is the threshold in bits before auto-push or conditional re-pushing is triggered.
pull_thresh is the threshold in bits before auto-push or conditional re-pushing is triggered.
The remaining parameters are:
asm_pio_encode( instr , sideset_count ) ¶
Assemble a single PIO instruction. You usually want to use
>>> rp2.asm_pio_encode("set(0, 1)", 0) 57345