Description
Currently, the RP2040 PIO support covers all the hardware configuration bits except the state machine
exec control for SIDE_PINDIR: this is defined in the hardware_structs header pio.h, for PIO_SMx_EXECCTRL : SIDE_PINDIR.
The bit next to it, SIDE_EN, is supported:
The line parsing in adafruit_pioasm.py only checks for 'opt', and not 'pindirs':
elif line.startswith(".side_set"):
sideset_count = int(line.split()[1], 0)
sideset_enable = "opt" in line
And the corresponding StateMachine() kwargs mapping would need to be added; the support would be analogous
to the SIDE_EN arg, which is now documented as:
- sideset_enable (bool) True when the top sideset bit is to enable. This should be used with the “
.side_set # opt
” directive
(https://docs.circuitpython.org/en/latest/shared-bindings/rp2pio/index.html)
... and the HAL interface already exists, in raspberrypi\common-hal\rp2pio\StateMachine.c : 321 -
already commented to indicate position of future sideset_direction
?
sm_config_set_sideset(&c, total_sideset_bits, sideset_enable, false /* pin direction */);
The idea is to support the PIO line
.side_set 1 opt pindirs
.
The rest works great; very easy to use. Many thanks for the good work.