Skip to content
Discussion options

You must be logged in to vote

There have been a few discussions over the years about adding a way to extract some sort of ID from a machine.Pin instance. It's difficult to do this in a portable way though -- on ports like rp2 and esp32 this is straightforward because the underlying IDs are numeric, but on say stm32 where a pin is a port and a number. Also there's both the ID that the board gives it versus the actual underlying pin (e.g. the GPIO 7 pin on rp2 is actually pin 9 on the package).

Anyway. The first idea that comes to mind is that if you have a list of the "registered" pins, then pins.index(p) where p is the argument to the common IRQ handler will give you an index you can use into your bytearray. e.g.

from m…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Flipje1955
Comment options

You must be logged in to vote
3 replies
@robert-hh
Comment options

@jimmo
Comment options

@jimmo
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants