1 /*
2 
3 Copyright (c) 2010 - 2024, Nordic Semiconductor ASA All rights reserved.
4 
5 SPDX-License-Identifier: BSD-3-Clause
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice, this
11    list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright
14    notice, this list of conditions and the following disclaimer in the
15    documentation and/or other materials provided with the distribution.
16 
17 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18    contributors may be used to endorse or promote products derived from this
19    software without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 POSSIBILITY OF SUCH DAMAGE.
32 
33 */
34 
35 #ifndef NRF_H
36 #define NRF_H
37 
38 /* MDK version */
39 #define MDK_MAJOR_VERSION   8
40 #define MDK_MINOR_VERSION   64
41 #define MDK_MICRO_VERSION   0
42 
43 
44 /* Define coprocessor domains */
45 #if defined (NRF5340_XXAA_APPLICATION) || defined (NRF5340_XXAA_NETWORK)
46     #ifndef NRF5340_XXAA
47         #define NRF5340_XXAA
48     #endif
49 #endif
50 #if defined (NRF5340_XXAA_APPLICATION)
51     #ifndef NRF_APPLICATION
52         #define NRF_APPLICATION
53     #endif
54 #endif
55 #if defined (NRF5340_XXAA_NETWORK)
56     #ifndef NRF_NETWORK
57         #define NRF_NETWORK
58     #endif
59 #endif
60 
61 /* Apply compatibility macros for old nRF5340 macros */
62 #if defined(NRF5340_XXAA)
63     #if defined (NRF_APPLICATION)
64         #ifndef NRF5340_XXAA_APPLICATION
65             #define NRF5340_XXAA_APPLICATION
66         #endif
67     #endif
68     #if defined (NRF_NETWORK)
69         #ifndef NRF5340_XXAA_NETWORK
70             #define NRF5340_XXAA_NETWORK
71         #endif
72     #endif
73 #endif
74 
75 /* Define NRF51_SERIES for common use in nRF51 series devices. Only if not previously defined. */
76 #if defined (NRF51) ||\
77     defined (NRF51422_XXAA) ||\
78     defined (NRF51422_XXAB) ||\
79     defined (NRF51422_XXAC) ||\
80     defined (NRF51801_XXAB) ||\
81     defined (NRF51802_XXAA) ||\
82     defined (NRF51822_XXAA) ||\
83     defined (NRF51822_XXAB) ||\
84     defined (NRF51822_XXAC) ||\
85     defined (NRF51824_XXAA)
86     #ifndef NRF51_SERIES
87         #define NRF51_SERIES
88     #endif
89     #ifndef NRF51
90         #define NRF51
91     #endif
92 #endif
93 
94 /* Redefine "old" too-generic name NRF52 to NRF52832_XXAA to keep backwards compatibility. */
95 #if defined (NRF52)
96     #ifndef NRF52832_XXAA
97         #define NRF52832_XXAA
98     #endif
99 #endif
100 
101 /* Define NRF52_SERIES for common use in nRF52 series devices. Only if not previously defined. */
102 #if defined (NRF52805_XXAA) || defined (NRF52810_XXAA) || defined (NRF52811_XXAA) || defined (NRF52820_XXAA) || defined (NRF52832_XXAA) || defined (NRF52832_XXAB) || defined (NRF52833_XXAA) || defined (NRF52840_XXAA)
103     #ifndef NRF52_SERIES
104         #define NRF52_SERIES
105     #endif
106 #endif
107 
108 /* Define NRF53_SERIES for common use in nRF53 series devices. */
109 #if defined (NRF5340_XXAA)
110     #ifndef NRF53_SERIES
111         #define NRF53_SERIES
112     #endif
113 #endif
114 
115 /* Define NRF54H_SERIES for common use in nRF54H series devices */
116 #if defined (NRF54H20_ENGA_XXAA) || defined (NRF54H20_XXAA)
117     #ifndef NRF54H_SERIES
118         #define NRF54H_SERIES
119     #endif
120     #ifndef HALTIUM_XXAA
121         #define HALTIUM_XXAA
122     #endif
123 #endif
124 
125 /* Define NRF54L_SERIES for common use in nRF54L series devices */
126 #if defined (NRF54L15_ENGA_XXAA) || defined (NRF54L15_XXAA)
127     #ifndef NRF54L_SERIES
128         #define NRF54L_SERIES
129     #endif
130     #ifndef LUMOS_XXAA
131         #define LUMOS_XXAA
132     #endif
133 #endif
134 
135 /* Define NRF91_SERIES for common use in nRF91 series devices. */
136 #if defined (NRF9160_XXAA) ||  defined (NRF9120_XXAA)
137     #ifndef NRF91_SERIES
138         #define NRF91_SERIES
139     #endif
140 #endif
141 
142 /* Define NRF92_SERIES for common use in nRF92 series devices. */
143 #if defined(NRF9230_ENGA_XXAA)
144     #ifndef NRF92_SERIES
145         #define NRF92_SERIES
146     #endif
147     #ifndef HALTIUM_XXAA
148         #define HALTIUM_XXAA
149     #endif
150 #endif
151 
152 /* Device selection for device includes. */
153 #if defined (NRF51)
154     #include "nrf51.h"
155     #include "nrf51_bitfields.h"
156     #include "nrf51_deprecated.h"
157 
158 #elif defined (NRF52805_XXAA)
159     #include "nrf52805.h"
160     #include "nrf52805_bitfields.h"
161     #include "nrf51_to_nrf52810.h"
162     #include "nrf52_to_nrf52810.h"
163     #include "nrf52810_to_nrf52811.h"
164 #elif defined (NRF52810_XXAA)
165     #include "nrf52810.h"
166     #include "nrf52810_bitfields.h"
167     #include "nrf51_to_nrf52810.h"
168     #include "nrf52_to_nrf52810.h"
169     #include "nrf52810_name_change.h"
170 #elif defined (NRF52811_XXAA)
171     #include "nrf52811.h"
172     #include "nrf52811_bitfields.h"
173     #include "nrf51_to_nrf52810.h"
174     #include "nrf52_to_nrf52810.h"
175     #include "nrf52810_to_nrf52811.h"
176 #elif defined (NRF52820_XXAA)
177     #include "nrf52820.h"
178     #include "nrf52820_bitfields.h"
179     #include "nrf51_to_nrf52.h"
180     #include "nrf52_to_nrf52833.h"
181     #include "nrf52833_to_nrf52820.h"
182 #elif defined (NRF52832_XXAA) || defined (NRF52832_XXAB)
183     #include "nrf52.h"
184     #include "nrf52_bitfields.h"
185     #include "nrf51_to_nrf52.h"
186     #include "nrf52_name_change.h"
187 #elif defined (NRF52833_XXAA)
188     #include "nrf52833.h"
189     #include "nrf52833_bitfields.h"
190     #include "nrf52_to_nrf52833.h"
191     #include "nrf51_to_nrf52.h"
192 #elif defined (NRF52840_XXAA)
193     #include "nrf52840.h"
194     #include "nrf52840_bitfields.h"
195     #include "nrf51_to_nrf52840.h"
196     #include "nrf52_to_nrf52840.h"
197 
198 #elif defined (NRF5340_XXAA)
199     #if defined(NRF_APPLICATION)
200         #include "nrf5340_application.h"
201         #include "nrf5340_application_bitfields.h"
202         #include "nrf5340_application_name_change.h"
203 
204         /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
205         #if !defined(NRF_FICR_NS)
206             #define NRF_FICR_NS_BASE 0x2007F000
207             #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
208         #endif
209     #elif defined (NRF_NETWORK)
210         #include "nrf5340_network.h"
211         #include "nrf5340_network_bitfields.h"
212         #include "nrf5340_network_name_change.h"
213     #endif
214 
215 #elif defined (NRF54H20_ENGA_XXAA)
216     #include "nrf54h20_enga.h"
217     #include "nrf54h20_enga_interim.h"
218     #include "nrf54h20_enga_name_change.h"
219 
220 #elif defined (NRF54H20_XXAA)
221     #include "nrf54h20.h"
222     #include "nrf54h20_interim.h"
223     #include "nrf54h20_name_change.h"
224 
225 #elif defined (NRF54L15_ENGA_XXAA)
226     #include "nrf54l15_enga.h"
227     #include "nrf54l15_enga_interim.h"
228     #include "nrf54l15_enga_name_change.h"
229 
230 #elif defined (NRF54L15_XXAA)
231     #include "nrf54l15.h"
232     #include "nrf54l15_interim.h"
233     #include "nrf54l15_name_change.h"
234 
235 #elif defined (NRF9160_XXAA)
236     #include "nrf9160.h"
237     #include "nrf9160_bitfields.h"
238     #include "nrf91_name_change.h"
239 
240     /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
241     #if !defined(NRF_FICR_NS)
242         #define NRF_FICR_NS_BASE 0x2003E000
243         #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
244     #endif
245 
246 #elif defined (NRF9120_XXAA)
247     #include "nrf9120.h"
248     #include "nrf9120_bitfields.h"
249     #include "nrf91_name_change.h"
250 
251     /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
252     #if !defined(NRF_FICR_NS)
253         #define NRF_FICR_NS_BASE 0x2003E000
254         #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
255     #endif
256 
257 #elif defined (NRF9230_ENGA_XXAA)
258     #include "nrf9230_enga.h"
259     #include "nrf9230_enga_interim.h"
260     #include "nrf9230_enga_name_change.h"
261 
262 #else
263     #error "Device must be defined. See nrf.h."
264 #endif /* NRF51, NRF52805_XXAA, NRF52810_XXAA, NRF52811_XXAA, NRF52820_XXAA, NRF52832_XXAA, NRF52832_XXAB, NRF52833_XXAA, NRF52840_XXAA, NRF5340_XXAA_APPLICATION, NRF5340_XXAA_NETWORK, NRF9160_XXAA */
265 
266 #include "compiler_abstraction.h"
267 
268 #endif /* NRF_H */
269 
270