- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello everybody,
I'm playing with D2000 MCU and got an issue that need your help, I'm trying to connect buttons to GPIO pins, when one button is pressed, an interrupt is triggered, but how can I know which pin caused the interrupt?
static void gpio_example_callback(void *data, uint32_t status)
{
// How can I know which pin caused the interrupt here?
}
void main()
{
cfg.int_en = BIT(PIN_1) | BIT(PIN_2) | BIT(PIN_3);
cfg.int_type = BIT(PIN_1) | BIT(PIN_2) | BIT(PIN_3);
...
cfg.callback = gpio_callback;
cfg.callback_data = NULL;
QM_IR_UNMASK_INT(QM_IRQ_GPIO_0_INT);
QM_IRQ_REQUEST(QM_IRQ_GPIO_0_INT, qm_gpio_0_isr);
qm_gpio_set_config(QM_GPIO_0, &cfg);
...
}
Thank you very much.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello,
Thank you for reaching out to Intel® Quark™ Microcontrollers Forum.
We will look into this issue and get back to you shortly.
Regards
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I will update you once i heard the feedback from my engineering team.
Regards
CK
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi!
In the simplest way you can read a pin state in the interrupt routine:
qm_gpio_read_pin(QM_GPIO_0, PINID);
Also your interrupt callback function has an argument:
uint32_t status
Try to read this variable in the callback function for check the required triggered pin

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page