pico-sdk
pico-sdk copied to clipboard
Feature request: gpio_set_irq_enabled_for_cpu()
We've come across a use case in MicroPython for enabling a gpio interrupt event on a specific core, rather than the executing core (context is https://github.com/micropython/micropython/pull/16915).
This seems supported by the hardware and relatively low-risk due to the atomic bit operations, so I was wondering if we could please have it in pico-sdk. i.e. something like:
void gpio_set_irq_enabled(uint gpio, uint32_t event_mask, bool enabled); // Existing function
void gpio_set_irq_enabled_for_cpu(uint gpio, uint32_t event_mask, bool enabled, uint cpu);
... or similar. It seems like most of the common implementation can stay the same.
(There are probably a couple of gpio interrupt functions that could support this pattern, I'm just mentioning this one as it's the one we have a use case for.)