How to shutdown from 3s power key button press?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to shutdown from 3s power key button press?

跳至解决方案
1,434 次查看
Gamka
Contributor III

I am using imxrt1064 with MCUXpresso. I would like to turn off the device after user has pressed power button for 3 seconds. Is there a way to accomplish this?

The "Dumb" PMIC mode allows me to set Max timeout to 5 secs, 10 sec or 15 secs, but I need to set it to 3 secs. With debounce I can get an interrupt that the button has been pressed for 500ms (or more), but I would need to know if the button is still being pressed after 3 secs (to shutdown). Is there a register to check this? Or any other way to implement 3 secs shutdown?

I understand, that I could wire the button to some GPIO, but is there any way to accomplish this without modifications to my hardware?

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,420 次查看
Gamka
Contributor III

I found the register myself. It is in HPSR bit 6. Now I can start a timer, when getting (0 ms) debounce. When the timer fires, I will check if the button is still being pressed. And if I get a debounce, while timer is running, I will just restart the timer.

Btw, it would be nice, if imxRT1064 reference manual "Chapter 13.5. ONOFF (Button)" could have a mention about this register as well (and other button related SNVS HP registers).

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,416 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Gamka 

   Thanks for your updated information and your effort.

  Yes, you can use the SNVS_HP or LP.

   If your question is solved, please help to mark the correct answer.

Any new issues in the future, welcome to create the new question post, thanks.

 

Best Regards,

kerry

0 项奖励
回复
1,421 次查看
Gamka
Contributor III

I found the register myself. It is in HPSR bit 6. Now I can start a timer, when getting (0 ms) debounce. When the timer fires, I will check if the button is still being pressed. And if I get a debounce, while timer is running, I will just restart the timer.

Btw, it would be nice, if imxRT1064 reference manual "Chapter 13.5. ONOFF (Button)" could have a mention about this register as well (and other button related SNVS HP registers).

0 项奖励
回复