1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #include <zephyr/kernel.h>
7 #include <zephyr/sys/poweroff.h>
8 #include <zephyr/toolchain.h>
9 
10 #include <stm32_ll_cortex.h>
11 #include <stm32_ll_pwr.h>
12 #include <stm32_ll_system.h>
13 
z_sys_poweroff(void)14 void z_sys_poweroff(void)
15 {
16 	LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
17 	LL_LPM_EnableDeepSleep();
18 	LL_DBGMCU_DisableDBGStandbyMode();
19 
20 	k_cpu_idle();
21 
22 	CODE_UNREACHABLE;
23 }
24