1.cubeMX配置
2.代码启用wkup唤醒实现
HAL_PWR_EnableWakeUpPin()函数的入口参数可以配置,wakeup_pin高电平有效或低电平有效:
one of the following value where the user can explicitly specify the enabled pin and
-
the chosen polarity:
-
@arg @ref PWR_WAKEUP_PIN1_HIGH or PWR_WAKEUP_PIN1_LOW
-
@arg @ref PWR_WAKEUP_PIN2_HIGH or PWR_WAKEUP_PIN2_LOW
-
@arg @ref PWR_WAKEUP_PIN3_HIGH or PWR_WAKEUP_PIN3_LOW
-
@arg @ref PWR_WAKEUP_PIN4_HIGH or PWR_WAKEUP_PIN4_LOW
-
@arg @ref PWR_WAKEUP_PIN5_HIGH or PWR_WAKEUP_PIN5_LOW
3.判断是否为wkup_pin1唤醒