PIO in Python with with multiple IOs
Posted: Sun Apr 11, 2021 10:20 am
Hi, Anyone figured out the syntax for multiple outputs (I'm guessing inputs as well) with 'pioasm' when output is for Python?
It works fine in Python, multiple lines are given to the asm_pio() decorator as a tuple, e.g :-
@rp2.asm_pio(
out_init = (
rp2.PIO.OUT_LOW,
rp2.PIO.OUT_HIGH,
rp2.PIO.OUT_LOW))
PIO initialisation can by output from 'pioasm' with the 'lang_opt' directive. For one line the following works
.lang_opt python out_init = rp2.PIO.OUT_LOW
but
.lang_opt python out_init = (rp2.PIO.OUT_LOW, rp2.PIO.OUT_HIGH, rp2.PIO.OUT_LOW)
doesn't work, 'pioasm' sees this as a syntax error. I've tried a few variants like list instead of tuple and just comma separated values. All the examples seem to use just one pin.
It works fine in Python, multiple lines are given to the asm_pio() decorator as a tuple, e.g :-
@rp2.asm_pio(
out_init = (
rp2.PIO.OUT_LOW,
rp2.PIO.OUT_HIGH,
rp2.PIO.OUT_LOW))
PIO initialisation can by output from 'pioasm' with the 'lang_opt' directive. For one line the following works
.lang_opt python out_init = rp2.PIO.OUT_LOW
but
.lang_opt python out_init = (rp2.PIO.OUT_LOW, rp2.PIO.OUT_HIGH, rp2.PIO.OUT_LOW)
doesn't work, 'pioasm' sees this as a syntax error. I've tried a few variants like list instead of tuple and just comma separated values. All the examples seem to use just one pin.