Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RP2040 - PIO sideset for pin direction #9630

Open
jchawks opened this issue Sep 15, 2024 · 5 comments
Open

RP2040 - PIO sideset for pin direction #9630

jchawks opened this issue Sep 15, 2024 · 5 comments
Labels
enhancement rp2 Both RP2 microcontrollers
Milestone

Comments

@jchawks
Copy link

jchawks commented Sep 15, 2024

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.

@tannewt tannewt added the rp2 Both RP2 microcontrollers label Sep 16, 2024
@tannewt tannewt added this to the 9.x.x milestone Sep 16, 2024
@tannewt
Copy link
Member

tannewt commented Sep 16, 2024

@jchawks
Copy link
Author

jchawks commented Sep 16, 2024

Thanks - I'll add the request this over there as well, linking back to here.

@jepler
Copy link
Member

jepler commented Sep 16, 2024

would you like to take a stab at adding it?

@jchawks
Copy link
Author

jchawks commented Sep 16, 2024 via email

@tannewt
Copy link
Member

tannewt commented Sep 17, 2024

This is a good git tutorial: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rp2 Both RP2 microcontrollers
Projects
None yet
Development

No branches or pull requests

3 participants