-
Notifications
You must be signed in to change notification settings - Fork 22
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
RP235x support #66
base: main
Are you sure you want to change the base?
RP235x support #66
Conversation
Would it be possible to use a single lalrpop file if it always understood the additions of RP235x? If every valid RP2040 pio program is also valid on the RP235x, that should work, and as I understand it this is how the additions were designed. |
That's certainly possible, but then there wouldn't be compile time errors when trying to use a program with the new instructions on the 2040. Or at least there wouldn't be compile time errors originating in the lalrpop generated code like it would for any other invalid instruction. |
Support for mov encodings to handle fifo get/put Support for mov PINDIR dest Support for wait JMPPIN source
That's another advantage to do the parsing with rp235x support: There may be .pio files containing multiple programs, some rp2040 compatible and some with rp235x extensions. Such files should be usable on rp2040 as long as one only installs compatible programs. But with the current approach, the whole file would fail to parse. Of course, now the question becomes at which point rp2040 compatibility should be checked. I did not yet think about it enough to have a clear picture. One possibility would be that We could also somehow note the PIO version inside the program and then check it in the macro (which could then provide a better error message). Not sure if that can be sensibly done without a breaking change, which would in turn necessitate a new version of rp2040-hal. |
Here is another attempt. I removed the rp2350 feature and added a version to the program struct, so pio-rs should be able to parse any program. I have mixed feelings about delegating handling the version to the HALs as I don't know how to make using an invalid program a compile time error there. This approach does make pio-rs much cleaner. I also added support for the new Irq index modes. I think that was the only new feature (that belongs here in pio-rs) that was missing. |
The primary purpose of this pr is to support the new rx fifo modes on the rp235x, it also includes the new JMP_PIN source for WAIT and PINDIRS destination for MOV.
I'm not happy that I had to make a second lalrpop file, but I couldn't figure out how to make conditional compilation work.
Also open to bike shedding on the feature name.