-
Notifications
You must be signed in to change notification settings - Fork 14
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
Passing pin name to avr_alloc_irq #39
Comments
Array of strings is probably something Swig can't handle out of the box. It would require some of the typemap magic. Just wondering. Are you creating some new Part in C++ but then connecting it all in Python? |
My use case is creating new parts in Python, see e.g. https://github.com/gergoerdi/avr-chip8-simulator-py/blob/master/LCD.py The benefit of adding names to the |
Is that typemap stuff applicable to just |
I'm not sure about that typemaps. It is usually bit tricky business. I see. Allocating new IRQs and using the connect_irq is the official way to add new parts. If you need to connect some existing (C) parts together that is probably the way to go. Regarding the nicer names. Perhaps renaming the AVR IRQ's where the part is connected to could achieve the same result? I was trying to say it is not necessary to allocate new IRQs at all. I woudl probably make that Board class the only thing facing the pysimavr IRQs and doing the raise-irq calls and registering callbacks in there. And then leave all the other parts like LCD, Keyboard fully (py)simavr-agnostic. And just use some python level way to register/publish/distribute events. |
I'd like to expose the "pins" of my simulated off-MCU components to the MCU simulation as standalone
irq
s. In C(++), I can do that like this:and then connect it to a pin of an MCU port:
I can see that
avr_alloc_irq
is exposed inpysimavr.swig.simavr
, however, I haven't been able to figure out how to pass the pin name to it. If I just trythen at runtime I get the following type error:
Of course, it's not hard to see why --
"LCD.DC"
is a string, not a pointer to a string; but how do I get over this hurdle?The text was updated successfully, but these errors were encountered: