1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_DRIVERS_RETAINED_MEM_NRF_RETAINED_MEM_H
8 #define ZEPHYR_INCLUDE_DRIVERS_RETAINED_MEM_NRF_RETAINED_MEM_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <zephyr/drivers/retained_mem.h>
15 
16 #if defined(CONFIG_RETAINED_MEM_NRF_RAM_CTRL) || defined(__DOXYGEN__)
17 /** @brief Apply memory retention settings.
18  *
19  * Memory retention settings to apply are derived from devicetree configuration.
20  *
21  * @retval 0 if the retention settings were applied successfully.
22  * @retval -ENOTSUP if retention configuration is not present in devicetree.
23  */
24 int z_nrf_retained_mem_retention_apply(void);
25 #else
26 static inline int z_nrf_retained_mem_retention_apply(void)
27 {
28 	return -ENOTSUP;
29 }
30 #endif
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif /* ZEPHYR_INCLUDE_DRIVERS_RETAINED_MEM_NRF_RETAINED_MEM_H */
37