File tree Expand file tree Collapse file tree 2 files changed +38
-3
lines changed
include/zephyr/drivers/retained_mem Expand file tree Collapse file tree 2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#include <zephyr/devicetree.h>
8
8
#include <zephyr/kernel.h>
9
+ #include <zephyr/drivers/retained_mem/nrf_retained_mem.h>
9
10
10
11
#include <helpers/nrfx_ram_ctrl.h>
11
12
@@ -22,7 +23,7 @@ static const struct ret_mem_region ret_mem_regions[] = {
22
23
DT_FOREACH_STATUS_OKAY (zephyr_retained_ram , _BUILD_MEM_REGION )
23
24
};
24
25
25
- static int retained_mem_nrf_init (void )
26
+ int z_nrf_retained_mem_retention_apply (void )
26
27
{
27
28
const struct ret_mem_region * rmr ;
28
29
@@ -33,5 +34,3 @@ static int retained_mem_nrf_init(void)
33
34
34
35
return 0 ;
35
36
}
36
-
37
- SYS_INIT (retained_mem_nrf_init , PRE_KERNEL_1 , 0 );
Original file line number Diff line number Diff line change
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 */
You can’t perform that action at this time.
0 commit comments