1 /*
2 
3 Copyright (c) 2010 - 2023, 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   55
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 NRF91_SERIES for common use in nRF91 series devices. */
116 #if defined (NRF9160_XXAA) ||  defined (NRF9120_XXAA)
117     #ifndef NRF91_SERIES
118         #define NRF91_SERIES
119     #endif
120 #endif
121 
122 /* Device selection for device includes. */
123 #if defined (NRF51)
124     #include "nrf51.h"
125     #include "nrf51_bitfields.h"
126     #include "nrf51_deprecated.h"
127 
128 #elif defined (NRF52805_XXAA)
129     #include "nrf52805.h"
130     #include "nrf52805_bitfields.h"
131     #include "nrf51_to_nrf52810.h"
132     #include "nrf52_to_nrf52810.h"
133     #include "nrf52810_to_nrf52811.h"
134 #elif defined (NRF52810_XXAA)
135     #include "nrf52810.h"
136     #include "nrf52810_bitfields.h"
137     #include "nrf51_to_nrf52810.h"
138     #include "nrf52_to_nrf52810.h"
139     #include "nrf52810_name_change.h"
140 #elif defined (NRF52811_XXAA)
141     #include "nrf52811.h"
142     #include "nrf52811_bitfields.h"
143     #include "nrf51_to_nrf52810.h"
144     #include "nrf52_to_nrf52810.h"
145     #include "nrf52810_to_nrf52811.h"
146 #elif defined (NRF52820_XXAA)
147     #include "nrf52820.h"
148     #include "nrf52820_bitfields.h"
149     #include "nrf51_to_nrf52.h"
150     #include "nrf52_to_nrf52833.h"
151     #include "nrf52833_to_nrf52820.h"
152 #elif defined (NRF52832_XXAA) || defined (NRF52832_XXAB)
153     #include "nrf52.h"
154     #include "nrf52_bitfields.h"
155     #include "nrf51_to_nrf52.h"
156     #include "nrf52_name_change.h"
157 #elif defined (NRF52833_XXAA)
158     #include "nrf52833.h"
159     #include "nrf52833_bitfields.h"
160     #include "nrf52_to_nrf52833.h"
161     #include "nrf51_to_nrf52.h"
162 #elif defined (NRF52840_XXAA)
163     #include "nrf52840.h"
164     #include "nrf52840_bitfields.h"
165     #include "nrf51_to_nrf52840.h"
166     #include "nrf52_to_nrf52840.h"
167 
168 #elif defined (NRF5340_XXAA)
169     #if defined(NRF_APPLICATION)
170         #include "nrf5340_application.h"
171         #include "nrf5340_application_bitfields.h"
172         #include "nrf5340_application_name_change.h"
173 
174         /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
175         #if !defined(NRF_FICR_NS)
176             #define NRF_FICR_NS_BASE 0x2007F000
177             #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
178         #endif
179     #elif defined (NRF_NETWORK)
180         #include "nrf5340_network.h"
181         #include "nrf5340_network_bitfields.h"
182         #include "nrf5340_network_name_change.h"
183     #endif
184 
185 #elif defined (NRF9160_XXAA)
186     #include "nrf9160.h"
187     #include "nrf9160_bitfields.h"
188     #include "nrf91_name_change.h"
189 
190     /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
191     #if !defined(NRF_FICR_NS)
192         #define NRF_FICR_NS_BASE 0x2003E000
193         #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
194     #endif
195 
196 #elif defined (NRF9120_XXAA)
197     #include "nrf9120.h"
198     #include "nrf9120_bitfields.h"
199     #include "nrf91_name_change.h"
200 
201     /* Address of locations in RAM that will be used to store a NS-accessible version of FICR */
202     #if !defined(NRF_FICR_NS)
203         #define NRF_FICR_NS_BASE 0x2003E000
204         #define NRF_FICR_NS ((NRF_FICR_Type*)          NRF_FICR_NS_BASE)
205     #endif
206 
207 #else
208     #error "Device must be defined. See nrf.h."
209 #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 */
210 
211 #include "compiler_abstraction.h"
212 
213 #endif /* NRF_H */
214 
215