DA14580 wakeup interrupt software design

⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
Aaron Li
Offline
Last seen:2 months 6 days ago
加入:2016-09-12 14:20
DA14580 wakeup interrupt software design

Hello Dialog Support team,
I would like to use interrupt from GPIO_PORT_2/GPIO_PIN_4 to control DA14580 sleep and wakeup. The detail as following:
If GPIO_PORT_2/GPIO_PIN_4 become logic 1, an interrupt will be trigered and wake up system from sleep mode. Use wkupct_enable_irq() to define this interrupt.
If GPIO_PORT_2/GPIO_PIN_4 become logic 0, another interrupt will be triggered and let system go into sleep mode. Use GPIO_EnableIRQ() to define this interrupt.
Two different interrupt will use same GPIO port and PIN. Can you help to suggest above solution is feasible? Or can you give me some better solution?

Thanks a lot for your suggestion!

Device:
PM_Dialog
Offline
Last seen:4 days 19 hours ago
Staff
加入:2018-02-08 11:03
Hi Aaron Li,

Hi Aaron Li,

Regarding the wake up procedure, I would strongly recommend you to check the ble_app_sleepmode example of the SDK. This example demonstrates this functionality, but you should change the polarity to HIGH. When the 580 wakes up, you can use the wake up controller to get the interrupt for entering the device into sleep, but you should reconfigure the polarity to LOW (maybe a flag is needed) and then change the callback functions will be triggered.

Thanks, PM_Dialog

Aaron Li
Offline
Last seen:2 months 6 days ago
加入:2016-09-12 14:20
Hi Dialog PM,

Hi Dialog PM,
非常感谢你的suggestoin !由way, can you help to suggest whether following method is feasible?
Define two different interrupt with the same GPIO port(GPIO_PORT2) and PIN(GPIO_PIN4).
Use wkupct_enable_irq() to define wakeup interrupt.
GPIO_EnableIRQ() to define GPIO interrupt and let device go into sleep mode

thanks a lot for your support!

Aaron Li
Offline
Last seen:2 months 6 days ago
加入:2016-09-12 14:20
Hi Dialog PM,

Hi Dialog PM,
非常感谢你的suggestoin !由way, can you help to suggest whether following method is feasible?
Define two different interrupt with the same GPIO port(GPIO_PORT2) and PIN(GPIO_PIN4).
Use wkupct_enable_irq() to define wakeup interrupt.
GPIO_EnableIRQ() to define GPIO interrupt and let device go into sleep mode

thanks a lot for your support!

PM_Dialog
Offline
Last seen:4 days 19 hours ago
Staff
加入:2018-02-08 11:03
Hi Aaron Li,

Hi Aaron Li,

Yes, this is feasible. When wkupct_enable_irq() is triggered and the device wakes up, you should configure the GPIO as GPIO_EnableIRQ(). When you get the other interrupt and the callback is triggered, you should reconfigure the GPIO as a wake up interrupt and re-enable the wake-up controller. In both of you case, you should take care the polarity of the GPIO.

Thanks, PM_Dialog