summaryrefslogtreecommitdiff
path: root/examples/usercmodule/cppexample
diff options
context:
space:
mode:
authorRene Straub <rene@see5.ch>2023-10-21 15:03:53 +0200
committerDamien George <damien@micropython.org>2023-11-03 17:14:05 +1100
commit47ea831c0e741722a9e7a94bb453947cff5f66d8 (patch)
treeee0284496b4a2a8031d3586a2ff908b6d2834337 /examples/usercmodule/cppexample
parente5014a4d7953808355c1882a65d6d7824cdd0001 (diff)
stm32: Add STM32H5 support for sleep mode.
Update rtc, machine and powerctrl drivers to support STM32H5 sleep modes. This makes RTC alarm wakeup working from lightsleep() and deepsleep(). Changes: - Determine start reason for machine.reset_cause() in modmachine.c. - Add proper interrupt clear code in rtc.c. - Add wakeup functionality in powerctrl_enter_stop_mode(). Remember and restore voltage scaling level. Restart HSI48 if it was on before entering sleep mode. - Clear DBGMCU_CR in SystemClock_Config() as for other variants. Otherwise debug flags prevent entering sleep mode. Implementation Notes: - rtc.c: EXTI_RTSTR1 bits are not present for H5. Code sequence from G0/G4/L4/WB/WL would be invalid. RTSTR is only defined for external (GPIO) interrupts. Maybe this is also true for other STM32 variants. - powerctrl_enter_stop_mode() uses complicated, nested conditionals to select STM32 variants. To make code slightly better readable, comment have been added. A non-nested, #if/#elif sequence would make the code more readable. I leave this to the original authors. Signed-off-by: Rene Straub <rene@see5.ch>
Diffstat (limited to 'examples/usercmodule/cppexample')
0 files changed, 0 insertions, 0 deletions