-
Is there any existing support for this as ZeptoForth words - or do a need to set CPU registers manually? In micropython it would be something like: pin.irq(trigger=Pin.IRQ_FALLING, handler=callback). I think the C/C++ API is something like: gpio_set_irq_enabled_with_callback(21, GPIO_IRQ_EDGE_RISE | GPIO_IRQ_EDGE_FALL, true, &gpio_callback); |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
This would be something like (note that I have not tried this code):
|
Beta Was this translation helpful? Give feedback.
-
Note that if you are compiling to flash, you will want this instead:
|
Beta Was this translation helpful? Give feedback.
-
Ah, yes, I missed that in the RP2040 docs. |
Beta Was this translation helpful? Give feedback.
-
When you are selecting which GPIO interrupt has fired to dispatch it, you are reading the interrupt enable register. (INTE). Surely you want to ue the INTS (interrupt status) register? (Not sure if you could also read the edge interrupt for INTR are as well ... it's only lists WC not read). This is what I meant be second part of my comment: |
Beta Was this translation helpful? Give feedback.
Good catch! That should read: