1 /*
2  * Copyright (c) 2024 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _PICO_RUNTIME_INIT_H
8 #define _PICO_RUNTIME_INIT_H
9 
10 #include "pico.h"
11 #include "pico/runtime.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * The runtime initialization is registration based.
19  *
20  * For each step of the initialization there is a 5 digit ordinal which indicates
21  * the ordering (alphabetic increasing sort of the 5 digits) of the steps.
22  *
23  * e.g. for the step "bootrom_reset", there is:
24  *
25  * \code
26  * #ifndef PICO_RUNTIME_INIT_BOOTROM_RESET
27  * #define PICO_RUNTIME_INIT_BOOTROM_RESET   "00050"
28  * #endif
29  * \endcode
30  *
31  * The user can override the order if they wish, by redefining PICO_RUNTIME_INIT_BOOTROM_RESET
32  *
33  * For each step, the automatic initialization may be skipped by defining (in this case)
34  * PICO_RUNTIME_SKIP_INIT_BOOTROM_RESET = 1. The user can then choose to either omit the step
35  * completely or register their own replacement initialization.
36  *
37  * The default method used to perform the initialization is provided, in case the user
38  * wishes to call it manually; in this case:
39  *
40  * \code
41  * void runtime_init_bootrom_reset(void);
42  * \endcode
43  *
44  * If PICO_RUNTIME_NO_INIT_BOOTOROM_RESET define is set (NO vs SKIP above), then the function
45  * is not defined, allowing the user to provide a replacement (and also avoiding
46  * cases where the default implementation won't compile due to missing dependencies)
47  */
48 
49 // must have no dependency on any other initialization code
50 #define PICO_RUNTIME_INIT_EARLIEST              "00001"
51 
52 #define PICO_RUNTIME_INIT_LATEST                "99999"
53 
54 // not supported on host at, (needs custom section)
55 #define PICO_RUNTIME_NO_INIT_MUTEX 1
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif