Adding a PIOProgram class #16632
Replies: 2 comments 3 replies
-
Can you provide an example how this works from a python perspective? Also I'm interessed to understand if and how this may help IDEs, linters or type checkers handle the Python form of the PIO code better than the current implementation |
Beta Was this translation helpful? Give feedback.
-
I would prefer a syntax where a decorator indicates the fact that PIO assembly is used, and
No unfortunately not. I've not found a way for Type Checkers to use a externally defined context based on a decorator. (I have tried more than a few ways )
for your proposal this could be adapted to something like:
and the stubs could re-use the common syntax. |
Beta Was this translation helpful? Give feedback.
-
I've been looking at adding a
PIOProgram
class as a wrapper around the opaque array returned byasm_pio
to make it much easier to implement a number of open tickets. There's a proof of concept PR here.Adding new features to the existing API didn't work out well IMHO - it would be cleaner and probably smaller to prefer implementation in Python vs C. My proposal is to create several PRs with a slightly different approach:
_pio_funcs
PIOProgram
class as an alternative toasm_pio
(no new features yet)asm_pio
to be a wrapper aroundPIOProgram
Looking for some good idea / bad idea type of discussion here before doing the work.
Beta Was this translation helpful? Give feedback.
All reactions