Use multiple wkupct_enable_irq with different callbacks?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
gme_johannes
Offline
Last seen:2 days 2 hours ago
加入:2017-12-22 10:09
Use multiple wkupct_enable_irq with different callbacks?

Hi,

we are using the "old" IoT sensor with SDK5, ported to Murata ZY (DA14580).

The SDK uses the BMI160 for interrupts during operation (FIFO watermark for sensor readout) and during sleep (motion wakeup), e.g.

#ifndef BLE_APP_SENSOR_FUSION void config_da1458x_pin_intr_1_enable(void) { wrbl_env.wrbl_intr_1_cb = wkup_intr_1_cb; wkupct_register_callback(wrbl_env.wrbl_intr_1_cb); #ifdef USE_MAG_DRDY_INTR wkupct_enable_irq(0x0040, 0x0040, 1, 0); //active high #else wkupct_enable_irq(WKUPCT_PIN_SELECT(INT1_PORT, INT1_PIN), WKUPCT_PIN_SELECT(INT1_PORT, INT1_PIN), 1, 0); //active low #endif }

We want to use another GPIO as interrupt to execute a specific command, it should work during operation but also during sleep modes (hence we can not use the GPIO_EnabeIRQ).

My understanding is:

1) Multiple GPIOs can be configured as wakeup source.
2) For wkupct_enable_irq it is not possible to register different callback functions for different interrupt sources.
3) If wkupct_register_callback() is called multiple times throughout the code, the last registered callback will be used.
Correct?

Question:
4) Is there a register that I can read after waking up, telling me which pin was the interrupt source? Fromhttps://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...I understand this is not possible?
5) But what about using NVIC_GetPendingIRQ? Aren't different interrupts assigned different IRQn?
--> I found out that they all use the same IRQn:

// datasheet.h WKUP_QUADEC_IRQn = 9, /* Combines the Wake up Capture Timer interrupt, the GPIO interrupt and the QuadDecoder interrupt */

BR Johannes

Device:
PM_Dialog
Offline
Last seen:10 hours 55 min ago
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

Thanks for your question but you have already created a similar forum thread for you issue. I will reply you in the forum thread below. Please, try to not duplicate your posts on the forum.

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/use-multiple-wkupctenableirq-different

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 days 2 hours ago
加入:2017-12-22 10:09
Apologies, I must have

Apologies, I must have accidentaly created a copy of the thread instead of modifying my own text as intended. I have corrected it in my original post.
Please feel free to delete this thread.

BR Johannes

PM_Dialog
Offline
Last seen:10 hours 55 min ago
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

No problem. It’s okay, so I leave it as it is! If you have any follow back questions, please update the other forum thread.

Thanks, PM_Dialog