Skip to content

RP2040 - PIO sideset for pin direction #9630

Closed
@jchawks

Description

@jchawks

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:

... 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions