1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_INCLUDE_SYS_POWEROFF_H_ 8 #define ZEPHYR_INCLUDE_SYS_POWEROFF_H_ 9 10 #include <zephyr/toolchain.h> 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @defgroup sys_poweroff System power off 18 * @ingroup os_services 19 * @{ 20 */ 21 22 /** @cond INTERNAL_HIDDEN */ 23 24 /** 25 * @brief System power off hook. 26 * 27 * This function needs to be implemented in platform code. It must only 28 * perform an immediate power off of the system. 29 */ 30 FUNC_NORETURN void z_sys_poweroff(void); 31 32 /** @endcond */ 33 34 /** 35 * @brief Perform a system power off. 36 * 37 * This function will perform an immediate power off of the system. It is the 38 * responsibility of the caller to ensure that the system is in a safe state to 39 * be powered off. Any required wake up sources must be enabled before calling 40 * this function. 41 * 42 * @kconfig{CONFIG_POWEROFF} needs to be enabled to use this API. 43 */ 44 FUNC_NORETURN void sys_poweroff(void); 45 46 /** @} */ 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* ZEPHYR_INCLUDE_SYS_POWEROFF_H_ */ 53