1 #ifndef NRF52_ERRATAS_H
2 #define NRF52_ERRATAS_H
3
4 /*
5
6 Copyright (c) 2010 - 2024, Nordic Semiconductor ASA All rights reserved.
7
8 SPDX-License-Identifier: BSD-3-Clause
9
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12
13 1. Redistributions of source code must retain the above copyright notice, this
14 list of conditions and the following disclaimer.
15
16 2. Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19
20 3. Neither the name of Nordic Semiconductor ASA nor the names of its
21 contributors may be used to endorse or promote products derived from this
22 software without specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35
36 */
37
38 #include <stdint.h>
39 #include <stdbool.h>
40 #include "compiler_abstraction.h"
41
42 static bool nrf52_errata_1(void) __UNUSED;
43 static bool nrf52_errata_2(void) __UNUSED;
44 static bool nrf52_errata_3(void) __UNUSED;
45 static bool nrf52_errata_4(void) __UNUSED;
46 static bool nrf52_errata_7(void) __UNUSED;
47 static bool nrf52_errata_8(void) __UNUSED;
48 static bool nrf52_errata_9(void) __UNUSED;
49 static bool nrf52_errata_10(void) __UNUSED;
50 static bool nrf52_errata_11(void) __UNUSED;
51 static bool nrf52_errata_12(void) __UNUSED;
52 static bool nrf52_errata_15(void) __UNUSED;
53 static bool nrf52_errata_16(void) __UNUSED;
54 static bool nrf52_errata_17(void) __UNUSED;
55 static bool nrf52_errata_20(void) __UNUSED;
56 static bool nrf52_errata_23(void) __UNUSED;
57 static bool nrf52_errata_24(void) __UNUSED;
58 static bool nrf52_errata_25(void) __UNUSED;
59 static bool nrf52_errata_26(void) __UNUSED;
60 static bool nrf52_errata_27(void) __UNUSED;
61 static bool nrf52_errata_28(void) __UNUSED;
62 static bool nrf52_errata_29(void) __UNUSED;
63 static bool nrf52_errata_30(void) __UNUSED;
64 static bool nrf52_errata_31(void) __UNUSED;
65 static bool nrf52_errata_32(void) __UNUSED;
66 static bool nrf52_errata_33(void) __UNUSED;
67 static bool nrf52_errata_34(void) __UNUSED;
68 static bool nrf52_errata_35(void) __UNUSED;
69 static bool nrf52_errata_36(void) __UNUSED;
70 static bool nrf52_errata_37(void) __UNUSED;
71 static bool nrf52_errata_38(void) __UNUSED;
72 static bool nrf52_errata_39(void) __UNUSED;
73 static bool nrf52_errata_40(void) __UNUSED;
74 static bool nrf52_errata_41(void) __UNUSED;
75 static bool nrf52_errata_42(void) __UNUSED;
76 static bool nrf52_errata_43(void) __UNUSED;
77 static bool nrf52_errata_44(void) __UNUSED;
78 static bool nrf52_errata_46(void) __UNUSED;
79 static bool nrf52_errata_47(void) __UNUSED;
80 static bool nrf52_errata_48(void) __UNUSED;
81 static bool nrf52_errata_49(void) __UNUSED;
82 static bool nrf52_errata_51(void) __UNUSED;
83 static bool nrf52_errata_54(void) __UNUSED;
84 static bool nrf52_errata_55(void) __UNUSED;
85 static bool nrf52_errata_57(void) __UNUSED;
86 static bool nrf52_errata_58(void) __UNUSED;
87 static bool nrf52_errata_62(void) __UNUSED;
88 static bool nrf52_errata_63(void) __UNUSED;
89 static bool nrf52_errata_64(void) __UNUSED;
90 static bool nrf52_errata_65(void) __UNUSED;
91 static bool nrf52_errata_66(void) __UNUSED;
92 static bool nrf52_errata_67(void) __UNUSED;
93 static bool nrf52_errata_68(void) __UNUSED;
94 static bool nrf52_errata_70(void) __UNUSED;
95 static bool nrf52_errata_71(void) __UNUSED;
96 static bool nrf52_errata_72(void) __UNUSED;
97 static bool nrf52_errata_73(void) __UNUSED;
98 static bool nrf52_errata_74(void) __UNUSED;
99 static bool nrf52_errata_75(void) __UNUSED;
100 static bool nrf52_errata_76(void) __UNUSED;
101 static bool nrf52_errata_77(void) __UNUSED;
102 static bool nrf52_errata_78(void) __UNUSED;
103 static bool nrf52_errata_79(void) __UNUSED;
104 static bool nrf52_errata_81(void) __UNUSED;
105 static bool nrf52_errata_83(void) __UNUSED;
106 static bool nrf52_errata_84(void) __UNUSED;
107 static bool nrf52_errata_86(void) __UNUSED;
108 static bool nrf52_errata_87(void) __UNUSED;
109 static bool nrf52_errata_88(void) __UNUSED;
110 static bool nrf52_errata_89(void) __UNUSED;
111 static bool nrf52_errata_91(void) __UNUSED;
112 static bool nrf52_errata_94(void) __UNUSED;
113 static bool nrf52_errata_96(void) __UNUSED;
114 static bool nrf52_errata_97(void) __UNUSED;
115 static bool nrf52_errata_98(void) __UNUSED;
116 static bool nrf52_errata_101(void) __UNUSED;
117 static bool nrf52_errata_102(void) __UNUSED;
118 static bool nrf52_errata_103(void) __UNUSED;
119 static bool nrf52_errata_104(void) __UNUSED;
120 static bool nrf52_errata_106(void) __UNUSED;
121 static bool nrf52_errata_107(void) __UNUSED;
122 static bool nrf52_errata_108(void) __UNUSED;
123 static bool nrf52_errata_109(void) __UNUSED;
124 static bool nrf52_errata_110(void) __UNUSED;
125 static bool nrf52_errata_111(void) __UNUSED;
126 static bool nrf52_errata_112(void) __UNUSED;
127 static bool nrf52_errata_113(void) __UNUSED;
128 static bool nrf52_errata_115(void) __UNUSED;
129 static bool nrf52_errata_116(void) __UNUSED;
130 static bool nrf52_errata_117(void) __UNUSED;
131 static bool nrf52_errata_118(void) __UNUSED;
132 static bool nrf52_errata_119(void) __UNUSED;
133 static bool nrf52_errata_120(void) __UNUSED;
134 static bool nrf52_errata_121(void) __UNUSED;
135 static bool nrf52_errata_122(void) __UNUSED;
136 static bool nrf52_errata_127(void) __UNUSED;
137 static bool nrf52_errata_128(void) __UNUSED;
138 static bool nrf52_errata_131(void) __UNUSED;
139 static bool nrf52_errata_132(void) __UNUSED;
140 static bool nrf52_errata_133(void) __UNUSED;
141 static bool nrf52_errata_134(void) __UNUSED;
142 static bool nrf52_errata_135(void) __UNUSED;
143 static bool nrf52_errata_136(void) __UNUSED;
144 static bool nrf52_errata_138(void) __UNUSED;
145 static bool nrf52_errata_140(void) __UNUSED;
146 static bool nrf52_errata_141(void) __UNUSED;
147 static bool nrf52_errata_142(void) __UNUSED;
148 static bool nrf52_errata_143(void) __UNUSED;
149 static bool nrf52_errata_144(void) __UNUSED;
150 static bool nrf52_errata_145(void) __UNUSED;
151 static bool nrf52_errata_146(void) __UNUSED;
152 static bool nrf52_errata_147(void) __UNUSED;
153 static bool nrf52_errata_149(void) __UNUSED;
154 static bool nrf52_errata_150(void) __UNUSED;
155 static bool nrf52_errata_151(void) __UNUSED;
156 static bool nrf52_errata_153(void) __UNUSED;
157 static bool nrf52_errata_154(void) __UNUSED;
158 static bool nrf52_errata_155(void) __UNUSED;
159 static bool nrf52_errata_156(void) __UNUSED;
160 static bool nrf52_errata_158(void) __UNUSED;
161 static bool nrf52_errata_160(void) __UNUSED;
162 static bool nrf52_errata_162(void) __UNUSED;
163 static bool nrf52_errata_163(void) __UNUSED;
164 static bool nrf52_errata_164(void) __UNUSED;
165 static bool nrf52_errata_166(void) __UNUSED;
166 static bool nrf52_errata_170(void) __UNUSED;
167 static bool nrf52_errata_171(void) __UNUSED;
168 static bool nrf52_errata_172(void) __UNUSED;
169 static bool nrf52_errata_173(void) __UNUSED;
170 static bool nrf52_errata_174(void) __UNUSED;
171 static bool nrf52_errata_176(void) __UNUSED;
172 static bool nrf52_errata_178(void) __UNUSED;
173 static bool nrf52_errata_179(void) __UNUSED;
174 static bool nrf52_errata_180(void) __UNUSED;
175 static bool nrf52_errata_181(void) __UNUSED;
176 static bool nrf52_errata_182(void) __UNUSED;
177 static bool nrf52_errata_183(void) __UNUSED;
178 static bool nrf52_errata_184(void) __UNUSED;
179 static bool nrf52_errata_186(void) __UNUSED;
180 static bool nrf52_errata_187(void) __UNUSED;
181 static bool nrf52_errata_189(void) __UNUSED;
182 static bool nrf52_errata_190(void) __UNUSED;
183 static bool nrf52_errata_191(void) __UNUSED;
184 static bool nrf52_errata_192(void) __UNUSED;
185 static bool nrf52_errata_193(void) __UNUSED;
186 static bool nrf52_errata_194(void) __UNUSED;
187 static bool nrf52_errata_195(void) __UNUSED;
188 static bool nrf52_errata_196(void) __UNUSED;
189 static bool nrf52_errata_197(void) __UNUSED;
190 static bool nrf52_errata_198(void) __UNUSED;
191 static bool nrf52_errata_199(void) __UNUSED;
192 static bool nrf52_errata_200(void) __UNUSED;
193 static bool nrf52_errata_201(void) __UNUSED;
194 static bool nrf52_errata_202(void) __UNUSED;
195 static bool nrf52_errata_204(void) __UNUSED;
196 static bool nrf52_errata_208(void) __UNUSED;
197 static bool nrf52_errata_209(void) __UNUSED;
198 static bool nrf52_errata_210(void) __UNUSED;
199 static bool nrf52_errata_211(void) __UNUSED;
200 static bool nrf52_errata_212(void) __UNUSED;
201 static bool nrf52_errata_213(void) __UNUSED;
202 static bool nrf52_errata_214(void) __UNUSED;
203 static bool nrf52_errata_215(void) __UNUSED;
204 static bool nrf52_errata_216(void) __UNUSED;
205 static bool nrf52_errata_217(void) __UNUSED;
206 static bool nrf52_errata_218(void) __UNUSED;
207 static bool nrf52_errata_219(void) __UNUSED;
208 static bool nrf52_errata_220(void) __UNUSED;
209 static bool nrf52_errata_223(void) __UNUSED;
210 static bool nrf52_errata_225(void) __UNUSED;
211 static bool nrf52_errata_228(void) __UNUSED;
212 static bool nrf52_errata_230(void) __UNUSED;
213 static bool nrf52_errata_231(void) __UNUSED;
214 static bool nrf52_errata_232(void) __UNUSED;
215 static bool nrf52_errata_233(void) __UNUSED;
216 static bool nrf52_errata_236(void) __UNUSED;
217 static bool nrf52_errata_237(void) __UNUSED;
218 static bool nrf52_errata_241(void) __UNUSED;
219 static bool nrf52_errata_242(void) __UNUSED;
220 static bool nrf52_errata_243(void) __UNUSED;
221 static bool nrf52_errata_244(void) __UNUSED;
222 static bool nrf52_errata_245(void) __UNUSED;
223 static bool nrf52_errata_246(void) __UNUSED;
224 static bool nrf52_errata_248(void) __UNUSED;
225 static bool nrf52_configuration_249(void) __UNUSED;
226 static bool nrf52_errata_250(void) __UNUSED;
227 static bool nrf52_errata_251(void) __UNUSED;
228 static bool nrf52_errata_252(void) __UNUSED;
229 static bool nrf52_configuration_254(void) __UNUSED;
230 static bool nrf52_configuration_255(void) __UNUSED;
231 static bool nrf52_configuration_256(void) __UNUSED;
232 static bool nrf52_configuration_257(void) __UNUSED;
233 static bool nrf52_errata_258(void) __UNUSED;
234 static bool nrf52_errata_259(void) __UNUSED;
235 static bool nrf52_errata_262(void) __UNUSED;
236 static bool nrf52_errata_263(void) __UNUSED;
237 static bool nrf52_errata_265(void) __UNUSED;
238 static bool nrf52_errata_266(void) __UNUSED;
239 static bool nrf52_errata_267(void) __UNUSED;
240 static bool nrf52_errata_268(void) __UNUSED;
241 static bool nrf52_errata_269(void) __UNUSED;
242 static bool nrf52_errata_270(void) __UNUSED;
243 static bool nrf52_errata_271(void) __UNUSED;
244 static bool nrf52_errata_272(void) __UNUSED;
245 static bool nrf52_errata_273(void) __UNUSED;
246
247 /* ========= Errata 1 ========= */
248 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
249 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
250 #define NRF52_ERRATA_1_PRESENT 1
251 #else
252 #define NRF52_ERRATA_1_PRESENT 0
253 #endif
254
255 #ifndef NRF52_ERRATA_1_ENABLE_WORKAROUND
256 #define NRF52_ERRATA_1_ENABLE_WORKAROUND NRF52_ERRATA_1_PRESENT
257 #endif
258
nrf52_errata_1(void)259 static bool nrf52_errata_1(void)
260 {
261 #ifndef NRF52_SERIES
262 return false;
263 #else
264 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
265 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
266 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
267 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
268 #endif
269 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
270 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
271 if (var1 == 0x06)
272 {
273 switch(var2)
274 {
275 case 0x03ul:
276 return true;
277 case 0x04ul:
278 return false;
279 case 0x05ul:
280 return false;
281 case 0x06ul:
282 return false;
283 case 0x07ul:
284 return false;
285 default:
286 return false;
287 }
288 }
289 #endif
290 return false;
291 #endif
292 }
293
294 /* ========= Errata 2 ========= */
295 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
296 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
297 #define NRF52_ERRATA_2_PRESENT 1
298 #else
299 #define NRF52_ERRATA_2_PRESENT 0
300 #endif
301
302 #ifndef NRF52_ERRATA_2_ENABLE_WORKAROUND
303 #define NRF52_ERRATA_2_ENABLE_WORKAROUND NRF52_ERRATA_2_PRESENT
304 #endif
305
nrf52_errata_2(void)306 static bool nrf52_errata_2(void)
307 {
308 #ifndef NRF52_SERIES
309 return false;
310 #else
311 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
312 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
313 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
314 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
315 #endif
316 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
317 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
318 if (var1 == 0x06)
319 {
320 switch(var2)
321 {
322 case 0x03ul:
323 return true;
324 case 0x04ul:
325 return false;
326 case 0x05ul:
327 return false;
328 case 0x06ul:
329 return false;
330 case 0x07ul:
331 return false;
332 default:
333 return false;
334 }
335 }
336 #endif
337 return false;
338 #endif
339 }
340
341 /* ========= Errata 3 ========= */
342 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
343 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
344 #define NRF52_ERRATA_3_PRESENT 1
345 #else
346 #define NRF52_ERRATA_3_PRESENT 0
347 #endif
348
349 #ifndef NRF52_ERRATA_3_ENABLE_WORKAROUND
350 #define NRF52_ERRATA_3_ENABLE_WORKAROUND NRF52_ERRATA_3_PRESENT
351 #endif
352
nrf52_errata_3(void)353 static bool nrf52_errata_3(void)
354 {
355 #ifndef NRF52_SERIES
356 return false;
357 #else
358 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
359 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
360 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
361 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
362 #endif
363 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
364 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
365 if (var1 == 0x06)
366 {
367 switch(var2)
368 {
369 case 0x03ul:
370 return true;
371 case 0x04ul:
372 return false;
373 case 0x05ul:
374 return false;
375 case 0x06ul:
376 return false;
377 case 0x07ul:
378 return false;
379 default:
380 return false;
381 }
382 }
383 #endif
384 return false;
385 #endif
386 }
387
388 /* ========= Errata 4 ========= */
389 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
390 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
391 #define NRF52_ERRATA_4_PRESENT 1
392 #else
393 #define NRF52_ERRATA_4_PRESENT 0
394 #endif
395
396 #ifndef NRF52_ERRATA_4_ENABLE_WORKAROUND
397 #define NRF52_ERRATA_4_ENABLE_WORKAROUND NRF52_ERRATA_4_PRESENT
398 #endif
399
nrf52_errata_4(void)400 static bool nrf52_errata_4(void)
401 {
402 #ifndef NRF52_SERIES
403 return false;
404 #else
405 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
406 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
407 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
408 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
409 #endif
410 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
411 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
412 if (var1 == 0x06)
413 {
414 switch(var2)
415 {
416 case 0x03ul:
417 return true;
418 case 0x04ul:
419 return false;
420 case 0x05ul:
421 return false;
422 case 0x06ul:
423 return false;
424 case 0x07ul:
425 return false;
426 default:
427 return false;
428 }
429 }
430 #endif
431 return false;
432 #endif
433 }
434
435 /* ========= Errata 7 ========= */
436 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
437 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
438 #define NRF52_ERRATA_7_PRESENT 1
439 #else
440 #define NRF52_ERRATA_7_PRESENT 0
441 #endif
442
443 #ifndef NRF52_ERRATA_7_ENABLE_WORKAROUND
444 #define NRF52_ERRATA_7_ENABLE_WORKAROUND NRF52_ERRATA_7_PRESENT
445 #endif
446
nrf52_errata_7(void)447 static bool nrf52_errata_7(void)
448 {
449 #ifndef NRF52_SERIES
450 return false;
451 #else
452 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
453 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
454 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
455 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
456 #endif
457 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
458 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
459 if (var1 == 0x06)
460 {
461 switch(var2)
462 {
463 case 0x03ul:
464 return true;
465 case 0x04ul:
466 return false;
467 case 0x05ul:
468 return false;
469 case 0x06ul:
470 return false;
471 case 0x07ul:
472 return false;
473 default:
474 return false;
475 }
476 }
477 #endif
478 return false;
479 #endif
480 }
481
482 /* ========= Errata 8 ========= */
483 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
484 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
485 #define NRF52_ERRATA_8_PRESENT 1
486 #else
487 #define NRF52_ERRATA_8_PRESENT 0
488 #endif
489
490 #ifndef NRF52_ERRATA_8_ENABLE_WORKAROUND
491 #define NRF52_ERRATA_8_ENABLE_WORKAROUND NRF52_ERRATA_8_PRESENT
492 #endif
493
nrf52_errata_8(void)494 static bool nrf52_errata_8(void)
495 {
496 #ifndef NRF52_SERIES
497 return false;
498 #else
499 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
500 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
501 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
502 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
503 #endif
504 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
505 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
506 if (var1 == 0x06)
507 {
508 switch(var2)
509 {
510 case 0x03ul:
511 return true;
512 case 0x04ul:
513 return false;
514 case 0x05ul:
515 return false;
516 case 0x06ul:
517 return false;
518 case 0x07ul:
519 return false;
520 default:
521 return false;
522 }
523 }
524 #endif
525 return false;
526 #endif
527 }
528
529 /* ========= Errata 9 ========= */
530 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
531 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
532 #define NRF52_ERRATA_9_PRESENT 1
533 #else
534 #define NRF52_ERRATA_9_PRESENT 0
535 #endif
536
537 #ifndef NRF52_ERRATA_9_ENABLE_WORKAROUND
538 #define NRF52_ERRATA_9_ENABLE_WORKAROUND NRF52_ERRATA_9_PRESENT
539 #endif
540
nrf52_errata_9(void)541 static bool nrf52_errata_9(void)
542 {
543 #ifndef NRF52_SERIES
544 return false;
545 #else
546 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
547 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
548 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
549 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
550 #endif
551 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
552 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
553 if (var1 == 0x06)
554 {
555 switch(var2)
556 {
557 case 0x03ul:
558 return true;
559 case 0x04ul:
560 return false;
561 case 0x05ul:
562 return false;
563 case 0x06ul:
564 return false;
565 case 0x07ul:
566 return false;
567 default:
568 return false;
569 }
570 }
571 #endif
572 return false;
573 #endif
574 }
575
576 /* ========= Errata 10 ========= */
577 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
578 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
579 #define NRF52_ERRATA_10_PRESENT 1
580 #else
581 #define NRF52_ERRATA_10_PRESENT 0
582 #endif
583
584 #ifndef NRF52_ERRATA_10_ENABLE_WORKAROUND
585 #define NRF52_ERRATA_10_ENABLE_WORKAROUND NRF52_ERRATA_10_PRESENT
586 #endif
587
nrf52_errata_10(void)588 static bool nrf52_errata_10(void)
589 {
590 #ifndef NRF52_SERIES
591 return false;
592 #else
593 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
594 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
595 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
596 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
597 #endif
598 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
599 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
600 if (var1 == 0x06)
601 {
602 switch(var2)
603 {
604 case 0x03ul:
605 return true;
606 case 0x04ul:
607 return false;
608 case 0x05ul:
609 return false;
610 case 0x06ul:
611 return false;
612 case 0x07ul:
613 return false;
614 default:
615 return false;
616 }
617 }
618 #endif
619 return false;
620 #endif
621 }
622
623 /* ========= Errata 11 ========= */
624 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
625 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
626 #define NRF52_ERRATA_11_PRESENT 1
627 #else
628 #define NRF52_ERRATA_11_PRESENT 0
629 #endif
630
631 #ifndef NRF52_ERRATA_11_ENABLE_WORKAROUND
632 #define NRF52_ERRATA_11_ENABLE_WORKAROUND NRF52_ERRATA_11_PRESENT
633 #endif
634
nrf52_errata_11(void)635 static bool nrf52_errata_11(void)
636 {
637 #ifndef NRF52_SERIES
638 return false;
639 #else
640 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
641 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
642 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
643 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
644 #endif
645 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
646 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
647 if (var1 == 0x06)
648 {
649 switch(var2)
650 {
651 case 0x03ul:
652 return true;
653 case 0x04ul:
654 return false;
655 case 0x05ul:
656 return false;
657 case 0x06ul:
658 return false;
659 case 0x07ul:
660 return false;
661 default:
662 return false;
663 }
664 }
665 #endif
666 return false;
667 #endif
668 }
669
670 /* ========= Errata 12 ========= */
671 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
672 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
673 #define NRF52_ERRATA_12_PRESENT 1
674 #else
675 #define NRF52_ERRATA_12_PRESENT 0
676 #endif
677
678 #ifndef NRF52_ERRATA_12_ENABLE_WORKAROUND
679 #define NRF52_ERRATA_12_ENABLE_WORKAROUND NRF52_ERRATA_12_PRESENT
680 #endif
681
nrf52_errata_12(void)682 static bool nrf52_errata_12(void)
683 {
684 #ifndef NRF52_SERIES
685 return false;
686 #else
687 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
688 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
689 uint32_t var1;
690 uint32_t var2;
691
692 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
693 {
694 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
695 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
696 }
697 else
698 {
699 var1 = *(uint32_t *)0x10000130ul;
700 var2 = *(uint32_t *)0x10000134ul;
701 }
702 #endif
703 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
704 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
705 if (var1 == 0x06)
706 {
707 switch(var2)
708 {
709 case 0x03ul:
710 return true;
711 case 0x04ul:
712 return true;
713 case 0x05ul:
714 return true;
715 case 0x06ul:
716 return true;
717 case 0x07ul:
718 return true;
719 default:
720 return true;
721 }
722 }
723 #endif
724 return false;
725 #endif
726 }
727
728 /* ========= Errata 15 ========= */
729 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
730 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
731 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
732 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
733 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
734 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
735 #define NRF52_ERRATA_15_PRESENT 1
736 #else
737 #define NRF52_ERRATA_15_PRESENT 0
738 #endif
739
740 #ifndef NRF52_ERRATA_15_ENABLE_WORKAROUND
741 #define NRF52_ERRATA_15_ENABLE_WORKAROUND NRF52_ERRATA_15_PRESENT
742 #endif
743
nrf52_errata_15(void)744 static bool nrf52_errata_15(void)
745 {
746 #ifndef NRF52_SERIES
747 return false;
748 #else
749 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
750 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
751 uint32_t var1;
752 uint32_t var2;
753
754 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
755 {
756 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
757 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
758 }
759 else
760 {
761 var1 = *(uint32_t *)0x10000130ul;
762 var2 = *(uint32_t *)0x10000134ul;
763 }
764 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
765 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
766 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
767 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
768 uint32_t var1 = *(uint32_t *)0x10000130ul;
769 uint32_t var2 = *(uint32_t *)0x10000134ul;
770 #endif
771 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
772 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
773 if (var1 == 0x06)
774 {
775 switch(var2)
776 {
777 case 0x03ul:
778 return true;
779 case 0x04ul:
780 return true;
781 case 0x05ul:
782 return true;
783 case 0x06ul:
784 return true;
785 case 0x07ul:
786 return true;
787 default:
788 return true;
789 }
790 }
791 #endif
792 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
793 if (var1 == 0x08)
794 {
795 switch(var2)
796 {
797 case 0x00ul:
798 return true;
799 case 0x01ul:
800 return false;
801 case 0x02ul:
802 return false;
803 case 0x03ul:
804 return false;
805 case 0x04ul:
806 return false;
807 case 0x05ul:
808 return false;
809 default:
810 return false;
811 }
812 }
813 #endif
814 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
815 if (var1 == 0x0A)
816 {
817 switch(var2)
818 {
819 case 0x00ul:
820 return true;
821 case 0x01ul:
822 return true;
823 case 0x02ul:
824 return true;
825 default:
826 return true;
827 }
828 }
829 #endif
830 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
831 if (var1 == 0x0E)
832 {
833 switch(var2)
834 {
835 case 0x00ul:
836 return true;
837 case 0x01ul:
838 return true;
839 default:
840 return true;
841 }
842 }
843 #endif
844 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
845 if (var1 == 0x0F)
846 {
847 switch(var2)
848 {
849 case 0x00ul:
850 return true;
851 case 0x01ul:
852 return true;
853 default:
854 return true;
855 }
856 }
857 #endif
858 return false;
859 #endif
860 }
861
862 /* ========= Errata 16 ========= */
863 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
864 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
865 #define NRF52_ERRATA_16_PRESENT 1
866 #else
867 #define NRF52_ERRATA_16_PRESENT 0
868 #endif
869
870 #ifndef NRF52_ERRATA_16_ENABLE_WORKAROUND
871 #define NRF52_ERRATA_16_ENABLE_WORKAROUND NRF52_ERRATA_16_PRESENT
872 #endif
873
nrf52_errata_16(void)874 static bool nrf52_errata_16(void)
875 {
876 #ifndef NRF52_SERIES
877 return false;
878 #else
879 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
880 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
881 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
882 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
883 #endif
884 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
885 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
886 if (var1 == 0x06)
887 {
888 switch(var2)
889 {
890 case 0x03ul:
891 return true;
892 case 0x04ul:
893 return false;
894 case 0x05ul:
895 return false;
896 case 0x06ul:
897 return false;
898 case 0x07ul:
899 return false;
900 default:
901 return false;
902 }
903 }
904 #endif
905 return false;
906 #endif
907 }
908
909 /* ========= Errata 17 ========= */
910 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
911 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
912 #define NRF52_ERRATA_17_PRESENT 1
913 #else
914 #define NRF52_ERRATA_17_PRESENT 0
915 #endif
916
917 #ifndef NRF52_ERRATA_17_ENABLE_WORKAROUND
918 #define NRF52_ERRATA_17_ENABLE_WORKAROUND NRF52_ERRATA_17_PRESENT
919 #endif
920
nrf52_errata_17(void)921 static bool nrf52_errata_17(void)
922 {
923 #ifndef NRF52_SERIES
924 return false;
925 #else
926 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
927 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
928 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
929 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
930 #endif
931 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
932 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
933 if (var1 == 0x06)
934 {
935 switch(var2)
936 {
937 case 0x03ul:
938 return true;
939 case 0x04ul:
940 return false;
941 case 0x05ul:
942 return false;
943 case 0x06ul:
944 return false;
945 case 0x07ul:
946 return false;
947 default:
948 return false;
949 }
950 }
951 #endif
952 return false;
953 #endif
954 }
955
956 /* ========= Errata 20 ========= */
957 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
958 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
959 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
960 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
961 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
962 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
963 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
964 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
965 #define NRF52_ERRATA_20_PRESENT 1
966 #else
967 #define NRF52_ERRATA_20_PRESENT 0
968 #endif
969
970 #ifndef NRF52_ERRATA_20_ENABLE_WORKAROUND
971 #define NRF52_ERRATA_20_ENABLE_WORKAROUND NRF52_ERRATA_20_PRESENT
972 #endif
973
nrf52_errata_20(void)974 static bool nrf52_errata_20(void)
975 {
976 #ifndef NRF52_SERIES
977 return false;
978 #else
979 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
980 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
981 uint32_t var1;
982 uint32_t var2;
983
984 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
985 {
986 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
987 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
988 }
989 else
990 {
991 var1 = *(uint32_t *)0x10000130ul;
992 var2 = *(uint32_t *)0x10000134ul;
993 }
994 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
995 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
996 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
997 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
998 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
999 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
1000 uint32_t var1 = *(uint32_t *)0x10000130ul;
1001 uint32_t var2 = *(uint32_t *)0x10000134ul;
1002 #endif
1003 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1004 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1005 if (var1 == 0x06)
1006 {
1007 switch(var2)
1008 {
1009 case 0x03ul:
1010 return true;
1011 case 0x04ul:
1012 return true;
1013 case 0x05ul:
1014 return true;
1015 case 0x06ul:
1016 return true;
1017 case 0x07ul:
1018 return true;
1019 default:
1020 return true;
1021 }
1022 }
1023 #endif
1024 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
1025 if (var1 == 0x08)
1026 {
1027 switch(var2)
1028 {
1029 case 0x00ul:
1030 return true;
1031 case 0x01ul:
1032 return true;
1033 case 0x02ul:
1034 return true;
1035 case 0x03ul:
1036 return true;
1037 case 0x04ul:
1038 return true;
1039 case 0x05ul:
1040 return true;
1041 default:
1042 return true;
1043 }
1044 }
1045 #endif
1046 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
1047 if (var1 == 0x0A)
1048 {
1049 switch(var2)
1050 {
1051 case 0x00ul:
1052 return true;
1053 case 0x01ul:
1054 return true;
1055 case 0x02ul:
1056 return true;
1057 default:
1058 return true;
1059 }
1060 }
1061 #endif
1062 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
1063 if (var1 == 0x0D)
1064 {
1065 switch(var2)
1066 {
1067 case 0x00ul:
1068 return true;
1069 case 0x01ul:
1070 return true;
1071 default:
1072 return true;
1073 }
1074 }
1075 #endif
1076 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
1077 if (var1 == 0x0E)
1078 {
1079 switch(var2)
1080 {
1081 case 0x00ul:
1082 return true;
1083 case 0x01ul:
1084 return true;
1085 default:
1086 return true;
1087 }
1088 }
1089 #endif
1090 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
1091 if (var1 == 0x0F)
1092 {
1093 switch(var2)
1094 {
1095 case 0x00ul:
1096 return true;
1097 case 0x01ul:
1098 return true;
1099 default:
1100 return true;
1101 }
1102 }
1103 #endif
1104 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
1105 if (var1 == 0x10)
1106 {
1107 switch(var2)
1108 {
1109 case 0x00ul:
1110 return true;
1111 case 0x01ul:
1112 return true;
1113 case 0x02ul:
1114 return true;
1115 case 0x03ul:
1116 return true;
1117 default:
1118 return true;
1119 }
1120 }
1121 #endif
1122 return false;
1123 #endif
1124 }
1125
1126 /* ========= Errata 23 ========= */
1127 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1128 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1129 #define NRF52_ERRATA_23_PRESENT 1
1130 #else
1131 #define NRF52_ERRATA_23_PRESENT 0
1132 #endif
1133
1134 #ifndef NRF52_ERRATA_23_ENABLE_WORKAROUND
1135 #define NRF52_ERRATA_23_ENABLE_WORKAROUND NRF52_ERRATA_23_PRESENT
1136 #endif
1137
nrf52_errata_23(void)1138 static bool nrf52_errata_23(void)
1139 {
1140 #ifndef NRF52_SERIES
1141 return false;
1142 #else
1143 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1144 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1145 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1146 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1147 #endif
1148 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1149 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1150 if (var1 == 0x06)
1151 {
1152 switch(var2)
1153 {
1154 case 0x03ul:
1155 return true;
1156 case 0x04ul:
1157 return false;
1158 case 0x05ul:
1159 return false;
1160 case 0x06ul:
1161 return false;
1162 case 0x07ul:
1163 return false;
1164 default:
1165 return false;
1166 }
1167 }
1168 #endif
1169 return false;
1170 #endif
1171 }
1172
1173 /* ========= Errata 24 ========= */
1174 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1175 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1176 #define NRF52_ERRATA_24_PRESENT 1
1177 #else
1178 #define NRF52_ERRATA_24_PRESENT 0
1179 #endif
1180
1181 #ifndef NRF52_ERRATA_24_ENABLE_WORKAROUND
1182 #define NRF52_ERRATA_24_ENABLE_WORKAROUND NRF52_ERRATA_24_PRESENT
1183 #endif
1184
nrf52_errata_24(void)1185 static bool nrf52_errata_24(void)
1186 {
1187 #ifndef NRF52_SERIES
1188 return false;
1189 #else
1190 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1191 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1192 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1193 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1194 #endif
1195 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1196 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1197 if (var1 == 0x06)
1198 {
1199 switch(var2)
1200 {
1201 case 0x03ul:
1202 return true;
1203 case 0x04ul:
1204 return false;
1205 case 0x05ul:
1206 return false;
1207 case 0x06ul:
1208 return false;
1209 case 0x07ul:
1210 return false;
1211 default:
1212 return false;
1213 }
1214 }
1215 #endif
1216 return false;
1217 #endif
1218 }
1219
1220 /* ========= Errata 25 ========= */
1221 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1222 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1223 #define NRF52_ERRATA_25_PRESENT 1
1224 #else
1225 #define NRF52_ERRATA_25_PRESENT 0
1226 #endif
1227
1228 #ifndef NRF52_ERRATA_25_ENABLE_WORKAROUND
1229 #define NRF52_ERRATA_25_ENABLE_WORKAROUND NRF52_ERRATA_25_PRESENT
1230 #endif
1231
nrf52_errata_25(void)1232 static bool nrf52_errata_25(void)
1233 {
1234 #ifndef NRF52_SERIES
1235 return false;
1236 #else
1237 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1238 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1239 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1240 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1241 #endif
1242 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1243 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1244 if (var1 == 0x06)
1245 {
1246 switch(var2)
1247 {
1248 case 0x03ul:
1249 return true;
1250 case 0x04ul:
1251 return false;
1252 case 0x05ul:
1253 return false;
1254 case 0x06ul:
1255 return false;
1256 case 0x07ul:
1257 return false;
1258 default:
1259 return false;
1260 }
1261 }
1262 #endif
1263 return false;
1264 #endif
1265 }
1266
1267 /* ========= Errata 26 ========= */
1268 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1269 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1270 #define NRF52_ERRATA_26_PRESENT 1
1271 #else
1272 #define NRF52_ERRATA_26_PRESENT 0
1273 #endif
1274
1275 #ifndef NRF52_ERRATA_26_ENABLE_WORKAROUND
1276 #define NRF52_ERRATA_26_ENABLE_WORKAROUND NRF52_ERRATA_26_PRESENT
1277 #endif
1278
nrf52_errata_26(void)1279 static bool nrf52_errata_26(void)
1280 {
1281 #ifndef NRF52_SERIES
1282 return false;
1283 #else
1284 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1285 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1286 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1287 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1288 #endif
1289 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1290 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1291 if (var1 == 0x06)
1292 {
1293 switch(var2)
1294 {
1295 case 0x03ul:
1296 return true;
1297 case 0x04ul:
1298 return false;
1299 case 0x05ul:
1300 return false;
1301 case 0x06ul:
1302 return false;
1303 case 0x07ul:
1304 return false;
1305 default:
1306 return false;
1307 }
1308 }
1309 #endif
1310 return false;
1311 #endif
1312 }
1313
1314 /* ========= Errata 27 ========= */
1315 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1316 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1317 #define NRF52_ERRATA_27_PRESENT 1
1318 #else
1319 #define NRF52_ERRATA_27_PRESENT 0
1320 #endif
1321
1322 #ifndef NRF52_ERRATA_27_ENABLE_WORKAROUND
1323 #define NRF52_ERRATA_27_ENABLE_WORKAROUND NRF52_ERRATA_27_PRESENT
1324 #endif
1325
nrf52_errata_27(void)1326 static bool nrf52_errata_27(void)
1327 {
1328 #ifndef NRF52_SERIES
1329 return false;
1330 #else
1331 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1332 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1333 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1334 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1335 #endif
1336 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1337 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1338 if (var1 == 0x06)
1339 {
1340 switch(var2)
1341 {
1342 case 0x03ul:
1343 return true;
1344 case 0x04ul:
1345 return false;
1346 case 0x05ul:
1347 return false;
1348 case 0x06ul:
1349 return false;
1350 case 0x07ul:
1351 return false;
1352 default:
1353 return false;
1354 }
1355 }
1356 #endif
1357 return false;
1358 #endif
1359 }
1360
1361 /* ========= Errata 28 ========= */
1362 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1363 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1364 #define NRF52_ERRATA_28_PRESENT 1
1365 #else
1366 #define NRF52_ERRATA_28_PRESENT 0
1367 #endif
1368
1369 #ifndef NRF52_ERRATA_28_ENABLE_WORKAROUND
1370 #define NRF52_ERRATA_28_ENABLE_WORKAROUND NRF52_ERRATA_28_PRESENT
1371 #endif
1372
nrf52_errata_28(void)1373 static bool nrf52_errata_28(void)
1374 {
1375 #ifndef NRF52_SERIES
1376 return false;
1377 #else
1378 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1379 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1380 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1381 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1382 #endif
1383 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1384 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1385 if (var1 == 0x06)
1386 {
1387 switch(var2)
1388 {
1389 case 0x03ul:
1390 return true;
1391 case 0x04ul:
1392 return false;
1393 case 0x05ul:
1394 return false;
1395 case 0x06ul:
1396 return false;
1397 case 0x07ul:
1398 return false;
1399 default:
1400 return false;
1401 }
1402 }
1403 #endif
1404 return false;
1405 #endif
1406 }
1407
1408 /* ========= Errata 29 ========= */
1409 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1410 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1411 #define NRF52_ERRATA_29_PRESENT 1
1412 #else
1413 #define NRF52_ERRATA_29_PRESENT 0
1414 #endif
1415
1416 #ifndef NRF52_ERRATA_29_ENABLE_WORKAROUND
1417 #define NRF52_ERRATA_29_ENABLE_WORKAROUND NRF52_ERRATA_29_PRESENT
1418 #endif
1419
nrf52_errata_29(void)1420 static bool nrf52_errata_29(void)
1421 {
1422 #ifndef NRF52_SERIES
1423 return false;
1424 #else
1425 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1426 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1427 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1428 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1429 #endif
1430 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1431 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1432 if (var1 == 0x06)
1433 {
1434 switch(var2)
1435 {
1436 case 0x03ul:
1437 return true;
1438 case 0x04ul:
1439 return false;
1440 case 0x05ul:
1441 return false;
1442 case 0x06ul:
1443 return false;
1444 case 0x07ul:
1445 return false;
1446 default:
1447 return false;
1448 }
1449 }
1450 #endif
1451 return false;
1452 #endif
1453 }
1454
1455 /* ========= Errata 30 ========= */
1456 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1457 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1458 #define NRF52_ERRATA_30_PRESENT 1
1459 #else
1460 #define NRF52_ERRATA_30_PRESENT 0
1461 #endif
1462
1463 #ifndef NRF52_ERRATA_30_ENABLE_WORKAROUND
1464 #define NRF52_ERRATA_30_ENABLE_WORKAROUND NRF52_ERRATA_30_PRESENT
1465 #endif
1466
nrf52_errata_30(void)1467 static bool nrf52_errata_30(void)
1468 {
1469 #ifndef NRF52_SERIES
1470 return false;
1471 #else
1472 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1473 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1474 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1475 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1476 #endif
1477 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1478 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1479 if (var1 == 0x06)
1480 {
1481 switch(var2)
1482 {
1483 case 0x03ul:
1484 return true;
1485 case 0x04ul:
1486 return false;
1487 case 0x05ul:
1488 return false;
1489 case 0x06ul:
1490 return false;
1491 case 0x07ul:
1492 return false;
1493 default:
1494 return false;
1495 }
1496 }
1497 #endif
1498 return false;
1499 #endif
1500 }
1501
1502 /* ========= Errata 31 ========= */
1503 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
1504 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
1505 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
1506 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1507 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1508 #define NRF52_ERRATA_31_PRESENT 1
1509 #else
1510 #define NRF52_ERRATA_31_PRESENT 0
1511 #endif
1512
1513 #ifndef NRF52_ERRATA_31_ENABLE_WORKAROUND
1514 #define NRF52_ERRATA_31_ENABLE_WORKAROUND NRF52_ERRATA_31_PRESENT
1515 #endif
1516
nrf52_errata_31(void)1517 static bool nrf52_errata_31(void)
1518 {
1519 #ifndef NRF52_SERIES
1520 return false;
1521 #else
1522 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1523 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1524 uint32_t var1;
1525 uint32_t var2;
1526
1527 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
1528 {
1529 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1530 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1531 }
1532 else
1533 {
1534 var1 = *(uint32_t *)0x10000130ul;
1535 var2 = *(uint32_t *)0x10000134ul;
1536 }
1537 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
1538 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
1539 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
1540 uint32_t var1 = *(uint32_t *)0x10000130ul;
1541 uint32_t var2 = *(uint32_t *)0x10000134ul;
1542 #endif
1543 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1544 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1545 if (var1 == 0x06)
1546 {
1547 switch(var2)
1548 {
1549 case 0x03ul:
1550 return true;
1551 case 0x04ul:
1552 return true;
1553 case 0x05ul:
1554 return true;
1555 case 0x06ul:
1556 return true;
1557 case 0x07ul:
1558 return true;
1559 default:
1560 return true;
1561 }
1562 }
1563 #endif
1564 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
1565 if (var1 == 0x0A)
1566 {
1567 switch(var2)
1568 {
1569 case 0x00ul:
1570 return true;
1571 case 0x01ul:
1572 return true;
1573 case 0x02ul:
1574 return true;
1575 default:
1576 return true;
1577 }
1578 }
1579 #endif
1580 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
1581 if (var1 == 0x0E)
1582 {
1583 switch(var2)
1584 {
1585 case 0x00ul:
1586 return true;
1587 case 0x01ul:
1588 return true;
1589 default:
1590 return true;
1591 }
1592 }
1593 #endif
1594 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
1595 if (var1 == 0x0F)
1596 {
1597 switch(var2)
1598 {
1599 case 0x00ul:
1600 return true;
1601 case 0x01ul:
1602 return true;
1603 default:
1604 return true;
1605 }
1606 }
1607 #endif
1608 return false;
1609 #endif
1610 }
1611
1612 /* ========= Errata 32 ========= */
1613 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1614 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1615 #define NRF52_ERRATA_32_PRESENT 1
1616 #else
1617 #define NRF52_ERRATA_32_PRESENT 0
1618 #endif
1619
1620 #ifndef NRF52_ERRATA_32_ENABLE_WORKAROUND
1621 #define NRF52_ERRATA_32_ENABLE_WORKAROUND NRF52_ERRATA_32_PRESENT
1622 #endif
1623
nrf52_errata_32(void)1624 static bool nrf52_errata_32(void)
1625 {
1626 #ifndef NRF52_SERIES
1627 return false;
1628 #else
1629 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1630 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1631 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1632 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1633 #endif
1634 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1635 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1636 if (var1 == 0x06)
1637 {
1638 switch(var2)
1639 {
1640 case 0x03ul:
1641 return true;
1642 case 0x04ul:
1643 return false;
1644 case 0x05ul:
1645 return false;
1646 case 0x06ul:
1647 return false;
1648 case 0x07ul:
1649 return false;
1650 default:
1651 return false;
1652 }
1653 }
1654 #endif
1655 return false;
1656 #endif
1657 }
1658
1659 /* ========= Errata 33 ========= */
1660 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1661 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1662 #define NRF52_ERRATA_33_PRESENT 1
1663 #else
1664 #define NRF52_ERRATA_33_PRESENT 0
1665 #endif
1666
1667 #ifndef NRF52_ERRATA_33_ENABLE_WORKAROUND
1668 #define NRF52_ERRATA_33_ENABLE_WORKAROUND NRF52_ERRATA_33_PRESENT
1669 #endif
1670
nrf52_errata_33(void)1671 static bool nrf52_errata_33(void)
1672 {
1673 #ifndef NRF52_SERIES
1674 return false;
1675 #else
1676 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1677 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1678 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1679 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1680 #endif
1681 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1682 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1683 if (var1 == 0x06)
1684 {
1685 switch(var2)
1686 {
1687 case 0x03ul:
1688 return true;
1689 case 0x04ul:
1690 return false;
1691 case 0x05ul:
1692 return false;
1693 case 0x06ul:
1694 return false;
1695 case 0x07ul:
1696 return false;
1697 default:
1698 return false;
1699 }
1700 }
1701 #endif
1702 return false;
1703 #endif
1704 }
1705
1706 /* ========= Errata 34 ========= */
1707 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1708 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1709 #define NRF52_ERRATA_34_PRESENT 1
1710 #else
1711 #define NRF52_ERRATA_34_PRESENT 0
1712 #endif
1713
1714 #ifndef NRF52_ERRATA_34_ENABLE_WORKAROUND
1715 #define NRF52_ERRATA_34_ENABLE_WORKAROUND NRF52_ERRATA_34_PRESENT
1716 #endif
1717
nrf52_errata_34(void)1718 static bool nrf52_errata_34(void)
1719 {
1720 #ifndef NRF52_SERIES
1721 return false;
1722 #else
1723 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1724 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1725 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1726 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1727 #endif
1728 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1729 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1730 if (var1 == 0x06)
1731 {
1732 switch(var2)
1733 {
1734 case 0x03ul:
1735 return true;
1736 case 0x04ul:
1737 return false;
1738 case 0x05ul:
1739 return false;
1740 case 0x06ul:
1741 return false;
1742 case 0x07ul:
1743 return false;
1744 default:
1745 return false;
1746 }
1747 }
1748 #endif
1749 return false;
1750 #endif
1751 }
1752
1753 /* ========= Errata 35 ========= */
1754 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1755 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1756 #define NRF52_ERRATA_35_PRESENT 1
1757 #else
1758 #define NRF52_ERRATA_35_PRESENT 0
1759 #endif
1760
1761 #ifndef NRF52_ERRATA_35_ENABLE_WORKAROUND
1762 #define NRF52_ERRATA_35_ENABLE_WORKAROUND NRF52_ERRATA_35_PRESENT
1763 #endif
1764
nrf52_errata_35(void)1765 static bool nrf52_errata_35(void)
1766 {
1767 #ifndef NRF52_SERIES
1768 return false;
1769 #else
1770 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1771 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1772 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1773 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1774 #endif
1775 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1776 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1777 if (var1 == 0x06)
1778 {
1779 switch(var2)
1780 {
1781 case 0x03ul:
1782 return true;
1783 case 0x04ul:
1784 return false;
1785 case 0x05ul:
1786 return false;
1787 case 0x06ul:
1788 return false;
1789 case 0x07ul:
1790 return false;
1791 default:
1792 return false;
1793 }
1794 }
1795 #endif
1796 return false;
1797 #endif
1798 }
1799
1800 /* ========= Errata 36 ========= */
1801 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
1802 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
1803 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
1804 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
1805 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1806 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
1807 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
1808 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
1809 #define NRF52_ERRATA_36_PRESENT 1
1810 #else
1811 #define NRF52_ERRATA_36_PRESENT 0
1812 #endif
1813
1814 #ifndef NRF52_ERRATA_36_ENABLE_WORKAROUND
1815 #define NRF52_ERRATA_36_ENABLE_WORKAROUND NRF52_ERRATA_36_PRESENT
1816 #endif
1817
nrf52_errata_36(void)1818 static bool nrf52_errata_36(void)
1819 {
1820 #ifndef NRF52_SERIES
1821 return false;
1822 #else
1823 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1824 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1825 uint32_t var1;
1826 uint32_t var2;
1827
1828 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
1829 {
1830 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1831 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1832 }
1833 else
1834 {
1835 var1 = *(uint32_t *)0x10000130ul;
1836 var2 = *(uint32_t *)0x10000134ul;
1837 }
1838 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
1839 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
1840 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
1841 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
1842 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
1843 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
1844 uint32_t var1 = *(uint32_t *)0x10000130ul;
1845 uint32_t var2 = *(uint32_t *)0x10000134ul;
1846 #endif
1847 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1848 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1849 if (var1 == 0x06)
1850 {
1851 switch(var2)
1852 {
1853 case 0x03ul:
1854 return true;
1855 case 0x04ul:
1856 return true;
1857 case 0x05ul:
1858 return true;
1859 case 0x06ul:
1860 return true;
1861 case 0x07ul:
1862 return true;
1863 default:
1864 return true;
1865 }
1866 }
1867 #endif
1868 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
1869 if (var1 == 0x08)
1870 {
1871 switch(var2)
1872 {
1873 case 0x00ul:
1874 return true;
1875 case 0x01ul:
1876 return true;
1877 case 0x02ul:
1878 return true;
1879 case 0x03ul:
1880 return true;
1881 case 0x04ul:
1882 return true;
1883 case 0x05ul:
1884 return true;
1885 default:
1886 return true;
1887 }
1888 }
1889 #endif
1890 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
1891 if (var1 == 0x0A)
1892 {
1893 switch(var2)
1894 {
1895 case 0x00ul:
1896 return true;
1897 case 0x01ul:
1898 return true;
1899 case 0x02ul:
1900 return true;
1901 default:
1902 return true;
1903 }
1904 }
1905 #endif
1906 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
1907 if (var1 == 0x0D)
1908 {
1909 switch(var2)
1910 {
1911 case 0x00ul:
1912 return true;
1913 case 0x01ul:
1914 return true;
1915 default:
1916 return true;
1917 }
1918 }
1919 #endif
1920 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
1921 if (var1 == 0x0E)
1922 {
1923 switch(var2)
1924 {
1925 case 0x00ul:
1926 return true;
1927 case 0x01ul:
1928 return true;
1929 default:
1930 return true;
1931 }
1932 }
1933 #endif
1934 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
1935 if (var1 == 0x0F)
1936 {
1937 switch(var2)
1938 {
1939 case 0x00ul:
1940 return true;
1941 case 0x01ul:
1942 return true;
1943 default:
1944 return true;
1945 }
1946 }
1947 #endif
1948 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
1949 if (var1 == 0x10)
1950 {
1951 switch(var2)
1952 {
1953 case 0x00ul:
1954 return true;
1955 case 0x01ul:
1956 return true;
1957 case 0x02ul:
1958 return true;
1959 case 0x03ul:
1960 return true;
1961 default:
1962 return true;
1963 }
1964 }
1965 #endif
1966 return false;
1967 #endif
1968 }
1969
1970 /* ========= Errata 37 ========= */
1971 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
1972 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1973 #define NRF52_ERRATA_37_PRESENT 1
1974 #else
1975 #define NRF52_ERRATA_37_PRESENT 0
1976 #endif
1977
1978 #ifndef NRF52_ERRATA_37_ENABLE_WORKAROUND
1979 #define NRF52_ERRATA_37_ENABLE_WORKAROUND NRF52_ERRATA_37_PRESENT
1980 #endif
1981
nrf52_errata_37(void)1982 static bool nrf52_errata_37(void)
1983 {
1984 #ifndef NRF52_SERIES
1985 return false;
1986 #else
1987 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1988 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1989 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
1990 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
1991 #endif
1992 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
1993 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
1994 if (var1 == 0x06)
1995 {
1996 switch(var2)
1997 {
1998 case 0x03ul:
1999 return true;
2000 case 0x04ul:
2001 return false;
2002 case 0x05ul:
2003 return false;
2004 case 0x06ul:
2005 return false;
2006 case 0x07ul:
2007 return false;
2008 default:
2009 return false;
2010 }
2011 }
2012 #endif
2013 return false;
2014 #endif
2015 }
2016
2017 /* ========= Errata 38 ========= */
2018 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2019 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2020 #define NRF52_ERRATA_38_PRESENT 1
2021 #else
2022 #define NRF52_ERRATA_38_PRESENT 0
2023 #endif
2024
2025 #ifndef NRF52_ERRATA_38_ENABLE_WORKAROUND
2026 #define NRF52_ERRATA_38_ENABLE_WORKAROUND NRF52_ERRATA_38_PRESENT
2027 #endif
2028
nrf52_errata_38(void)2029 static bool nrf52_errata_38(void)
2030 {
2031 #ifndef NRF52_SERIES
2032 return false;
2033 #else
2034 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2035 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2036 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2037 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2038 #endif
2039 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2040 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2041 if (var1 == 0x06)
2042 {
2043 switch(var2)
2044 {
2045 case 0x03ul:
2046 return true;
2047 case 0x04ul:
2048 return false;
2049 case 0x05ul:
2050 return false;
2051 case 0x06ul:
2052 return false;
2053 case 0x07ul:
2054 return false;
2055 default:
2056 return false;
2057 }
2058 }
2059 #endif
2060 return false;
2061 #endif
2062 }
2063
2064 /* ========= Errata 39 ========= */
2065 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2066 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2067 #define NRF52_ERRATA_39_PRESENT 1
2068 #else
2069 #define NRF52_ERRATA_39_PRESENT 0
2070 #endif
2071
2072 #ifndef NRF52_ERRATA_39_ENABLE_WORKAROUND
2073 #define NRF52_ERRATA_39_ENABLE_WORKAROUND NRF52_ERRATA_39_PRESENT
2074 #endif
2075
nrf52_errata_39(void)2076 static bool nrf52_errata_39(void)
2077 {
2078 #ifndef NRF52_SERIES
2079 return false;
2080 #else
2081 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2082 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2083 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2084 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2085 #endif
2086 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2087 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2088 if (var1 == 0x06)
2089 {
2090 switch(var2)
2091 {
2092 case 0x03ul:
2093 return true;
2094 case 0x04ul:
2095 return false;
2096 case 0x05ul:
2097 return false;
2098 case 0x06ul:
2099 return false;
2100 case 0x07ul:
2101 return false;
2102 default:
2103 return false;
2104 }
2105 }
2106 #endif
2107 return false;
2108 #endif
2109 }
2110
2111 /* ========= Errata 40 ========= */
2112 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2113 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2114 #define NRF52_ERRATA_40_PRESENT 1
2115 #else
2116 #define NRF52_ERRATA_40_PRESENT 0
2117 #endif
2118
2119 #ifndef NRF52_ERRATA_40_ENABLE_WORKAROUND
2120 #define NRF52_ERRATA_40_ENABLE_WORKAROUND NRF52_ERRATA_40_PRESENT
2121 #endif
2122
nrf52_errata_40(void)2123 static bool nrf52_errata_40(void)
2124 {
2125 #ifndef NRF52_SERIES
2126 return false;
2127 #else
2128 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2129 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2130 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2131 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2132 #endif
2133 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2134 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2135 if (var1 == 0x06)
2136 {
2137 switch(var2)
2138 {
2139 case 0x03ul:
2140 return true;
2141 case 0x04ul:
2142 return false;
2143 case 0x05ul:
2144 return false;
2145 case 0x06ul:
2146 return false;
2147 case 0x07ul:
2148 return false;
2149 default:
2150 return false;
2151 }
2152 }
2153 #endif
2154 return false;
2155 #endif
2156 }
2157
2158 /* ========= Errata 41 ========= */
2159 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2160 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2161 #define NRF52_ERRATA_41_PRESENT 1
2162 #else
2163 #define NRF52_ERRATA_41_PRESENT 0
2164 #endif
2165
2166 #ifndef NRF52_ERRATA_41_ENABLE_WORKAROUND
2167 #define NRF52_ERRATA_41_ENABLE_WORKAROUND NRF52_ERRATA_41_PRESENT
2168 #endif
2169
nrf52_errata_41(void)2170 static bool nrf52_errata_41(void)
2171 {
2172 #ifndef NRF52_SERIES
2173 return false;
2174 #else
2175 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2176 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2177 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2178 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2179 #endif
2180 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2181 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2182 if (var1 == 0x06)
2183 {
2184 switch(var2)
2185 {
2186 case 0x03ul:
2187 return true;
2188 case 0x04ul:
2189 return false;
2190 case 0x05ul:
2191 return false;
2192 case 0x06ul:
2193 return false;
2194 case 0x07ul:
2195 return false;
2196 default:
2197 return false;
2198 }
2199 }
2200 #endif
2201 return false;
2202 #endif
2203 }
2204
2205 /* ========= Errata 42 ========= */
2206 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2207 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2208 #define NRF52_ERRATA_42_PRESENT 1
2209 #else
2210 #define NRF52_ERRATA_42_PRESENT 0
2211 #endif
2212
2213 #ifndef NRF52_ERRATA_42_ENABLE_WORKAROUND
2214 #define NRF52_ERRATA_42_ENABLE_WORKAROUND NRF52_ERRATA_42_PRESENT
2215 #endif
2216
nrf52_errata_42(void)2217 static bool nrf52_errata_42(void)
2218 {
2219 #ifndef NRF52_SERIES
2220 return false;
2221 #else
2222 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2223 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2224 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2225 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2226 #endif
2227 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2228 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2229 if (var1 == 0x06)
2230 {
2231 switch(var2)
2232 {
2233 case 0x03ul:
2234 return true;
2235 case 0x04ul:
2236 return false;
2237 case 0x05ul:
2238 return false;
2239 case 0x06ul:
2240 return false;
2241 case 0x07ul:
2242 return false;
2243 default:
2244 return false;
2245 }
2246 }
2247 #endif
2248 return false;
2249 #endif
2250 }
2251
2252 /* ========= Errata 43 ========= */
2253 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2254 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2255 #define NRF52_ERRATA_43_PRESENT 1
2256 #else
2257 #define NRF52_ERRATA_43_PRESENT 0
2258 #endif
2259
2260 #ifndef NRF52_ERRATA_43_ENABLE_WORKAROUND
2261 #define NRF52_ERRATA_43_ENABLE_WORKAROUND NRF52_ERRATA_43_PRESENT
2262 #endif
2263
nrf52_errata_43(void)2264 static bool nrf52_errata_43(void)
2265 {
2266 #ifndef NRF52_SERIES
2267 return false;
2268 #else
2269 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2270 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2271 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2272 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2273 #endif
2274 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2275 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2276 if (var1 == 0x06)
2277 {
2278 switch(var2)
2279 {
2280 case 0x03ul:
2281 return true;
2282 case 0x04ul:
2283 return false;
2284 case 0x05ul:
2285 return false;
2286 case 0x06ul:
2287 return false;
2288 case 0x07ul:
2289 return false;
2290 default:
2291 return false;
2292 }
2293 }
2294 #endif
2295 return false;
2296 #endif
2297 }
2298
2299 /* ========= Errata 44 ========= */
2300 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2301 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2302 #define NRF52_ERRATA_44_PRESENT 1
2303 #else
2304 #define NRF52_ERRATA_44_PRESENT 0
2305 #endif
2306
2307 #ifndef NRF52_ERRATA_44_ENABLE_WORKAROUND
2308 #define NRF52_ERRATA_44_ENABLE_WORKAROUND NRF52_ERRATA_44_PRESENT
2309 #endif
2310
nrf52_errata_44(void)2311 static bool nrf52_errata_44(void)
2312 {
2313 #ifndef NRF52_SERIES
2314 return false;
2315 #else
2316 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2317 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2318 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2319 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2320 #endif
2321 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2322 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2323 if (var1 == 0x06)
2324 {
2325 switch(var2)
2326 {
2327 case 0x03ul:
2328 return true;
2329 case 0x04ul:
2330 return false;
2331 case 0x05ul:
2332 return false;
2333 case 0x06ul:
2334 return false;
2335 case 0x07ul:
2336 return false;
2337 default:
2338 return false;
2339 }
2340 }
2341 #endif
2342 return false;
2343 #endif
2344 }
2345
2346 /* ========= Errata 46 ========= */
2347 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2348 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2349 #define NRF52_ERRATA_46_PRESENT 1
2350 #else
2351 #define NRF52_ERRATA_46_PRESENT 0
2352 #endif
2353
2354 #ifndef NRF52_ERRATA_46_ENABLE_WORKAROUND
2355 #define NRF52_ERRATA_46_ENABLE_WORKAROUND NRF52_ERRATA_46_PRESENT
2356 #endif
2357
nrf52_errata_46(void)2358 static bool nrf52_errata_46(void)
2359 {
2360 #ifndef NRF52_SERIES
2361 return false;
2362 #else
2363 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2364 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2365 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2366 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2367 #endif
2368 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2369 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2370 if (var1 == 0x06)
2371 {
2372 switch(var2)
2373 {
2374 case 0x03ul:
2375 return true;
2376 case 0x04ul:
2377 return false;
2378 case 0x05ul:
2379 return false;
2380 case 0x06ul:
2381 return false;
2382 case 0x07ul:
2383 return false;
2384 default:
2385 return false;
2386 }
2387 }
2388 #endif
2389 return false;
2390 #endif
2391 }
2392
2393 /* ========= Errata 47 ========= */
2394 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2395 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2396 #define NRF52_ERRATA_47_PRESENT 1
2397 #else
2398 #define NRF52_ERRATA_47_PRESENT 0
2399 #endif
2400
2401 #ifndef NRF52_ERRATA_47_ENABLE_WORKAROUND
2402 #define NRF52_ERRATA_47_ENABLE_WORKAROUND NRF52_ERRATA_47_PRESENT
2403 #endif
2404
nrf52_errata_47(void)2405 static bool nrf52_errata_47(void)
2406 {
2407 #ifndef NRF52_SERIES
2408 return false;
2409 #else
2410 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2411 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2412 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2413 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2414 #endif
2415 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2416 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2417 if (var1 == 0x06)
2418 {
2419 switch(var2)
2420 {
2421 case 0x03ul:
2422 return true;
2423 case 0x04ul:
2424 return false;
2425 case 0x05ul:
2426 return false;
2427 case 0x06ul:
2428 return false;
2429 case 0x07ul:
2430 return false;
2431 default:
2432 return false;
2433 }
2434 }
2435 #endif
2436 return false;
2437 #endif
2438 }
2439
2440 /* ========= Errata 48 ========= */
2441 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2442 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2443 #define NRF52_ERRATA_48_PRESENT 1
2444 #else
2445 #define NRF52_ERRATA_48_PRESENT 0
2446 #endif
2447
2448 #ifndef NRF52_ERRATA_48_ENABLE_WORKAROUND
2449 #define NRF52_ERRATA_48_ENABLE_WORKAROUND NRF52_ERRATA_48_PRESENT
2450 #endif
2451
nrf52_errata_48(void)2452 static bool nrf52_errata_48(void)
2453 {
2454 #ifndef NRF52_SERIES
2455 return false;
2456 #else
2457 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2458 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2459 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2460 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2461 #endif
2462 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2463 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2464 if (var1 == 0x06)
2465 {
2466 switch(var2)
2467 {
2468 case 0x03ul:
2469 return true;
2470 case 0x04ul:
2471 return false;
2472 case 0x05ul:
2473 return false;
2474 case 0x06ul:
2475 return false;
2476 case 0x07ul:
2477 return false;
2478 default:
2479 return false;
2480 }
2481 }
2482 #endif
2483 return false;
2484 #endif
2485 }
2486
2487 /* ========= Errata 49 ========= */
2488 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2489 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2490 #define NRF52_ERRATA_49_PRESENT 1
2491 #else
2492 #define NRF52_ERRATA_49_PRESENT 0
2493 #endif
2494
2495 #ifndef NRF52_ERRATA_49_ENABLE_WORKAROUND
2496 #define NRF52_ERRATA_49_ENABLE_WORKAROUND NRF52_ERRATA_49_PRESENT
2497 #endif
2498
nrf52_errata_49(void)2499 static bool nrf52_errata_49(void)
2500 {
2501 #ifndef NRF52_SERIES
2502 return false;
2503 #else
2504 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2505 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2506 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2507 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2508 #endif
2509 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2510 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2511 if (var1 == 0x06)
2512 {
2513 switch(var2)
2514 {
2515 case 0x03ul:
2516 return true;
2517 case 0x04ul:
2518 return false;
2519 case 0x05ul:
2520 return false;
2521 case 0x06ul:
2522 return false;
2523 case 0x07ul:
2524 return false;
2525 default:
2526 return false;
2527 }
2528 }
2529 #endif
2530 return false;
2531 #endif
2532 }
2533
2534 /* ========= Errata 51 ========= */
2535 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2536 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2537 #define NRF52_ERRATA_51_PRESENT 1
2538 #else
2539 #define NRF52_ERRATA_51_PRESENT 0
2540 #endif
2541
2542 #ifndef NRF52_ERRATA_51_ENABLE_WORKAROUND
2543 #define NRF52_ERRATA_51_ENABLE_WORKAROUND NRF52_ERRATA_51_PRESENT
2544 #endif
2545
nrf52_errata_51(void)2546 static bool nrf52_errata_51(void)
2547 {
2548 #ifndef NRF52_SERIES
2549 return false;
2550 #else
2551 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2552 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2553 uint32_t var1;
2554 uint32_t var2;
2555
2556 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
2557 {
2558 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2559 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2560 }
2561 else
2562 {
2563 var1 = *(uint32_t *)0x10000130ul;
2564 var2 = *(uint32_t *)0x10000134ul;
2565 }
2566 #endif
2567 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2568 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2569 if (var1 == 0x06)
2570 {
2571 switch(var2)
2572 {
2573 case 0x03ul:
2574 return false;
2575 case 0x04ul:
2576 return true;
2577 case 0x05ul:
2578 return true;
2579 case 0x06ul:
2580 return true;
2581 case 0x07ul:
2582 return true;
2583 default:
2584 return true;
2585 }
2586 }
2587 #endif
2588 return false;
2589 #endif
2590 }
2591
2592 /* ========= Errata 54 ========= */
2593 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2594 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
2595 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2596 #define NRF52_ERRATA_54_PRESENT 1
2597 #else
2598 #define NRF52_ERRATA_54_PRESENT 0
2599 #endif
2600
2601 #ifndef NRF52_ERRATA_54_ENABLE_WORKAROUND
2602 #define NRF52_ERRATA_54_ENABLE_WORKAROUND NRF52_ERRATA_54_PRESENT
2603 #endif
2604
nrf52_errata_54(void)2605 static bool nrf52_errata_54(void)
2606 {
2607 #ifndef NRF52_SERIES
2608 return false;
2609 #else
2610 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2611 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2612 uint32_t var1;
2613 uint32_t var2;
2614
2615 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
2616 {
2617 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2618 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2619 }
2620 else
2621 {
2622 var1 = *(uint32_t *)0x10000130ul;
2623 var2 = *(uint32_t *)0x10000134ul;
2624 }
2625 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2626 uint32_t var1 = *(uint32_t *)0x10000130ul;
2627 uint32_t var2 = *(uint32_t *)0x10000134ul;
2628 #endif
2629 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2630 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2631 if (var1 == 0x06)
2632 {
2633 switch(var2)
2634 {
2635 case 0x03ul:
2636 return false;
2637 case 0x04ul:
2638 return true;
2639 case 0x05ul:
2640 return true;
2641 case 0x06ul:
2642 return true;
2643 case 0x07ul:
2644 return true;
2645 default:
2646 return true;
2647 }
2648 }
2649 #endif
2650 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2651 if (var1 == 0x08)
2652 {
2653 switch(var2)
2654 {
2655 case 0x00ul:
2656 return true;
2657 case 0x01ul:
2658 return false;
2659 case 0x02ul:
2660 return false;
2661 case 0x03ul:
2662 return false;
2663 case 0x04ul:
2664 return false;
2665 case 0x05ul:
2666 return false;
2667 default:
2668 return false;
2669 }
2670 }
2671 #endif
2672 return false;
2673 #endif
2674 }
2675
2676 /* ========= Errata 55 ========= */
2677 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
2678 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2679 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
2680 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
2681 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2682 #define NRF52_ERRATA_55_PRESENT 1
2683 #else
2684 #define NRF52_ERRATA_55_PRESENT 0
2685 #endif
2686
2687 #ifndef NRF52_ERRATA_55_ENABLE_WORKAROUND
2688 #define NRF52_ERRATA_55_ENABLE_WORKAROUND NRF52_ERRATA_55_PRESENT
2689 #endif
2690
nrf52_errata_55(void)2691 static bool nrf52_errata_55(void)
2692 {
2693 #ifndef NRF52_SERIES
2694 return false;
2695 #else
2696 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2697 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2698 uint32_t var1;
2699 uint32_t var2;
2700
2701 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
2702 {
2703 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2704 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2705 }
2706 else
2707 {
2708 var1 = *(uint32_t *)0x10000130ul;
2709 var2 = *(uint32_t *)0x10000134ul;
2710 }
2711 #elif defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
2712 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
2713 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2714 uint32_t var1 = *(uint32_t *)0x10000130ul;
2715 uint32_t var2 = *(uint32_t *)0x10000134ul;
2716 #endif
2717 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2718 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2719 if (var1 == 0x06)
2720 {
2721 switch(var2)
2722 {
2723 case 0x03ul:
2724 return false;
2725 case 0x04ul:
2726 return true;
2727 case 0x05ul:
2728 return true;
2729 case 0x06ul:
2730 return true;
2731 case 0x07ul:
2732 return true;
2733 default:
2734 return true;
2735 }
2736 }
2737 #endif
2738 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2739 if (var1 == 0x08)
2740 {
2741 switch(var2)
2742 {
2743 case 0x00ul:
2744 return true;
2745 case 0x01ul:
2746 return true;
2747 case 0x02ul:
2748 return true;
2749 case 0x03ul:
2750 return true;
2751 case 0x04ul:
2752 return true;
2753 case 0x05ul:
2754 return true;
2755 default:
2756 return true;
2757 }
2758 }
2759 #endif
2760 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
2761 if (var1 == 0x0D)
2762 {
2763 switch(var2)
2764 {
2765 case 0x00ul:
2766 return true;
2767 case 0x01ul:
2768 return true;
2769 default:
2770 return true;
2771 }
2772 }
2773 #endif
2774 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
2775 if (var1 == 0x10)
2776 {
2777 switch(var2)
2778 {
2779 case 0x00ul:
2780 return true;
2781 case 0x01ul:
2782 return true;
2783 case 0x02ul:
2784 return false;
2785 case 0x03ul:
2786 return false;
2787 default:
2788 return false;
2789 }
2790 }
2791 #endif
2792 return false;
2793 #endif
2794 }
2795
2796 /* ========= Errata 57 ========= */
2797 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2798 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2799 #define NRF52_ERRATA_57_PRESENT 1
2800 #else
2801 #define NRF52_ERRATA_57_PRESENT 0
2802 #endif
2803
2804 #ifndef NRF52_ERRATA_57_ENABLE_WORKAROUND
2805 #define NRF52_ERRATA_57_ENABLE_WORKAROUND NRF52_ERRATA_57_PRESENT
2806 #endif
2807
nrf52_errata_57(void)2808 static bool nrf52_errata_57(void)
2809 {
2810 #ifndef NRF52_SERIES
2811 return false;
2812 #else
2813 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2814 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2815 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2816 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2817 #endif
2818 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2819 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2820 if (var1 == 0x06)
2821 {
2822 switch(var2)
2823 {
2824 case 0x03ul:
2825 return true;
2826 case 0x04ul:
2827 return false;
2828 case 0x05ul:
2829 return false;
2830 case 0x06ul:
2831 return false;
2832 case 0x07ul:
2833 return false;
2834 default:
2835 return false;
2836 }
2837 }
2838 #endif
2839 return false;
2840 #endif
2841 }
2842
2843 /* ========= Errata 58 ========= */
2844 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2845 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
2846 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2847 #define NRF52_ERRATA_58_PRESENT 1
2848 #else
2849 #define NRF52_ERRATA_58_PRESENT 0
2850 #endif
2851
2852 #ifndef NRF52_ERRATA_58_ENABLE_WORKAROUND
2853 #define NRF52_ERRATA_58_ENABLE_WORKAROUND NRF52_ERRATA_58_PRESENT
2854 #endif
2855
nrf52_errata_58(void)2856 static bool nrf52_errata_58(void)
2857 {
2858 #ifndef NRF52_SERIES
2859 return false;
2860 #else
2861 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2862 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2863 uint32_t var1;
2864 uint32_t var2;
2865
2866 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
2867 {
2868 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2869 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2870 }
2871 else
2872 {
2873 var1 = *(uint32_t *)0x10000130ul;
2874 var2 = *(uint32_t *)0x10000134ul;
2875 }
2876 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2877 uint32_t var1 = *(uint32_t *)0x10000130ul;
2878 uint32_t var2 = *(uint32_t *)0x10000134ul;
2879 #endif
2880 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2881 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2882 if (var1 == 0x06)
2883 {
2884 switch(var2)
2885 {
2886 case 0x03ul:
2887 return true;
2888 case 0x04ul:
2889 return true;
2890 case 0x05ul:
2891 return true;
2892 case 0x06ul:
2893 return true;
2894 case 0x07ul:
2895 return true;
2896 default:
2897 return true;
2898 }
2899 }
2900 #endif
2901 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
2902 if (var1 == 0x08)
2903 {
2904 switch(var2)
2905 {
2906 case 0x00ul:
2907 return true;
2908 case 0x01ul:
2909 return false;
2910 case 0x02ul:
2911 return false;
2912 case 0x03ul:
2913 return false;
2914 case 0x04ul:
2915 return false;
2916 case 0x05ul:
2917 return false;
2918 default:
2919 return false;
2920 }
2921 }
2922 #endif
2923 return false;
2924 #endif
2925 }
2926
2927 /* ========= Errata 62 ========= */
2928 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2929 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2930 #define NRF52_ERRATA_62_PRESENT 1
2931 #else
2932 #define NRF52_ERRATA_62_PRESENT 0
2933 #endif
2934
2935 #ifndef NRF52_ERRATA_62_ENABLE_WORKAROUND
2936 #define NRF52_ERRATA_62_ENABLE_WORKAROUND NRF52_ERRATA_62_PRESENT
2937 #endif
2938
nrf52_errata_62(void)2939 static bool nrf52_errata_62(void)
2940 {
2941 #ifndef NRF52_SERIES
2942 return false;
2943 #else
2944 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2945 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2946 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2947 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2948 #endif
2949 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2950 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2951 if (var1 == 0x06)
2952 {
2953 switch(var2)
2954 {
2955 case 0x03ul:
2956 return true;
2957 case 0x04ul:
2958 return false;
2959 case 0x05ul:
2960 return false;
2961 case 0x06ul:
2962 return false;
2963 case 0x07ul:
2964 return false;
2965 default:
2966 return false;
2967 }
2968 }
2969 #endif
2970 return false;
2971 #endif
2972 }
2973
2974 /* ========= Errata 63 ========= */
2975 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
2976 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2977 #define NRF52_ERRATA_63_PRESENT 1
2978 #else
2979 #define NRF52_ERRATA_63_PRESENT 0
2980 #endif
2981
2982 #ifndef NRF52_ERRATA_63_ENABLE_WORKAROUND
2983 #define NRF52_ERRATA_63_ENABLE_WORKAROUND NRF52_ERRATA_63_PRESENT
2984 #endif
2985
nrf52_errata_63(void)2986 static bool nrf52_errata_63(void)
2987 {
2988 #ifndef NRF52_SERIES
2989 return false;
2990 #else
2991 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2992 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2993 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
2994 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
2995 #endif
2996 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
2997 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
2998 if (var1 == 0x06)
2999 {
3000 switch(var2)
3001 {
3002 case 0x03ul:
3003 return true;
3004 case 0x04ul:
3005 return true;
3006 case 0x05ul:
3007 return false;
3008 case 0x06ul:
3009 return false;
3010 case 0x07ul:
3011 return false;
3012 default:
3013 return false;
3014 }
3015 }
3016 #endif
3017 return false;
3018 #endif
3019 }
3020
3021 /* ========= Errata 64 ========= */
3022 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3023 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3024 #define NRF52_ERRATA_64_PRESENT 1
3025 #else
3026 #define NRF52_ERRATA_64_PRESENT 0
3027 #endif
3028
3029 #ifndef NRF52_ERRATA_64_ENABLE_WORKAROUND
3030 #define NRF52_ERRATA_64_ENABLE_WORKAROUND NRF52_ERRATA_64_PRESENT
3031 #endif
3032
nrf52_errata_64(void)3033 static bool nrf52_errata_64(void)
3034 {
3035 #ifndef NRF52_SERIES
3036 return false;
3037 #else
3038 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3039 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3040 uint32_t var1;
3041 uint32_t var2;
3042
3043 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3044 {
3045 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3046 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3047 }
3048 else
3049 {
3050 var1 = *(uint32_t *)0x10000130ul;
3051 var2 = *(uint32_t *)0x10000134ul;
3052 }
3053 #endif
3054 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3055 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3056 if (var1 == 0x06)
3057 {
3058 switch(var2)
3059 {
3060 case 0x03ul:
3061 return true;
3062 case 0x04ul:
3063 return true;
3064 case 0x05ul:
3065 return true;
3066 case 0x06ul:
3067 return true;
3068 case 0x07ul:
3069 return true;
3070 default:
3071 return true;
3072 }
3073 }
3074 #endif
3075 return false;
3076 #endif
3077 }
3078
3079 /* ========= Errata 65 ========= */
3080 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3081 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3082 #define NRF52_ERRATA_65_PRESENT 1
3083 #else
3084 #define NRF52_ERRATA_65_PRESENT 0
3085 #endif
3086
3087 #ifndef NRF52_ERRATA_65_ENABLE_WORKAROUND
3088 #define NRF52_ERRATA_65_ENABLE_WORKAROUND NRF52_ERRATA_65_PRESENT
3089 #endif
3090
nrf52_errata_65(void)3091 static bool nrf52_errata_65(void)
3092 {
3093 #ifndef NRF52_SERIES
3094 return false;
3095 #else
3096 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3097 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3098 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3099 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3100 #endif
3101 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3102 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3103 if (var1 == 0x06)
3104 {
3105 switch(var2)
3106 {
3107 case 0x03ul:
3108 return true;
3109 case 0x04ul:
3110 return false;
3111 case 0x05ul:
3112 return false;
3113 case 0x06ul:
3114 return false;
3115 case 0x07ul:
3116 return false;
3117 default:
3118 return false;
3119 }
3120 }
3121 #endif
3122 return false;
3123 #endif
3124 }
3125
3126 /* ========= Errata 66 ========= */
3127 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
3128 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
3129 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
3130 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
3131 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3132 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
3133 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
3134 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3135 #define NRF52_ERRATA_66_PRESENT 1
3136 #else
3137 #define NRF52_ERRATA_66_PRESENT 0
3138 #endif
3139
3140 #ifndef NRF52_ERRATA_66_ENABLE_WORKAROUND
3141 #define NRF52_ERRATA_66_ENABLE_WORKAROUND NRF52_ERRATA_66_PRESENT
3142 #endif
3143
nrf52_errata_66(void)3144 static bool nrf52_errata_66(void)
3145 {
3146 #ifndef NRF52_SERIES
3147 return false;
3148 #else
3149 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3150 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3151 uint32_t var1;
3152 uint32_t var2;
3153
3154 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3155 {
3156 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3157 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3158 }
3159 else
3160 {
3161 var1 = *(uint32_t *)0x10000130ul;
3162 var2 = *(uint32_t *)0x10000134ul;
3163 }
3164 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
3165 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
3166 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
3167 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
3168 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
3169 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3170 uint32_t var1 = *(uint32_t *)0x10000130ul;
3171 uint32_t var2 = *(uint32_t *)0x10000134ul;
3172 #endif
3173 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3174 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3175 if (var1 == 0x06)
3176 {
3177 switch(var2)
3178 {
3179 case 0x03ul:
3180 return false;
3181 case 0x04ul:
3182 return false;
3183 case 0x05ul:
3184 return true;
3185 case 0x06ul:
3186 return true;
3187 case 0x07ul:
3188 return true;
3189 default:
3190 return true;
3191 }
3192 }
3193 #endif
3194 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3195 if (var1 == 0x08)
3196 {
3197 switch(var2)
3198 {
3199 case 0x00ul:
3200 return true;
3201 case 0x01ul:
3202 return true;
3203 case 0x02ul:
3204 return true;
3205 case 0x03ul:
3206 return true;
3207 case 0x04ul:
3208 return true;
3209 case 0x05ul:
3210 return true;
3211 default:
3212 return true;
3213 }
3214 }
3215 #endif
3216 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
3217 if (var1 == 0x0A)
3218 {
3219 switch(var2)
3220 {
3221 case 0x00ul:
3222 return true;
3223 case 0x01ul:
3224 return true;
3225 case 0x02ul:
3226 return true;
3227 default:
3228 return true;
3229 }
3230 }
3231 #endif
3232 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
3233 if (var1 == 0x0D)
3234 {
3235 switch(var2)
3236 {
3237 case 0x00ul:
3238 return true;
3239 case 0x01ul:
3240 return true;
3241 default:
3242 return true;
3243 }
3244 }
3245 #endif
3246 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
3247 if (var1 == 0x0E)
3248 {
3249 switch(var2)
3250 {
3251 case 0x00ul:
3252 return true;
3253 case 0x01ul:
3254 return true;
3255 default:
3256 return true;
3257 }
3258 }
3259 #endif
3260 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
3261 if (var1 == 0x0F)
3262 {
3263 switch(var2)
3264 {
3265 case 0x00ul:
3266 return true;
3267 case 0x01ul:
3268 return true;
3269 default:
3270 return true;
3271 }
3272 }
3273 #endif
3274 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
3275 if (var1 == 0x10)
3276 {
3277 switch(var2)
3278 {
3279 case 0x00ul:
3280 return true;
3281 case 0x01ul:
3282 return true;
3283 case 0x02ul:
3284 return true;
3285 case 0x03ul:
3286 return true;
3287 default:
3288 return true;
3289 }
3290 }
3291 #endif
3292 return false;
3293 #endif
3294 }
3295
3296 /* ========= Errata 67 ========= */
3297 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3298 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3299 #define NRF52_ERRATA_67_PRESENT 1
3300 #else
3301 #define NRF52_ERRATA_67_PRESENT 0
3302 #endif
3303
3304 #ifndef NRF52_ERRATA_67_ENABLE_WORKAROUND
3305 #define NRF52_ERRATA_67_ENABLE_WORKAROUND NRF52_ERRATA_67_PRESENT
3306 #endif
3307
nrf52_errata_67(void)3308 static bool nrf52_errata_67(void)
3309 {
3310 #ifndef NRF52_SERIES
3311 return false;
3312 #else
3313 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3314 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3315 uint32_t var1;
3316 uint32_t var2;
3317
3318 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3319 {
3320 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3321 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3322 }
3323 else
3324 {
3325 var1 = *(uint32_t *)0x10000130ul;
3326 var2 = *(uint32_t *)0x10000134ul;
3327 }
3328 #endif
3329 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3330 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3331 if (var1 == 0x06)
3332 {
3333 switch(var2)
3334 {
3335 case 0x03ul:
3336 return true;
3337 case 0x04ul:
3338 return true;
3339 case 0x05ul:
3340 return true;
3341 case 0x06ul:
3342 return true;
3343 case 0x07ul:
3344 return true;
3345 default:
3346 return true;
3347 }
3348 }
3349 #endif
3350 return false;
3351 #endif
3352 }
3353
3354 /* ========= Errata 68 ========= */
3355 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
3356 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
3357 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
3358 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3359 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
3360 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3361 #define NRF52_ERRATA_68_PRESENT 1
3362 #else
3363 #define NRF52_ERRATA_68_PRESENT 0
3364 #endif
3365
3366 #ifndef NRF52_ERRATA_68_ENABLE_WORKAROUND
3367 #define NRF52_ERRATA_68_ENABLE_WORKAROUND NRF52_ERRATA_68_PRESENT
3368 #endif
3369
nrf52_errata_68(void)3370 static bool nrf52_errata_68(void)
3371 {
3372 #ifndef NRF52_SERIES
3373 return false;
3374 #else
3375 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3376 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3377 uint32_t var1;
3378 uint32_t var2;
3379
3380 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3381 {
3382 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3383 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3384 }
3385 else
3386 {
3387 var1 = *(uint32_t *)0x10000130ul;
3388 var2 = *(uint32_t *)0x10000134ul;
3389 }
3390 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
3391 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
3392 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
3393 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3394 uint32_t var1 = *(uint32_t *)0x10000130ul;
3395 uint32_t var2 = *(uint32_t *)0x10000134ul;
3396 #endif
3397 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3398 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3399 if (var1 == 0x06)
3400 {
3401 switch(var2)
3402 {
3403 case 0x03ul:
3404 return true;
3405 case 0x04ul:
3406 return true;
3407 case 0x05ul:
3408 return true;
3409 case 0x06ul:
3410 return true;
3411 case 0x07ul:
3412 return true;
3413 default:
3414 return true;
3415 }
3416 }
3417 #endif
3418 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3419 if (var1 == 0x08)
3420 {
3421 switch(var2)
3422 {
3423 case 0x00ul:
3424 return true;
3425 case 0x01ul:
3426 return false;
3427 case 0x02ul:
3428 return false;
3429 case 0x03ul:
3430 return false;
3431 case 0x04ul:
3432 return false;
3433 case 0x05ul:
3434 return false;
3435 default:
3436 return false;
3437 }
3438 }
3439 #endif
3440 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
3441 if (var1 == 0x0A)
3442 {
3443 switch(var2)
3444 {
3445 case 0x00ul:
3446 return true;
3447 case 0x01ul:
3448 return true;
3449 case 0x02ul:
3450 return true;
3451 default:
3452 return true;
3453 }
3454 }
3455 #endif
3456 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
3457 if (var1 == 0x0E)
3458 {
3459 switch(var2)
3460 {
3461 case 0x00ul:
3462 return true;
3463 case 0x01ul:
3464 return true;
3465 default:
3466 return true;
3467 }
3468 }
3469 #endif
3470 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
3471 if (var1 == 0x0F)
3472 {
3473 switch(var2)
3474 {
3475 case 0x00ul:
3476 return true;
3477 case 0x01ul:
3478 return true;
3479 default:
3480 return true;
3481 }
3482 }
3483 #endif
3484 return false;
3485 #endif
3486 }
3487
3488 /* ========= Errata 70 ========= */
3489 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3490 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3491 #define NRF52_ERRATA_70_PRESENT 1
3492 #else
3493 #define NRF52_ERRATA_70_PRESENT 0
3494 #endif
3495
3496 #ifndef NRF52_ERRATA_70_ENABLE_WORKAROUND
3497 #define NRF52_ERRATA_70_ENABLE_WORKAROUND NRF52_ERRATA_70_PRESENT
3498 #endif
3499
nrf52_errata_70(void)3500 static bool nrf52_errata_70(void)
3501 {
3502 #ifndef NRF52_SERIES
3503 return false;
3504 #else
3505 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3506 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3507 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3508 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3509 #endif
3510 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3511 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3512 if (var1 == 0x06)
3513 {
3514 switch(var2)
3515 {
3516 case 0x03ul:
3517 return true;
3518 case 0x04ul:
3519 return true;
3520 case 0x05ul:
3521 return false;
3522 case 0x06ul:
3523 return false;
3524 case 0x07ul:
3525 return false;
3526 default:
3527 return false;
3528 }
3529 }
3530 #endif
3531 return false;
3532 #endif
3533 }
3534
3535 /* ========= Errata 71 ========= */
3536 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3537 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3538 #define NRF52_ERRATA_71_PRESENT 1
3539 #else
3540 #define NRF52_ERRATA_71_PRESENT 0
3541 #endif
3542
3543 #ifndef NRF52_ERRATA_71_ENABLE_WORKAROUND
3544 #define NRF52_ERRATA_71_ENABLE_WORKAROUND NRF52_ERRATA_71_PRESENT
3545 #endif
3546
nrf52_errata_71(void)3547 static bool nrf52_errata_71(void)
3548 {
3549 #ifndef NRF52_SERIES
3550 return false;
3551 #else
3552 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3553 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3554 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3555 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3556 #endif
3557 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3558 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3559 if (var1 == 0x06)
3560 {
3561 switch(var2)
3562 {
3563 case 0x03ul:
3564 return true;
3565 case 0x04ul:
3566 return true;
3567 case 0x05ul:
3568 return false;
3569 case 0x06ul:
3570 return false;
3571 case 0x07ul:
3572 return false;
3573 default:
3574 return false;
3575 }
3576 }
3577 #endif
3578 return false;
3579 #endif
3580 }
3581
3582 /* ========= Errata 72 ========= */
3583 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3584 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3585 #define NRF52_ERRATA_72_PRESENT 1
3586 #else
3587 #define NRF52_ERRATA_72_PRESENT 0
3588 #endif
3589
3590 #ifndef NRF52_ERRATA_72_ENABLE_WORKAROUND
3591 #define NRF52_ERRATA_72_ENABLE_WORKAROUND NRF52_ERRATA_72_PRESENT
3592 #endif
3593
nrf52_errata_72(void)3594 static bool nrf52_errata_72(void)
3595 {
3596 #ifndef NRF52_SERIES
3597 return false;
3598 #else
3599 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3600 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3601 uint32_t var1;
3602 uint32_t var2;
3603
3604 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3605 {
3606 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3607 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3608 }
3609 else
3610 {
3611 var1 = *(uint32_t *)0x10000130ul;
3612 var2 = *(uint32_t *)0x10000134ul;
3613 }
3614 #endif
3615 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3616 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3617 if (var1 == 0x06)
3618 {
3619 switch(var2)
3620 {
3621 case 0x03ul:
3622 return true;
3623 case 0x04ul:
3624 return true;
3625 case 0x05ul:
3626 return true;
3627 case 0x06ul:
3628 return true;
3629 case 0x07ul:
3630 return true;
3631 default:
3632 return true;
3633 }
3634 }
3635 #endif
3636 return false;
3637 #endif
3638 }
3639
3640 /* ========= Errata 73 ========= */
3641 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3642 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3643 #define NRF52_ERRATA_73_PRESENT 1
3644 #else
3645 #define NRF52_ERRATA_73_PRESENT 0
3646 #endif
3647
3648 #ifndef NRF52_ERRATA_73_ENABLE_WORKAROUND
3649 #define NRF52_ERRATA_73_ENABLE_WORKAROUND NRF52_ERRATA_73_PRESENT
3650 #endif
3651
nrf52_errata_73(void)3652 static bool nrf52_errata_73(void)
3653 {
3654 #ifndef NRF52_SERIES
3655 return false;
3656 #else
3657 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3658 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3659 uint32_t var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3660 uint32_t var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3661 #endif
3662 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3663 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3664 if (var1 == 0x06)
3665 {
3666 switch(var2)
3667 {
3668 case 0x03ul:
3669 return true;
3670 case 0x04ul:
3671 return true;
3672 case 0x05ul:
3673 return false;
3674 case 0x06ul:
3675 return false;
3676 case 0x07ul:
3677 return false;
3678 default:
3679 return false;
3680 }
3681 }
3682 #endif
3683 return false;
3684 #endif
3685 }
3686
3687 /* ========= Errata 74 ========= */
3688 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3689 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3690 #define NRF52_ERRATA_74_PRESENT 1
3691 #else
3692 #define NRF52_ERRATA_74_PRESENT 0
3693 #endif
3694
3695 #ifndef NRF52_ERRATA_74_ENABLE_WORKAROUND
3696 #define NRF52_ERRATA_74_ENABLE_WORKAROUND NRF52_ERRATA_74_PRESENT
3697 #endif
3698
nrf52_errata_74(void)3699 static bool nrf52_errata_74(void)
3700 {
3701 #ifndef NRF52_SERIES
3702 return false;
3703 #else
3704 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3705 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3706 uint32_t var1;
3707 uint32_t var2;
3708
3709 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3710 {
3711 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3712 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3713 }
3714 else
3715 {
3716 var1 = *(uint32_t *)0x10000130ul;
3717 var2 = *(uint32_t *)0x10000134ul;
3718 }
3719 #endif
3720 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3721 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3722 if (var1 == 0x06)
3723 {
3724 switch(var2)
3725 {
3726 case 0x03ul:
3727 return true;
3728 case 0x04ul:
3729 return true;
3730 case 0x05ul:
3731 return true;
3732 case 0x06ul:
3733 return true;
3734 case 0x07ul:
3735 return true;
3736 default:
3737 return true;
3738 }
3739 }
3740 #endif
3741 return false;
3742 #endif
3743 }
3744
3745 /* ========= Errata 75 ========= */
3746 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3747 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3748 #define NRF52_ERRATA_75_PRESENT 1
3749 #else
3750 #define NRF52_ERRATA_75_PRESENT 0
3751 #endif
3752
3753 #ifndef NRF52_ERRATA_75_ENABLE_WORKAROUND
3754 #define NRF52_ERRATA_75_ENABLE_WORKAROUND NRF52_ERRATA_75_PRESENT
3755 #endif
3756
nrf52_errata_75(void)3757 static bool nrf52_errata_75(void)
3758 {
3759 #ifndef NRF52_SERIES
3760 return false;
3761 #else
3762 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3763 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3764 uint32_t var1;
3765 uint32_t var2;
3766
3767 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3768 {
3769 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3770 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3771 }
3772 else
3773 {
3774 var1 = *(uint32_t *)0x10000130ul;
3775 var2 = *(uint32_t *)0x10000134ul;
3776 }
3777 #endif
3778 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3779 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3780 if (var1 == 0x06)
3781 {
3782 switch(var2)
3783 {
3784 case 0x03ul:
3785 return false;
3786 case 0x04ul:
3787 return true;
3788 case 0x05ul:
3789 return true;
3790 case 0x06ul:
3791 return true;
3792 case 0x07ul:
3793 return true;
3794 default:
3795 return true;
3796 }
3797 }
3798 #endif
3799 return false;
3800 #endif
3801 }
3802
3803 /* ========= Errata 76 ========= */
3804 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3805 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3806 #define NRF52_ERRATA_76_PRESENT 1
3807 #else
3808 #define NRF52_ERRATA_76_PRESENT 0
3809 #endif
3810
3811 #ifndef NRF52_ERRATA_76_ENABLE_WORKAROUND
3812 #define NRF52_ERRATA_76_ENABLE_WORKAROUND NRF52_ERRATA_76_PRESENT
3813 #endif
3814
nrf52_errata_76(void)3815 static bool nrf52_errata_76(void)
3816 {
3817 #ifndef NRF52_SERIES
3818 return false;
3819 #else
3820 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3821 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3822 uint32_t var1;
3823 uint32_t var2;
3824
3825 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3826 {
3827 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3828 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3829 }
3830 else
3831 {
3832 var1 = *(uint32_t *)0x10000130ul;
3833 var2 = *(uint32_t *)0x10000134ul;
3834 }
3835 #endif
3836 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3837 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3838 if (var1 == 0x06)
3839 {
3840 switch(var2)
3841 {
3842 case 0x03ul:
3843 return false;
3844 case 0x04ul:
3845 return true;
3846 case 0x05ul:
3847 return true;
3848 case 0x06ul:
3849 return true;
3850 case 0x07ul:
3851 return true;
3852 default:
3853 return true;
3854 }
3855 }
3856 #endif
3857 return false;
3858 #endif
3859 }
3860
3861 /* ========= Errata 77 ========= */
3862 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
3863 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
3864 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
3865 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3866 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3867 #define NRF52_ERRATA_77_PRESENT 1
3868 #else
3869 #define NRF52_ERRATA_77_PRESENT 0
3870 #endif
3871
3872 #ifndef NRF52_ERRATA_77_ENABLE_WORKAROUND
3873 #define NRF52_ERRATA_77_ENABLE_WORKAROUND NRF52_ERRATA_77_PRESENT
3874 #endif
3875
nrf52_errata_77(void)3876 static bool nrf52_errata_77(void)
3877 {
3878 #ifndef NRF52_SERIES
3879 return false;
3880 #else
3881 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3882 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3883 uint32_t var1;
3884 uint32_t var2;
3885
3886 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
3887 {
3888 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
3889 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
3890 }
3891 else
3892 {
3893 var1 = *(uint32_t *)0x10000130ul;
3894 var2 = *(uint32_t *)0x10000134ul;
3895 }
3896 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
3897 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
3898 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
3899 uint32_t var1 = *(uint32_t *)0x10000130ul;
3900 uint32_t var2 = *(uint32_t *)0x10000134ul;
3901 #endif
3902 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3903 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3904 if (var1 == 0x06)
3905 {
3906 switch(var2)
3907 {
3908 case 0x03ul:
3909 return true;
3910 case 0x04ul:
3911 return true;
3912 case 0x05ul:
3913 return true;
3914 case 0x06ul:
3915 return true;
3916 case 0x07ul:
3917 return true;
3918 default:
3919 return true;
3920 }
3921 }
3922 #endif
3923 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
3924 if (var1 == 0x0A)
3925 {
3926 switch(var2)
3927 {
3928 case 0x00ul:
3929 return true;
3930 case 0x01ul:
3931 return true;
3932 case 0x02ul:
3933 return true;
3934 default:
3935 return true;
3936 }
3937 }
3938 #endif
3939 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
3940 if (var1 == 0x0E)
3941 {
3942 switch(var2)
3943 {
3944 case 0x00ul:
3945 return true;
3946 case 0x01ul:
3947 return true;
3948 default:
3949 return true;
3950 }
3951 }
3952 #endif
3953 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
3954 if (var1 == 0x0F)
3955 {
3956 switch(var2)
3957 {
3958 case 0x00ul:
3959 return true;
3960 case 0x01ul:
3961 return true;
3962 default:
3963 return true;
3964 }
3965 }
3966 #endif
3967 return false;
3968 #endif
3969 }
3970
3971 /* ========= Errata 78 ========= */
3972 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
3973 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
3974 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
3975 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
3976 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
3977 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
3978 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
3979 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
3980 #define NRF52_ERRATA_78_PRESENT 1
3981 #else
3982 #define NRF52_ERRATA_78_PRESENT 0
3983 #endif
3984
3985 #ifndef NRF52_ERRATA_78_ENABLE_WORKAROUND
3986 #define NRF52_ERRATA_78_ENABLE_WORKAROUND NRF52_ERRATA_78_PRESENT
3987 #endif
3988
nrf52_errata_78(void)3989 static bool nrf52_errata_78(void)
3990 {
3991 #ifndef NRF52_SERIES
3992 return false;
3993 #else
3994 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
3995 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
3996 uint32_t var1;
3997 uint32_t var2;
3998
3999 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4000 {
4001 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4002 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4003 }
4004 else
4005 {
4006 var1 = *(uint32_t *)0x10000130ul;
4007 var2 = *(uint32_t *)0x10000134ul;
4008 }
4009 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
4010 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
4011 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
4012 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
4013 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
4014 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4015 uint32_t var1 = *(uint32_t *)0x10000130ul;
4016 uint32_t var2 = *(uint32_t *)0x10000134ul;
4017 #endif
4018 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4019 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4020 if (var1 == 0x06)
4021 {
4022 switch(var2)
4023 {
4024 case 0x03ul:
4025 return true;
4026 case 0x04ul:
4027 return true;
4028 case 0x05ul:
4029 return true;
4030 case 0x06ul:
4031 return true;
4032 case 0x07ul:
4033 return true;
4034 default:
4035 return true;
4036 }
4037 }
4038 #endif
4039 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4040 if (var1 == 0x08)
4041 {
4042 switch(var2)
4043 {
4044 case 0x00ul:
4045 return true;
4046 case 0x01ul:
4047 return true;
4048 case 0x02ul:
4049 return true;
4050 case 0x03ul:
4051 return true;
4052 case 0x04ul:
4053 return true;
4054 case 0x05ul:
4055 return true;
4056 default:
4057 return true;
4058 }
4059 }
4060 #endif
4061 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
4062 if (var1 == 0x0A)
4063 {
4064 switch(var2)
4065 {
4066 case 0x00ul:
4067 return true;
4068 case 0x01ul:
4069 return true;
4070 case 0x02ul:
4071 return true;
4072 default:
4073 return true;
4074 }
4075 }
4076 #endif
4077 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
4078 if (var1 == 0x0D)
4079 {
4080 switch(var2)
4081 {
4082 case 0x00ul:
4083 return true;
4084 case 0x01ul:
4085 return true;
4086 default:
4087 return true;
4088 }
4089 }
4090 #endif
4091 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
4092 if (var1 == 0x0E)
4093 {
4094 switch(var2)
4095 {
4096 case 0x00ul:
4097 return true;
4098 case 0x01ul:
4099 return true;
4100 default:
4101 return true;
4102 }
4103 }
4104 #endif
4105 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
4106 if (var1 == 0x0F)
4107 {
4108 switch(var2)
4109 {
4110 case 0x00ul:
4111 return true;
4112 case 0x01ul:
4113 return true;
4114 default:
4115 return true;
4116 }
4117 }
4118 #endif
4119 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
4120 if (var1 == 0x10)
4121 {
4122 switch(var2)
4123 {
4124 case 0x00ul:
4125 return true;
4126 case 0x01ul:
4127 return true;
4128 case 0x02ul:
4129 return true;
4130 case 0x03ul:
4131 return true;
4132 default:
4133 return true;
4134 }
4135 }
4136 #endif
4137 return false;
4138 #endif
4139 }
4140
4141 /* ========= Errata 79 ========= */
4142 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4143 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4144 #define NRF52_ERRATA_79_PRESENT 1
4145 #else
4146 #define NRF52_ERRATA_79_PRESENT 0
4147 #endif
4148
4149 #ifndef NRF52_ERRATA_79_ENABLE_WORKAROUND
4150 #define NRF52_ERRATA_79_ENABLE_WORKAROUND NRF52_ERRATA_79_PRESENT
4151 #endif
4152
nrf52_errata_79(void)4153 static bool nrf52_errata_79(void)
4154 {
4155 #ifndef NRF52_SERIES
4156 return false;
4157 #else
4158 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4159 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4160 uint32_t var1;
4161 uint32_t var2;
4162
4163 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4164 {
4165 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4166 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4167 }
4168 else
4169 {
4170 var1 = *(uint32_t *)0x10000130ul;
4171 var2 = *(uint32_t *)0x10000134ul;
4172 }
4173 #endif
4174 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4175 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4176 if (var1 == 0x06)
4177 {
4178 switch(var2)
4179 {
4180 case 0x03ul:
4181 return false;
4182 case 0x04ul:
4183 return true;
4184 case 0x05ul:
4185 return true;
4186 case 0x06ul:
4187 return true;
4188 case 0x07ul:
4189 return true;
4190 default:
4191 return true;
4192 }
4193 }
4194 #endif
4195 return false;
4196 #endif
4197 }
4198
4199 /* ========= Errata 81 ========= */
4200 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
4201 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
4202 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
4203 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4204 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
4205 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4206 #define NRF52_ERRATA_81_PRESENT 1
4207 #else
4208 #define NRF52_ERRATA_81_PRESENT 0
4209 #endif
4210
4211 #ifndef NRF52_ERRATA_81_ENABLE_WORKAROUND
4212 #define NRF52_ERRATA_81_ENABLE_WORKAROUND NRF52_ERRATA_81_PRESENT
4213 #endif
4214
nrf52_errata_81(void)4215 static bool nrf52_errata_81(void)
4216 {
4217 #ifndef NRF52_SERIES
4218 return false;
4219 #else
4220 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4221 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4222 uint32_t var1;
4223 uint32_t var2;
4224
4225 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4226 {
4227 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4228 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4229 }
4230 else
4231 {
4232 var1 = *(uint32_t *)0x10000130ul;
4233 var2 = *(uint32_t *)0x10000134ul;
4234 }
4235 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
4236 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
4237 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
4238 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4239 uint32_t var1 = *(uint32_t *)0x10000130ul;
4240 uint32_t var2 = *(uint32_t *)0x10000134ul;
4241 #endif
4242 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4243 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4244 if (var1 == 0x06)
4245 {
4246 switch(var2)
4247 {
4248 case 0x03ul:
4249 return false;
4250 case 0x04ul:
4251 return true;
4252 case 0x05ul:
4253 return true;
4254 case 0x06ul:
4255 return true;
4256 case 0x07ul:
4257 return true;
4258 default:
4259 return true;
4260 }
4261 }
4262 #endif
4263 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4264 if (var1 == 0x08)
4265 {
4266 switch(var2)
4267 {
4268 case 0x00ul:
4269 return true;
4270 case 0x01ul:
4271 return true;
4272 case 0x02ul:
4273 return true;
4274 case 0x03ul:
4275 return true;
4276 case 0x04ul:
4277 return true;
4278 case 0x05ul:
4279 return true;
4280 default:
4281 return true;
4282 }
4283 }
4284 #endif
4285 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
4286 if (var1 == 0x0A)
4287 {
4288 switch(var2)
4289 {
4290 case 0x00ul:
4291 return true;
4292 case 0x01ul:
4293 return true;
4294 case 0x02ul:
4295 return true;
4296 default:
4297 return true;
4298 }
4299 }
4300 #endif
4301 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
4302 if (var1 == 0x0E)
4303 {
4304 switch(var2)
4305 {
4306 case 0x00ul:
4307 return true;
4308 case 0x01ul:
4309 return true;
4310 default:
4311 return true;
4312 }
4313 }
4314 #endif
4315 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
4316 if (var1 == 0x0F)
4317 {
4318 switch(var2)
4319 {
4320 case 0x00ul:
4321 return true;
4322 case 0x01ul:
4323 return true;
4324 default:
4325 return true;
4326 }
4327 }
4328 #endif
4329 return false;
4330 #endif
4331 }
4332
4333 /* ========= Errata 83 ========= */
4334 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
4335 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
4336 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
4337 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4338 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
4339 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4340 #define NRF52_ERRATA_83_PRESENT 1
4341 #else
4342 #define NRF52_ERRATA_83_PRESENT 0
4343 #endif
4344
4345 #ifndef NRF52_ERRATA_83_ENABLE_WORKAROUND
4346 #define NRF52_ERRATA_83_ENABLE_WORKAROUND NRF52_ERRATA_83_PRESENT
4347 #endif
4348
nrf52_errata_83(void)4349 static bool nrf52_errata_83(void)
4350 {
4351 #ifndef NRF52_SERIES
4352 return false;
4353 #else
4354 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4355 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4356 uint32_t var1;
4357 uint32_t var2;
4358
4359 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4360 {
4361 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4362 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4363 }
4364 else
4365 {
4366 var1 = *(uint32_t *)0x10000130ul;
4367 var2 = *(uint32_t *)0x10000134ul;
4368 }
4369 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
4370 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
4371 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
4372 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4373 uint32_t var1 = *(uint32_t *)0x10000130ul;
4374 uint32_t var2 = *(uint32_t *)0x10000134ul;
4375 #endif
4376 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4377 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4378 if (var1 == 0x06)
4379 {
4380 switch(var2)
4381 {
4382 case 0x03ul:
4383 return false;
4384 case 0x04ul:
4385 return true;
4386 case 0x05ul:
4387 return true;
4388 case 0x06ul:
4389 return true;
4390 case 0x07ul:
4391 return true;
4392 default:
4393 return true;
4394 }
4395 }
4396 #endif
4397 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4398 if (var1 == 0x08)
4399 {
4400 switch(var2)
4401 {
4402 case 0x00ul:
4403 return true;
4404 case 0x01ul:
4405 return false;
4406 case 0x02ul:
4407 return false;
4408 case 0x03ul:
4409 return false;
4410 case 0x04ul:
4411 return false;
4412 case 0x05ul:
4413 return false;
4414 default:
4415 return false;
4416 }
4417 }
4418 #endif
4419 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
4420 if (var1 == 0x0A)
4421 {
4422 switch(var2)
4423 {
4424 case 0x00ul:
4425 return true;
4426 case 0x01ul:
4427 return true;
4428 case 0x02ul:
4429 return true;
4430 default:
4431 return true;
4432 }
4433 }
4434 #endif
4435 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
4436 if (var1 == 0x0E)
4437 {
4438 switch(var2)
4439 {
4440 case 0x00ul:
4441 return true;
4442 case 0x01ul:
4443 return true;
4444 default:
4445 return true;
4446 }
4447 }
4448 #endif
4449 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
4450 if (var1 == 0x0F)
4451 {
4452 switch(var2)
4453 {
4454 case 0x00ul:
4455 return true;
4456 case 0x01ul:
4457 return true;
4458 default:
4459 return true;
4460 }
4461 }
4462 #endif
4463 return false;
4464 #endif
4465 }
4466
4467 /* ========= Errata 84 ========= */
4468 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4469 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4470 #define NRF52_ERRATA_84_PRESENT 1
4471 #else
4472 #define NRF52_ERRATA_84_PRESENT 0
4473 #endif
4474
4475 #ifndef NRF52_ERRATA_84_ENABLE_WORKAROUND
4476 #define NRF52_ERRATA_84_ENABLE_WORKAROUND NRF52_ERRATA_84_PRESENT
4477 #endif
4478
nrf52_errata_84(void)4479 static bool nrf52_errata_84(void)
4480 {
4481 #ifndef NRF52_SERIES
4482 return false;
4483 #else
4484 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4485 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4486 uint32_t var1;
4487 uint32_t var2;
4488
4489 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4490 {
4491 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4492 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4493 }
4494 else
4495 {
4496 var1 = *(uint32_t *)0x10000130ul;
4497 var2 = *(uint32_t *)0x10000134ul;
4498 }
4499 #endif
4500 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4501 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4502 if (var1 == 0x06)
4503 {
4504 switch(var2)
4505 {
4506 case 0x03ul:
4507 return true;
4508 case 0x04ul:
4509 return true;
4510 case 0x05ul:
4511 return true;
4512 case 0x06ul:
4513 return true;
4514 case 0x07ul:
4515 return true;
4516 default:
4517 return true;
4518 }
4519 }
4520 #endif
4521 return false;
4522 #endif
4523 }
4524
4525 /* ========= Errata 86 ========= */
4526 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4527 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4528 #define NRF52_ERRATA_86_PRESENT 1
4529 #else
4530 #define NRF52_ERRATA_86_PRESENT 0
4531 #endif
4532
4533 #ifndef NRF52_ERRATA_86_ENABLE_WORKAROUND
4534 #define NRF52_ERRATA_86_ENABLE_WORKAROUND NRF52_ERRATA_86_PRESENT
4535 #endif
4536
nrf52_errata_86(void)4537 static bool nrf52_errata_86(void)
4538 {
4539 #ifndef NRF52_SERIES
4540 return false;
4541 #else
4542 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4543 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4544 uint32_t var1;
4545 uint32_t var2;
4546
4547 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4548 {
4549 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4550 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4551 }
4552 else
4553 {
4554 var1 = *(uint32_t *)0x10000130ul;
4555 var2 = *(uint32_t *)0x10000134ul;
4556 }
4557 #endif
4558 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4559 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4560 if (var1 == 0x06)
4561 {
4562 switch(var2)
4563 {
4564 case 0x03ul:
4565 return true;
4566 case 0x04ul:
4567 return true;
4568 case 0x05ul:
4569 return true;
4570 case 0x06ul:
4571 return true;
4572 case 0x07ul:
4573 return true;
4574 default:
4575 return true;
4576 }
4577 }
4578 #endif
4579 return false;
4580 #endif
4581 }
4582
4583 /* ========= Errata 87 ========= */
4584 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
4585 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4586 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
4587 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
4588 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4589 #define NRF52_ERRATA_87_PRESENT 1
4590 #else
4591 #define NRF52_ERRATA_87_PRESENT 0
4592 #endif
4593
4594 #ifndef NRF52_ERRATA_87_ENABLE_WORKAROUND
4595 #define NRF52_ERRATA_87_ENABLE_WORKAROUND NRF52_ERRATA_87_PRESENT
4596 #endif
4597
nrf52_errata_87(void)4598 static bool nrf52_errata_87(void)
4599 {
4600 #ifndef NRF52_SERIES
4601 return false;
4602 #else
4603 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4604 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4605 uint32_t var1;
4606 uint32_t var2;
4607
4608 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4609 {
4610 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4611 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4612 }
4613 else
4614 {
4615 var1 = *(uint32_t *)0x10000130ul;
4616 var2 = *(uint32_t *)0x10000134ul;
4617 }
4618 #elif defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
4619 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
4620 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4621 uint32_t var1 = *(uint32_t *)0x10000130ul;
4622 uint32_t var2 = *(uint32_t *)0x10000134ul;
4623 #endif
4624 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4625 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4626 if (var1 == 0x06)
4627 {
4628 switch(var2)
4629 {
4630 case 0x03ul:
4631 return true;
4632 case 0x04ul:
4633 return true;
4634 case 0x05ul:
4635 return true;
4636 case 0x06ul:
4637 return true;
4638 case 0x07ul:
4639 return true;
4640 default:
4641 return true;
4642 }
4643 }
4644 #endif
4645 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4646 if (var1 == 0x08)
4647 {
4648 switch(var2)
4649 {
4650 case 0x00ul:
4651 return true;
4652 case 0x01ul:
4653 return true;
4654 case 0x02ul:
4655 return true;
4656 case 0x03ul:
4657 return true;
4658 case 0x04ul:
4659 return true;
4660 case 0x05ul:
4661 return true;
4662 default:
4663 return true;
4664 }
4665 }
4666 #endif
4667 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
4668 if (var1 == 0x0D)
4669 {
4670 switch(var2)
4671 {
4672 case 0x00ul:
4673 return true;
4674 case 0x01ul:
4675 return true;
4676 default:
4677 return true;
4678 }
4679 }
4680 #endif
4681 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
4682 if (var1 == 0x10)
4683 {
4684 switch(var2)
4685 {
4686 case 0x00ul:
4687 return true;
4688 case 0x01ul:
4689 return true;
4690 case 0x02ul:
4691 return false;
4692 case 0x03ul:
4693 return false;
4694 default:
4695 return false;
4696 }
4697 }
4698 #endif
4699 return false;
4700 #endif
4701 }
4702
4703 /* ========= Errata 88 ========= */
4704 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
4705 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
4706 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
4707 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4708 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4709 #define NRF52_ERRATA_88_PRESENT 1
4710 #else
4711 #define NRF52_ERRATA_88_PRESENT 0
4712 #endif
4713
4714 #ifndef NRF52_ERRATA_88_ENABLE_WORKAROUND
4715 #define NRF52_ERRATA_88_ENABLE_WORKAROUND NRF52_ERRATA_88_PRESENT
4716 #endif
4717
nrf52_errata_88(void)4718 static bool nrf52_errata_88(void)
4719 {
4720 #ifndef NRF52_SERIES
4721 return false;
4722 #else
4723 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4724 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4725 uint32_t var1;
4726 uint32_t var2;
4727
4728 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4729 {
4730 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4731 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4732 }
4733 else
4734 {
4735 var1 = *(uint32_t *)0x10000130ul;
4736 var2 = *(uint32_t *)0x10000134ul;
4737 }
4738 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
4739 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
4740 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
4741 uint32_t var1 = *(uint32_t *)0x10000130ul;
4742 uint32_t var2 = *(uint32_t *)0x10000134ul;
4743 #endif
4744 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4745 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4746 if (var1 == 0x06)
4747 {
4748 switch(var2)
4749 {
4750 case 0x03ul:
4751 return true;
4752 case 0x04ul:
4753 return true;
4754 case 0x05ul:
4755 return true;
4756 case 0x06ul:
4757 return true;
4758 case 0x07ul:
4759 return true;
4760 default:
4761 return true;
4762 }
4763 }
4764 #endif
4765 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
4766 if (var1 == 0x0A)
4767 {
4768 switch(var2)
4769 {
4770 case 0x00ul:
4771 return true;
4772 case 0x01ul:
4773 return true;
4774 case 0x02ul:
4775 return true;
4776 default:
4777 return true;
4778 }
4779 }
4780 #endif
4781 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
4782 if (var1 == 0x0E)
4783 {
4784 switch(var2)
4785 {
4786 case 0x00ul:
4787 return true;
4788 case 0x01ul:
4789 return true;
4790 default:
4791 return true;
4792 }
4793 }
4794 #endif
4795 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
4796 if (var1 == 0x0F)
4797 {
4798 switch(var2)
4799 {
4800 case 0x00ul:
4801 return true;
4802 case 0x01ul:
4803 return true;
4804 default:
4805 return true;
4806 }
4807 }
4808 #endif
4809 return false;
4810 #endif
4811 }
4812
4813 /* ========= Errata 89 ========= */
4814 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4815 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
4816 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4817 #define NRF52_ERRATA_89_PRESENT 1
4818 #else
4819 #define NRF52_ERRATA_89_PRESENT 0
4820 #endif
4821
4822 #ifndef NRF52_ERRATA_89_ENABLE_WORKAROUND
4823 #define NRF52_ERRATA_89_ENABLE_WORKAROUND NRF52_ERRATA_89_PRESENT
4824 #endif
4825
nrf52_errata_89(void)4826 static bool nrf52_errata_89(void)
4827 {
4828 #ifndef NRF52_SERIES
4829 return false;
4830 #else
4831 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4832 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4833 uint32_t var1;
4834 uint32_t var2;
4835
4836 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4837 {
4838 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4839 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4840 }
4841 else
4842 {
4843 var1 = *(uint32_t *)0x10000130ul;
4844 var2 = *(uint32_t *)0x10000134ul;
4845 }
4846 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4847 uint32_t var1 = *(uint32_t *)0x10000130ul;
4848 uint32_t var2 = *(uint32_t *)0x10000134ul;
4849 #endif
4850 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4851 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4852 if (var1 == 0x06)
4853 {
4854 switch(var2)
4855 {
4856 case 0x03ul:
4857 return false;
4858 case 0x04ul:
4859 return true;
4860 case 0x05ul:
4861 return true;
4862 case 0x06ul:
4863 return true;
4864 case 0x07ul:
4865 return true;
4866 default:
4867 return true;
4868 }
4869 }
4870 #endif
4871 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4872 if (var1 == 0x08)
4873 {
4874 switch(var2)
4875 {
4876 case 0x00ul:
4877 return true;
4878 case 0x01ul:
4879 return false;
4880 case 0x02ul:
4881 return false;
4882 case 0x03ul:
4883 return false;
4884 case 0x04ul:
4885 return false;
4886 case 0x05ul:
4887 return false;
4888 default:
4889 return false;
4890 }
4891 }
4892 #endif
4893 return false;
4894 #endif
4895 }
4896
4897 /* ========= Errata 91 ========= */
4898 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
4899 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4900 #define NRF52_ERRATA_91_PRESENT 1
4901 #else
4902 #define NRF52_ERRATA_91_PRESENT 0
4903 #endif
4904
4905 #ifndef NRF52_ERRATA_91_ENABLE_WORKAROUND
4906 #define NRF52_ERRATA_91_ENABLE_WORKAROUND NRF52_ERRATA_91_PRESENT
4907 #endif
4908
nrf52_errata_91(void)4909 static bool nrf52_errata_91(void)
4910 {
4911 #ifndef NRF52_SERIES
4912 return false;
4913 #else
4914 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4915 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4916 uint32_t var1;
4917 uint32_t var2;
4918
4919 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
4920 {
4921 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
4922 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
4923 }
4924 else
4925 {
4926 var1 = *(uint32_t *)0x10000130ul;
4927 var2 = *(uint32_t *)0x10000134ul;
4928 }
4929 #endif
4930 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
4931 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
4932 if (var1 == 0x06)
4933 {
4934 switch(var2)
4935 {
4936 case 0x03ul:
4937 return false;
4938 case 0x04ul:
4939 return false;
4940 case 0x05ul:
4941 return true;
4942 case 0x06ul:
4943 return true;
4944 case 0x07ul:
4945 return true;
4946 default:
4947 return true;
4948 }
4949 }
4950 #endif
4951 return false;
4952 #endif
4953 }
4954
4955 /* ========= Errata 94 ========= */
4956 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4957 #define NRF52_ERRATA_94_PRESENT 1
4958 #else
4959 #define NRF52_ERRATA_94_PRESENT 0
4960 #endif
4961
4962 #ifndef NRF52_ERRATA_94_ENABLE_WORKAROUND
4963 #define NRF52_ERRATA_94_ENABLE_WORKAROUND NRF52_ERRATA_94_PRESENT
4964 #endif
4965
nrf52_errata_94(void)4966 static bool nrf52_errata_94(void)
4967 {
4968 #ifndef NRF52_SERIES
4969 return false;
4970 #else
4971 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4972 uint32_t var1 = *(uint32_t *)0x10000130ul;
4973 uint32_t var2 = *(uint32_t *)0x10000134ul;
4974 #endif
4975 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
4976 if (var1 == 0x08)
4977 {
4978 switch(var2)
4979 {
4980 case 0x00ul:
4981 return true;
4982 case 0x01ul:
4983 return true;
4984 case 0x02ul:
4985 return false;
4986 case 0x03ul:
4987 return false;
4988 case 0x04ul:
4989 return false;
4990 case 0x05ul:
4991 return false;
4992 default:
4993 return false;
4994 }
4995 }
4996 #endif
4997 return false;
4998 #endif
4999 }
5000
5001 /* ========= Errata 96 ========= */
5002 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5003 #define NRF52_ERRATA_96_PRESENT 1
5004 #else
5005 #define NRF52_ERRATA_96_PRESENT 0
5006 #endif
5007
5008 #ifndef NRF52_ERRATA_96_ENABLE_WORKAROUND
5009 #define NRF52_ERRATA_96_ENABLE_WORKAROUND NRF52_ERRATA_96_PRESENT
5010 #endif
5011
nrf52_errata_96(void)5012 static bool nrf52_errata_96(void)
5013 {
5014 #ifndef NRF52_SERIES
5015 return false;
5016 #else
5017 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5018 uint32_t var1 = *(uint32_t *)0x10000130ul;
5019 uint32_t var2 = *(uint32_t *)0x10000134ul;
5020 #endif
5021 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5022 if (var1 == 0x08)
5023 {
5024 switch(var2)
5025 {
5026 case 0x00ul:
5027 return true;
5028 case 0x01ul:
5029 return false;
5030 case 0x02ul:
5031 return false;
5032 case 0x03ul:
5033 return false;
5034 case 0x04ul:
5035 return false;
5036 case 0x05ul:
5037 return false;
5038 default:
5039 return false;
5040 }
5041 }
5042 #endif
5043 return false;
5044 #endif
5045 }
5046
5047 /* ========= Errata 97 ========= */
5048 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5049 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
5050 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5051 #define NRF52_ERRATA_97_PRESENT 1
5052 #else
5053 #define NRF52_ERRATA_97_PRESENT 0
5054 #endif
5055
5056 #ifndef NRF52_ERRATA_97_ENABLE_WORKAROUND
5057 #define NRF52_ERRATA_97_ENABLE_WORKAROUND NRF52_ERRATA_97_PRESENT
5058 #endif
5059
nrf52_errata_97(void)5060 static bool nrf52_errata_97(void)
5061 {
5062 #ifndef NRF52_SERIES
5063 return false;
5064 #else
5065 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5066 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5067 uint32_t var1;
5068 uint32_t var2;
5069
5070 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5071 {
5072 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5073 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5074 }
5075 else
5076 {
5077 var1 = *(uint32_t *)0x10000130ul;
5078 var2 = *(uint32_t *)0x10000134ul;
5079 }
5080 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5081 uint32_t var1 = *(uint32_t *)0x10000130ul;
5082 uint32_t var2 = *(uint32_t *)0x10000134ul;
5083 #endif
5084 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5085 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5086 if (var1 == 0x06)
5087 {
5088 switch(var2)
5089 {
5090 case 0x03ul:
5091 return true;
5092 case 0x04ul:
5093 return true;
5094 case 0x05ul:
5095 return true;
5096 case 0x06ul:
5097 return true;
5098 case 0x07ul:
5099 return true;
5100 default:
5101 return true;
5102 }
5103 }
5104 #endif
5105 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5106 if (var1 == 0x08)
5107 {
5108 switch(var2)
5109 {
5110 case 0x00ul:
5111 return true;
5112 case 0x01ul:
5113 return false;
5114 case 0x02ul:
5115 return false;
5116 case 0x03ul:
5117 return false;
5118 case 0x04ul:
5119 return false;
5120 case 0x05ul:
5121 return false;
5122 default:
5123 return false;
5124 }
5125 }
5126 #endif
5127 return false;
5128 #endif
5129 }
5130
5131 /* ========= Errata 98 ========= */
5132 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5133 #define NRF52_ERRATA_98_PRESENT 1
5134 #else
5135 #define NRF52_ERRATA_98_PRESENT 0
5136 #endif
5137
5138 #ifndef NRF52_ERRATA_98_ENABLE_WORKAROUND
5139 #define NRF52_ERRATA_98_ENABLE_WORKAROUND NRF52_ERRATA_98_PRESENT
5140 #endif
5141
nrf52_errata_98(void)5142 static bool nrf52_errata_98(void)
5143 {
5144 #ifndef NRF52_SERIES
5145 return false;
5146 #else
5147 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5148 uint32_t var1 = *(uint32_t *)0x10000130ul;
5149 uint32_t var2 = *(uint32_t *)0x10000134ul;
5150 #endif
5151 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5152 if (var1 == 0x08)
5153 {
5154 switch(var2)
5155 {
5156 case 0x00ul:
5157 return true;
5158 case 0x01ul:
5159 return false;
5160 case 0x02ul:
5161 return false;
5162 case 0x03ul:
5163 return false;
5164 case 0x04ul:
5165 return false;
5166 case 0x05ul:
5167 return false;
5168 default:
5169 return false;
5170 }
5171 }
5172 #endif
5173 return false;
5174 #endif
5175 }
5176
5177 /* ========= Errata 101 ========= */
5178 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5179 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5180 #define NRF52_ERRATA_101_PRESENT 1
5181 #else
5182 #define NRF52_ERRATA_101_PRESENT 0
5183 #endif
5184
5185 #ifndef NRF52_ERRATA_101_ENABLE_WORKAROUND
5186 #define NRF52_ERRATA_101_ENABLE_WORKAROUND NRF52_ERRATA_101_PRESENT
5187 #endif
5188
nrf52_errata_101(void)5189 static bool nrf52_errata_101(void)
5190 {
5191 #ifndef NRF52_SERIES
5192 return false;
5193 #else
5194 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5195 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5196 uint32_t var1;
5197 uint32_t var2;
5198
5199 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5200 {
5201 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5202 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5203 }
5204 else
5205 {
5206 var1 = *(uint32_t *)0x10000130ul;
5207 var2 = *(uint32_t *)0x10000134ul;
5208 }
5209 #endif
5210 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5211 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5212 if (var1 == 0x06)
5213 {
5214 switch(var2)
5215 {
5216 case 0x03ul:
5217 return false;
5218 case 0x04ul:
5219 return true;
5220 case 0x05ul:
5221 return true;
5222 case 0x06ul:
5223 return true;
5224 case 0x07ul:
5225 return true;
5226 default:
5227 return true;
5228 }
5229 }
5230 #endif
5231 return false;
5232 #endif
5233 }
5234
5235 /* ========= Errata 102 ========= */
5236 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5237 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5238 #define NRF52_ERRATA_102_PRESENT 1
5239 #else
5240 #define NRF52_ERRATA_102_PRESENT 0
5241 #endif
5242
5243 #ifndef NRF52_ERRATA_102_ENABLE_WORKAROUND
5244 #define NRF52_ERRATA_102_ENABLE_WORKAROUND NRF52_ERRATA_102_PRESENT
5245 #endif
5246
nrf52_errata_102(void)5247 static bool nrf52_errata_102(void)
5248 {
5249 #ifndef NRF52_SERIES
5250 return false;
5251 #else
5252 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5253 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5254 uint32_t var1;
5255 uint32_t var2;
5256
5257 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5258 {
5259 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5260 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5261 }
5262 else
5263 {
5264 var1 = *(uint32_t *)0x10000130ul;
5265 var2 = *(uint32_t *)0x10000134ul;
5266 }
5267 #endif
5268 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5269 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5270 if (var1 == 0x06)
5271 {
5272 switch(var2)
5273 {
5274 case 0x03ul:
5275 return false;
5276 case 0x04ul:
5277 return true;
5278 case 0x05ul:
5279 return true;
5280 case 0x06ul:
5281 return false;
5282 case 0x07ul:
5283 return false;
5284 default:
5285 return false;
5286 }
5287 }
5288 #endif
5289 return false;
5290 #endif
5291 }
5292
5293 /* ========= Errata 103 ========= */
5294 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5295 #define NRF52_ERRATA_103_PRESENT 1
5296 #else
5297 #define NRF52_ERRATA_103_PRESENT 0
5298 #endif
5299
5300 #ifndef NRF52_ERRATA_103_ENABLE_WORKAROUND
5301 #define NRF52_ERRATA_103_ENABLE_WORKAROUND NRF52_ERRATA_103_PRESENT
5302 #endif
5303
nrf52_errata_103(void)5304 static bool nrf52_errata_103(void)
5305 {
5306 #ifndef NRF52_SERIES
5307 return false;
5308 #else
5309 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5310 uint32_t var1 = *(uint32_t *)0x10000130ul;
5311 uint32_t var2 = *(uint32_t *)0x10000134ul;
5312 #endif
5313 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5314 if (var1 == 0x08)
5315 {
5316 switch(var2)
5317 {
5318 case 0x00ul:
5319 return true;
5320 case 0x01ul:
5321 return false;
5322 case 0x02ul:
5323 return false;
5324 case 0x03ul:
5325 return false;
5326 case 0x04ul:
5327 return false;
5328 case 0x05ul:
5329 return false;
5330 default:
5331 return false;
5332 }
5333 }
5334 #endif
5335 return false;
5336 #endif
5337 }
5338
5339 /* ========= Errata 104 ========= */
5340 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5341 #define NRF52_ERRATA_104_PRESENT 1
5342 #else
5343 #define NRF52_ERRATA_104_PRESENT 0
5344 #endif
5345
5346 #ifndef NRF52_ERRATA_104_ENABLE_WORKAROUND
5347 #define NRF52_ERRATA_104_ENABLE_WORKAROUND NRF52_ERRATA_104_PRESENT
5348 #endif
5349
nrf52_errata_104(void)5350 static bool nrf52_errata_104(void)
5351 {
5352 #ifndef NRF52_SERIES
5353 return false;
5354 #else
5355 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5356 uint32_t var1 = *(uint32_t *)0x10000130ul;
5357 uint32_t var2 = *(uint32_t *)0x10000134ul;
5358 #endif
5359 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5360 if (var1 == 0x08)
5361 {
5362 switch(var2)
5363 {
5364 case 0x00ul:
5365 return true;
5366 case 0x01ul:
5367 return false;
5368 case 0x02ul:
5369 return false;
5370 case 0x03ul:
5371 return false;
5372 case 0x04ul:
5373 return false;
5374 case 0x05ul:
5375 return false;
5376 default:
5377 return false;
5378 }
5379 }
5380 #endif
5381 return false;
5382 #endif
5383 }
5384
5385 /* ========= Errata 106 ========= */
5386 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5387 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5388 #define NRF52_ERRATA_106_PRESENT 1
5389 #else
5390 #define NRF52_ERRATA_106_PRESENT 0
5391 #endif
5392
5393 #ifndef NRF52_ERRATA_106_ENABLE_WORKAROUND
5394 #define NRF52_ERRATA_106_ENABLE_WORKAROUND NRF52_ERRATA_106_PRESENT
5395 #endif
5396
nrf52_errata_106(void)5397 static bool nrf52_errata_106(void)
5398 {
5399 #ifndef NRF52_SERIES
5400 return false;
5401 #else
5402 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5403 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5404 uint32_t var1;
5405 uint32_t var2;
5406
5407 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5408 {
5409 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5410 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5411 }
5412 else
5413 {
5414 var1 = *(uint32_t *)0x10000130ul;
5415 var2 = *(uint32_t *)0x10000134ul;
5416 }
5417 #endif
5418 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5419 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5420 if (var1 == 0x06)
5421 {
5422 switch(var2)
5423 {
5424 case 0x03ul:
5425 return false;
5426 case 0x04ul:
5427 return false;
5428 case 0x05ul:
5429 return true;
5430 case 0x06ul:
5431 return false;
5432 case 0x07ul:
5433 return false;
5434 default:
5435 return false;
5436 }
5437 }
5438 #endif
5439 return false;
5440 #endif
5441 }
5442
5443 /* ========= Errata 107 ========= */
5444 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5445 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5446 #define NRF52_ERRATA_107_PRESENT 1
5447 #else
5448 #define NRF52_ERRATA_107_PRESENT 0
5449 #endif
5450
5451 #ifndef NRF52_ERRATA_107_ENABLE_WORKAROUND
5452 #define NRF52_ERRATA_107_ENABLE_WORKAROUND NRF52_ERRATA_107_PRESENT
5453 #endif
5454
nrf52_errata_107(void)5455 static bool nrf52_errata_107(void)
5456 {
5457 #ifndef NRF52_SERIES
5458 return false;
5459 #else
5460 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5461 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5462 uint32_t var1;
5463 uint32_t var2;
5464
5465 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5466 {
5467 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5468 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5469 }
5470 else
5471 {
5472 var1 = *(uint32_t *)0x10000130ul;
5473 var2 = *(uint32_t *)0x10000134ul;
5474 }
5475 #endif
5476 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5477 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5478 if (var1 == 0x06)
5479 {
5480 switch(var2)
5481 {
5482 case 0x03ul:
5483 return false;
5484 case 0x04ul:
5485 return false;
5486 case 0x05ul:
5487 return true;
5488 case 0x06ul:
5489 return false;
5490 case 0x07ul:
5491 return false;
5492 default:
5493 return false;
5494 }
5495 }
5496 #endif
5497 return false;
5498 #endif
5499 }
5500
5501 /* ========= Errata 108 ========= */
5502 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5503 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5504 #define NRF52_ERRATA_108_PRESENT 1
5505 #else
5506 #define NRF52_ERRATA_108_PRESENT 0
5507 #endif
5508
5509 #ifndef NRF52_ERRATA_108_ENABLE_WORKAROUND
5510 #define NRF52_ERRATA_108_ENABLE_WORKAROUND NRF52_ERRATA_108_PRESENT
5511 #endif
5512
nrf52_errata_108(void)5513 static bool nrf52_errata_108(void)
5514 {
5515 #ifndef NRF52_SERIES
5516 return false;
5517 #else
5518 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5519 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5520 uint32_t var1;
5521 uint32_t var2;
5522
5523 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5524 {
5525 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5526 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5527 }
5528 else
5529 {
5530 var1 = *(uint32_t *)0x10000130ul;
5531 var2 = *(uint32_t *)0x10000134ul;
5532 }
5533 #endif
5534 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5535 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5536 if (var1 == 0x06)
5537 {
5538 switch(var2)
5539 {
5540 case 0x03ul:
5541 return true;
5542 case 0x04ul:
5543 return true;
5544 case 0x05ul:
5545 return true;
5546 case 0x06ul:
5547 return true;
5548 case 0x07ul:
5549 return true;
5550 default:
5551 return true;
5552 }
5553 }
5554 #endif
5555 return false;
5556 #endif
5557 }
5558
5559 /* ========= Errata 109 ========= */
5560 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5561 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5562 #define NRF52_ERRATA_109_PRESENT 1
5563 #else
5564 #define NRF52_ERRATA_109_PRESENT 0
5565 #endif
5566
5567 #ifndef NRF52_ERRATA_109_ENABLE_WORKAROUND
5568 #define NRF52_ERRATA_109_ENABLE_WORKAROUND NRF52_ERRATA_109_PRESENT
5569 #endif
5570
nrf52_errata_109(void)5571 static bool nrf52_errata_109(void)
5572 {
5573 #ifndef NRF52_SERIES
5574 return false;
5575 #else
5576 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5577 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5578 uint32_t var1;
5579 uint32_t var2;
5580
5581 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5582 {
5583 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5584 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5585 }
5586 else
5587 {
5588 var1 = *(uint32_t *)0x10000130ul;
5589 var2 = *(uint32_t *)0x10000134ul;
5590 }
5591 #endif
5592 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5593 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5594 if (var1 == 0x06)
5595 {
5596 switch(var2)
5597 {
5598 case 0x03ul:
5599 return false;
5600 case 0x04ul:
5601 return false;
5602 case 0x05ul:
5603 return true;
5604 case 0x06ul:
5605 return true;
5606 case 0x07ul:
5607 return true;
5608 default:
5609 return true;
5610 }
5611 }
5612 #endif
5613 return false;
5614 #endif
5615 }
5616
5617 /* ========= Errata 110 ========= */
5618 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5619 #define NRF52_ERRATA_110_PRESENT 1
5620 #else
5621 #define NRF52_ERRATA_110_PRESENT 0
5622 #endif
5623
5624 #ifndef NRF52_ERRATA_110_ENABLE_WORKAROUND
5625 #define NRF52_ERRATA_110_ENABLE_WORKAROUND NRF52_ERRATA_110_PRESENT
5626 #endif
5627
nrf52_errata_110(void)5628 static bool nrf52_errata_110(void)
5629 {
5630 #ifndef NRF52_SERIES
5631 return false;
5632 #else
5633 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5634 uint32_t var1 = *(uint32_t *)0x10000130ul;
5635 uint32_t var2 = *(uint32_t *)0x10000134ul;
5636 #endif
5637 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5638 if (var1 == 0x08)
5639 {
5640 switch(var2)
5641 {
5642 case 0x00ul:
5643 return true;
5644 case 0x01ul:
5645 return false;
5646 case 0x02ul:
5647 return false;
5648 case 0x03ul:
5649 return false;
5650 case 0x04ul:
5651 return false;
5652 case 0x05ul:
5653 return false;
5654 default:
5655 return false;
5656 }
5657 }
5658 #endif
5659 return false;
5660 #endif
5661 }
5662
5663 /* ========= Errata 111 ========= */
5664 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5665 #define NRF52_ERRATA_111_PRESENT 1
5666 #else
5667 #define NRF52_ERRATA_111_PRESENT 0
5668 #endif
5669
5670 #ifndef NRF52_ERRATA_111_ENABLE_WORKAROUND
5671 #define NRF52_ERRATA_111_ENABLE_WORKAROUND NRF52_ERRATA_111_PRESENT
5672 #endif
5673
nrf52_errata_111(void)5674 static bool nrf52_errata_111(void)
5675 {
5676 #ifndef NRF52_SERIES
5677 return false;
5678 #else
5679 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5680 uint32_t var1 = *(uint32_t *)0x10000130ul;
5681 uint32_t var2 = *(uint32_t *)0x10000134ul;
5682 #endif
5683 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5684 if (var1 == 0x08)
5685 {
5686 switch(var2)
5687 {
5688 case 0x00ul:
5689 return true;
5690 case 0x01ul:
5691 return false;
5692 case 0x02ul:
5693 return false;
5694 case 0x03ul:
5695 return false;
5696 case 0x04ul:
5697 return false;
5698 case 0x05ul:
5699 return false;
5700 default:
5701 return false;
5702 }
5703 }
5704 #endif
5705 return false;
5706 #endif
5707 }
5708
5709 /* ========= Errata 112 ========= */
5710 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5711 #define NRF52_ERRATA_112_PRESENT 1
5712 #else
5713 #define NRF52_ERRATA_112_PRESENT 0
5714 #endif
5715
5716 #ifndef NRF52_ERRATA_112_ENABLE_WORKAROUND
5717 #define NRF52_ERRATA_112_ENABLE_WORKAROUND NRF52_ERRATA_112_PRESENT
5718 #endif
5719
nrf52_errata_112(void)5720 static bool nrf52_errata_112(void)
5721 {
5722 #ifndef NRF52_SERIES
5723 return false;
5724 #else
5725 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5726 uint32_t var1 = *(uint32_t *)0x10000130ul;
5727 uint32_t var2 = *(uint32_t *)0x10000134ul;
5728 #endif
5729 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5730 if (var1 == 0x08)
5731 {
5732 switch(var2)
5733 {
5734 case 0x00ul:
5735 return true;
5736 case 0x01ul:
5737 return false;
5738 case 0x02ul:
5739 return false;
5740 case 0x03ul:
5741 return false;
5742 case 0x04ul:
5743 return false;
5744 case 0x05ul:
5745 return false;
5746 default:
5747 return false;
5748 }
5749 }
5750 #endif
5751 return false;
5752 #endif
5753 }
5754
5755 /* ========= Errata 113 ========= */
5756 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
5757 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
5758 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5759 #define NRF52_ERRATA_113_PRESENT 1
5760 #else
5761 #define NRF52_ERRATA_113_PRESENT 0
5762 #endif
5763
5764 #ifndef NRF52_ERRATA_113_ENABLE_WORKAROUND
5765 #define NRF52_ERRATA_113_ENABLE_WORKAROUND NRF52_ERRATA_113_PRESENT
5766 #endif
5767
nrf52_errata_113(void)5768 static bool nrf52_errata_113(void)
5769 {
5770 #ifndef NRF52_SERIES
5771 return false;
5772 #else
5773 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5774 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5775 uint32_t var1;
5776 uint32_t var2;
5777
5778 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
5779 {
5780 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
5781 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
5782 }
5783 else
5784 {
5785 var1 = *(uint32_t *)0x10000130ul;
5786 var2 = *(uint32_t *)0x10000134ul;
5787 }
5788 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5789 uint32_t var1 = *(uint32_t *)0x10000130ul;
5790 uint32_t var2 = *(uint32_t *)0x10000134ul;
5791 #endif
5792 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
5793 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
5794 if (var1 == 0x06)
5795 {
5796 switch(var2)
5797 {
5798 case 0x03ul:
5799 return false;
5800 case 0x04ul:
5801 return false;
5802 case 0x05ul:
5803 return true;
5804 case 0x06ul:
5805 return true;
5806 case 0x07ul:
5807 return true;
5808 default:
5809 return true;
5810 }
5811 }
5812 #endif
5813 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5814 if (var1 == 0x08)
5815 {
5816 switch(var2)
5817 {
5818 case 0x00ul:
5819 return true;
5820 case 0x01ul:
5821 return false;
5822 case 0x02ul:
5823 return false;
5824 case 0x03ul:
5825 return false;
5826 case 0x04ul:
5827 return false;
5828 case 0x05ul:
5829 return false;
5830 default:
5831 return false;
5832 }
5833 }
5834 #endif
5835 return false;
5836 #endif
5837 }
5838
5839 /* ========= Errata 115 ========= */
5840 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5841 #define NRF52_ERRATA_115_PRESENT 1
5842 #else
5843 #define NRF52_ERRATA_115_PRESENT 0
5844 #endif
5845
5846 #ifndef NRF52_ERRATA_115_ENABLE_WORKAROUND
5847 #define NRF52_ERRATA_115_ENABLE_WORKAROUND NRF52_ERRATA_115_PRESENT
5848 #endif
5849
nrf52_errata_115(void)5850 static bool nrf52_errata_115(void)
5851 {
5852 #ifndef NRF52_SERIES
5853 return false;
5854 #else
5855 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5856 uint32_t var1 = *(uint32_t *)0x10000130ul;
5857 uint32_t var2 = *(uint32_t *)0x10000134ul;
5858 #endif
5859 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5860 if (var1 == 0x08)
5861 {
5862 switch(var2)
5863 {
5864 case 0x00ul:
5865 return true;
5866 case 0x01ul:
5867 return false;
5868 case 0x02ul:
5869 return false;
5870 case 0x03ul:
5871 return false;
5872 case 0x04ul:
5873 return false;
5874 case 0x05ul:
5875 return false;
5876 default:
5877 return false;
5878 }
5879 }
5880 #endif
5881 return false;
5882 #endif
5883 }
5884
5885 /* ========= Errata 116 ========= */
5886 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5887 #define NRF52_ERRATA_116_PRESENT 1
5888 #else
5889 #define NRF52_ERRATA_116_PRESENT 0
5890 #endif
5891
5892 #ifndef NRF52_ERRATA_116_ENABLE_WORKAROUND
5893 #define NRF52_ERRATA_116_ENABLE_WORKAROUND NRF52_ERRATA_116_PRESENT
5894 #endif
5895
nrf52_errata_116(void)5896 static bool nrf52_errata_116(void)
5897 {
5898 #ifndef NRF52_SERIES
5899 return false;
5900 #else
5901 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5902 uint32_t var1 = *(uint32_t *)0x10000130ul;
5903 uint32_t var2 = *(uint32_t *)0x10000134ul;
5904 #endif
5905 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5906 if (var1 == 0x08)
5907 {
5908 switch(var2)
5909 {
5910 case 0x00ul:
5911 return true;
5912 case 0x01ul:
5913 return false;
5914 case 0x02ul:
5915 return false;
5916 case 0x03ul:
5917 return false;
5918 case 0x04ul:
5919 return false;
5920 case 0x05ul:
5921 return false;
5922 default:
5923 return false;
5924 }
5925 }
5926 #endif
5927 return false;
5928 #endif
5929 }
5930
5931 /* ========= Errata 117 ========= */
5932 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5933 #define NRF52_ERRATA_117_PRESENT 1
5934 #else
5935 #define NRF52_ERRATA_117_PRESENT 0
5936 #endif
5937
5938 #ifndef NRF52_ERRATA_117_ENABLE_WORKAROUND
5939 #define NRF52_ERRATA_117_ENABLE_WORKAROUND NRF52_ERRATA_117_PRESENT
5940 #endif
5941
nrf52_errata_117(void)5942 static bool nrf52_errata_117(void)
5943 {
5944 #ifndef NRF52_SERIES
5945 return false;
5946 #else
5947 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5948 uint32_t var1 = *(uint32_t *)0x10000130ul;
5949 uint32_t var2 = *(uint32_t *)0x10000134ul;
5950 #endif
5951 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5952 if (var1 == 0x08)
5953 {
5954 switch(var2)
5955 {
5956 case 0x00ul:
5957 return true;
5958 case 0x01ul:
5959 return false;
5960 case 0x02ul:
5961 return false;
5962 case 0x03ul:
5963 return false;
5964 case 0x04ul:
5965 return false;
5966 case 0x05ul:
5967 return false;
5968 default:
5969 return false;
5970 }
5971 }
5972 #endif
5973 return false;
5974 #endif
5975 }
5976
5977 /* ========= Errata 118 ========= */
5978 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5979 #define NRF52_ERRATA_118_PRESENT 1
5980 #else
5981 #define NRF52_ERRATA_118_PRESENT 0
5982 #endif
5983
5984 #ifndef NRF52_ERRATA_118_ENABLE_WORKAROUND
5985 #define NRF52_ERRATA_118_ENABLE_WORKAROUND NRF52_ERRATA_118_PRESENT
5986 #endif
5987
nrf52_errata_118(void)5988 static bool nrf52_errata_118(void)
5989 {
5990 #ifndef NRF52_SERIES
5991 return false;
5992 #else
5993 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5994 uint32_t var1 = *(uint32_t *)0x10000130ul;
5995 uint32_t var2 = *(uint32_t *)0x10000134ul;
5996 #endif
5997 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
5998 if (var1 == 0x08)
5999 {
6000 switch(var2)
6001 {
6002 case 0x00ul:
6003 return true;
6004 case 0x01ul:
6005 return false;
6006 case 0x02ul:
6007 return false;
6008 case 0x03ul:
6009 return false;
6010 case 0x04ul:
6011 return false;
6012 case 0x05ul:
6013 return false;
6014 default:
6015 return false;
6016 }
6017 }
6018 #endif
6019 return false;
6020 #endif
6021 }
6022
6023 /* ========= Errata 119 ========= */
6024 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6025 #define NRF52_ERRATA_119_PRESENT 1
6026 #else
6027 #define NRF52_ERRATA_119_PRESENT 0
6028 #endif
6029
6030 #ifndef NRF52_ERRATA_119_ENABLE_WORKAROUND
6031 #define NRF52_ERRATA_119_ENABLE_WORKAROUND NRF52_ERRATA_119_PRESENT
6032 #endif
6033
nrf52_errata_119(void)6034 static bool nrf52_errata_119(void)
6035 {
6036 #ifndef NRF52_SERIES
6037 return false;
6038 #else
6039 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6040 uint32_t var1 = *(uint32_t *)0x10000130ul;
6041 uint32_t var2 = *(uint32_t *)0x10000134ul;
6042 #endif
6043 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6044 if (var1 == 0x08)
6045 {
6046 switch(var2)
6047 {
6048 case 0x00ul:
6049 return true;
6050 case 0x01ul:
6051 return false;
6052 case 0x02ul:
6053 return false;
6054 case 0x03ul:
6055 return false;
6056 case 0x04ul:
6057 return false;
6058 case 0x05ul:
6059 return false;
6060 default:
6061 return false;
6062 }
6063 }
6064 #endif
6065 return false;
6066 #endif
6067 }
6068
6069 /* ========= Errata 120 ========= */
6070 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6071 #define NRF52_ERRATA_120_PRESENT 1
6072 #else
6073 #define NRF52_ERRATA_120_PRESENT 0
6074 #endif
6075
6076 #ifndef NRF52_ERRATA_120_ENABLE_WORKAROUND
6077 #define NRF52_ERRATA_120_ENABLE_WORKAROUND NRF52_ERRATA_120_PRESENT
6078 #endif
6079
nrf52_errata_120(void)6080 static bool nrf52_errata_120(void)
6081 {
6082 #ifndef NRF52_SERIES
6083 return false;
6084 #else
6085 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6086 uint32_t var1 = *(uint32_t *)0x10000130ul;
6087 uint32_t var2 = *(uint32_t *)0x10000134ul;
6088 #endif
6089 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6090 if (var1 == 0x08)
6091 {
6092 switch(var2)
6093 {
6094 case 0x00ul:
6095 return true;
6096 case 0x01ul:
6097 return false;
6098 case 0x02ul:
6099 return false;
6100 case 0x03ul:
6101 return false;
6102 case 0x04ul:
6103 return false;
6104 case 0x05ul:
6105 return false;
6106 default:
6107 return false;
6108 }
6109 }
6110 #endif
6111 return false;
6112 #endif
6113 }
6114
6115 /* ========= Errata 121 ========= */
6116 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6117 #define NRF52_ERRATA_121_PRESENT 1
6118 #else
6119 #define NRF52_ERRATA_121_PRESENT 0
6120 #endif
6121
6122 #ifndef NRF52_ERRATA_121_ENABLE_WORKAROUND
6123 #define NRF52_ERRATA_121_ENABLE_WORKAROUND NRF52_ERRATA_121_PRESENT
6124 #endif
6125
nrf52_errata_121(void)6126 static bool nrf52_errata_121(void)
6127 {
6128 #ifndef NRF52_SERIES
6129 return false;
6130 #else
6131 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6132 uint32_t var1 = *(uint32_t *)0x10000130ul;
6133 uint32_t var2 = *(uint32_t *)0x10000134ul;
6134 #endif
6135 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6136 if (var1 == 0x08)
6137 {
6138 switch(var2)
6139 {
6140 case 0x00ul:
6141 return true;
6142 case 0x01ul:
6143 return false;
6144 case 0x02ul:
6145 return false;
6146 case 0x03ul:
6147 return false;
6148 case 0x04ul:
6149 return false;
6150 case 0x05ul:
6151 return false;
6152 default:
6153 return false;
6154 }
6155 }
6156 #endif
6157 return false;
6158 #endif
6159 }
6160
6161 /* ========= Errata 122 ========= */
6162 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6163 #define NRF52_ERRATA_122_PRESENT 1
6164 #else
6165 #define NRF52_ERRATA_122_PRESENT 0
6166 #endif
6167
6168 #ifndef NRF52_ERRATA_122_ENABLE_WORKAROUND
6169 #define NRF52_ERRATA_122_ENABLE_WORKAROUND NRF52_ERRATA_122_PRESENT
6170 #endif
6171
nrf52_errata_122(void)6172 static bool nrf52_errata_122(void)
6173 {
6174 #ifndef NRF52_SERIES
6175 return false;
6176 #else
6177 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6178 uint32_t var1 = *(uint32_t *)0x10000130ul;
6179 uint32_t var2 = *(uint32_t *)0x10000134ul;
6180 #endif
6181 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6182 if (var1 == 0x08)
6183 {
6184 switch(var2)
6185 {
6186 case 0x00ul:
6187 return true;
6188 case 0x01ul:
6189 return true;
6190 case 0x02ul:
6191 return true;
6192 case 0x03ul:
6193 return true;
6194 case 0x04ul:
6195 return true;
6196 case 0x05ul:
6197 return true;
6198 default:
6199 return true;
6200 }
6201 }
6202 #endif
6203 return false;
6204 #endif
6205 }
6206
6207 /* ========= Errata 127 ========= */
6208 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6209 #define NRF52_ERRATA_127_PRESENT 1
6210 #else
6211 #define NRF52_ERRATA_127_PRESENT 0
6212 #endif
6213
6214 #ifndef NRF52_ERRATA_127_ENABLE_WORKAROUND
6215 #define NRF52_ERRATA_127_ENABLE_WORKAROUND NRF52_ERRATA_127_PRESENT
6216 #endif
6217
nrf52_errata_127(void)6218 static bool nrf52_errata_127(void)
6219 {
6220 #ifndef NRF52_SERIES
6221 return false;
6222 #else
6223 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6224 uint32_t var1 = *(uint32_t *)0x10000130ul;
6225 uint32_t var2 = *(uint32_t *)0x10000134ul;
6226 #endif
6227 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6228 if (var1 == 0x08)
6229 {
6230 switch(var2)
6231 {
6232 case 0x00ul:
6233 return true;
6234 case 0x01ul:
6235 return false;
6236 case 0x02ul:
6237 return false;
6238 case 0x03ul:
6239 return false;
6240 case 0x04ul:
6241 return false;
6242 case 0x05ul:
6243 return false;
6244 default:
6245 return false;
6246 }
6247 }
6248 #endif
6249 return false;
6250 #endif
6251 }
6252
6253 /* ========= Errata 128 ========= */
6254 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6255 #define NRF52_ERRATA_128_PRESENT 1
6256 #else
6257 #define NRF52_ERRATA_128_PRESENT 0
6258 #endif
6259
6260 #ifndef NRF52_ERRATA_128_ENABLE_WORKAROUND
6261 #define NRF52_ERRATA_128_ENABLE_WORKAROUND NRF52_ERRATA_128_PRESENT
6262 #endif
6263
nrf52_errata_128(void)6264 static bool nrf52_errata_128(void)
6265 {
6266 #ifndef NRF52_SERIES
6267 return false;
6268 #else
6269 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6270 uint32_t var1 = *(uint32_t *)0x10000130ul;
6271 uint32_t var2 = *(uint32_t *)0x10000134ul;
6272 #endif
6273 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6274 if (var1 == 0x08)
6275 {
6276 switch(var2)
6277 {
6278 case 0x00ul:
6279 return true;
6280 case 0x01ul:
6281 return false;
6282 case 0x02ul:
6283 return false;
6284 case 0x03ul:
6285 return false;
6286 case 0x04ul:
6287 return false;
6288 case 0x05ul:
6289 return false;
6290 default:
6291 return false;
6292 }
6293 }
6294 #endif
6295 return false;
6296 #endif
6297 }
6298
6299 /* ========= Errata 131 ========= */
6300 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6301 #define NRF52_ERRATA_131_PRESENT 1
6302 #else
6303 #define NRF52_ERRATA_131_PRESENT 0
6304 #endif
6305
6306 #ifndef NRF52_ERRATA_131_ENABLE_WORKAROUND
6307 #define NRF52_ERRATA_131_ENABLE_WORKAROUND NRF52_ERRATA_131_PRESENT
6308 #endif
6309
nrf52_errata_131(void)6310 static bool nrf52_errata_131(void)
6311 {
6312 #ifndef NRF52_SERIES
6313 return false;
6314 #else
6315 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6316 uint32_t var1 = *(uint32_t *)0x10000130ul;
6317 uint32_t var2 = *(uint32_t *)0x10000134ul;
6318 #endif
6319 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6320 if (var1 == 0x08)
6321 {
6322 switch(var2)
6323 {
6324 case 0x00ul:
6325 return true;
6326 case 0x01ul:
6327 return false;
6328 case 0x02ul:
6329 return false;
6330 case 0x03ul:
6331 return false;
6332 case 0x04ul:
6333 return false;
6334 case 0x05ul:
6335 return false;
6336 default:
6337 return false;
6338 }
6339 }
6340 #endif
6341 return false;
6342 #endif
6343 }
6344
6345 /* ========= Errata 132 ========= */
6346 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
6347 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6348 #define NRF52_ERRATA_132_PRESENT 1
6349 #else
6350 #define NRF52_ERRATA_132_PRESENT 0
6351 #endif
6352
6353 #ifndef NRF52_ERRATA_132_ENABLE_WORKAROUND
6354 #define NRF52_ERRATA_132_ENABLE_WORKAROUND NRF52_ERRATA_132_PRESENT
6355 #endif
6356
nrf52_errata_132(void)6357 static bool nrf52_errata_132(void)
6358 {
6359 #ifndef NRF52_SERIES
6360 return false;
6361 #else
6362 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6363 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6364 uint32_t var1;
6365 uint32_t var2;
6366
6367 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
6368 {
6369 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
6370 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
6371 }
6372 else
6373 {
6374 var1 = *(uint32_t *)0x10000130ul;
6375 var2 = *(uint32_t *)0x10000134ul;
6376 }
6377 #endif
6378 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6379 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6380 if (var1 == 0x06)
6381 {
6382 switch(var2)
6383 {
6384 case 0x03ul:
6385 return false;
6386 case 0x04ul:
6387 return false;
6388 case 0x05ul:
6389 return true;
6390 case 0x06ul:
6391 return true;
6392 case 0x07ul:
6393 return true;
6394 default:
6395 return true;
6396 }
6397 }
6398 #endif
6399 return false;
6400 #endif
6401 }
6402
6403 /* ========= Errata 133 ========= */
6404 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6405 #define NRF52_ERRATA_133_PRESENT 1
6406 #else
6407 #define NRF52_ERRATA_133_PRESENT 0
6408 #endif
6409
6410 #ifndef NRF52_ERRATA_133_ENABLE_WORKAROUND
6411 #define NRF52_ERRATA_133_ENABLE_WORKAROUND NRF52_ERRATA_133_PRESENT
6412 #endif
6413
nrf52_errata_133(void)6414 static bool nrf52_errata_133(void)
6415 {
6416 #ifndef NRF52_SERIES
6417 return false;
6418 #else
6419 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6420 uint32_t var1 = *(uint32_t *)0x10000130ul;
6421 uint32_t var2 = *(uint32_t *)0x10000134ul;
6422 #endif
6423 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6424 if (var1 == 0x08)
6425 {
6426 switch(var2)
6427 {
6428 case 0x00ul:
6429 return true;
6430 case 0x01ul:
6431 return false;
6432 case 0x02ul:
6433 return false;
6434 case 0x03ul:
6435 return false;
6436 case 0x04ul:
6437 return false;
6438 case 0x05ul:
6439 return false;
6440 default:
6441 return false;
6442 }
6443 }
6444 #endif
6445 return false;
6446 #endif
6447 }
6448
6449 /* ========= Errata 134 ========= */
6450 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6451 #define NRF52_ERRATA_134_PRESENT 1
6452 #else
6453 #define NRF52_ERRATA_134_PRESENT 0
6454 #endif
6455
6456 #ifndef NRF52_ERRATA_134_ENABLE_WORKAROUND
6457 #define NRF52_ERRATA_134_ENABLE_WORKAROUND NRF52_ERRATA_134_PRESENT
6458 #endif
6459
nrf52_errata_134(void)6460 static bool nrf52_errata_134(void)
6461 {
6462 #ifndef NRF52_SERIES
6463 return false;
6464 #else
6465 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6466 uint32_t var1 = *(uint32_t *)0x10000130ul;
6467 uint32_t var2 = *(uint32_t *)0x10000134ul;
6468 #endif
6469 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6470 if (var1 == 0x08)
6471 {
6472 switch(var2)
6473 {
6474 case 0x00ul:
6475 return true;
6476 case 0x01ul:
6477 return false;
6478 case 0x02ul:
6479 return false;
6480 case 0x03ul:
6481 return false;
6482 case 0x04ul:
6483 return false;
6484 case 0x05ul:
6485 return false;
6486 default:
6487 return false;
6488 }
6489 }
6490 #endif
6491 return false;
6492 #endif
6493 }
6494
6495 /* ========= Errata 135 ========= */
6496 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6497 #define NRF52_ERRATA_135_PRESENT 1
6498 #else
6499 #define NRF52_ERRATA_135_PRESENT 0
6500 #endif
6501
6502 #ifndef NRF52_ERRATA_135_ENABLE_WORKAROUND
6503 #define NRF52_ERRATA_135_ENABLE_WORKAROUND NRF52_ERRATA_135_PRESENT
6504 #endif
6505
nrf52_errata_135(void)6506 static bool nrf52_errata_135(void)
6507 {
6508 #ifndef NRF52_SERIES
6509 return false;
6510 #else
6511 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6512 uint32_t var1 = *(uint32_t *)0x10000130ul;
6513 uint32_t var2 = *(uint32_t *)0x10000134ul;
6514 #endif
6515 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6516 if (var1 == 0x08)
6517 {
6518 switch(var2)
6519 {
6520 case 0x00ul:
6521 return true;
6522 case 0x01ul:
6523 return false;
6524 case 0x02ul:
6525 return false;
6526 case 0x03ul:
6527 return false;
6528 case 0x04ul:
6529 return false;
6530 case 0x05ul:
6531 return false;
6532 default:
6533 return false;
6534 }
6535 }
6536 #endif
6537 return false;
6538 #endif
6539 }
6540
6541 /* ========= Errata 136 ========= */
6542 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
6543 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
6544 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
6545 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
6546 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
6547 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
6548 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
6549 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6550 #define NRF52_ERRATA_136_PRESENT 1
6551 #else
6552 #define NRF52_ERRATA_136_PRESENT 0
6553 #endif
6554
6555 #ifndef NRF52_ERRATA_136_ENABLE_WORKAROUND
6556 #define NRF52_ERRATA_136_ENABLE_WORKAROUND NRF52_ERRATA_136_PRESENT
6557 #endif
6558
nrf52_errata_136(void)6559 static bool nrf52_errata_136(void)
6560 {
6561 #ifndef NRF52_SERIES
6562 return false;
6563 #else
6564 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6565 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6566 uint32_t var1;
6567 uint32_t var2;
6568
6569 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
6570 {
6571 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
6572 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
6573 }
6574 else
6575 {
6576 var1 = *(uint32_t *)0x10000130ul;
6577 var2 = *(uint32_t *)0x10000134ul;
6578 }
6579 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
6580 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
6581 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
6582 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
6583 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
6584 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6585 uint32_t var1 = *(uint32_t *)0x10000130ul;
6586 uint32_t var2 = *(uint32_t *)0x10000134ul;
6587 #endif
6588 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6589 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6590 if (var1 == 0x06)
6591 {
6592 switch(var2)
6593 {
6594 case 0x03ul:
6595 return true;
6596 case 0x04ul:
6597 return true;
6598 case 0x05ul:
6599 return true;
6600 case 0x06ul:
6601 return true;
6602 case 0x07ul:
6603 return true;
6604 default:
6605 return true;
6606 }
6607 }
6608 #endif
6609 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6610 if (var1 == 0x08)
6611 {
6612 switch(var2)
6613 {
6614 case 0x00ul:
6615 return true;
6616 case 0x01ul:
6617 return true;
6618 case 0x02ul:
6619 return true;
6620 case 0x03ul:
6621 return true;
6622 case 0x04ul:
6623 return true;
6624 case 0x05ul:
6625 return true;
6626 default:
6627 return true;
6628 }
6629 }
6630 #endif
6631 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
6632 if (var1 == 0x0A)
6633 {
6634 switch(var2)
6635 {
6636 case 0x00ul:
6637 return true;
6638 case 0x01ul:
6639 return true;
6640 case 0x02ul:
6641 return true;
6642 default:
6643 return true;
6644 }
6645 }
6646 #endif
6647 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
6648 if (var1 == 0x0D)
6649 {
6650 switch(var2)
6651 {
6652 case 0x00ul:
6653 return true;
6654 case 0x01ul:
6655 return true;
6656 default:
6657 return true;
6658 }
6659 }
6660 #endif
6661 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
6662 if (var1 == 0x0E)
6663 {
6664 switch(var2)
6665 {
6666 case 0x00ul:
6667 return true;
6668 case 0x01ul:
6669 return true;
6670 default:
6671 return true;
6672 }
6673 }
6674 #endif
6675 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
6676 if (var1 == 0x0F)
6677 {
6678 switch(var2)
6679 {
6680 case 0x00ul:
6681 return true;
6682 case 0x01ul:
6683 return true;
6684 default:
6685 return true;
6686 }
6687 }
6688 #endif
6689 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
6690 if (var1 == 0x10)
6691 {
6692 switch(var2)
6693 {
6694 case 0x00ul:
6695 return true;
6696 case 0x01ul:
6697 return true;
6698 case 0x02ul:
6699 return true;
6700 case 0x03ul:
6701 return true;
6702 default:
6703 return true;
6704 }
6705 }
6706 #endif
6707 return false;
6708 #endif
6709 }
6710
6711 /* ========= Errata 138 ========= */
6712 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
6713 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6714 #define NRF52_ERRATA_138_PRESENT 1
6715 #else
6716 #define NRF52_ERRATA_138_PRESENT 0
6717 #endif
6718
6719 #ifndef NRF52_ERRATA_138_ENABLE_WORKAROUND
6720 #define NRF52_ERRATA_138_ENABLE_WORKAROUND NRF52_ERRATA_138_PRESENT
6721 #endif
6722
nrf52_errata_138(void)6723 static bool nrf52_errata_138(void)
6724 {
6725 #ifndef NRF52_SERIES
6726 return false;
6727 #else
6728 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6729 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6730 uint32_t var1;
6731 uint32_t var2;
6732
6733 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
6734 {
6735 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
6736 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
6737 }
6738 else
6739 {
6740 var1 = *(uint32_t *)0x10000130ul;
6741 var2 = *(uint32_t *)0x10000134ul;
6742 }
6743 #endif
6744 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6745 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6746 if (var1 == 0x06)
6747 {
6748 switch(var2)
6749 {
6750 case 0x03ul:
6751 return false;
6752 case 0x04ul:
6753 return false;
6754 case 0x05ul:
6755 return true;
6756 case 0x06ul:
6757 return true;
6758 case 0x07ul:
6759 return true;
6760 default:
6761 return true;
6762 }
6763 }
6764 #endif
6765 return false;
6766 #endif
6767 }
6768
6769 /* ========= Errata 140 ========= */
6770 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6771 #define NRF52_ERRATA_140_PRESENT 1
6772 #else
6773 #define NRF52_ERRATA_140_PRESENT 0
6774 #endif
6775
6776 #ifndef NRF52_ERRATA_140_ENABLE_WORKAROUND
6777 #define NRF52_ERRATA_140_ENABLE_WORKAROUND NRF52_ERRATA_140_PRESENT
6778 #endif
6779
nrf52_errata_140(void)6780 static bool nrf52_errata_140(void)
6781 {
6782 #ifndef NRF52_SERIES
6783 return false;
6784 #else
6785 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6786 uint32_t var1 = *(uint32_t *)0x10000130ul;
6787 uint32_t var2 = *(uint32_t *)0x10000134ul;
6788 #endif
6789 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6790 if (var1 == 0x08)
6791 {
6792 switch(var2)
6793 {
6794 case 0x00ul:
6795 return true;
6796 case 0x01ul:
6797 return false;
6798 case 0x02ul:
6799 return false;
6800 case 0x03ul:
6801 return false;
6802 case 0x04ul:
6803 return false;
6804 case 0x05ul:
6805 return false;
6806 default:
6807 return false;
6808 }
6809 }
6810 #endif
6811 return false;
6812 #endif
6813 }
6814
6815 /* ========= Errata 141 ========= */
6816 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
6817 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6818 #define NRF52_ERRATA_141_PRESENT 1
6819 #else
6820 #define NRF52_ERRATA_141_PRESENT 0
6821 #endif
6822
6823 #ifndef NRF52_ERRATA_141_ENABLE_WORKAROUND
6824 #define NRF52_ERRATA_141_ENABLE_WORKAROUND NRF52_ERRATA_141_PRESENT
6825 #endif
6826
nrf52_errata_141(void)6827 static bool nrf52_errata_141(void)
6828 {
6829 #ifndef NRF52_SERIES
6830 return false;
6831 #else
6832 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6833 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6834 uint32_t var1;
6835 uint32_t var2;
6836
6837 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
6838 {
6839 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
6840 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
6841 }
6842 else
6843 {
6844 var1 = *(uint32_t *)0x10000130ul;
6845 var2 = *(uint32_t *)0x10000134ul;
6846 }
6847 #endif
6848 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6849 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6850 if (var1 == 0x06)
6851 {
6852 switch(var2)
6853 {
6854 case 0x03ul:
6855 return false;
6856 case 0x04ul:
6857 return false;
6858 case 0x05ul:
6859 return true;
6860 case 0x06ul:
6861 return true;
6862 case 0x07ul:
6863 return true;
6864 default:
6865 return true;
6866 }
6867 }
6868 #endif
6869 return false;
6870 #endif
6871 }
6872
6873 /* ========= Errata 142 ========= */
6874 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6875 #define NRF52_ERRATA_142_PRESENT 1
6876 #else
6877 #define NRF52_ERRATA_142_PRESENT 0
6878 #endif
6879
6880 #ifndef NRF52_ERRATA_142_ENABLE_WORKAROUND
6881 #define NRF52_ERRATA_142_ENABLE_WORKAROUND NRF52_ERRATA_142_PRESENT
6882 #endif
6883
nrf52_errata_142(void)6884 static bool nrf52_errata_142(void)
6885 {
6886 #ifndef NRF52_SERIES
6887 return false;
6888 #else
6889 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6890 uint32_t var1 = *(uint32_t *)0x10000130ul;
6891 uint32_t var2 = *(uint32_t *)0x10000134ul;
6892 #endif
6893 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6894 if (var1 == 0x08)
6895 {
6896 switch(var2)
6897 {
6898 case 0x00ul:
6899 return true;
6900 case 0x01ul:
6901 return false;
6902 case 0x02ul:
6903 return false;
6904 case 0x03ul:
6905 return false;
6906 case 0x04ul:
6907 return false;
6908 case 0x05ul:
6909 return false;
6910 default:
6911 return false;
6912 }
6913 }
6914 #endif
6915 return false;
6916 #endif
6917 }
6918
6919 /* ========= Errata 143 ========= */
6920 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
6921 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
6922 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6923 #define NRF52_ERRATA_143_PRESENT 1
6924 #else
6925 #define NRF52_ERRATA_143_PRESENT 0
6926 #endif
6927
6928 #ifndef NRF52_ERRATA_143_ENABLE_WORKAROUND
6929 #define NRF52_ERRATA_143_ENABLE_WORKAROUND NRF52_ERRATA_143_PRESENT
6930 #endif
6931
nrf52_errata_143(void)6932 static bool nrf52_errata_143(void)
6933 {
6934 #ifndef NRF52_SERIES
6935 return false;
6936 #else
6937 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6938 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6939 uint32_t var1;
6940 uint32_t var2;
6941
6942 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
6943 {
6944 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
6945 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
6946 }
6947 else
6948 {
6949 var1 = *(uint32_t *)0x10000130ul;
6950 var2 = *(uint32_t *)0x10000134ul;
6951 }
6952 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6953 uint32_t var1 = *(uint32_t *)0x10000130ul;
6954 uint32_t var2 = *(uint32_t *)0x10000134ul;
6955 #endif
6956 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
6957 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
6958 if (var1 == 0x06)
6959 {
6960 switch(var2)
6961 {
6962 case 0x03ul:
6963 return false;
6964 case 0x04ul:
6965 return false;
6966 case 0x05ul:
6967 return true;
6968 case 0x06ul:
6969 return true;
6970 case 0x07ul:
6971 return true;
6972 default:
6973 return true;
6974 }
6975 }
6976 #endif
6977 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
6978 if (var1 == 0x08)
6979 {
6980 switch(var2)
6981 {
6982 case 0x00ul:
6983 return true;
6984 case 0x01ul:
6985 return false;
6986 case 0x02ul:
6987 return false;
6988 case 0x03ul:
6989 return false;
6990 case 0x04ul:
6991 return false;
6992 case 0x05ul:
6993 return false;
6994 default:
6995 return false;
6996 }
6997 }
6998 #endif
6999 return false;
7000 #endif
7001 }
7002
7003 /* ========= Errata 144 ========= */
7004 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7005 #define NRF52_ERRATA_144_PRESENT 1
7006 #else
7007 #define NRF52_ERRATA_144_PRESENT 0
7008 #endif
7009
7010 #ifndef NRF52_ERRATA_144_ENABLE_WORKAROUND
7011 #define NRF52_ERRATA_144_ENABLE_WORKAROUND NRF52_ERRATA_144_PRESENT
7012 #endif
7013
nrf52_errata_144(void)7014 static bool nrf52_errata_144(void)
7015 {
7016 #ifndef NRF52_SERIES
7017 return false;
7018 #else
7019 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7020 uint32_t var1 = *(uint32_t *)0x10000130ul;
7021 uint32_t var2 = *(uint32_t *)0x10000134ul;
7022 #endif
7023 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7024 if (var1 == 0x08)
7025 {
7026 switch(var2)
7027 {
7028 case 0x00ul:
7029 return true;
7030 case 0x01ul:
7031 return false;
7032 case 0x02ul:
7033 return false;
7034 case 0x03ul:
7035 return false;
7036 case 0x04ul:
7037 return false;
7038 case 0x05ul:
7039 return false;
7040 default:
7041 return false;
7042 }
7043 }
7044 #endif
7045 return false;
7046 #endif
7047 }
7048
7049 /* ========= Errata 145 ========= */
7050 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7051 #define NRF52_ERRATA_145_PRESENT 1
7052 #else
7053 #define NRF52_ERRATA_145_PRESENT 0
7054 #endif
7055
7056 #ifndef NRF52_ERRATA_145_ENABLE_WORKAROUND
7057 #define NRF52_ERRATA_145_ENABLE_WORKAROUND NRF52_ERRATA_145_PRESENT
7058 #endif
7059
nrf52_errata_145(void)7060 static bool nrf52_errata_145(void)
7061 {
7062 #ifndef NRF52_SERIES
7063 return false;
7064 #else
7065 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7066 uint32_t var1 = *(uint32_t *)0x10000130ul;
7067 uint32_t var2 = *(uint32_t *)0x10000134ul;
7068 #endif
7069 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7070 if (var1 == 0x08)
7071 {
7072 switch(var2)
7073 {
7074 case 0x00ul:
7075 return true;
7076 case 0x01ul:
7077 return false;
7078 case 0x02ul:
7079 return false;
7080 case 0x03ul:
7081 return false;
7082 case 0x04ul:
7083 return false;
7084 case 0x05ul:
7085 return false;
7086 default:
7087 return false;
7088 }
7089 }
7090 #endif
7091 return false;
7092 #endif
7093 }
7094
7095 /* ========= Errata 146 ========= */
7096 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7097 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7098 #define NRF52_ERRATA_146_PRESENT 1
7099 #else
7100 #define NRF52_ERRATA_146_PRESENT 0
7101 #endif
7102
7103 #ifndef NRF52_ERRATA_146_ENABLE_WORKAROUND
7104 #define NRF52_ERRATA_146_ENABLE_WORKAROUND NRF52_ERRATA_146_PRESENT
7105 #endif
7106
nrf52_errata_146(void)7107 static bool nrf52_errata_146(void)
7108 {
7109 #ifndef NRF52_SERIES
7110 return false;
7111 #else
7112 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7113 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7114 uint32_t var1;
7115 uint32_t var2;
7116
7117 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7118 {
7119 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7120 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7121 }
7122 else
7123 {
7124 var1 = *(uint32_t *)0x10000130ul;
7125 var2 = *(uint32_t *)0x10000134ul;
7126 }
7127 #endif
7128 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7129 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7130 if (var1 == 0x06)
7131 {
7132 switch(var2)
7133 {
7134 case 0x03ul:
7135 return false;
7136 case 0x04ul:
7137 return true;
7138 case 0x05ul:
7139 return true;
7140 case 0x06ul:
7141 return true;
7142 case 0x07ul:
7143 return true;
7144 default:
7145 return true;
7146 }
7147 }
7148 #endif
7149 return false;
7150 #endif
7151 }
7152
7153 /* ========= Errata 147 ========= */
7154 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7155 #define NRF52_ERRATA_147_PRESENT 1
7156 #else
7157 #define NRF52_ERRATA_147_PRESENT 0
7158 #endif
7159
7160 #ifndef NRF52_ERRATA_147_ENABLE_WORKAROUND
7161 #define NRF52_ERRATA_147_ENABLE_WORKAROUND NRF52_ERRATA_147_PRESENT
7162 #endif
7163
nrf52_errata_147(void)7164 static bool nrf52_errata_147(void)
7165 {
7166 #ifndef NRF52_SERIES
7167 return false;
7168 #else
7169 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7170 uint32_t var1 = *(uint32_t *)0x10000130ul;
7171 uint32_t var2 = *(uint32_t *)0x10000134ul;
7172 #endif
7173 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7174 if (var1 == 0x08)
7175 {
7176 switch(var2)
7177 {
7178 case 0x00ul:
7179 return true;
7180 case 0x01ul:
7181 return false;
7182 case 0x02ul:
7183 return false;
7184 case 0x03ul:
7185 return false;
7186 case 0x04ul:
7187 return false;
7188 case 0x05ul:
7189 return false;
7190 default:
7191 return false;
7192 }
7193 }
7194 #endif
7195 return false;
7196 #endif
7197 }
7198
7199 /* ========= Errata 149 ========= */
7200 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7201 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7202 #define NRF52_ERRATA_149_PRESENT 1
7203 #else
7204 #define NRF52_ERRATA_149_PRESENT 0
7205 #endif
7206
7207 #ifndef NRF52_ERRATA_149_ENABLE_WORKAROUND
7208 #define NRF52_ERRATA_149_ENABLE_WORKAROUND NRF52_ERRATA_149_PRESENT
7209 #endif
7210
nrf52_errata_149(void)7211 static bool nrf52_errata_149(void)
7212 {
7213 #ifndef NRF52_SERIES
7214 return false;
7215 #else
7216 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7217 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7218 uint32_t var1;
7219 uint32_t var2;
7220
7221 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7222 {
7223 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7224 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7225 }
7226 else
7227 {
7228 var1 = *(uint32_t *)0x10000130ul;
7229 var2 = *(uint32_t *)0x10000134ul;
7230 }
7231 #endif
7232 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7233 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7234 if (var1 == 0x06)
7235 {
7236 switch(var2)
7237 {
7238 case 0x03ul:
7239 return false;
7240 case 0x04ul:
7241 return false;
7242 case 0x05ul:
7243 return true;
7244 case 0x06ul:
7245 return true;
7246 case 0x07ul:
7247 return true;
7248 default:
7249 return true;
7250 }
7251 }
7252 #endif
7253 return false;
7254 #endif
7255 }
7256
7257 /* ========= Errata 150 ========= */
7258 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
7259 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7260 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
7261 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7262 #define NRF52_ERRATA_150_PRESENT 1
7263 #else
7264 #define NRF52_ERRATA_150_PRESENT 0
7265 #endif
7266
7267 #ifndef NRF52_ERRATA_150_ENABLE_WORKAROUND
7268 #define NRF52_ERRATA_150_ENABLE_WORKAROUND NRF52_ERRATA_150_PRESENT
7269 #endif
7270
nrf52_errata_150(void)7271 static bool nrf52_errata_150(void)
7272 {
7273 #ifndef NRF52_SERIES
7274 return false;
7275 #else
7276 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7277 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7278 uint32_t var1;
7279 uint32_t var2;
7280
7281 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7282 {
7283 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7284 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7285 }
7286 else
7287 {
7288 var1 = *(uint32_t *)0x10000130ul;
7289 var2 = *(uint32_t *)0x10000134ul;
7290 }
7291 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
7292 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7293 uint32_t var1 = *(uint32_t *)0x10000130ul;
7294 uint32_t var2 = *(uint32_t *)0x10000134ul;
7295 #endif
7296 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7297 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7298 if (var1 == 0x06)
7299 {
7300 switch(var2)
7301 {
7302 case 0x03ul:
7303 return false;
7304 case 0x04ul:
7305 return false;
7306 case 0x05ul:
7307 return true;
7308 case 0x06ul:
7309 return true;
7310 case 0x07ul:
7311 return true;
7312 default:
7313 return true;
7314 }
7315 }
7316 #endif
7317 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7318 if (var1 == 0x08)
7319 {
7320 switch(var2)
7321 {
7322 case 0x00ul:
7323 return true;
7324 case 0x01ul:
7325 return false;
7326 case 0x02ul:
7327 return false;
7328 case 0x03ul:
7329 return false;
7330 case 0x04ul:
7331 return false;
7332 case 0x05ul:
7333 return false;
7334 default:
7335 return false;
7336 }
7337 }
7338 #endif
7339 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
7340 if (var1 == 0x0A)
7341 {
7342 switch(var2)
7343 {
7344 case 0x00ul:
7345 return true;
7346 case 0x01ul:
7347 return false;
7348 case 0x02ul:
7349 return false;
7350 default:
7351 return false;
7352 }
7353 }
7354 #endif
7355 return false;
7356 #endif
7357 }
7358
7359 /* ========= Errata 151 ========= */
7360 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7361 #define NRF52_ERRATA_151_PRESENT 1
7362 #else
7363 #define NRF52_ERRATA_151_PRESENT 0
7364 #endif
7365
7366 #ifndef NRF52_ERRATA_151_ENABLE_WORKAROUND
7367 #define NRF52_ERRATA_151_ENABLE_WORKAROUND NRF52_ERRATA_151_PRESENT
7368 #endif
7369
nrf52_errata_151(void)7370 static bool nrf52_errata_151(void)
7371 {
7372 #ifndef NRF52_SERIES
7373 return false;
7374 #else
7375 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7376 uint32_t var1 = *(uint32_t *)0x10000130ul;
7377 uint32_t var2 = *(uint32_t *)0x10000134ul;
7378 #endif
7379 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7380 if (var1 == 0x08)
7381 {
7382 switch(var2)
7383 {
7384 case 0x00ul:
7385 return true;
7386 case 0x01ul:
7387 return false;
7388 case 0x02ul:
7389 return false;
7390 case 0x03ul:
7391 return false;
7392 case 0x04ul:
7393 return false;
7394 case 0x05ul:
7395 return false;
7396 default:
7397 return false;
7398 }
7399 }
7400 #endif
7401 return false;
7402 #endif
7403 }
7404
7405 /* ========= Errata 153 ========= */
7406 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
7407 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
7408 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7409 #define NRF52_ERRATA_153_PRESENT 1
7410 #else
7411 #define NRF52_ERRATA_153_PRESENT 0
7412 #endif
7413
7414 #ifndef NRF52_ERRATA_153_ENABLE_WORKAROUND
7415 #define NRF52_ERRATA_153_ENABLE_WORKAROUND NRF52_ERRATA_153_PRESENT
7416 #endif
7417
nrf52_errata_153(void)7418 static bool nrf52_errata_153(void)
7419 {
7420 #ifndef NRF52_SERIES
7421 return false;
7422 #else
7423 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
7424 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
7425 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7426 uint32_t var1 = *(uint32_t *)0x10000130ul;
7427 uint32_t var2 = *(uint32_t *)0x10000134ul;
7428 #endif
7429 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7430 if (var1 == 0x08)
7431 {
7432 switch(var2)
7433 {
7434 case 0x00ul:
7435 return true;
7436 case 0x01ul:
7437 return true;
7438 case 0x02ul:
7439 return true;
7440 case 0x03ul:
7441 return true;
7442 case 0x04ul:
7443 return true;
7444 case 0x05ul:
7445 return true;
7446 default:
7447 return true;
7448 }
7449 }
7450 #endif
7451 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
7452 if (var1 == 0x0A)
7453 {
7454 switch(var2)
7455 {
7456 case 0x00ul:
7457 return false;
7458 case 0x01ul:
7459 return true;
7460 case 0x02ul:
7461 return false;
7462 default:
7463 return false;
7464 }
7465 }
7466 #endif
7467 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
7468 if (var1 == 0x0E)
7469 {
7470 switch(var2)
7471 {
7472 case 0x00ul:
7473 return true;
7474 case 0x01ul:
7475 return true;
7476 default:
7477 return true;
7478 }
7479 }
7480 #endif
7481 return false;
7482 #endif
7483 }
7484
7485 /* ========= Errata 154 ========= */
7486 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7487 #define NRF52_ERRATA_154_PRESENT 1
7488 #else
7489 #define NRF52_ERRATA_154_PRESENT 0
7490 #endif
7491
7492 #ifndef NRF52_ERRATA_154_ENABLE_WORKAROUND
7493 #define NRF52_ERRATA_154_ENABLE_WORKAROUND NRF52_ERRATA_154_PRESENT
7494 #endif
7495
nrf52_errata_154(void)7496 static bool nrf52_errata_154(void)
7497 {
7498 #ifndef NRF52_SERIES
7499 return false;
7500 #else
7501 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7502 uint32_t var1 = *(uint32_t *)0x10000130ul;
7503 uint32_t var2 = *(uint32_t *)0x10000134ul;
7504 #endif
7505 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7506 if (var1 == 0x08)
7507 {
7508 switch(var2)
7509 {
7510 case 0x00ul:
7511 return true;
7512 case 0x01ul:
7513 return false;
7514 case 0x02ul:
7515 return false;
7516 case 0x03ul:
7517 return false;
7518 case 0x04ul:
7519 return false;
7520 case 0x05ul:
7521 return false;
7522 default:
7523 return false;
7524 }
7525 }
7526 #endif
7527 return false;
7528 #endif
7529 }
7530
7531 /* ========= Errata 155 ========= */
7532 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
7533 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
7534 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
7535 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7536 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
7537 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7538 #define NRF52_ERRATA_155_PRESENT 1
7539 #else
7540 #define NRF52_ERRATA_155_PRESENT 0
7541 #endif
7542
7543 #ifndef NRF52_ERRATA_155_ENABLE_WORKAROUND
7544 #define NRF52_ERRATA_155_ENABLE_WORKAROUND NRF52_ERRATA_155_PRESENT
7545 #endif
7546
nrf52_errata_155(void)7547 static bool nrf52_errata_155(void)
7548 {
7549 #ifndef NRF52_SERIES
7550 return false;
7551 #else
7552 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7553 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7554 uint32_t var1;
7555 uint32_t var2;
7556
7557 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7558 {
7559 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7560 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7561 }
7562 else
7563 {
7564 var1 = *(uint32_t *)0x10000130ul;
7565 var2 = *(uint32_t *)0x10000134ul;
7566 }
7567 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
7568 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
7569 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
7570 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7571 uint32_t var1 = *(uint32_t *)0x10000130ul;
7572 uint32_t var2 = *(uint32_t *)0x10000134ul;
7573 #endif
7574 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7575 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7576 if (var1 == 0x06)
7577 {
7578 switch(var2)
7579 {
7580 case 0x03ul:
7581 return false;
7582 case 0x04ul:
7583 return false;
7584 case 0x05ul:
7585 return true;
7586 case 0x06ul:
7587 return true;
7588 case 0x07ul:
7589 return true;
7590 default:
7591 return true;
7592 }
7593 }
7594 #endif
7595 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7596 if (var1 == 0x08)
7597 {
7598 switch(var2)
7599 {
7600 case 0x00ul:
7601 return true;
7602 case 0x01ul:
7603 return true;
7604 case 0x02ul:
7605 return true;
7606 case 0x03ul:
7607 return true;
7608 case 0x04ul:
7609 return true;
7610 case 0x05ul:
7611 return true;
7612 default:
7613 return true;
7614 }
7615 }
7616 #endif
7617 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
7618 if (var1 == 0x0A)
7619 {
7620 switch(var2)
7621 {
7622 case 0x00ul:
7623 return true;
7624 case 0x01ul:
7625 return true;
7626 case 0x02ul:
7627 return true;
7628 default:
7629 return true;
7630 }
7631 }
7632 #endif
7633 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
7634 if (var1 == 0x0E)
7635 {
7636 switch(var2)
7637 {
7638 case 0x00ul:
7639 return true;
7640 case 0x01ul:
7641 return true;
7642 default:
7643 return true;
7644 }
7645 }
7646 #endif
7647 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
7648 if (var1 == 0x0F)
7649 {
7650 switch(var2)
7651 {
7652 case 0x00ul:
7653 return true;
7654 case 0x01ul:
7655 return true;
7656 default:
7657 return true;
7658 }
7659 }
7660 #endif
7661 return false;
7662 #endif
7663 }
7664
7665 /* ========= Errata 156 ========= */
7666 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
7667 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
7668 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
7669 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7670 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
7671 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7672 #define NRF52_ERRATA_156_PRESENT 1
7673 #else
7674 #define NRF52_ERRATA_156_PRESENT 0
7675 #endif
7676
7677 #ifndef NRF52_ERRATA_156_ENABLE_WORKAROUND
7678 #define NRF52_ERRATA_156_ENABLE_WORKAROUND NRF52_ERRATA_156_PRESENT
7679 #endif
7680
nrf52_errata_156(void)7681 static bool nrf52_errata_156(void)
7682 {
7683 #ifndef NRF52_SERIES
7684 return false;
7685 #else
7686 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7687 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7688 uint32_t var1;
7689 uint32_t var2;
7690
7691 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7692 {
7693 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7694 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7695 }
7696 else
7697 {
7698 var1 = *(uint32_t *)0x10000130ul;
7699 var2 = *(uint32_t *)0x10000134ul;
7700 }
7701 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
7702 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
7703 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
7704 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7705 uint32_t var1 = *(uint32_t *)0x10000130ul;
7706 uint32_t var2 = *(uint32_t *)0x10000134ul;
7707 #endif
7708 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7709 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7710 if (var1 == 0x06)
7711 {
7712 switch(var2)
7713 {
7714 case 0x03ul:
7715 return false;
7716 case 0x04ul:
7717 return false;
7718 case 0x05ul:
7719 return true;
7720 case 0x06ul:
7721 return true;
7722 case 0x07ul:
7723 return true;
7724 default:
7725 return true;
7726 }
7727 }
7728 #endif
7729 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7730 if (var1 == 0x08)
7731 {
7732 switch(var2)
7733 {
7734 case 0x00ul:
7735 return true;
7736 case 0x01ul:
7737 return false;
7738 case 0x02ul:
7739 return false;
7740 case 0x03ul:
7741 return false;
7742 case 0x04ul:
7743 return false;
7744 case 0x05ul:
7745 return false;
7746 default:
7747 return false;
7748 }
7749 }
7750 #endif
7751 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
7752 if (var1 == 0x0A)
7753 {
7754 switch(var2)
7755 {
7756 case 0x00ul:
7757 return true;
7758 case 0x01ul:
7759 return true;
7760 case 0x02ul:
7761 return true;
7762 default:
7763 return true;
7764 }
7765 }
7766 #endif
7767 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
7768 if (var1 == 0x0E)
7769 {
7770 switch(var2)
7771 {
7772 case 0x00ul:
7773 return true;
7774 case 0x01ul:
7775 return true;
7776 default:
7777 return true;
7778 }
7779 }
7780 #endif
7781 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
7782 if (var1 == 0x0F)
7783 {
7784 switch(var2)
7785 {
7786 case 0x00ul:
7787 return true;
7788 case 0x01ul:
7789 return true;
7790 default:
7791 return true;
7792 }
7793 }
7794 #endif
7795 return false;
7796 #endif
7797 }
7798
7799 /* ========= Errata 158 ========= */
7800 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7801 #define NRF52_ERRATA_158_PRESENT 1
7802 #else
7803 #define NRF52_ERRATA_158_PRESENT 0
7804 #endif
7805
7806 #ifndef NRF52_ERRATA_158_ENABLE_WORKAROUND
7807 #define NRF52_ERRATA_158_ENABLE_WORKAROUND NRF52_ERRATA_158_PRESENT
7808 #endif
7809
nrf52_errata_158(void)7810 static bool nrf52_errata_158(void)
7811 {
7812 #ifndef NRF52_SERIES
7813 return false;
7814 #else
7815 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7816 uint32_t var1 = *(uint32_t *)0x10000130ul;
7817 uint32_t var2 = *(uint32_t *)0x10000134ul;
7818 #endif
7819 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7820 if (var1 == 0x08)
7821 {
7822 switch(var2)
7823 {
7824 case 0x00ul:
7825 return true;
7826 case 0x01ul:
7827 return false;
7828 case 0x02ul:
7829 return false;
7830 case 0x03ul:
7831 return false;
7832 case 0x04ul:
7833 return false;
7834 case 0x05ul:
7835 return false;
7836 default:
7837 return false;
7838 }
7839 }
7840 #endif
7841 return false;
7842 #endif
7843 }
7844
7845 /* ========= Errata 160 ========= */
7846 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7847 #define NRF52_ERRATA_160_PRESENT 1
7848 #else
7849 #define NRF52_ERRATA_160_PRESENT 0
7850 #endif
7851
7852 #ifndef NRF52_ERRATA_160_ENABLE_WORKAROUND
7853 #define NRF52_ERRATA_160_ENABLE_WORKAROUND NRF52_ERRATA_160_PRESENT
7854 #endif
7855
nrf52_errata_160(void)7856 static bool nrf52_errata_160(void)
7857 {
7858 #ifndef NRF52_SERIES
7859 return false;
7860 #else
7861 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7862 uint32_t var1 = *(uint32_t *)0x10000130ul;
7863 uint32_t var2 = *(uint32_t *)0x10000134ul;
7864 #endif
7865 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7866 if (var1 == 0x08)
7867 {
7868 switch(var2)
7869 {
7870 case 0x00ul:
7871 return true;
7872 case 0x01ul:
7873 return false;
7874 case 0x02ul:
7875 return false;
7876 case 0x03ul:
7877 return false;
7878 case 0x04ul:
7879 return false;
7880 case 0x05ul:
7881 return false;
7882 default:
7883 return false;
7884 }
7885 }
7886 #endif
7887 return false;
7888 #endif
7889 }
7890
7891 /* ========= Errata 162 ========= */
7892 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7893 #define NRF52_ERRATA_162_PRESENT 1
7894 #else
7895 #define NRF52_ERRATA_162_PRESENT 0
7896 #endif
7897
7898 #ifndef NRF52_ERRATA_162_ENABLE_WORKAROUND
7899 #define NRF52_ERRATA_162_ENABLE_WORKAROUND NRF52_ERRATA_162_PRESENT
7900 #endif
7901
nrf52_errata_162(void)7902 static bool nrf52_errata_162(void)
7903 {
7904 #ifndef NRF52_SERIES
7905 return false;
7906 #else
7907 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7908 uint32_t var1 = *(uint32_t *)0x10000130ul;
7909 uint32_t var2 = *(uint32_t *)0x10000134ul;
7910 #endif
7911 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7912 if (var1 == 0x08)
7913 {
7914 switch(var2)
7915 {
7916 case 0x00ul:
7917 return true;
7918 case 0x01ul:
7919 return false;
7920 case 0x02ul:
7921 return false;
7922 case 0x03ul:
7923 return false;
7924 case 0x04ul:
7925 return false;
7926 case 0x05ul:
7927 return false;
7928 default:
7929 return false;
7930 }
7931 }
7932 #endif
7933 return false;
7934 #endif
7935 }
7936
7937 /* ========= Errata 163 ========= */
7938 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
7939 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7940 #define NRF52_ERRATA_163_PRESENT 1
7941 #else
7942 #define NRF52_ERRATA_163_PRESENT 0
7943 #endif
7944
7945 #ifndef NRF52_ERRATA_163_ENABLE_WORKAROUND
7946 #define NRF52_ERRATA_163_ENABLE_WORKAROUND NRF52_ERRATA_163_PRESENT
7947 #endif
7948
nrf52_errata_163(void)7949 static bool nrf52_errata_163(void)
7950 {
7951 #ifndef NRF52_SERIES
7952 return false;
7953 #else
7954 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7955 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7956 uint32_t var1;
7957 uint32_t var2;
7958
7959 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
7960 {
7961 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
7962 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
7963 }
7964 else
7965 {
7966 var1 = *(uint32_t *)0x10000130ul;
7967 var2 = *(uint32_t *)0x10000134ul;
7968 }
7969 #endif
7970 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
7971 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
7972 if (var1 == 0x06)
7973 {
7974 switch(var2)
7975 {
7976 case 0x03ul:
7977 return false;
7978 case 0x04ul:
7979 return false;
7980 case 0x05ul:
7981 return true;
7982 case 0x06ul:
7983 return false;
7984 case 0x07ul:
7985 return false;
7986 default:
7987 return false;
7988 }
7989 }
7990 #endif
7991 return false;
7992 #endif
7993 }
7994
7995 /* ========= Errata 164 ========= */
7996 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
7997 #define NRF52_ERRATA_164_PRESENT 1
7998 #else
7999 #define NRF52_ERRATA_164_PRESENT 0
8000 #endif
8001
8002 #ifndef NRF52_ERRATA_164_ENABLE_WORKAROUND
8003 #define NRF52_ERRATA_164_ENABLE_WORKAROUND NRF52_ERRATA_164_PRESENT
8004 #endif
8005
nrf52_errata_164(void)8006 static bool nrf52_errata_164(void)
8007 {
8008 #ifndef NRF52_SERIES
8009 return false;
8010 #else
8011 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8012 uint32_t var1 = *(uint32_t *)0x10000130ul;
8013 uint32_t var2 = *(uint32_t *)0x10000134ul;
8014 #endif
8015 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8016 if (var1 == 0x08)
8017 {
8018 switch(var2)
8019 {
8020 case 0x00ul:
8021 return true;
8022 case 0x01ul:
8023 return false;
8024 case 0x02ul:
8025 return false;
8026 case 0x03ul:
8027 return false;
8028 case 0x04ul:
8029 return false;
8030 case 0x05ul:
8031 return false;
8032 default:
8033 return false;
8034 }
8035 }
8036 #endif
8037 return false;
8038 #endif
8039 }
8040
8041 /* ========= Errata 166 ========= */
8042 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8043 #define NRF52_ERRATA_166_PRESENT 1
8044 #else
8045 #define NRF52_ERRATA_166_PRESENT 0
8046 #endif
8047
8048 #ifndef NRF52_ERRATA_166_ENABLE_WORKAROUND
8049 #define NRF52_ERRATA_166_ENABLE_WORKAROUND NRF52_ERRATA_166_PRESENT
8050 #endif
8051
nrf52_errata_166(void)8052 static bool nrf52_errata_166(void)
8053 {
8054 #ifndef NRF52_SERIES
8055 return false;
8056 #else
8057 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8058 uint32_t var1 = *(uint32_t *)0x10000130ul;
8059 uint32_t var2 = *(uint32_t *)0x10000134ul;
8060 #endif
8061 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8062 if (var1 == 0x08)
8063 {
8064 switch(var2)
8065 {
8066 case 0x00ul:
8067 return true;
8068 case 0x01ul:
8069 return true;
8070 case 0x02ul:
8071 return true;
8072 case 0x03ul:
8073 return true;
8074 case 0x04ul:
8075 return true;
8076 case 0x05ul:
8077 return true;
8078 default:
8079 return true;
8080 }
8081 }
8082 #endif
8083 return false;
8084 #endif
8085 }
8086
8087 /* ========= Errata 170 ========= */
8088 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
8089 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
8090 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8091 #define NRF52_ERRATA_170_PRESENT 1
8092 #else
8093 #define NRF52_ERRATA_170_PRESENT 0
8094 #endif
8095
8096 #ifndef NRF52_ERRATA_170_ENABLE_WORKAROUND
8097 #define NRF52_ERRATA_170_ENABLE_WORKAROUND NRF52_ERRATA_170_PRESENT
8098 #endif
8099
nrf52_errata_170(void)8100 static bool nrf52_errata_170(void)
8101 {
8102 #ifndef NRF52_SERIES
8103 return false;
8104 #else
8105 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
8106 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
8107 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8108 uint32_t var1 = *(uint32_t *)0x10000130ul;
8109 uint32_t var2 = *(uint32_t *)0x10000134ul;
8110 #endif
8111 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8112 if (var1 == 0x08)
8113 {
8114 switch(var2)
8115 {
8116 case 0x00ul:
8117 return true;
8118 case 0x01ul:
8119 return true;
8120 case 0x02ul:
8121 return true;
8122 case 0x03ul:
8123 return true;
8124 case 0x04ul:
8125 return true;
8126 case 0x05ul:
8127 return true;
8128 default:
8129 return true;
8130 }
8131 }
8132 #endif
8133 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
8134 if (var1 == 0x0D)
8135 {
8136 switch(var2)
8137 {
8138 case 0x00ul:
8139 return true;
8140 case 0x01ul:
8141 return true;
8142 default:
8143 return true;
8144 }
8145 }
8146 #endif
8147 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
8148 if (var1 == 0x10)
8149 {
8150 switch(var2)
8151 {
8152 case 0x00ul:
8153 return true;
8154 case 0x01ul:
8155 return true;
8156 case 0x02ul:
8157 return false;
8158 case 0x03ul:
8159 return false;
8160 default:
8161 return false;
8162 }
8163 }
8164 #endif
8165 return false;
8166 #endif
8167 }
8168
8169 /* ========= Errata 171 ========= */
8170 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8171 #define NRF52_ERRATA_171_PRESENT 1
8172 #else
8173 #define NRF52_ERRATA_171_PRESENT 0
8174 #endif
8175
8176 #ifndef NRF52_ERRATA_171_ENABLE_WORKAROUND
8177 #define NRF52_ERRATA_171_ENABLE_WORKAROUND NRF52_ERRATA_171_PRESENT
8178 #endif
8179
nrf52_errata_171(void)8180 static bool nrf52_errata_171(void)
8181 {
8182 #ifndef NRF52_SERIES
8183 return false;
8184 #else
8185 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8186 uint32_t var1 = *(uint32_t *)0x10000130ul;
8187 uint32_t var2 = *(uint32_t *)0x10000134ul;
8188 #endif
8189 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8190 if (var1 == 0x08)
8191 {
8192 switch(var2)
8193 {
8194 case 0x00ul:
8195 return true;
8196 case 0x01ul:
8197 return true;
8198 case 0x02ul:
8199 return true;
8200 case 0x03ul:
8201 return true;
8202 case 0x04ul:
8203 return true;
8204 case 0x05ul:
8205 return true;
8206 default:
8207 return true;
8208 }
8209 }
8210 #endif
8211 return false;
8212 #endif
8213 }
8214
8215 /* ========= Errata 172 ========= */
8216 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8217 #define NRF52_ERRATA_172_PRESENT 1
8218 #else
8219 #define NRF52_ERRATA_172_PRESENT 0
8220 #endif
8221
8222 #ifndef NRF52_ERRATA_172_ENABLE_WORKAROUND
8223 #define NRF52_ERRATA_172_ENABLE_WORKAROUND NRF52_ERRATA_172_PRESENT
8224 #endif
8225
nrf52_errata_172(void)8226 static bool nrf52_errata_172(void)
8227 {
8228 #ifndef NRF52_SERIES
8229 return false;
8230 #else
8231 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8232 uint32_t var1 = *(uint32_t *)0x10000130ul;
8233 uint32_t var2 = *(uint32_t *)0x10000134ul;
8234 #endif
8235 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8236 if (var1 == 0x08)
8237 {
8238 switch(var2)
8239 {
8240 case 0x00ul:
8241 return false;
8242 case 0x01ul:
8243 return true;
8244 case 0x02ul:
8245 return true;
8246 case 0x03ul:
8247 return true;
8248 case 0x04ul:
8249 return true;
8250 case 0x05ul:
8251 return true;
8252 default:
8253 return true;
8254 }
8255 }
8256 #endif
8257 return false;
8258 #endif
8259 }
8260
8261 /* ========= Errata 173 ========= */
8262 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
8263 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
8264 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
8265 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
8266 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8267 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
8268 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
8269 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8270 #define NRF52_ERRATA_173_PRESENT 1
8271 #else
8272 #define NRF52_ERRATA_173_PRESENT 0
8273 #endif
8274
8275 #ifndef NRF52_ERRATA_173_ENABLE_WORKAROUND
8276 #define NRF52_ERRATA_173_ENABLE_WORKAROUND NRF52_ERRATA_173_PRESENT
8277 #endif
8278
nrf52_errata_173(void)8279 static bool nrf52_errata_173(void)
8280 {
8281 #ifndef NRF52_SERIES
8282 return false;
8283 #else
8284 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8285 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8286 uint32_t var1;
8287 uint32_t var2;
8288
8289 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
8290 {
8291 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
8292 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
8293 }
8294 else
8295 {
8296 var1 = *(uint32_t *)0x10000130ul;
8297 var2 = *(uint32_t *)0x10000134ul;
8298 }
8299 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
8300 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
8301 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
8302 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
8303 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
8304 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8305 uint32_t var1 = *(uint32_t *)0x10000130ul;
8306 uint32_t var2 = *(uint32_t *)0x10000134ul;
8307 #endif
8308 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8309 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8310 if (var1 == 0x06)
8311 {
8312 switch(var2)
8313 {
8314 case 0x03ul:
8315 return false;
8316 case 0x04ul:
8317 return false;
8318 case 0x05ul:
8319 return true;
8320 case 0x06ul:
8321 return true;
8322 case 0x07ul:
8323 return true;
8324 default:
8325 return true;
8326 }
8327 }
8328 #endif
8329 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8330 if (var1 == 0x08)
8331 {
8332 switch(var2)
8333 {
8334 case 0x00ul:
8335 return true;
8336 case 0x01ul:
8337 return true;
8338 case 0x02ul:
8339 return true;
8340 case 0x03ul:
8341 return true;
8342 case 0x04ul:
8343 return true;
8344 case 0x05ul:
8345 return true;
8346 default:
8347 return true;
8348 }
8349 }
8350 #endif
8351 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
8352 if (var1 == 0x0A)
8353 {
8354 switch(var2)
8355 {
8356 case 0x00ul:
8357 return true;
8358 case 0x01ul:
8359 return true;
8360 case 0x02ul:
8361 return true;
8362 default:
8363 return true;
8364 }
8365 }
8366 #endif
8367 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
8368 if (var1 == 0x0D)
8369 {
8370 switch(var2)
8371 {
8372 case 0x00ul:
8373 return true;
8374 case 0x01ul:
8375 return true;
8376 default:
8377 return true;
8378 }
8379 }
8380 #endif
8381 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
8382 if (var1 == 0x0E)
8383 {
8384 switch(var2)
8385 {
8386 case 0x00ul:
8387 return true;
8388 case 0x01ul:
8389 return true;
8390 default:
8391 return true;
8392 }
8393 }
8394 #endif
8395 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
8396 if (var1 == 0x0F)
8397 {
8398 switch(var2)
8399 {
8400 case 0x00ul:
8401 return true;
8402 case 0x01ul:
8403 return true;
8404 default:
8405 return true;
8406 }
8407 }
8408 #endif
8409 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
8410 if (var1 == 0x10)
8411 {
8412 switch(var2)
8413 {
8414 case 0x00ul:
8415 return true;
8416 case 0x01ul:
8417 return true;
8418 case 0x02ul:
8419 return true;
8420 case 0x03ul:
8421 return true;
8422 default:
8423 return true;
8424 }
8425 }
8426 #endif
8427 return false;
8428 #endif
8429 }
8430
8431 /* ========= Errata 174 ========= */
8432 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8433 #define NRF52_ERRATA_174_PRESENT 1
8434 #else
8435 #define NRF52_ERRATA_174_PRESENT 0
8436 #endif
8437
8438 #ifndef NRF52_ERRATA_174_ENABLE_WORKAROUND
8439 #define NRF52_ERRATA_174_ENABLE_WORKAROUND NRF52_ERRATA_174_PRESENT
8440 #endif
8441
nrf52_errata_174(void)8442 static bool nrf52_errata_174(void)
8443 {
8444 #ifndef NRF52_SERIES
8445 return false;
8446 #else
8447 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8448 uint32_t var1 = *(uint32_t *)0x10000130ul;
8449 uint32_t var2 = *(uint32_t *)0x10000134ul;
8450 #endif
8451 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8452 if (var1 == 0x08)
8453 {
8454 switch(var2)
8455 {
8456 case 0x00ul:
8457 return false;
8458 case 0x01ul:
8459 return true;
8460 case 0x02ul:
8461 return true;
8462 case 0x03ul:
8463 return true;
8464 case 0x04ul:
8465 return true;
8466 case 0x05ul:
8467 return true;
8468 default:
8469 return true;
8470 }
8471 }
8472 #endif
8473 return false;
8474 #endif
8475 }
8476
8477 /* ========= Errata 176 ========= */
8478 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
8479 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
8480 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
8481 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
8482 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8483 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
8484 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
8485 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8486 #define NRF52_ERRATA_176_PRESENT 1
8487 #else
8488 #define NRF52_ERRATA_176_PRESENT 0
8489 #endif
8490
8491 #ifndef NRF52_ERRATA_176_ENABLE_WORKAROUND
8492 #define NRF52_ERRATA_176_ENABLE_WORKAROUND NRF52_ERRATA_176_PRESENT
8493 #endif
8494
nrf52_errata_176(void)8495 static bool nrf52_errata_176(void)
8496 {
8497 #ifndef NRF52_SERIES
8498 return false;
8499 #else
8500 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8501 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8502 uint32_t var1;
8503 uint32_t var2;
8504
8505 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
8506 {
8507 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
8508 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
8509 }
8510 else
8511 {
8512 var1 = *(uint32_t *)0x10000130ul;
8513 var2 = *(uint32_t *)0x10000134ul;
8514 }
8515 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
8516 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
8517 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
8518 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
8519 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
8520 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8521 uint32_t var1 = *(uint32_t *)0x10000130ul;
8522 uint32_t var2 = *(uint32_t *)0x10000134ul;
8523 #endif
8524 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8525 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8526 if (var1 == 0x06)
8527 {
8528 switch(var2)
8529 {
8530 case 0x03ul:
8531 return false;
8532 case 0x04ul:
8533 return false;
8534 case 0x05ul:
8535 return true;
8536 case 0x06ul:
8537 return true;
8538 case 0x07ul:
8539 return true;
8540 default:
8541 return true;
8542 }
8543 }
8544 #endif
8545 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8546 if (var1 == 0x08)
8547 {
8548 switch(var2)
8549 {
8550 case 0x00ul:
8551 return true;
8552 case 0x01ul:
8553 return true;
8554 case 0x02ul:
8555 return true;
8556 case 0x03ul:
8557 return true;
8558 case 0x04ul:
8559 return true;
8560 case 0x05ul:
8561 return true;
8562 default:
8563 return true;
8564 }
8565 }
8566 #endif
8567 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
8568 if (var1 == 0x0A)
8569 {
8570 switch(var2)
8571 {
8572 case 0x00ul:
8573 return true;
8574 case 0x01ul:
8575 return true;
8576 case 0x02ul:
8577 return true;
8578 default:
8579 return true;
8580 }
8581 }
8582 #endif
8583 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
8584 if (var1 == 0x0D)
8585 {
8586 switch(var2)
8587 {
8588 case 0x00ul:
8589 return true;
8590 case 0x01ul:
8591 return true;
8592 default:
8593 return true;
8594 }
8595 }
8596 #endif
8597 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
8598 if (var1 == 0x0E)
8599 {
8600 switch(var2)
8601 {
8602 case 0x00ul:
8603 return true;
8604 case 0x01ul:
8605 return true;
8606 default:
8607 return true;
8608 }
8609 }
8610 #endif
8611 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
8612 if (var1 == 0x0F)
8613 {
8614 switch(var2)
8615 {
8616 case 0x00ul:
8617 return true;
8618 case 0x01ul:
8619 return true;
8620 default:
8621 return true;
8622 }
8623 }
8624 #endif
8625 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
8626 if (var1 == 0x10)
8627 {
8628 switch(var2)
8629 {
8630 case 0x00ul:
8631 return true;
8632 case 0x01ul:
8633 return true;
8634 case 0x02ul:
8635 return true;
8636 case 0x03ul:
8637 return true;
8638 default:
8639 return true;
8640 }
8641 }
8642 #endif
8643 return false;
8644 #endif
8645 }
8646
8647 /* ========= Errata 178 ========= */
8648 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8649 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8650 #define NRF52_ERRATA_178_PRESENT 1
8651 #else
8652 #define NRF52_ERRATA_178_PRESENT 0
8653 #endif
8654
8655 #ifndef NRF52_ERRATA_178_ENABLE_WORKAROUND
8656 #define NRF52_ERRATA_178_ENABLE_WORKAROUND NRF52_ERRATA_178_PRESENT
8657 #endif
8658
nrf52_errata_178(void)8659 static bool nrf52_errata_178(void)
8660 {
8661 #ifndef NRF52_SERIES
8662 return false;
8663 #else
8664 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8665 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8666 uint32_t var1;
8667 uint32_t var2;
8668
8669 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
8670 {
8671 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
8672 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
8673 }
8674 else
8675 {
8676 var1 = *(uint32_t *)0x10000130ul;
8677 var2 = *(uint32_t *)0x10000134ul;
8678 }
8679 #endif
8680 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8681 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8682 if (var1 == 0x06)
8683 {
8684 switch(var2)
8685 {
8686 case 0x03ul:
8687 return false;
8688 case 0x04ul:
8689 return false;
8690 case 0x05ul:
8691 return true;
8692 case 0x06ul:
8693 return true;
8694 case 0x07ul:
8695 return true;
8696 default:
8697 return true;
8698 }
8699 }
8700 #endif
8701 return false;
8702 #endif
8703 }
8704
8705 /* ========= Errata 179 ========= */
8706 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
8707 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
8708 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
8709 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8710 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
8711 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8712 #define NRF52_ERRATA_179_PRESENT 1
8713 #else
8714 #define NRF52_ERRATA_179_PRESENT 0
8715 #endif
8716
8717 #ifndef NRF52_ERRATA_179_ENABLE_WORKAROUND
8718 #define NRF52_ERRATA_179_ENABLE_WORKAROUND NRF52_ERRATA_179_PRESENT
8719 #endif
8720
nrf52_errata_179(void)8721 static bool nrf52_errata_179(void)
8722 {
8723 #ifndef NRF52_SERIES
8724 return false;
8725 #else
8726 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8727 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8728 uint32_t var1;
8729 uint32_t var2;
8730
8731 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
8732 {
8733 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
8734 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
8735 }
8736 else
8737 {
8738 var1 = *(uint32_t *)0x10000130ul;
8739 var2 = *(uint32_t *)0x10000134ul;
8740 }
8741 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
8742 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
8743 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
8744 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8745 uint32_t var1 = *(uint32_t *)0x10000130ul;
8746 uint32_t var2 = *(uint32_t *)0x10000134ul;
8747 #endif
8748 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8749 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8750 if (var1 == 0x06)
8751 {
8752 switch(var2)
8753 {
8754 case 0x03ul:
8755 return false;
8756 case 0x04ul:
8757 return false;
8758 case 0x05ul:
8759 return true;
8760 case 0x06ul:
8761 return true;
8762 case 0x07ul:
8763 return true;
8764 default:
8765 return true;
8766 }
8767 }
8768 #endif
8769 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8770 if (var1 == 0x08)
8771 {
8772 switch(var2)
8773 {
8774 case 0x00ul:
8775 return true;
8776 case 0x01ul:
8777 return true;
8778 case 0x02ul:
8779 return true;
8780 case 0x03ul:
8781 return true;
8782 case 0x04ul:
8783 return true;
8784 case 0x05ul:
8785 return true;
8786 default:
8787 return true;
8788 }
8789 }
8790 #endif
8791 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
8792 if (var1 == 0x0A)
8793 {
8794 switch(var2)
8795 {
8796 case 0x00ul:
8797 return true;
8798 case 0x01ul:
8799 return true;
8800 case 0x02ul:
8801 return true;
8802 default:
8803 return true;
8804 }
8805 }
8806 #endif
8807 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
8808 if (var1 == 0x0E)
8809 {
8810 switch(var2)
8811 {
8812 case 0x00ul:
8813 return true;
8814 case 0x01ul:
8815 return true;
8816 default:
8817 return true;
8818 }
8819 }
8820 #endif
8821 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
8822 if (var1 == 0x0F)
8823 {
8824 switch(var2)
8825 {
8826 case 0x00ul:
8827 return true;
8828 case 0x01ul:
8829 return true;
8830 default:
8831 return true;
8832 }
8833 }
8834 #endif
8835 return false;
8836 #endif
8837 }
8838
8839 /* ========= Errata 180 ========= */
8840 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8841 #define NRF52_ERRATA_180_PRESENT 1
8842 #else
8843 #define NRF52_ERRATA_180_PRESENT 0
8844 #endif
8845
8846 #ifndef NRF52_ERRATA_180_ENABLE_WORKAROUND
8847 #define NRF52_ERRATA_180_ENABLE_WORKAROUND NRF52_ERRATA_180_PRESENT
8848 #endif
8849
nrf52_errata_180(void)8850 static bool nrf52_errata_180(void)
8851 {
8852 #ifndef NRF52_SERIES
8853 return false;
8854 #else
8855 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8856 uint32_t var1 = *(uint32_t *)0x10000130ul;
8857 uint32_t var2 = *(uint32_t *)0x10000134ul;
8858 #endif
8859 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8860 if (var1 == 0x08)
8861 {
8862 switch(var2)
8863 {
8864 case 0x00ul:
8865 return true;
8866 case 0x01ul:
8867 return false;
8868 case 0x02ul:
8869 return false;
8870 case 0x03ul:
8871 return false;
8872 case 0x04ul:
8873 return false;
8874 case 0x05ul:
8875 return false;
8876 default:
8877 return false;
8878 }
8879 }
8880 #endif
8881 return false;
8882 #endif
8883 }
8884
8885 /* ========= Errata 181 ========= */
8886 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8887 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
8888 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8889 #define NRF52_ERRATA_181_PRESENT 1
8890 #else
8891 #define NRF52_ERRATA_181_PRESENT 0
8892 #endif
8893
8894 #ifndef NRF52_ERRATA_181_ENABLE_WORKAROUND
8895 #define NRF52_ERRATA_181_ENABLE_WORKAROUND NRF52_ERRATA_181_PRESENT
8896 #endif
8897
nrf52_errata_181(void)8898 static bool nrf52_errata_181(void)
8899 {
8900 #ifndef NRF52_SERIES
8901 return false;
8902 #else
8903 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8904 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8905 uint32_t var1;
8906 uint32_t var2;
8907
8908 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
8909 {
8910 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
8911 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
8912 }
8913 else
8914 {
8915 var1 = *(uint32_t *)0x10000130ul;
8916 var2 = *(uint32_t *)0x10000134ul;
8917 }
8918 #elif defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8919 uint32_t var1 = *(uint32_t *)0x10000130ul;
8920 uint32_t var2 = *(uint32_t *)0x10000134ul;
8921 #endif
8922 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8923 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8924 if (var1 == 0x06)
8925 {
8926 switch(var2)
8927 {
8928 case 0x03ul:
8929 return false;
8930 case 0x04ul:
8931 return false;
8932 case 0x05ul:
8933 return true;
8934 case 0x06ul:
8935 return false;
8936 case 0x07ul:
8937 return false;
8938 default:
8939 return false;
8940 }
8941 }
8942 #endif
8943 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
8944 if (var1 == 0x08)
8945 {
8946 switch(var2)
8947 {
8948 case 0x00ul:
8949 return true;
8950 case 0x01ul:
8951 return false;
8952 case 0x02ul:
8953 return false;
8954 case 0x03ul:
8955 return false;
8956 case 0x04ul:
8957 return false;
8958 case 0x05ul:
8959 return false;
8960 default:
8961 return false;
8962 }
8963 }
8964 #endif
8965 return false;
8966 #endif
8967 }
8968
8969 /* ========= Errata 182 ========= */
8970 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
8971 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8972 #define NRF52_ERRATA_182_PRESENT 1
8973 #else
8974 #define NRF52_ERRATA_182_PRESENT 0
8975 #endif
8976
8977 #ifndef NRF52_ERRATA_182_ENABLE_WORKAROUND
8978 #define NRF52_ERRATA_182_ENABLE_WORKAROUND NRF52_ERRATA_182_PRESENT
8979 #endif
8980
nrf52_errata_182(void)8981 static bool nrf52_errata_182(void)
8982 {
8983 #ifndef NRF52_SERIES
8984 return false;
8985 #else
8986 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8987 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8988 uint32_t var1 = *(uint32_t *)0x10000130ul;
8989 uint32_t var2 = *(uint32_t *)0x10000134ul;
8990 #endif
8991 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
8992 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
8993 if (var1 == 0x06)
8994 {
8995 switch(var2)
8996 {
8997 case 0x03ul:
8998 return false;
8999 case 0x04ul:
9000 return false;
9001 case 0x05ul:
9002 return false;
9003 case 0x06ul:
9004 return true;
9005 case 0x07ul:
9006 return true;
9007 default:
9008 return true;
9009 }
9010 }
9011 #endif
9012 return false;
9013 #endif
9014 }
9015
9016 /* ========= Errata 183 ========= */
9017 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
9018 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
9019 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9020 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
9021 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
9022 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9023 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9024 #define NRF52_ERRATA_183_PRESENT 1
9025 #else
9026 #define NRF52_ERRATA_183_PRESENT 0
9027 #endif
9028
9029 #ifndef NRF52_ERRATA_183_ENABLE_WORKAROUND
9030 #define NRF52_ERRATA_183_ENABLE_WORKAROUND NRF52_ERRATA_183_PRESENT
9031 #endif
9032
nrf52_errata_183(void)9033 static bool nrf52_errata_183(void)
9034 {
9035 #ifndef NRF52_SERIES
9036 return false;
9037 #else
9038 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9039 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9040 uint32_t var1;
9041 uint32_t var2;
9042
9043 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
9044 {
9045 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
9046 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
9047 }
9048 else
9049 {
9050 var1 = *(uint32_t *)0x10000130ul;
9051 var2 = *(uint32_t *)0x10000134ul;
9052 }
9053 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
9054 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
9055 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9056 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9057 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9058 uint32_t var1 = *(uint32_t *)0x10000130ul;
9059 uint32_t var2 = *(uint32_t *)0x10000134ul;
9060 #endif
9061 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9062 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9063 if (var1 == 0x06)
9064 {
9065 switch(var2)
9066 {
9067 case 0x03ul:
9068 return false;
9069 case 0x04ul:
9070 return false;
9071 case 0x05ul:
9072 return true;
9073 case 0x06ul:
9074 return true;
9075 case 0x07ul:
9076 return true;
9077 default:
9078 return true;
9079 }
9080 }
9081 #endif
9082 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9083 if (var1 == 0x08)
9084 {
9085 switch(var2)
9086 {
9087 case 0x00ul:
9088 return true;
9089 case 0x01ul:
9090 return true;
9091 case 0x02ul:
9092 return true;
9093 case 0x03ul:
9094 return true;
9095 case 0x04ul:
9096 return true;
9097 case 0x05ul:
9098 return true;
9099 default:
9100 return true;
9101 }
9102 }
9103 #endif
9104 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
9105 if (var1 == 0x0A)
9106 {
9107 switch(var2)
9108 {
9109 case 0x00ul:
9110 return true;
9111 case 0x01ul:
9112 return true;
9113 case 0x02ul:
9114 return true;
9115 default:
9116 return true;
9117 }
9118 }
9119 #endif
9120 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
9121 if (var1 == 0x0D)
9122 {
9123 switch(var2)
9124 {
9125 case 0x00ul:
9126 return true;
9127 case 0x01ul:
9128 return true;
9129 default:
9130 return true;
9131 }
9132 }
9133 #endif
9134 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
9135 if (var1 == 0x0E)
9136 {
9137 switch(var2)
9138 {
9139 case 0x00ul:
9140 return true;
9141 case 0x01ul:
9142 return true;
9143 default:
9144 return true;
9145 }
9146 }
9147 #endif
9148 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
9149 if (var1 == 0x10)
9150 {
9151 switch(var2)
9152 {
9153 case 0x00ul:
9154 return true;
9155 case 0x01ul:
9156 return true;
9157 case 0x02ul:
9158 return false;
9159 case 0x03ul:
9160 return false;
9161 default:
9162 return false;
9163 }
9164 }
9165 #endif
9166 return false;
9167 #endif
9168 }
9169
9170 /* ========= Errata 184 ========= */
9171 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
9172 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
9173 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
9174 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9175 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9176 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9177 #define NRF52_ERRATA_184_PRESENT 1
9178 #else
9179 #define NRF52_ERRATA_184_PRESENT 0
9180 #endif
9181
9182 #ifndef NRF52_ERRATA_184_ENABLE_WORKAROUND
9183 #define NRF52_ERRATA_184_ENABLE_WORKAROUND NRF52_ERRATA_184_PRESENT
9184 #endif
9185
nrf52_errata_184(void)9186 static bool nrf52_errata_184(void)
9187 {
9188 #ifndef NRF52_SERIES
9189 return false;
9190 #else
9191 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
9192 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
9193 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
9194 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9195 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9196 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9197 uint32_t var1 = *(uint32_t *)0x10000130ul;
9198 uint32_t var2 = *(uint32_t *)0x10000134ul;
9199 #endif
9200 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9201 if (var1 == 0x08)
9202 {
9203 switch(var2)
9204 {
9205 case 0x00ul:
9206 return true;
9207 case 0x01ul:
9208 return true;
9209 case 0x02ul:
9210 return true;
9211 case 0x03ul:
9212 return true;
9213 case 0x04ul:
9214 return true;
9215 case 0x05ul:
9216 return true;
9217 default:
9218 return true;
9219 }
9220 }
9221 #endif
9222 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
9223 if (var1 == 0x0A)
9224 {
9225 switch(var2)
9226 {
9227 case 0x00ul:
9228 return true;
9229 case 0x01ul:
9230 return true;
9231 case 0x02ul:
9232 return true;
9233 default:
9234 return true;
9235 }
9236 }
9237 #endif
9238 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
9239 if (var1 == 0x0D)
9240 {
9241 switch(var2)
9242 {
9243 case 0x00ul:
9244 return true;
9245 case 0x01ul:
9246 return true;
9247 default:
9248 return true;
9249 }
9250 }
9251 #endif
9252 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
9253 if (var1 == 0x0E)
9254 {
9255 switch(var2)
9256 {
9257 case 0x00ul:
9258 return true;
9259 case 0x01ul:
9260 return true;
9261 default:
9262 return true;
9263 }
9264 }
9265 #endif
9266 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
9267 if (var1 == 0x0F)
9268 {
9269 switch(var2)
9270 {
9271 case 0x00ul:
9272 return true;
9273 case 0x01ul:
9274 return true;
9275 default:
9276 return true;
9277 }
9278 }
9279 #endif
9280 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
9281 if (var1 == 0x10)
9282 {
9283 switch(var2)
9284 {
9285 case 0x00ul:
9286 return true;
9287 case 0x01ul:
9288 return true;
9289 case 0x02ul:
9290 return true;
9291 case 0x03ul:
9292 return true;
9293 default:
9294 return true;
9295 }
9296 }
9297 #endif
9298 return false;
9299 #endif
9300 }
9301
9302 /* ========= Errata 186 ========= */
9303 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9304 #define NRF52_ERRATA_186_PRESENT 1
9305 #else
9306 #define NRF52_ERRATA_186_PRESENT 0
9307 #endif
9308
9309 #ifndef NRF52_ERRATA_186_ENABLE_WORKAROUND
9310 #define NRF52_ERRATA_186_ENABLE_WORKAROUND NRF52_ERRATA_186_PRESENT
9311 #endif
9312
nrf52_errata_186(void)9313 static bool nrf52_errata_186(void)
9314 {
9315 #ifndef NRF52_SERIES
9316 return false;
9317 #else
9318 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9319 uint32_t var1 = *(uint32_t *)0x10000130ul;
9320 uint32_t var2 = *(uint32_t *)0x10000134ul;
9321 #endif
9322 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9323 if (var1 == 0x08)
9324 {
9325 switch(var2)
9326 {
9327 case 0x00ul:
9328 return false;
9329 case 0x01ul:
9330 return true;
9331 case 0x02ul:
9332 return false;
9333 case 0x03ul:
9334 return false;
9335 case 0x04ul:
9336 return false;
9337 case 0x05ul:
9338 return false;
9339 default:
9340 return false;
9341 }
9342 }
9343 #endif
9344 return false;
9345 #endif
9346 }
9347
9348 /* ========= Errata 187 ========= */
9349 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9350 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9351 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9352 #define NRF52_ERRATA_187_PRESENT 1
9353 #else
9354 #define NRF52_ERRATA_187_PRESENT 0
9355 #endif
9356
9357 #ifndef NRF52_ERRATA_187_ENABLE_WORKAROUND
9358 #define NRF52_ERRATA_187_ENABLE_WORKAROUND NRF52_ERRATA_187_PRESENT
9359 #endif
9360
nrf52_errata_187(void)9361 static bool nrf52_errata_187(void)
9362 {
9363 #ifndef NRF52_SERIES
9364 return false;
9365 #else
9366 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9367 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9368 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9369 uint32_t var1 = *(uint32_t *)0x10000130ul;
9370 uint32_t var2 = *(uint32_t *)0x10000134ul;
9371 #endif
9372 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9373 if (var1 == 0x08)
9374 {
9375 switch(var2)
9376 {
9377 case 0x00ul:
9378 return false;
9379 case 0x01ul:
9380 return true;
9381 case 0x02ul:
9382 return true;
9383 case 0x03ul:
9384 return true;
9385 case 0x04ul:
9386 return true;
9387 case 0x05ul:
9388 return true;
9389 default:
9390 return true;
9391 }
9392 }
9393 #endif
9394 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
9395 if (var1 == 0x0D)
9396 {
9397 switch(var2)
9398 {
9399 case 0x00ul:
9400 return true;
9401 case 0x01ul:
9402 return true;
9403 default:
9404 return true;
9405 }
9406 }
9407 #endif
9408 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
9409 if (var1 == 0x10)
9410 {
9411 switch(var2)
9412 {
9413 case 0x00ul:
9414 return true;
9415 case 0x01ul:
9416 return true;
9417 case 0x02ul:
9418 return true;
9419 case 0x03ul:
9420 return true;
9421 default:
9422 return true;
9423 }
9424 }
9425 #endif
9426 return false;
9427 #endif
9428 }
9429
9430 /* ========= Errata 189 ========= */
9431 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9432 #define NRF52_ERRATA_189_PRESENT 1
9433 #else
9434 #define NRF52_ERRATA_189_PRESENT 0
9435 #endif
9436
9437 #ifndef NRF52_ERRATA_189_ENABLE_WORKAROUND
9438 #define NRF52_ERRATA_189_ENABLE_WORKAROUND NRF52_ERRATA_189_PRESENT
9439 #endif
9440
nrf52_errata_189(void)9441 static bool nrf52_errata_189(void)
9442 {
9443 #ifndef NRF52_SERIES
9444 return false;
9445 #else
9446 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9447 uint32_t var1 = *(uint32_t *)0x10000130ul;
9448 uint32_t var2 = *(uint32_t *)0x10000134ul;
9449 #endif
9450 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9451 if (var1 == 0x08)
9452 {
9453 switch(var2)
9454 {
9455 case 0x00ul:
9456 return false;
9457 case 0x01ul:
9458 return true;
9459 case 0x02ul:
9460 return false;
9461 case 0x03ul:
9462 return false;
9463 case 0x04ul:
9464 return false;
9465 case 0x05ul:
9466 return false;
9467 default:
9468 return false;
9469 }
9470 }
9471 #endif
9472 return false;
9473 #endif
9474 }
9475
9476 /* ========= Errata 190 ========= */
9477 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9478 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9479 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9480 #define NRF52_ERRATA_190_PRESENT 1
9481 #else
9482 #define NRF52_ERRATA_190_PRESENT 0
9483 #endif
9484
9485 #ifndef NRF52_ERRATA_190_ENABLE_WORKAROUND
9486 #define NRF52_ERRATA_190_ENABLE_WORKAROUND NRF52_ERRATA_190_PRESENT
9487 #endif
9488
nrf52_errata_190(void)9489 static bool nrf52_errata_190(void)
9490 {
9491 #ifndef NRF52_SERIES
9492 return false;
9493 #else
9494 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9495 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9496 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9497 uint32_t var1 = *(uint32_t *)0x10000130ul;
9498 uint32_t var2 = *(uint32_t *)0x10000134ul;
9499 #endif
9500 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9501 if (var1 == 0x08)
9502 {
9503 switch(var2)
9504 {
9505 case 0x00ul:
9506 return false;
9507 case 0x01ul:
9508 return true;
9509 case 0x02ul:
9510 return true;
9511 case 0x03ul:
9512 return true;
9513 case 0x04ul:
9514 return true;
9515 case 0x05ul:
9516 return true;
9517 default:
9518 return true;
9519 }
9520 }
9521 #endif
9522 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
9523 if (var1 == 0x0D)
9524 {
9525 switch(var2)
9526 {
9527 case 0x00ul:
9528 return true;
9529 case 0x01ul:
9530 return true;
9531 default:
9532 return true;
9533 }
9534 }
9535 #endif
9536 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
9537 if (var1 == 0x10)
9538 {
9539 switch(var2)
9540 {
9541 case 0x00ul:
9542 return true;
9543 case 0x01ul:
9544 return true;
9545 case 0x02ul:
9546 return false;
9547 case 0x03ul:
9548 return false;
9549 default:
9550 return false;
9551 }
9552 }
9553 #endif
9554 return false;
9555 #endif
9556 }
9557
9558 /* ========= Errata 191 ========= */
9559 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9560 #define NRF52_ERRATA_191_PRESENT 1
9561 #else
9562 #define NRF52_ERRATA_191_PRESENT 0
9563 #endif
9564
9565 #ifndef NRF52_ERRATA_191_ENABLE_WORKAROUND
9566 #define NRF52_ERRATA_191_ENABLE_WORKAROUND NRF52_ERRATA_191_PRESENT
9567 #endif
9568
nrf52_errata_191(void)9569 static bool nrf52_errata_191(void)
9570 {
9571 #ifndef NRF52_SERIES
9572 return false;
9573 #else
9574 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9575 uint32_t var1 = *(uint32_t *)0x10000130ul;
9576 uint32_t var2 = *(uint32_t *)0x10000134ul;
9577 #endif
9578 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9579 if (var1 == 0x08)
9580 {
9581 switch(var2)
9582 {
9583 case 0x00ul:
9584 return false;
9585 case 0x01ul:
9586 return true;
9587 case 0x02ul:
9588 return true;
9589 case 0x03ul:
9590 return true;
9591 case 0x04ul:
9592 return true;
9593 case 0x05ul:
9594 return true;
9595 default:
9596 return true;
9597 }
9598 }
9599 #endif
9600 return false;
9601 #endif
9602 }
9603
9604 /* ========= Errata 192 ========= */
9605 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
9606 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
9607 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
9608 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9609 #define NRF52_ERRATA_192_PRESENT 1
9610 #else
9611 #define NRF52_ERRATA_192_PRESENT 0
9612 #endif
9613
9614 #ifndef NRF52_ERRATA_192_ENABLE_WORKAROUND
9615 #define NRF52_ERRATA_192_ENABLE_WORKAROUND NRF52_ERRATA_192_PRESENT
9616 #endif
9617
nrf52_errata_192(void)9618 static bool nrf52_errata_192(void)
9619 {
9620 #ifndef NRF52_SERIES
9621 return false;
9622 #else
9623 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9624 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9625 uint32_t var1;
9626 uint32_t var2;
9627
9628 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
9629 {
9630 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
9631 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
9632 }
9633 else
9634 {
9635 var1 = *(uint32_t *)0x10000130ul;
9636 var2 = *(uint32_t *)0x10000134ul;
9637 }
9638 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
9639 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9640 uint32_t var1 = *(uint32_t *)0x10000130ul;
9641 uint32_t var2 = *(uint32_t *)0x10000134ul;
9642 #endif
9643 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9644 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9645 if (var1 == 0x06)
9646 {
9647 switch(var2)
9648 {
9649 case 0x03ul:
9650 return false;
9651 case 0x04ul:
9652 return false;
9653 case 0x05ul:
9654 return true;
9655 case 0x06ul:
9656 return true;
9657 case 0x07ul:
9658 return true;
9659 default:
9660 return true;
9661 }
9662 }
9663 #endif
9664 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9665 if (var1 == 0x08)
9666 {
9667 switch(var2)
9668 {
9669 case 0x00ul:
9670 return true;
9671 case 0x01ul:
9672 return true;
9673 case 0x02ul:
9674 return true;
9675 case 0x03ul:
9676 return false;
9677 case 0x04ul:
9678 return false;
9679 case 0x05ul:
9680 return false;
9681 default:
9682 return false;
9683 }
9684 }
9685 #endif
9686 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
9687 if (var1 == 0x0A)
9688 {
9689 switch(var2)
9690 {
9691 case 0x00ul:
9692 return true;
9693 case 0x01ul:
9694 return false;
9695 case 0x02ul:
9696 return false;
9697 default:
9698 return false;
9699 }
9700 }
9701 #endif
9702 return false;
9703 #endif
9704 }
9705
9706 /* ========= Errata 193 ========= */
9707 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9708 #define NRF52_ERRATA_193_PRESENT 1
9709 #else
9710 #define NRF52_ERRATA_193_PRESENT 0
9711 #endif
9712
9713 #ifndef NRF52_ERRATA_193_ENABLE_WORKAROUND
9714 #define NRF52_ERRATA_193_ENABLE_WORKAROUND NRF52_ERRATA_193_PRESENT
9715 #endif
9716
nrf52_errata_193(void)9717 static bool nrf52_errata_193(void)
9718 {
9719 #ifndef NRF52_SERIES
9720 return false;
9721 #else
9722 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9723 uint32_t var1 = *(uint32_t *)0x10000130ul;
9724 uint32_t var2 = *(uint32_t *)0x10000134ul;
9725 #endif
9726 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9727 if (var1 == 0x08)
9728 {
9729 switch(var2)
9730 {
9731 case 0x00ul:
9732 return false;
9733 case 0x01ul:
9734 return true;
9735 case 0x02ul:
9736 return true;
9737 case 0x03ul:
9738 return true;
9739 case 0x04ul:
9740 return true;
9741 case 0x05ul:
9742 return true;
9743 default:
9744 return true;
9745 }
9746 }
9747 #endif
9748 return false;
9749 #endif
9750 }
9751
9752 /* ========= Errata 194 ========= */
9753 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9754 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
9755 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
9756 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9757 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9758 #define NRF52_ERRATA_194_PRESENT 1
9759 #else
9760 #define NRF52_ERRATA_194_PRESENT 0
9761 #endif
9762
9763 #ifndef NRF52_ERRATA_194_ENABLE_WORKAROUND
9764 #define NRF52_ERRATA_194_ENABLE_WORKAROUND NRF52_ERRATA_194_PRESENT
9765 #endif
9766
nrf52_errata_194(void)9767 static bool nrf52_errata_194(void)
9768 {
9769 #ifndef NRF52_SERIES
9770 return false;
9771 #else
9772 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9773 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9774 uint32_t var1;
9775 uint32_t var2;
9776
9777 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
9778 {
9779 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
9780 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
9781 }
9782 else
9783 {
9784 var1 = *(uint32_t *)0x10000130ul;
9785 var2 = *(uint32_t *)0x10000134ul;
9786 }
9787 #elif defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9788 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9789 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9790 uint32_t var1 = *(uint32_t *)0x10000130ul;
9791 uint32_t var2 = *(uint32_t *)0x10000134ul;
9792 #endif
9793 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9794 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9795 if (var1 == 0x06)
9796 {
9797 switch(var2)
9798 {
9799 case 0x03ul:
9800 return false;
9801 case 0x04ul:
9802 return false;
9803 case 0x05ul:
9804 return true;
9805 case 0x06ul:
9806 return true;
9807 case 0x07ul:
9808 return true;
9809 default:
9810 return true;
9811 }
9812 }
9813 #endif
9814 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9815 if (var1 == 0x08)
9816 {
9817 switch(var2)
9818 {
9819 case 0x00ul:
9820 return true;
9821 case 0x01ul:
9822 return true;
9823 case 0x02ul:
9824 return true;
9825 case 0x03ul:
9826 return true;
9827 case 0x04ul:
9828 return true;
9829 case 0x05ul:
9830 return true;
9831 default:
9832 return true;
9833 }
9834 }
9835 #endif
9836 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
9837 if (var1 == 0x0D)
9838 {
9839 switch(var2)
9840 {
9841 case 0x00ul:
9842 return true;
9843 case 0x01ul:
9844 return true;
9845 default:
9846 return true;
9847 }
9848 }
9849 #endif
9850 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
9851 if (var1 == 0x10)
9852 {
9853 switch(var2)
9854 {
9855 case 0x00ul:
9856 return true;
9857 case 0x01ul:
9858 return true;
9859 case 0x02ul:
9860 return false;
9861 case 0x03ul:
9862 return false;
9863 default:
9864 return false;
9865 }
9866 }
9867 #endif
9868 return false;
9869 #endif
9870 }
9871
9872 /* ========= Errata 195 ========= */
9873 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9874 #define NRF52_ERRATA_195_PRESENT 1
9875 #else
9876 #define NRF52_ERRATA_195_PRESENT 0
9877 #endif
9878
9879 #ifndef NRF52_ERRATA_195_ENABLE_WORKAROUND
9880 #define NRF52_ERRATA_195_ENABLE_WORKAROUND NRF52_ERRATA_195_PRESENT
9881 #endif
9882
nrf52_errata_195(void)9883 static bool nrf52_errata_195(void)
9884 {
9885 #ifndef NRF52_SERIES
9886 return false;
9887 #else
9888 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9889 uint32_t var1 = *(uint32_t *)0x10000130ul;
9890 uint32_t var2 = *(uint32_t *)0x10000134ul;
9891 #endif
9892 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9893 if (var1 == 0x08)
9894 {
9895 switch(var2)
9896 {
9897 case 0x00ul:
9898 return false;
9899 case 0x01ul:
9900 return true;
9901 case 0x02ul:
9902 return true;
9903 case 0x03ul:
9904 return true;
9905 case 0x04ul:
9906 return true;
9907 case 0x05ul:
9908 return true;
9909 default:
9910 return true;
9911 }
9912 }
9913 #endif
9914 return false;
9915 #endif
9916 }
9917
9918 /* ========= Errata 196 ========= */
9919 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
9920 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
9921 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
9922 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
9923 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9924 #define NRF52_ERRATA_196_PRESENT 1
9925 #else
9926 #define NRF52_ERRATA_196_PRESENT 0
9927 #endif
9928
9929 #ifndef NRF52_ERRATA_196_ENABLE_WORKAROUND
9930 #define NRF52_ERRATA_196_ENABLE_WORKAROUND NRF52_ERRATA_196_PRESENT
9931 #endif
9932
nrf52_errata_196(void)9933 static bool nrf52_errata_196(void)
9934 {
9935 #ifndef NRF52_SERIES
9936 return false;
9937 #else
9938 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9939 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9940 uint32_t var1;
9941 uint32_t var2;
9942
9943 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
9944 {
9945 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
9946 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
9947 }
9948 else
9949 {
9950 var1 = *(uint32_t *)0x10000130ul;
9951 var2 = *(uint32_t *)0x10000134ul;
9952 }
9953 #elif defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
9954 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
9955 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9956 uint32_t var1 = *(uint32_t *)0x10000130ul;
9957 uint32_t var2 = *(uint32_t *)0x10000134ul;
9958 #endif
9959 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
9960 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
9961 if (var1 == 0x06)
9962 {
9963 switch(var2)
9964 {
9965 case 0x03ul:
9966 return false;
9967 case 0x04ul:
9968 return false;
9969 case 0x05ul:
9970 return true;
9971 case 0x06ul:
9972 return true;
9973 case 0x07ul:
9974 return true;
9975 default:
9976 return true;
9977 }
9978 }
9979 #endif
9980 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
9981 if (var1 == 0x08)
9982 {
9983 switch(var2)
9984 {
9985 case 0x00ul:
9986 return true;
9987 case 0x01ul:
9988 return true;
9989 case 0x02ul:
9990 return true;
9991 case 0x03ul:
9992 return true;
9993 case 0x04ul:
9994 return true;
9995 case 0x05ul:
9996 return true;
9997 default:
9998 return true;
9999 }
10000 }
10001 #endif
10002 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
10003 if (var1 == 0x0D)
10004 {
10005 switch(var2)
10006 {
10007 case 0x00ul:
10008 return true;
10009 case 0x01ul:
10010 return true;
10011 default:
10012 return true;
10013 }
10014 }
10015 #endif
10016 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
10017 if (var1 == 0x10)
10018 {
10019 switch(var2)
10020 {
10021 case 0x00ul:
10022 return true;
10023 case 0x01ul:
10024 return true;
10025 case 0x02ul:
10026 return false;
10027 case 0x03ul:
10028 return false;
10029 default:
10030 return false;
10031 }
10032 }
10033 #endif
10034 return false;
10035 #endif
10036 }
10037
10038 /* ========= Errata 197 ========= */
10039 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10040 #define NRF52_ERRATA_197_PRESENT 1
10041 #else
10042 #define NRF52_ERRATA_197_PRESENT 0
10043 #endif
10044
10045 #ifndef NRF52_ERRATA_197_ENABLE_WORKAROUND
10046 #define NRF52_ERRATA_197_ENABLE_WORKAROUND NRF52_ERRATA_197_PRESENT
10047 #endif
10048
nrf52_errata_197(void)10049 static bool nrf52_errata_197(void)
10050 {
10051 #ifndef NRF52_SERIES
10052 return false;
10053 #else
10054 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10055 uint32_t var1 = *(uint32_t *)0x10000130ul;
10056 uint32_t var2 = *(uint32_t *)0x10000134ul;
10057 #endif
10058 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10059 if (var1 == 0x08)
10060 {
10061 switch(var2)
10062 {
10063 case 0x00ul:
10064 return false;
10065 case 0x01ul:
10066 return false;
10067 case 0x02ul:
10068 return true;
10069 case 0x03ul:
10070 return false;
10071 case 0x04ul:
10072 return false;
10073 case 0x05ul:
10074 return false;
10075 default:
10076 return false;
10077 }
10078 }
10079 #endif
10080 return false;
10081 #endif
10082 }
10083
10084 /* ========= Errata 198 ========= */
10085 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10086 #define NRF52_ERRATA_198_PRESENT 1
10087 #else
10088 #define NRF52_ERRATA_198_PRESENT 0
10089 #endif
10090
10091 #ifndef NRF52_ERRATA_198_ENABLE_WORKAROUND
10092 #define NRF52_ERRATA_198_ENABLE_WORKAROUND NRF52_ERRATA_198_PRESENT
10093 #endif
10094
nrf52_errata_198(void)10095 static bool nrf52_errata_198(void)
10096 {
10097 #ifndef NRF52_SERIES
10098 return false;
10099 #else
10100 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10101 uint32_t var1 = *(uint32_t *)0x10000130ul;
10102 uint32_t var2 = *(uint32_t *)0x10000134ul;
10103 #endif
10104 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10105 if (var1 == 0x08)
10106 {
10107 switch(var2)
10108 {
10109 case 0x00ul:
10110 return false;
10111 case 0x01ul:
10112 return true;
10113 case 0x02ul:
10114 return true;
10115 case 0x03ul:
10116 return true;
10117 case 0x04ul:
10118 return true;
10119 case 0x05ul:
10120 return true;
10121 default:
10122 return true;
10123 }
10124 }
10125 #endif
10126 return false;
10127 #endif
10128 }
10129
10130 /* ========= Errata 199 ========= */
10131 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10132 #define NRF52_ERRATA_199_PRESENT 1
10133 #else
10134 #define NRF52_ERRATA_199_PRESENT 0
10135 #endif
10136
10137 #ifndef NRF52_ERRATA_199_ENABLE_WORKAROUND
10138 #define NRF52_ERRATA_199_ENABLE_WORKAROUND NRF52_ERRATA_199_PRESENT
10139 #endif
10140
nrf52_errata_199(void)10141 static bool nrf52_errata_199(void)
10142 {
10143 #ifndef NRF52_SERIES
10144 return false;
10145 #else
10146 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10147 uint32_t var1 = *(uint32_t *)0x10000130ul;
10148 uint32_t var2 = *(uint32_t *)0x10000134ul;
10149 #endif
10150 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10151 if (var1 == 0x08)
10152 {
10153 switch(var2)
10154 {
10155 case 0x00ul:
10156 return true;
10157 case 0x01ul:
10158 return true;
10159 case 0x02ul:
10160 return true;
10161 case 0x03ul:
10162 return true;
10163 case 0x04ul:
10164 return true;
10165 case 0x05ul:
10166 return true;
10167 default:
10168 return true;
10169 }
10170 }
10171 #endif
10172 return false;
10173 #endif
10174 }
10175
10176 /* ========= Errata 200 ========= */
10177 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10178 #define NRF52_ERRATA_200_PRESENT 1
10179 #else
10180 #define NRF52_ERRATA_200_PRESENT 0
10181 #endif
10182
10183 #ifndef NRF52_ERRATA_200_ENABLE_WORKAROUND
10184 #define NRF52_ERRATA_200_ENABLE_WORKAROUND NRF52_ERRATA_200_PRESENT
10185 #endif
10186
nrf52_errata_200(void)10187 static bool nrf52_errata_200(void)
10188 {
10189 #ifndef NRF52_SERIES
10190 return false;
10191 #else
10192 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10193 uint32_t var1 = *(uint32_t *)0x10000130ul;
10194 uint32_t var2 = *(uint32_t *)0x10000134ul;
10195 #endif
10196 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10197 if (var1 == 0x08)
10198 {
10199 switch(var2)
10200 {
10201 case 0x00ul:
10202 return true;
10203 case 0x01ul:
10204 return false;
10205 case 0x02ul:
10206 return false;
10207 case 0x03ul:
10208 return false;
10209 case 0x04ul:
10210 return false;
10211 case 0x05ul:
10212 return false;
10213 default:
10214 return false;
10215 }
10216 }
10217 #endif
10218 return false;
10219 #endif
10220 }
10221
10222 /* ========= Errata 201 ========= */
10223 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
10224 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
10225 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
10226 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10227 #define NRF52_ERRATA_201_PRESENT 1
10228 #else
10229 #define NRF52_ERRATA_201_PRESENT 0
10230 #endif
10231
10232 #ifndef NRF52_ERRATA_201_ENABLE_WORKAROUND
10233 #define NRF52_ERRATA_201_ENABLE_WORKAROUND NRF52_ERRATA_201_PRESENT
10234 #endif
10235
nrf52_errata_201(void)10236 static bool nrf52_errata_201(void)
10237 {
10238 #ifndef NRF52_SERIES
10239 return false;
10240 #else
10241 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10242 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10243 uint32_t var1;
10244 uint32_t var2;
10245
10246 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
10247 {
10248 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
10249 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
10250 }
10251 else
10252 {
10253 var1 = *(uint32_t *)0x10000130ul;
10254 var2 = *(uint32_t *)0x10000134ul;
10255 }
10256 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
10257 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10258 uint32_t var1 = *(uint32_t *)0x10000130ul;
10259 uint32_t var2 = *(uint32_t *)0x10000134ul;
10260 #endif
10261 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10262 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10263 if (var1 == 0x06)
10264 {
10265 switch(var2)
10266 {
10267 case 0x03ul:
10268 return false;
10269 case 0x04ul:
10270 return false;
10271 case 0x05ul:
10272 return true;
10273 case 0x06ul:
10274 return true;
10275 case 0x07ul:
10276 return true;
10277 default:
10278 return true;
10279 }
10280 }
10281 #endif
10282 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10283 if (var1 == 0x08)
10284 {
10285 switch(var2)
10286 {
10287 case 0x00ul:
10288 return true;
10289 case 0x01ul:
10290 return true;
10291 case 0x02ul:
10292 return true;
10293 case 0x03ul:
10294 return false;
10295 case 0x04ul:
10296 return false;
10297 case 0x05ul:
10298 return false;
10299 default:
10300 return false;
10301 }
10302 }
10303 #endif
10304 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
10305 if (var1 == 0x0A)
10306 {
10307 switch(var2)
10308 {
10309 case 0x00ul:
10310 return true;
10311 case 0x01ul:
10312 return false;
10313 case 0x02ul:
10314 return false;
10315 default:
10316 return false;
10317 }
10318 }
10319 #endif
10320 return false;
10321 #endif
10322 }
10323
10324 /* ========= Errata 202 ========= */
10325 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10326 #define NRF52_ERRATA_202_PRESENT 1
10327 #else
10328 #define NRF52_ERRATA_202_PRESENT 0
10329 #endif
10330
10331 #ifndef NRF52_ERRATA_202_ENABLE_WORKAROUND
10332 #define NRF52_ERRATA_202_ENABLE_WORKAROUND NRF52_ERRATA_202_PRESENT
10333 #endif
10334
nrf52_errata_202(void)10335 static bool nrf52_errata_202(void)
10336 {
10337 #ifndef NRF52_SERIES
10338 return false;
10339 #else
10340 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10341 uint32_t var1 = *(uint32_t *)0x10000130ul;
10342 uint32_t var2 = *(uint32_t *)0x10000134ul;
10343 #endif
10344 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10345 if (var1 == 0x08)
10346 {
10347 switch(var2)
10348 {
10349 case 0x00ul:
10350 return false;
10351 case 0x01ul:
10352 return true;
10353 case 0x02ul:
10354 return true;
10355 case 0x03ul:
10356 return false;
10357 case 0x04ul:
10358 return false;
10359 case 0x05ul:
10360 return false;
10361 default:
10362 return false;
10363 }
10364 }
10365 #endif
10366 return false;
10367 #endif
10368 }
10369
10370 /* ========= Errata 204 ========= */
10371 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
10372 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
10373 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
10374 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10375 #define NRF52_ERRATA_204_PRESENT 1
10376 #else
10377 #define NRF52_ERRATA_204_PRESENT 0
10378 #endif
10379
10380 #ifndef NRF52_ERRATA_204_ENABLE_WORKAROUND
10381 #define NRF52_ERRATA_204_ENABLE_WORKAROUND NRF52_ERRATA_204_PRESENT
10382 #endif
10383
nrf52_errata_204(void)10384 static bool nrf52_errata_204(void)
10385 {
10386 #ifndef NRF52_SERIES
10387 return false;
10388 #else
10389 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10390 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10391 uint32_t var1;
10392 uint32_t var2;
10393
10394 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
10395 {
10396 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
10397 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
10398 }
10399 else
10400 {
10401 var1 = *(uint32_t *)0x10000130ul;
10402 var2 = *(uint32_t *)0x10000134ul;
10403 }
10404 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
10405 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10406 uint32_t var1 = *(uint32_t *)0x10000130ul;
10407 uint32_t var2 = *(uint32_t *)0x10000134ul;
10408 #endif
10409 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10410 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10411 if (var1 == 0x06)
10412 {
10413 switch(var2)
10414 {
10415 case 0x03ul:
10416 return false;
10417 case 0x04ul:
10418 return false;
10419 case 0x05ul:
10420 return true;
10421 case 0x06ul:
10422 return true;
10423 case 0x07ul:
10424 return true;
10425 default:
10426 return true;
10427 }
10428 }
10429 #endif
10430 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10431 if (var1 == 0x08)
10432 {
10433 switch(var2)
10434 {
10435 case 0x00ul:
10436 return true;
10437 case 0x01ul:
10438 return true;
10439 case 0x02ul:
10440 return true;
10441 case 0x03ul:
10442 return true;
10443 case 0x04ul:
10444 return true;
10445 case 0x05ul:
10446 return true;
10447 default:
10448 return true;
10449 }
10450 }
10451 #endif
10452 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
10453 if (var1 == 0x0A)
10454 {
10455 switch(var2)
10456 {
10457 case 0x00ul:
10458 return true;
10459 case 0x01ul:
10460 return true;
10461 case 0x02ul:
10462 return true;
10463 default:
10464 return true;
10465 }
10466 }
10467 #endif
10468 return false;
10469 #endif
10470 }
10471
10472 /* ========= Errata 208 ========= */
10473 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10474 #define NRF52_ERRATA_208_PRESENT 1
10475 #else
10476 #define NRF52_ERRATA_208_PRESENT 0
10477 #endif
10478
10479 #ifndef NRF52_ERRATA_208_ENABLE_WORKAROUND
10480 #define NRF52_ERRATA_208_ENABLE_WORKAROUND NRF52_ERRATA_208_PRESENT
10481 #endif
10482
nrf52_errata_208(void)10483 static bool nrf52_errata_208(void)
10484 {
10485 #ifndef NRF52_SERIES
10486 return false;
10487 #else
10488 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10489 uint32_t var1 = *(uint32_t *)0x10000130ul;
10490 uint32_t var2 = *(uint32_t *)0x10000134ul;
10491 #endif
10492 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10493 if (var1 == 0x08)
10494 {
10495 switch(var2)
10496 {
10497 case 0x00ul:
10498 return true;
10499 case 0x01ul:
10500 return true;
10501 case 0x02ul:
10502 return true;
10503 case 0x03ul:
10504 return true;
10505 case 0x04ul:
10506 return true;
10507 case 0x05ul:
10508 return true;
10509 default:
10510 return true;
10511 }
10512 }
10513 #endif
10514 return false;
10515 #endif
10516 }
10517
10518 /* ========= Errata 209 ========= */
10519 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10520 #define NRF52_ERRATA_209_PRESENT 1
10521 #else
10522 #define NRF52_ERRATA_209_PRESENT 0
10523 #endif
10524
10525 #ifndef NRF52_ERRATA_209_ENABLE_WORKAROUND
10526 #define NRF52_ERRATA_209_ENABLE_WORKAROUND NRF52_ERRATA_209_PRESENT
10527 #endif
10528
nrf52_errata_209(void)10529 static bool nrf52_errata_209(void)
10530 {
10531 #ifndef NRF52_SERIES
10532 return false;
10533 #else
10534 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10535 uint32_t var1 = *(uint32_t *)0x10000130ul;
10536 uint32_t var2 = *(uint32_t *)0x10000134ul;
10537 #endif
10538 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10539 if (var1 == 0x08)
10540 {
10541 switch(var2)
10542 {
10543 case 0x00ul:
10544 return true;
10545 case 0x01ul:
10546 return true;
10547 case 0x02ul:
10548 return true;
10549 case 0x03ul:
10550 return true;
10551 case 0x04ul:
10552 return true;
10553 case 0x05ul:
10554 return true;
10555 default:
10556 return true;
10557 }
10558 }
10559 #endif
10560 return false;
10561 #endif
10562 }
10563
10564 /* ========= Errata 210 ========= */
10565 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
10566 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
10567 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
10568 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
10569 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
10570 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
10571 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
10572 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10573 #define NRF52_ERRATA_210_PRESENT 1
10574 #else
10575 #define NRF52_ERRATA_210_PRESENT 0
10576 #endif
10577
10578 #ifndef NRF52_ERRATA_210_ENABLE_WORKAROUND
10579 #define NRF52_ERRATA_210_ENABLE_WORKAROUND NRF52_ERRATA_210_PRESENT
10580 #endif
10581
nrf52_errata_210(void)10582 static bool nrf52_errata_210(void)
10583 {
10584 #ifndef NRF52_SERIES
10585 return false;
10586 #else
10587 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10588 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10589 uint32_t var1;
10590 uint32_t var2;
10591
10592 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
10593 {
10594 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
10595 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
10596 }
10597 else
10598 {
10599 var1 = *(uint32_t *)0x10000130ul;
10600 var2 = *(uint32_t *)0x10000134ul;
10601 }
10602 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
10603 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
10604 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
10605 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
10606 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
10607 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10608 uint32_t var1 = *(uint32_t *)0x10000130ul;
10609 uint32_t var2 = *(uint32_t *)0x10000134ul;
10610 #endif
10611 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10612 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10613 if (var1 == 0x06)
10614 {
10615 switch(var2)
10616 {
10617 case 0x03ul:
10618 return false;
10619 case 0x04ul:
10620 return false;
10621 case 0x05ul:
10622 return true;
10623 case 0x06ul:
10624 return true;
10625 case 0x07ul:
10626 return true;
10627 default:
10628 return true;
10629 }
10630 }
10631 #endif
10632 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10633 if (var1 == 0x08)
10634 {
10635 switch(var2)
10636 {
10637 case 0x00ul:
10638 return false;
10639 case 0x01ul:
10640 return false;
10641 case 0x02ul:
10642 return true;
10643 case 0x03ul:
10644 return true;
10645 case 0x04ul:
10646 return true;
10647 case 0x05ul:
10648 return true;
10649 default:
10650 return true;
10651 }
10652 }
10653 #endif
10654 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
10655 if (var1 == 0x0A)
10656 {
10657 switch(var2)
10658 {
10659 case 0x00ul:
10660 return true;
10661 case 0x01ul:
10662 return true;
10663 case 0x02ul:
10664 return true;
10665 default:
10666 return true;
10667 }
10668 }
10669 #endif
10670 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
10671 if (var1 == 0x0D)
10672 {
10673 switch(var2)
10674 {
10675 case 0x00ul:
10676 return true;
10677 case 0x01ul:
10678 return true;
10679 default:
10680 return true;
10681 }
10682 }
10683 #endif
10684 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
10685 if (var1 == 0x0E)
10686 {
10687 switch(var2)
10688 {
10689 case 0x00ul:
10690 return true;
10691 case 0x01ul:
10692 return true;
10693 default:
10694 return true;
10695 }
10696 }
10697 #endif
10698 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
10699 if (var1 == 0x0F)
10700 {
10701 switch(var2)
10702 {
10703 case 0x00ul:
10704 return true;
10705 case 0x01ul:
10706 return true;
10707 default:
10708 return true;
10709 }
10710 }
10711 #endif
10712 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
10713 if (var1 == 0x10)
10714 {
10715 switch(var2)
10716 {
10717 case 0x00ul:
10718 return true;
10719 case 0x01ul:
10720 return true;
10721 case 0x02ul:
10722 return true;
10723 case 0x03ul:
10724 return true;
10725 default:
10726 return true;
10727 }
10728 }
10729 #endif
10730 return false;
10731 #endif
10732 }
10733
10734 /* ========= Errata 211 ========= */
10735 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
10736 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
10737 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10738 #define NRF52_ERRATA_211_PRESENT 1
10739 #else
10740 #define NRF52_ERRATA_211_PRESENT 0
10741 #endif
10742
10743 #ifndef NRF52_ERRATA_211_ENABLE_WORKAROUND
10744 #define NRF52_ERRATA_211_ENABLE_WORKAROUND NRF52_ERRATA_211_PRESENT
10745 #endif
10746
nrf52_errata_211(void)10747 static bool nrf52_errata_211(void)
10748 {
10749 #ifndef NRF52_SERIES
10750 return false;
10751 #else
10752 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
10753 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
10754 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10755 uint32_t var1 = *(uint32_t *)0x10000130ul;
10756 uint32_t var2 = *(uint32_t *)0x10000134ul;
10757 #endif
10758 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10759 if (var1 == 0x08)
10760 {
10761 switch(var2)
10762 {
10763 case 0x00ul:
10764 return false;
10765 case 0x01ul:
10766 return true;
10767 case 0x02ul:
10768 return true;
10769 case 0x03ul:
10770 return true;
10771 case 0x04ul:
10772 return true;
10773 case 0x05ul:
10774 return true;
10775 default:
10776 return true;
10777 }
10778 }
10779 #endif
10780 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
10781 if (var1 == 0x0D)
10782 {
10783 switch(var2)
10784 {
10785 case 0x00ul:
10786 return true;
10787 case 0x01ul:
10788 return true;
10789 default:
10790 return true;
10791 }
10792 }
10793 #endif
10794 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
10795 if (var1 == 0x10)
10796 {
10797 switch(var2)
10798 {
10799 case 0x00ul:
10800 return true;
10801 case 0x01ul:
10802 return true;
10803 case 0x02ul:
10804 return true;
10805 case 0x03ul:
10806 return true;
10807 default:
10808 return true;
10809 }
10810 }
10811 #endif
10812 return false;
10813 #endif
10814 }
10815
10816 /* ========= Errata 212 ========= */
10817 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
10818 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
10819 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
10820 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
10821 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
10822 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
10823 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
10824 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10825 #define NRF52_ERRATA_212_PRESENT 1
10826 #else
10827 #define NRF52_ERRATA_212_PRESENT 0
10828 #endif
10829
10830 #ifndef NRF52_ERRATA_212_ENABLE_WORKAROUND
10831 #define NRF52_ERRATA_212_ENABLE_WORKAROUND NRF52_ERRATA_212_PRESENT
10832 #endif
10833
nrf52_errata_212(void)10834 static bool nrf52_errata_212(void)
10835 {
10836 #ifndef NRF52_SERIES
10837 return false;
10838 #else
10839 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10840 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10841 uint32_t var1;
10842 uint32_t var2;
10843
10844 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
10845 {
10846 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
10847 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
10848 }
10849 else
10850 {
10851 var1 = *(uint32_t *)0x10000130ul;
10852 var2 = *(uint32_t *)0x10000134ul;
10853 }
10854 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
10855 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
10856 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
10857 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
10858 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
10859 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10860 uint32_t var1 = *(uint32_t *)0x10000130ul;
10861 uint32_t var2 = *(uint32_t *)0x10000134ul;
10862 #endif
10863 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
10864 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
10865 if (var1 == 0x06)
10866 {
10867 switch(var2)
10868 {
10869 case 0x03ul:
10870 return false;
10871 case 0x04ul:
10872 return false;
10873 case 0x05ul:
10874 return true;
10875 case 0x06ul:
10876 return true;
10877 case 0x07ul:
10878 return true;
10879 default:
10880 return true;
10881 }
10882 }
10883 #endif
10884 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10885 if (var1 == 0x08)
10886 {
10887 switch(var2)
10888 {
10889 case 0x00ul:
10890 return true;
10891 case 0x01ul:
10892 return false;
10893 case 0x02ul:
10894 return true;
10895 case 0x03ul:
10896 return true;
10897 case 0x04ul:
10898 return true;
10899 case 0x05ul:
10900 return true;
10901 default:
10902 return true;
10903 }
10904 }
10905 #endif
10906 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
10907 if (var1 == 0x0A)
10908 {
10909 switch(var2)
10910 {
10911 case 0x00ul:
10912 return true;
10913 case 0x01ul:
10914 return true;
10915 case 0x02ul:
10916 return true;
10917 default:
10918 return true;
10919 }
10920 }
10921 #endif
10922 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
10923 if (var1 == 0x0D)
10924 {
10925 switch(var2)
10926 {
10927 case 0x00ul:
10928 return true;
10929 case 0x01ul:
10930 return true;
10931 default:
10932 return true;
10933 }
10934 }
10935 #endif
10936 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
10937 if (var1 == 0x0E)
10938 {
10939 switch(var2)
10940 {
10941 case 0x00ul:
10942 return true;
10943 case 0x01ul:
10944 return true;
10945 default:
10946 return true;
10947 }
10948 }
10949 #endif
10950 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
10951 if (var1 == 0x0F)
10952 {
10953 switch(var2)
10954 {
10955 case 0x00ul:
10956 return true;
10957 case 0x01ul:
10958 return true;
10959 default:
10960 return true;
10961 }
10962 }
10963 #endif
10964 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
10965 if (var1 == 0x10)
10966 {
10967 switch(var2)
10968 {
10969 case 0x00ul:
10970 return true;
10971 case 0x01ul:
10972 return true;
10973 case 0x02ul:
10974 return false;
10975 case 0x03ul:
10976 return false;
10977 default:
10978 return false;
10979 }
10980 }
10981 #endif
10982 return false;
10983 #endif
10984 }
10985
10986 /* ========= Errata 213 ========= */
10987 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
10988 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
10989 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
10990 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
10991 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
10992 #define NRF52_ERRATA_213_PRESENT 1
10993 #else
10994 #define NRF52_ERRATA_213_PRESENT 0
10995 #endif
10996
10997 #ifndef NRF52_ERRATA_213_ENABLE_WORKAROUND
10998 #define NRF52_ERRATA_213_ENABLE_WORKAROUND NRF52_ERRATA_213_PRESENT
10999 #endif
11000
nrf52_errata_213(void)11001 static bool nrf52_errata_213(void)
11002 {
11003 #ifndef NRF52_SERIES
11004 return false;
11005 #else
11006 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11007 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11008 uint32_t var1;
11009 uint32_t var2;
11010
11011 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
11012 {
11013 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
11014 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
11015 }
11016 else
11017 {
11018 var1 = *(uint32_t *)0x10000130ul;
11019 var2 = *(uint32_t *)0x10000134ul;
11020 }
11021 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
11022 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
11023 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11024 uint32_t var1 = *(uint32_t *)0x10000130ul;
11025 uint32_t var2 = *(uint32_t *)0x10000134ul;
11026 #endif
11027 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11028 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11029 if (var1 == 0x06)
11030 {
11031 switch(var2)
11032 {
11033 case 0x03ul:
11034 return true;
11035 case 0x04ul:
11036 return true;
11037 case 0x05ul:
11038 return true;
11039 case 0x06ul:
11040 return true;
11041 case 0x07ul:
11042 return true;
11043 default:
11044 return true;
11045 }
11046 }
11047 #endif
11048 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11049 if (var1 == 0x08)
11050 {
11051 switch(var2)
11052 {
11053 case 0x00ul:
11054 return true;
11055 case 0x01ul:
11056 return true;
11057 case 0x02ul:
11058 return true;
11059 case 0x03ul:
11060 return true;
11061 case 0x04ul:
11062 return true;
11063 case 0x05ul:
11064 return true;
11065 default:
11066 return true;
11067 }
11068 }
11069 #endif
11070 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
11071 if (var1 == 0x0A)
11072 {
11073 switch(var2)
11074 {
11075 case 0x00ul:
11076 return true;
11077 case 0x01ul:
11078 return true;
11079 case 0x02ul:
11080 return true;
11081 default:
11082 return true;
11083 }
11084 }
11085 #endif
11086 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11087 if (var1 == 0x0E)
11088 {
11089 switch(var2)
11090 {
11091 case 0x00ul:
11092 return true;
11093 case 0x01ul:
11094 return true;
11095 default:
11096 return true;
11097 }
11098 }
11099 #endif
11100 return false;
11101 #endif
11102 }
11103
11104 /* ========= Errata 214 ========= */
11105 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11106 #define NRF52_ERRATA_214_PRESENT 1
11107 #else
11108 #define NRF52_ERRATA_214_PRESENT 0
11109 #endif
11110
11111 #ifndef NRF52_ERRATA_214_ENABLE_WORKAROUND
11112 #define NRF52_ERRATA_214_ENABLE_WORKAROUND NRF52_ERRATA_214_PRESENT
11113 #endif
11114
nrf52_errata_214(void)11115 static bool nrf52_errata_214(void)
11116 {
11117 #ifndef NRF52_SERIES
11118 return false;
11119 #else
11120 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11121 uint32_t var1 = *(uint32_t *)0x10000130ul;
11122 uint32_t var2 = *(uint32_t *)0x10000134ul;
11123 #endif
11124 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11125 if (var1 == 0x08)
11126 {
11127 switch(var2)
11128 {
11129 case 0x00ul:
11130 return true;
11131 case 0x01ul:
11132 return true;
11133 case 0x02ul:
11134 return true;
11135 case 0x03ul:
11136 return true;
11137 case 0x04ul:
11138 return true;
11139 case 0x05ul:
11140 return true;
11141 default:
11142 return true;
11143 }
11144 }
11145 #endif
11146 return false;
11147 #endif
11148 }
11149
11150 /* ========= Errata 215 ========= */
11151 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11152 #define NRF52_ERRATA_215_PRESENT 1
11153 #else
11154 #define NRF52_ERRATA_215_PRESENT 0
11155 #endif
11156
11157 #ifndef NRF52_ERRATA_215_ENABLE_WORKAROUND
11158 #define NRF52_ERRATA_215_ENABLE_WORKAROUND NRF52_ERRATA_215_PRESENT
11159 #endif
11160
nrf52_errata_215(void)11161 static bool nrf52_errata_215(void)
11162 {
11163 #ifndef NRF52_SERIES
11164 return false;
11165 #else
11166 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11167 uint32_t var1 = *(uint32_t *)0x10000130ul;
11168 uint32_t var2 = *(uint32_t *)0x10000134ul;
11169 #endif
11170 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11171 if (var1 == 0x08)
11172 {
11173 switch(var2)
11174 {
11175 case 0x00ul:
11176 return true;
11177 case 0x01ul:
11178 return true;
11179 case 0x02ul:
11180 return true;
11181 case 0x03ul:
11182 return true;
11183 case 0x04ul:
11184 return true;
11185 case 0x05ul:
11186 return true;
11187 default:
11188 return true;
11189 }
11190 }
11191 #endif
11192 return false;
11193 #endif
11194 }
11195
11196 /* ========= Errata 216 ========= */
11197 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11198 #define NRF52_ERRATA_216_PRESENT 1
11199 #else
11200 #define NRF52_ERRATA_216_PRESENT 0
11201 #endif
11202
11203 #ifndef NRF52_ERRATA_216_ENABLE_WORKAROUND
11204 #define NRF52_ERRATA_216_ENABLE_WORKAROUND NRF52_ERRATA_216_PRESENT
11205 #endif
11206
nrf52_errata_216(void)11207 static bool nrf52_errata_216(void)
11208 {
11209 #ifndef NRF52_SERIES
11210 return false;
11211 #else
11212 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11213 uint32_t var1 = *(uint32_t *)0x10000130ul;
11214 uint32_t var2 = *(uint32_t *)0x10000134ul;
11215 #endif
11216 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11217 if (var1 == 0x08)
11218 {
11219 switch(var2)
11220 {
11221 case 0x00ul:
11222 return true;
11223 case 0x01ul:
11224 return true;
11225 case 0x02ul:
11226 return true;
11227 case 0x03ul:
11228 return true;
11229 case 0x04ul:
11230 return true;
11231 case 0x05ul:
11232 return true;
11233 default:
11234 return true;
11235 }
11236 }
11237 #endif
11238 return false;
11239 #endif
11240 }
11241
11242 /* ========= Errata 217 ========= */
11243 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
11244 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
11245 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11246 #define NRF52_ERRATA_217_PRESENT 1
11247 #else
11248 #define NRF52_ERRATA_217_PRESENT 0
11249 #endif
11250
11251 #ifndef NRF52_ERRATA_217_ENABLE_WORKAROUND
11252 #define NRF52_ERRATA_217_ENABLE_WORKAROUND NRF52_ERRATA_217_PRESENT
11253 #endif
11254
nrf52_errata_217(void)11255 static bool nrf52_errata_217(void)
11256 {
11257 #ifndef NRF52_SERIES
11258 return false;
11259 #else
11260 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
11261 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
11262 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11263 uint32_t var1 = *(uint32_t *)0x10000130ul;
11264 uint32_t var2 = *(uint32_t *)0x10000134ul;
11265 #endif
11266 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
11267 if (var1 == 0x0A)
11268 {
11269 switch(var2)
11270 {
11271 case 0x00ul:
11272 return false;
11273 case 0x01ul:
11274 return true;
11275 case 0x02ul:
11276 return false;
11277 default:
11278 return false;
11279 }
11280 }
11281 #endif
11282 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11283 if (var1 == 0x0E)
11284 {
11285 switch(var2)
11286 {
11287 case 0x00ul:
11288 return true;
11289 case 0x01ul:
11290 return true;
11291 default:
11292 return true;
11293 }
11294 }
11295 #endif
11296 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
11297 if (var1 == 0x0F)
11298 {
11299 switch(var2)
11300 {
11301 case 0x00ul:
11302 return true;
11303 case 0x01ul:
11304 return true;
11305 default:
11306 return true;
11307 }
11308 }
11309 #endif
11310 return false;
11311 #endif
11312 }
11313
11314 /* ========= Errata 218 ========= */
11315 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
11316 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
11317 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
11318 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
11319 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11320 #define NRF52_ERRATA_218_PRESENT 1
11321 #else
11322 #define NRF52_ERRATA_218_PRESENT 0
11323 #endif
11324
11325 #ifndef NRF52_ERRATA_218_ENABLE_WORKAROUND
11326 #define NRF52_ERRATA_218_ENABLE_WORKAROUND NRF52_ERRATA_218_PRESENT
11327 #endif
11328
nrf52_errata_218(void)11329 static bool nrf52_errata_218(void)
11330 {
11331 #ifndef NRF52_SERIES
11332 return false;
11333 #else
11334 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11335 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11336 uint32_t var1;
11337 uint32_t var2;
11338
11339 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
11340 {
11341 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
11342 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
11343 }
11344 else
11345 {
11346 var1 = *(uint32_t *)0x10000130ul;
11347 var2 = *(uint32_t *)0x10000134ul;
11348 }
11349 #elif defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
11350 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
11351 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11352 uint32_t var1 = *(uint32_t *)0x10000130ul;
11353 uint32_t var2 = *(uint32_t *)0x10000134ul;
11354 #endif
11355 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11356 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11357 if (var1 == 0x06)
11358 {
11359 switch(var2)
11360 {
11361 case 0x03ul:
11362 return false;
11363 case 0x04ul:
11364 return false;
11365 case 0x05ul:
11366 return true;
11367 case 0x06ul:
11368 return true;
11369 case 0x07ul:
11370 return true;
11371 default:
11372 return true;
11373 }
11374 }
11375 #endif
11376 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11377 if (var1 == 0x08)
11378 {
11379 switch(var2)
11380 {
11381 case 0x00ul:
11382 return false;
11383 case 0x01ul:
11384 return false;
11385 case 0x02ul:
11386 return true;
11387 case 0x03ul:
11388 return true;
11389 case 0x04ul:
11390 return true;
11391 case 0x05ul:
11392 return true;
11393 default:
11394 return true;
11395 }
11396 }
11397 #endif
11398 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11399 if (var1 == 0x0D)
11400 {
11401 switch(var2)
11402 {
11403 case 0x00ul:
11404 return true;
11405 case 0x01ul:
11406 return true;
11407 default:
11408 return true;
11409 }
11410 }
11411 #endif
11412 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11413 if (var1 == 0x10)
11414 {
11415 switch(var2)
11416 {
11417 case 0x00ul:
11418 return true;
11419 case 0x01ul:
11420 return true;
11421 case 0x02ul:
11422 return false;
11423 case 0x03ul:
11424 return false;
11425 default:
11426 return false;
11427 }
11428 }
11429 #endif
11430 return false;
11431 #endif
11432 }
11433
11434 /* ========= Errata 219 ========= */
11435 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
11436 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
11437 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
11438 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
11439 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
11440 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
11441 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
11442 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11443 #define NRF52_ERRATA_219_PRESENT 1
11444 #else
11445 #define NRF52_ERRATA_219_PRESENT 0
11446 #endif
11447
11448 #ifndef NRF52_ERRATA_219_ENABLE_WORKAROUND
11449 #define NRF52_ERRATA_219_ENABLE_WORKAROUND NRF52_ERRATA_219_PRESENT
11450 #endif
11451
nrf52_errata_219(void)11452 static bool nrf52_errata_219(void)
11453 {
11454 #ifndef NRF52_SERIES
11455 return false;
11456 #else
11457 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11458 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11459 uint32_t var1;
11460 uint32_t var2;
11461
11462 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
11463 {
11464 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
11465 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
11466 }
11467 else
11468 {
11469 var1 = *(uint32_t *)0x10000130ul;
11470 var2 = *(uint32_t *)0x10000134ul;
11471 }
11472 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
11473 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
11474 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
11475 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
11476 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
11477 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11478 uint32_t var1 = *(uint32_t *)0x10000130ul;
11479 uint32_t var2 = *(uint32_t *)0x10000134ul;
11480 #endif
11481 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11482 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11483 if (var1 == 0x06)
11484 {
11485 switch(var2)
11486 {
11487 case 0x03ul:
11488 return false;
11489 case 0x04ul:
11490 return false;
11491 case 0x05ul:
11492 return true;
11493 case 0x06ul:
11494 return true;
11495 case 0x07ul:
11496 return true;
11497 default:
11498 return true;
11499 }
11500 }
11501 #endif
11502 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11503 if (var1 == 0x08)
11504 {
11505 switch(var2)
11506 {
11507 case 0x00ul:
11508 return true;
11509 case 0x01ul:
11510 return true;
11511 case 0x02ul:
11512 return true;
11513 case 0x03ul:
11514 return true;
11515 case 0x04ul:
11516 return true;
11517 case 0x05ul:
11518 return true;
11519 default:
11520 return true;
11521 }
11522 }
11523 #endif
11524 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
11525 if (var1 == 0x0A)
11526 {
11527 switch(var2)
11528 {
11529 case 0x00ul:
11530 return true;
11531 case 0x01ul:
11532 return true;
11533 case 0x02ul:
11534 return true;
11535 default:
11536 return true;
11537 }
11538 }
11539 #endif
11540 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11541 if (var1 == 0x0D)
11542 {
11543 switch(var2)
11544 {
11545 case 0x00ul:
11546 return true;
11547 case 0x01ul:
11548 return true;
11549 default:
11550 return true;
11551 }
11552 }
11553 #endif
11554 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11555 if (var1 == 0x0E)
11556 {
11557 switch(var2)
11558 {
11559 case 0x00ul:
11560 return true;
11561 case 0x01ul:
11562 return true;
11563 default:
11564 return true;
11565 }
11566 }
11567 #endif
11568 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
11569 if (var1 == 0x0F)
11570 {
11571 switch(var2)
11572 {
11573 case 0x00ul:
11574 return true;
11575 case 0x01ul:
11576 return true;
11577 default:
11578 return true;
11579 }
11580 }
11581 #endif
11582 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11583 if (var1 == 0x10)
11584 {
11585 switch(var2)
11586 {
11587 case 0x00ul:
11588 return true;
11589 case 0x01ul:
11590 return true;
11591 case 0x02ul:
11592 return true;
11593 case 0x03ul:
11594 return true;
11595 default:
11596 return true;
11597 }
11598 }
11599 #endif
11600 return false;
11601 #endif
11602 }
11603
11604 /* ========= Errata 220 ========= */
11605 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
11606 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11607 #define NRF52_ERRATA_220_PRESENT 1
11608 #else
11609 #define NRF52_ERRATA_220_PRESENT 0
11610 #endif
11611
11612 #ifndef NRF52_ERRATA_220_ENABLE_WORKAROUND
11613 #define NRF52_ERRATA_220_ENABLE_WORKAROUND NRF52_ERRATA_220_PRESENT
11614 #endif
11615
nrf52_errata_220(void)11616 static bool nrf52_errata_220(void)
11617 {
11618 #ifndef NRF52_SERIES
11619 return false;
11620 #else
11621 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11622 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11623 uint32_t var1;
11624 uint32_t var2;
11625
11626 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
11627 {
11628 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
11629 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
11630 }
11631 else
11632 {
11633 var1 = *(uint32_t *)0x10000130ul;
11634 var2 = *(uint32_t *)0x10000134ul;
11635 }
11636 #endif
11637 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
11638 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
11639 if (var1 == 0x06)
11640 {
11641 switch(var2)
11642 {
11643 case 0x03ul:
11644 return false;
11645 case 0x04ul:
11646 return false;
11647 case 0x05ul:
11648 return true;
11649 case 0x06ul:
11650 return true;
11651 case 0x07ul:
11652 return true;
11653 default:
11654 return true;
11655 }
11656 }
11657 #endif
11658 return false;
11659 #endif
11660 }
11661
11662 /* ========= Errata 223 ========= */
11663 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
11664 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11665 #define NRF52_ERRATA_223_PRESENT 1
11666 #else
11667 #define NRF52_ERRATA_223_PRESENT 0
11668 #endif
11669
11670 #ifndef NRF52_ERRATA_223_ENABLE_WORKAROUND
11671 #define NRF52_ERRATA_223_ENABLE_WORKAROUND NRF52_ERRATA_223_PRESENT
11672 #endif
11673
nrf52_errata_223(void)11674 static bool nrf52_errata_223(void)
11675 {
11676 #ifndef NRF52_SERIES
11677 return false;
11678 #else
11679 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
11680 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11681 uint32_t var1 = *(uint32_t *)0x10000130ul;
11682 uint32_t var2 = *(uint32_t *)0x10000134ul;
11683 #endif
11684 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11685 if (var1 == 0x0D)
11686 {
11687 switch(var2)
11688 {
11689 case 0x00ul:
11690 return true;
11691 case 0x01ul:
11692 return true;
11693 default:
11694 return true;
11695 }
11696 }
11697 #endif
11698 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11699 if (var1 == 0x10)
11700 {
11701 switch(var2)
11702 {
11703 case 0x00ul:
11704 return true;
11705 case 0x01ul:
11706 return true;
11707 case 0x02ul:
11708 return true;
11709 case 0x03ul:
11710 return true;
11711 default:
11712 return true;
11713 }
11714 }
11715 #endif
11716 return false;
11717 #endif
11718 }
11719
11720 /* ========= Errata 225 ========= */
11721 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
11722 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11723 #define NRF52_ERRATA_225_PRESENT 1
11724 #else
11725 #define NRF52_ERRATA_225_PRESENT 0
11726 #endif
11727
11728 #ifndef NRF52_ERRATA_225_ENABLE_WORKAROUND
11729 #define NRF52_ERRATA_225_ENABLE_WORKAROUND NRF52_ERRATA_225_PRESENT
11730 #endif
11731
nrf52_errata_225(void)11732 static bool nrf52_errata_225(void)
11733 {
11734 #ifndef NRF52_SERIES
11735 return false;
11736 #else
11737 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
11738 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11739 uint32_t var1 = *(uint32_t *)0x10000130ul;
11740 uint32_t var2 = *(uint32_t *)0x10000134ul;
11741 #endif
11742 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11743 if (var1 == 0x0D)
11744 {
11745 switch(var2)
11746 {
11747 case 0x00ul:
11748 return true;
11749 case 0x01ul:
11750 return true;
11751 default:
11752 return true;
11753 }
11754 }
11755 #endif
11756 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11757 if (var1 == 0x10)
11758 {
11759 switch(var2)
11760 {
11761 case 0x00ul:
11762 return true;
11763 case 0x01ul:
11764 return true;
11765 case 0x02ul:
11766 return true;
11767 case 0x03ul:
11768 return true;
11769 default:
11770 return true;
11771 }
11772 }
11773 #endif
11774 return false;
11775 #endif
11776 }
11777
11778 /* ========= Errata 228 ========= */
11779 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
11780 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
11781 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
11782 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
11783 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11784 #define NRF52_ERRATA_228_PRESENT 1
11785 #else
11786 #define NRF52_ERRATA_228_PRESENT 0
11787 #endif
11788
11789 #ifndef NRF52_ERRATA_228_ENABLE_WORKAROUND
11790 #define NRF52_ERRATA_228_ENABLE_WORKAROUND NRF52_ERRATA_228_PRESENT
11791 #endif
11792
nrf52_errata_228(void)11793 static bool nrf52_errata_228(void)
11794 {
11795 #ifndef NRF52_SERIES
11796 return false;
11797 #else
11798 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
11799 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
11800 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
11801 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
11802 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11803 uint32_t var1 = *(uint32_t *)0x10000130ul;
11804 uint32_t var2 = *(uint32_t *)0x10000134ul;
11805 #endif
11806 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
11807 if (var1 == 0x08)
11808 {
11809 switch(var2)
11810 {
11811 case 0x00ul:
11812 return true;
11813 case 0x01ul:
11814 return true;
11815 case 0x02ul:
11816 return true;
11817 case 0x03ul:
11818 return true;
11819 case 0x04ul:
11820 return true;
11821 case 0x05ul:
11822 return true;
11823 default:
11824 return true;
11825 }
11826 }
11827 #endif
11828 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
11829 if (var1 == 0x0A)
11830 {
11831 switch(var2)
11832 {
11833 case 0x00ul:
11834 return false;
11835 case 0x01ul:
11836 return true;
11837 case 0x02ul:
11838 return false;
11839 default:
11840 return false;
11841 }
11842 }
11843 #endif
11844 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
11845 if (var1 == 0x0D)
11846 {
11847 switch(var2)
11848 {
11849 case 0x00ul:
11850 return true;
11851 case 0x01ul:
11852 return true;
11853 default:
11854 return true;
11855 }
11856 }
11857 #endif
11858 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11859 if (var1 == 0x0E)
11860 {
11861 switch(var2)
11862 {
11863 case 0x00ul:
11864 return true;
11865 case 0x01ul:
11866 return true;
11867 default:
11868 return true;
11869 }
11870 }
11871 #endif
11872 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11873 if (var1 == 0x10)
11874 {
11875 switch(var2)
11876 {
11877 case 0x00ul:
11878 return true;
11879 case 0x01ul:
11880 return true;
11881 case 0x02ul:
11882 return true;
11883 case 0x03ul:
11884 return true;
11885 default:
11886 return true;
11887 }
11888 }
11889 #endif
11890 return false;
11891 #endif
11892 }
11893
11894 /* ========= Errata 230 ========= */
11895 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11896 #define NRF52_ERRATA_230_PRESENT 1
11897 #else
11898 #define NRF52_ERRATA_230_PRESENT 0
11899 #endif
11900
11901 #ifndef NRF52_ERRATA_230_ENABLE_WORKAROUND
11902 #define NRF52_ERRATA_230_ENABLE_WORKAROUND NRF52_ERRATA_230_PRESENT
11903 #endif
11904
nrf52_errata_230(void)11905 static bool nrf52_errata_230(void)
11906 {
11907 #ifndef NRF52_SERIES
11908 return false;
11909 #else
11910 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11911 uint32_t var1 = *(uint32_t *)0x10000130ul;
11912 uint32_t var2 = *(uint32_t *)0x10000134ul;
11913 #endif
11914 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11915 if (var1 == 0x10)
11916 {
11917 switch(var2)
11918 {
11919 case 0x00ul:
11920 return true;
11921 case 0x01ul:
11922 return false;
11923 case 0x02ul:
11924 return false;
11925 case 0x03ul:
11926 return false;
11927 default:
11928 return false;
11929 }
11930 }
11931 #endif
11932 return false;
11933 #endif
11934 }
11935
11936 /* ========= Errata 231 ========= */
11937 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11938 #define NRF52_ERRATA_231_PRESENT 1
11939 #else
11940 #define NRF52_ERRATA_231_PRESENT 0
11941 #endif
11942
11943 #ifndef NRF52_ERRATA_231_ENABLE_WORKAROUND
11944 #define NRF52_ERRATA_231_ENABLE_WORKAROUND NRF52_ERRATA_231_PRESENT
11945 #endif
11946
nrf52_errata_231(void)11947 static bool nrf52_errata_231(void)
11948 {
11949 #ifndef NRF52_SERIES
11950 return false;
11951 #else
11952 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11953 uint32_t var1 = *(uint32_t *)0x10000130ul;
11954 uint32_t var2 = *(uint32_t *)0x10000134ul;
11955 #endif
11956 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
11957 if (var1 == 0x10)
11958 {
11959 switch(var2)
11960 {
11961 case 0x00ul:
11962 return true;
11963 case 0x01ul:
11964 return false;
11965 case 0x02ul:
11966 return false;
11967 case 0x03ul:
11968 return false;
11969 default:
11970 return false;
11971 }
11972 }
11973 #endif
11974 return false;
11975 #endif
11976 }
11977
11978 /* ========= Errata 232 ========= */
11979 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
11980 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11981 #define NRF52_ERRATA_232_PRESENT 1
11982 #else
11983 #define NRF52_ERRATA_232_PRESENT 0
11984 #endif
11985
11986 #ifndef NRF52_ERRATA_232_ENABLE_WORKAROUND
11987 #define NRF52_ERRATA_232_ENABLE_WORKAROUND NRF52_ERRATA_232_PRESENT
11988 #endif
11989
nrf52_errata_232(void)11990 static bool nrf52_errata_232(void)
11991 {
11992 #ifndef NRF52_SERIES
11993 return false;
11994 #else
11995 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
11996 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
11997 uint32_t var1 = *(uint32_t *)0x10000130ul;
11998 uint32_t var2 = *(uint32_t *)0x10000134ul;
11999 #endif
12000 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12001 if (var1 == 0x0A)
12002 {
12003 switch(var2)
12004 {
12005 case 0x00ul:
12006 return false;
12007 case 0x01ul:
12008 return true;
12009 case 0x02ul:
12010 return false;
12011 default:
12012 return false;
12013 }
12014 }
12015 #endif
12016 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12017 if (var1 == 0x0E)
12018 {
12019 switch(var2)
12020 {
12021 case 0x00ul:
12022 return true;
12023 case 0x01ul:
12024 return true;
12025 default:
12026 return true;
12027 }
12028 }
12029 #endif
12030 return false;
12031 #endif
12032 }
12033
12034 /* ========= Errata 233 ========= */
12035 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12036 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12037 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12038 #define NRF52_ERRATA_233_PRESENT 1
12039 #else
12040 #define NRF52_ERRATA_233_PRESENT 0
12041 #endif
12042
12043 #ifndef NRF52_ERRATA_233_ENABLE_WORKAROUND
12044 #define NRF52_ERRATA_233_ENABLE_WORKAROUND NRF52_ERRATA_233_PRESENT
12045 #endif
12046
nrf52_errata_233(void)12047 static bool nrf52_errata_233(void)
12048 {
12049 #ifndef NRF52_SERIES
12050 return false;
12051 #else
12052 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12053 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12054 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12055 uint32_t var1 = *(uint32_t *)0x10000130ul;
12056 uint32_t var2 = *(uint32_t *)0x10000134ul;
12057 #endif
12058 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12059 if (var1 == 0x08)
12060 {
12061 switch(var2)
12062 {
12063 case 0x00ul:
12064 return true;
12065 case 0x01ul:
12066 return true;
12067 case 0x02ul:
12068 return true;
12069 case 0x03ul:
12070 return true;
12071 case 0x04ul:
12072 return true;
12073 case 0x05ul:
12074 return true;
12075 default:
12076 return true;
12077 }
12078 }
12079 #endif
12080 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12081 if (var1 == 0x0D)
12082 {
12083 switch(var2)
12084 {
12085 case 0x00ul:
12086 return true;
12087 case 0x01ul:
12088 return true;
12089 default:
12090 return true;
12091 }
12092 }
12093 #endif
12094 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
12095 if (var1 == 0x10)
12096 {
12097 switch(var2)
12098 {
12099 case 0x00ul:
12100 return true;
12101 case 0x01ul:
12102 return true;
12103 case 0x02ul:
12104 return true;
12105 case 0x03ul:
12106 return true;
12107 default:
12108 return true;
12109 }
12110 }
12111 #endif
12112 return false;
12113 #endif
12114 }
12115
12116 /* ========= Errata 236 ========= */
12117 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12118 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12119 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12120 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12121 #define NRF52_ERRATA_236_PRESENT 1
12122 #else
12123 #define NRF52_ERRATA_236_PRESENT 0
12124 #endif
12125
12126 #ifndef NRF52_ERRATA_236_ENABLE_WORKAROUND
12127 #define NRF52_ERRATA_236_ENABLE_WORKAROUND NRF52_ERRATA_236_PRESENT
12128 #endif
12129
nrf52_errata_236(void)12130 static bool nrf52_errata_236(void)
12131 {
12132 #ifndef NRF52_SERIES
12133 return false;
12134 #else
12135 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12136 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12137 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12138 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12139 uint32_t var1 = *(uint32_t *)0x10000130ul;
12140 uint32_t var2 = *(uint32_t *)0x10000134ul;
12141 #endif
12142 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12143 if (var1 == 0x08)
12144 {
12145 switch(var2)
12146 {
12147 case 0x00ul:
12148 return true;
12149 case 0x01ul:
12150 return true;
12151 case 0x02ul:
12152 return true;
12153 case 0x03ul:
12154 return true;
12155 case 0x04ul:
12156 return true;
12157 case 0x05ul:
12158 return true;
12159 default:
12160 return true;
12161 }
12162 }
12163 #endif
12164 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12165 if (var1 == 0x0A)
12166 {
12167 switch(var2)
12168 {
12169 case 0x00ul:
12170 return false;
12171 case 0x01ul:
12172 return true;
12173 case 0x02ul:
12174 return false;
12175 default:
12176 return false;
12177 }
12178 }
12179 #endif
12180 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12181 if (var1 == 0x0D)
12182 {
12183 switch(var2)
12184 {
12185 case 0x00ul:
12186 return true;
12187 case 0x01ul:
12188 return false;
12189 default:
12190 return false;
12191 }
12192 }
12193 #endif
12194 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12195 if (var1 == 0x0E)
12196 {
12197 switch(var2)
12198 {
12199 case 0x00ul:
12200 return true;
12201 case 0x01ul:
12202 return true;
12203 default:
12204 return true;
12205 }
12206 }
12207 #endif
12208 return false;
12209 #endif
12210 }
12211
12212 /* ========= Errata 237 ========= */
12213 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12214 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12215 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12216 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12217 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12218 #define NRF52_ERRATA_237_PRESENT 1
12219 #else
12220 #define NRF52_ERRATA_237_PRESENT 0
12221 #endif
12222
12223 #ifndef NRF52_ERRATA_237_ENABLE_WORKAROUND
12224 #define NRF52_ERRATA_237_ENABLE_WORKAROUND NRF52_ERRATA_237_PRESENT
12225 #endif
12226
nrf52_errata_237(void)12227 static bool nrf52_errata_237(void)
12228 {
12229 #ifndef NRF52_SERIES
12230 return false;
12231 #else
12232 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12233 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12234 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12235 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12236 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12237 uint32_t var1 = *(uint32_t *)0x10000130ul;
12238 uint32_t var2 = *(uint32_t *)0x10000134ul;
12239 #endif
12240 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12241 if (var1 == 0x08)
12242 {
12243 switch(var2)
12244 {
12245 case 0x00ul:
12246 return true;
12247 case 0x01ul:
12248 return true;
12249 case 0x02ul:
12250 return true;
12251 case 0x03ul:
12252 return true;
12253 case 0x04ul:
12254 return true;
12255 case 0x05ul:
12256 return true;
12257 default:
12258 return true;
12259 }
12260 }
12261 #endif
12262 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12263 if (var1 == 0x0A)
12264 {
12265 switch(var2)
12266 {
12267 case 0x00ul:
12268 return true;
12269 case 0x01ul:
12270 return true;
12271 case 0x02ul:
12272 return true;
12273 default:
12274 return true;
12275 }
12276 }
12277 #endif
12278 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12279 if (var1 == 0x0D)
12280 {
12281 switch(var2)
12282 {
12283 case 0x00ul:
12284 return true;
12285 case 0x01ul:
12286 return true;
12287 default:
12288 return true;
12289 }
12290 }
12291 #endif
12292 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12293 if (var1 == 0x0E)
12294 {
12295 switch(var2)
12296 {
12297 case 0x00ul:
12298 return true;
12299 case 0x01ul:
12300 return true;
12301 default:
12302 return true;
12303 }
12304 }
12305 #endif
12306 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
12307 if (var1 == 0x10)
12308 {
12309 switch(var2)
12310 {
12311 case 0x00ul:
12312 return true;
12313 case 0x01ul:
12314 return true;
12315 case 0x02ul:
12316 return false;
12317 case 0x03ul:
12318 return false;
12319 default:
12320 return false;
12321 }
12322 }
12323 #endif
12324 return false;
12325 #endif
12326 }
12327
12328 /* ========= Errata 241 ========= */
12329 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
12330 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12331 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12332 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12333 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
12334 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
12335 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12336 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12337 #define NRF52_ERRATA_241_PRESENT 1
12338 #else
12339 #define NRF52_ERRATA_241_PRESENT 0
12340 #endif
12341
12342 #ifndef NRF52_ERRATA_241_ENABLE_WORKAROUND
12343 #define NRF52_ERRATA_241_ENABLE_WORKAROUND NRF52_ERRATA_241_PRESENT
12344 #endif
12345
nrf52_errata_241(void)12346 static bool nrf52_errata_241(void)
12347 {
12348 #ifndef NRF52_SERIES
12349 return false;
12350 #else
12351 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
12352 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
12353 uint32_t var1;
12354 uint32_t var2;
12355
12356 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
12357 {
12358 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
12359 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
12360 }
12361 else
12362 {
12363 var1 = *(uint32_t *)0x10000130ul;
12364 var2 = *(uint32_t *)0x10000134ul;
12365 }
12366 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
12367 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12368 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12369 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12370 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12371 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12372 uint32_t var1 = *(uint32_t *)0x10000130ul;
12373 uint32_t var2 = *(uint32_t *)0x10000134ul;
12374 #endif
12375 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
12376 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
12377 if (var1 == 0x06)
12378 {
12379 switch(var2)
12380 {
12381 case 0x03ul:
12382 return false;
12383 case 0x04ul:
12384 return false;
12385 case 0x05ul:
12386 return true;
12387 case 0x06ul:
12388 return true;
12389 case 0x07ul:
12390 return true;
12391 default:
12392 return true;
12393 }
12394 }
12395 #endif
12396 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12397 if (var1 == 0x08)
12398 {
12399 switch(var2)
12400 {
12401 case 0x00ul:
12402 return false;
12403 case 0x01ul:
12404 return false;
12405 case 0x02ul:
12406 return true;
12407 case 0x03ul:
12408 return true;
12409 case 0x04ul:
12410 return true;
12411 case 0x05ul:
12412 return true;
12413 default:
12414 return true;
12415 }
12416 }
12417 #endif
12418 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12419 if (var1 == 0x0A)
12420 {
12421 switch(var2)
12422 {
12423 case 0x00ul:
12424 return true;
12425 case 0x01ul:
12426 return true;
12427 case 0x02ul:
12428 return true;
12429 default:
12430 return true;
12431 }
12432 }
12433 #endif
12434 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12435 if (var1 == 0x0D)
12436 {
12437 switch(var2)
12438 {
12439 case 0x00ul:
12440 return true;
12441 case 0x01ul:
12442 return true;
12443 default:
12444 return true;
12445 }
12446 }
12447 #endif
12448 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12449 if (var1 == 0x0E)
12450 {
12451 switch(var2)
12452 {
12453 case 0x00ul:
12454 return true;
12455 case 0x01ul:
12456 return true;
12457 default:
12458 return true;
12459 }
12460 }
12461 #endif
12462 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
12463 if (var1 == 0x0F)
12464 {
12465 switch(var2)
12466 {
12467 case 0x00ul:
12468 return true;
12469 case 0x01ul:
12470 return true;
12471 default:
12472 return true;
12473 }
12474 }
12475 #endif
12476 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
12477 if (var1 == 0x10)
12478 {
12479 switch(var2)
12480 {
12481 case 0x00ul:
12482 return true;
12483 case 0x01ul:
12484 return true;
12485 case 0x02ul:
12486 return false;
12487 case 0x03ul:
12488 return false;
12489 default:
12490 return false;
12491 }
12492 }
12493 #endif
12494 return false;
12495 #endif
12496 }
12497
12498 /* ========= Errata 242 ========= */
12499 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
12500 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12501 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12502 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12503 #define NRF52_ERRATA_242_PRESENT 1
12504 #else
12505 #define NRF52_ERRATA_242_PRESENT 0
12506 #endif
12507
12508 #ifndef NRF52_ERRATA_242_ENABLE_WORKAROUND
12509 #define NRF52_ERRATA_242_ENABLE_WORKAROUND NRF52_ERRATA_242_PRESENT
12510 #endif
12511
nrf52_errata_242(void)12512 static bool nrf52_errata_242(void)
12513 {
12514 #ifndef NRF52_SERIES
12515 return false;
12516 #else
12517 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
12518 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12519 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12520 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12521 uint32_t var1 = *(uint32_t *)0x10000130ul;
12522 uint32_t var2 = *(uint32_t *)0x10000134ul;
12523 #endif
12524 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12525 if (var1 == 0x08)
12526 {
12527 switch(var2)
12528 {
12529 case 0x00ul:
12530 return true;
12531 case 0x01ul:
12532 return true;
12533 case 0x02ul:
12534 return true;
12535 case 0x03ul:
12536 return true;
12537 case 0x04ul:
12538 return true;
12539 case 0x05ul:
12540 return true;
12541 default:
12542 return true;
12543 }
12544 }
12545 #endif
12546 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12547 if (var1 == 0x0A)
12548 {
12549 switch(var2)
12550 {
12551 case 0x00ul:
12552 return true;
12553 case 0x01ul:
12554 return true;
12555 case 0x02ul:
12556 return true;
12557 default:
12558 return true;
12559 }
12560 }
12561 #endif
12562 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12563 if (var1 == 0x0E)
12564 {
12565 switch(var2)
12566 {
12567 case 0x00ul:
12568 return true;
12569 case 0x01ul:
12570 return true;
12571 default:
12572 return true;
12573 }
12574 }
12575 #endif
12576 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
12577 if (var1 == 0x0F)
12578 {
12579 switch(var2)
12580 {
12581 case 0x00ul:
12582 return true;
12583 case 0x01ul:
12584 return true;
12585 default:
12586 return true;
12587 }
12588 }
12589 #endif
12590 return false;
12591 #endif
12592 }
12593
12594 /* ========= Errata 243 ========= */
12595 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12596 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12597 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12598 #define NRF52_ERRATA_243_PRESENT 1
12599 #else
12600 #define NRF52_ERRATA_243_PRESENT 0
12601 #endif
12602
12603 #ifndef NRF52_ERRATA_243_ENABLE_WORKAROUND
12604 #define NRF52_ERRATA_243_ENABLE_WORKAROUND NRF52_ERRATA_243_PRESENT
12605 #endif
12606
nrf52_errata_243(void)12607 static bool nrf52_errata_243(void)
12608 {
12609 #ifndef NRF52_SERIES
12610 return false;
12611 #else
12612 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12613 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12614 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12615 uint32_t var1 = *(uint32_t *)0x10000130ul;
12616 uint32_t var2 = *(uint32_t *)0x10000134ul;
12617 #endif
12618 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12619 if (var1 == 0x08)
12620 {
12621 switch(var2)
12622 {
12623 case 0x00ul:
12624 return true;
12625 case 0x01ul:
12626 return true;
12627 case 0x02ul:
12628 return true;
12629 case 0x03ul:
12630 return true;
12631 case 0x04ul:
12632 return true;
12633 case 0x05ul:
12634 return true;
12635 default:
12636 return true;
12637 }
12638 }
12639 #endif
12640 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12641 if (var1 == 0x0D)
12642 {
12643 switch(var2)
12644 {
12645 case 0x00ul:
12646 return true;
12647 case 0x01ul:
12648 return true;
12649 default:
12650 return true;
12651 }
12652 }
12653 #endif
12654 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
12655 if (var1 == 0x10)
12656 {
12657 switch(var2)
12658 {
12659 case 0x00ul:
12660 return true;
12661 case 0x01ul:
12662 return true;
12663 case 0x02ul:
12664 return true;
12665 case 0x03ul:
12666 return true;
12667 default:
12668 return true;
12669 }
12670 }
12671 #endif
12672 return false;
12673 #endif
12674 }
12675
12676 /* ========= Errata 244 ========= */
12677 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12678 #define NRF52_ERRATA_244_PRESENT 1
12679 #else
12680 #define NRF52_ERRATA_244_PRESENT 0
12681 #endif
12682
12683 #ifndef NRF52_ERRATA_244_ENABLE_WORKAROUND
12684 #define NRF52_ERRATA_244_ENABLE_WORKAROUND NRF52_ERRATA_244_PRESENT
12685 #endif
12686
nrf52_errata_244(void)12687 static bool nrf52_errata_244(void)
12688 {
12689 #ifndef NRF52_SERIES
12690 return false;
12691 #else
12692 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12693 uint32_t var1 = *(uint32_t *)0x10000130ul;
12694 uint32_t var2 = *(uint32_t *)0x10000134ul;
12695 #endif
12696 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12697 if (var1 == 0x08)
12698 {
12699 switch(var2)
12700 {
12701 case 0x00ul:
12702 return true;
12703 case 0x01ul:
12704 return true;
12705 case 0x02ul:
12706 return true;
12707 case 0x03ul:
12708 return true;
12709 case 0x04ul:
12710 return true;
12711 case 0x05ul:
12712 return true;
12713 default:
12714 return true;
12715 }
12716 }
12717 #endif
12718 return false;
12719 #endif
12720 }
12721
12722 /* ========= Errata 245 ========= */
12723 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
12724 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12725 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12726 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12727 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
12728 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
12729 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12730 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12731 #define NRF52_ERRATA_245_PRESENT 1
12732 #else
12733 #define NRF52_ERRATA_245_PRESENT 0
12734 #endif
12735
12736 #ifndef NRF52_ERRATA_245_ENABLE_WORKAROUND
12737 #define NRF52_ERRATA_245_ENABLE_WORKAROUND 0
12738 #endif
12739
nrf52_errata_245(void)12740 static bool nrf52_errata_245(void)
12741 {
12742 #ifndef NRF52_SERIES
12743 return false;
12744 #else
12745 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
12746 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
12747 uint32_t var1;
12748 uint32_t var2;
12749
12750 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
12751 {
12752 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
12753 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
12754 }
12755 else
12756 {
12757 var1 = *(uint32_t *)0x10000130ul;
12758 var2 = *(uint32_t *)0x10000134ul;
12759 }
12760 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
12761 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12762 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12763 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12764 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12765 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12766 uint32_t var1 = *(uint32_t *)0x10000130ul;
12767 uint32_t var2 = *(uint32_t *)0x10000134ul;
12768 #endif
12769 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
12770 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
12771 if (var1 == 0x06)
12772 {
12773 switch(var2)
12774 {
12775 case 0x03ul:
12776 return true;
12777 case 0x04ul:
12778 return true;
12779 case 0x05ul:
12780 return true;
12781 case 0x06ul:
12782 return true;
12783 case 0x07ul:
12784 return true;
12785 default:
12786 return true;
12787 }
12788 }
12789 #endif
12790 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12791 if (var1 == 0x08)
12792 {
12793 switch(var2)
12794 {
12795 case 0x00ul:
12796 return true;
12797 case 0x01ul:
12798 return true;
12799 case 0x02ul:
12800 return true;
12801 case 0x03ul:
12802 return true;
12803 case 0x04ul:
12804 return true;
12805 case 0x05ul:
12806 return true;
12807 default:
12808 return true;
12809 }
12810 }
12811 #endif
12812 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12813 if (var1 == 0x0A)
12814 {
12815 switch(var2)
12816 {
12817 case 0x00ul:
12818 return true;
12819 case 0x01ul:
12820 return true;
12821 case 0x02ul:
12822 return true;
12823 default:
12824 return true;
12825 }
12826 }
12827 #endif
12828 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12829 if (var1 == 0x0D)
12830 {
12831 switch(var2)
12832 {
12833 case 0x00ul:
12834 return true;
12835 case 0x01ul:
12836 return true;
12837 default:
12838 return true;
12839 }
12840 }
12841 #endif
12842 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12843 if (var1 == 0x0E)
12844 {
12845 switch(var2)
12846 {
12847 case 0x00ul:
12848 return true;
12849 case 0x01ul:
12850 return true;
12851 default:
12852 return true;
12853 }
12854 }
12855 #endif
12856 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
12857 if (var1 == 0x0F)
12858 {
12859 switch(var2)
12860 {
12861 case 0x00ul:
12862 return true;
12863 case 0x01ul:
12864 return true;
12865 default:
12866 return true;
12867 }
12868 }
12869 #endif
12870 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
12871 if (var1 == 0x10)
12872 {
12873 switch(var2)
12874 {
12875 case 0x00ul:
12876 return true;
12877 case 0x01ul:
12878 return true;
12879 case 0x02ul:
12880 return true;
12881 case 0x03ul:
12882 return true;
12883 default:
12884 return true;
12885 }
12886 }
12887 #endif
12888 return false;
12889 #endif
12890 }
12891
12892 /* ========= Errata 246 ========= */
12893 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
12894 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
12895 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
12896 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
12897 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
12898 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12899 #define NRF52_ERRATA_246_PRESENT 1
12900 #else
12901 #define NRF52_ERRATA_246_PRESENT 0
12902 #endif
12903
12904 #ifndef NRF52_ERRATA_246_ENABLE_WORKAROUND
12905 #define NRF52_ERRATA_246_ENABLE_WORKAROUND NRF52_ERRATA_246_PRESENT
12906 #endif
12907
nrf52_errata_246(void)12908 static bool nrf52_errata_246(void)
12909 {
12910 #ifndef NRF52_SERIES
12911 return false;
12912 #else
12913 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
12914 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
12915 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
12916 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
12917 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
12918 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12919 uint32_t var1 = *(uint32_t *)0x10000130ul;
12920 uint32_t var2 = *(uint32_t *)0x10000134ul;
12921 #endif
12922 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
12923 if (var1 == 0x08)
12924 {
12925 switch(var2)
12926 {
12927 case 0x00ul:
12928 return true;
12929 case 0x01ul:
12930 return true;
12931 case 0x02ul:
12932 return true;
12933 case 0x03ul:
12934 return true;
12935 case 0x04ul:
12936 return true;
12937 case 0x05ul:
12938 return true;
12939 default:
12940 return true;
12941 }
12942 }
12943 #endif
12944 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
12945 if (var1 == 0x0A)
12946 {
12947 switch(var2)
12948 {
12949 case 0x00ul:
12950 return true;
12951 case 0x01ul:
12952 return true;
12953 case 0x02ul:
12954 return true;
12955 default:
12956 return true;
12957 }
12958 }
12959 #endif
12960 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
12961 if (var1 == 0x0D)
12962 {
12963 switch(var2)
12964 {
12965 case 0x00ul:
12966 return true;
12967 case 0x01ul:
12968 return true;
12969 default:
12970 return true;
12971 }
12972 }
12973 #endif
12974 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
12975 if (var1 == 0x0E)
12976 {
12977 switch(var2)
12978 {
12979 case 0x00ul:
12980 return true;
12981 case 0x01ul:
12982 return true;
12983 default:
12984 return true;
12985 }
12986 }
12987 #endif
12988 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
12989 if (var1 == 0x0F)
12990 {
12991 switch(var2)
12992 {
12993 case 0x00ul:
12994 return true;
12995 case 0x01ul:
12996 return true;
12997 default:
12998 return true;
12999 }
13000 }
13001 #endif
13002 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13003 if (var1 == 0x10)
13004 {
13005 switch(var2)
13006 {
13007 case 0x00ul:
13008 return true;
13009 case 0x01ul:
13010 return true;
13011 case 0x02ul:
13012 return true;
13013 case 0x03ul:
13014 return true;
13015 default:
13016 return true;
13017 }
13018 }
13019 #endif
13020 return false;
13021 #endif
13022 }
13023
13024 /* ========= Errata 248 ========= */
13025 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
13026 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
13027 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13028 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
13029 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13030 #define NRF52_ERRATA_248_PRESENT 1
13031 #else
13032 #define NRF52_ERRATA_248_PRESENT 0
13033 #endif
13034
13035 #ifndef NRF52_ERRATA_248_ENABLE_WORKAROUND
13036 #define NRF52_ERRATA_248_ENABLE_WORKAROUND NRF52_ERRATA_248_PRESENT
13037 #endif
13038
nrf52_errata_248(void)13039 static bool nrf52_errata_248(void)
13040 {
13041 #ifndef NRF52_SERIES
13042 return false;
13043 #else
13044 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
13045 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
13046 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13047 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
13048 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13049 uint32_t var1 = *(uint32_t *)0x10000130ul;
13050 uint32_t var2 = *(uint32_t *)0x10000134ul;
13051 #endif
13052 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13053 if (var1 == 0x08)
13054 {
13055 switch(var2)
13056 {
13057 case 0x00ul:
13058 return true;
13059 case 0x01ul:
13060 return true;
13061 case 0x02ul:
13062 return true;
13063 case 0x03ul:
13064 return true;
13065 case 0x04ul:
13066 return true;
13067 case 0x05ul:
13068 return true;
13069 default:
13070 return true;
13071 }
13072 }
13073 #endif
13074 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
13075 if (var1 == 0x0A)
13076 {
13077 switch(var2)
13078 {
13079 case 0x00ul:
13080 return false;
13081 case 0x01ul:
13082 return true;
13083 case 0x02ul:
13084 return false;
13085 default:
13086 return false;
13087 }
13088 }
13089 #endif
13090 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13091 if (var1 == 0x0D)
13092 {
13093 switch(var2)
13094 {
13095 case 0x00ul:
13096 return true;
13097 case 0x01ul:
13098 return true;
13099 default:
13100 return true;
13101 }
13102 }
13103 #endif
13104 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13105 if (var1 == 0x0E)
13106 {
13107 switch(var2)
13108 {
13109 case 0x00ul:
13110 return true;
13111 case 0x01ul:
13112 return true;
13113 default:
13114 return true;
13115 }
13116 }
13117 #endif
13118 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13119 if (var1 == 0x10)
13120 {
13121 switch(var2)
13122 {
13123 case 0x00ul:
13124 return true;
13125 case 0x01ul:
13126 return true;
13127 case 0x02ul:
13128 return true;
13129 case 0x03ul:
13130 return true;
13131 default:
13132 return true;
13133 }
13134 }
13135 #endif
13136 return false;
13137 #endif
13138 }
13139
13140 /* ========= Errata 249 ========= */
13141 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
13142 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
13143 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
13144 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13145 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
13146 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
13147 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
13148 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13149 #define NRF52_CONFIGURATION_249_PRESENT 1
13150 #else
13151 #define NRF52_CONFIGURATION_249_PRESENT 0
13152 #endif
13153
13154 #ifndef NRF52_CONFIGURATION_249_ENABLE
13155 #define NRF52_CONFIGURATION_249_ENABLE NRF52_CONFIGURATION_249_PRESENT
13156 #endif
13157
nrf52_configuration_249(void)13158 static bool nrf52_configuration_249(void)
13159 {
13160 #ifndef NRF52_SERIES
13161 return false;
13162 #else
13163 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
13164 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
13165 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
13166 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13167 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13168 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)\
13169 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
13170 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13171 uint32_t var1 = *(uint32_t *)0x10000130ul;
13172 uint32_t var2 = *(uint32_t *)0x10000134ul;
13173 #endif
13174 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13175 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13176 if (var1 == 0x06)
13177 {
13178 switch(var2)
13179 {
13180 case 0x03ul:
13181 return false;
13182 case 0x04ul:
13183 return false;
13184 case 0x05ul:
13185 return false;
13186 case 0x06ul:
13187 return false;
13188 case 0x07ul:
13189 return true;
13190 default:
13191 return true;
13192 }
13193 }
13194 #endif
13195 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13196 if (var1 == 0x08)
13197 {
13198 switch(var2)
13199 {
13200 case 0x00ul:
13201 return false;
13202 case 0x01ul:
13203 return false;
13204 case 0x02ul:
13205 return false;
13206 case 0x03ul:
13207 return false;
13208 case 0x04ul:
13209 return false;
13210 case 0x05ul:
13211 return true;
13212 default:
13213 return true;
13214 }
13215 }
13216 #endif
13217 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
13218 if (var1 == 0x0A)
13219 {
13220 switch(var2)
13221 {
13222 case 0x00ul:
13223 return false;
13224 case 0x01ul:
13225 return false;
13226 case 0x02ul:
13227 return true;
13228 default:
13229 return true;
13230 }
13231 }
13232 #endif
13233 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13234 if (var1 == 0x0D)
13235 {
13236 switch(var2)
13237 {
13238 case 0x00ul:
13239 return false;
13240 case 0x01ul:
13241 return true;
13242 default:
13243 return true;
13244 }
13245 }
13246 #endif
13247 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13248 if (var1 == 0x0E)
13249 {
13250 switch(var2)
13251 {
13252 case 0x00ul:
13253 return false;
13254 case 0x01ul:
13255 return true;
13256 default:
13257 return true;
13258 }
13259 }
13260 #endif
13261 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
13262 if (var1 == 0x0F)
13263 {
13264 switch(var2)
13265 {
13266 case 0x00ul:
13267 return false;
13268 case 0x01ul:
13269 return true;
13270 default:
13271 return true;
13272 }
13273 }
13274 #endif
13275 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13276 if (var1 == 0x10)
13277 {
13278 switch(var2)
13279 {
13280 case 0x00ul:
13281 return false;
13282 case 0x01ul:
13283 return false;
13284 case 0x02ul:
13285 return false;
13286 case 0x03ul:
13287 return true;
13288 default:
13289 return true;
13290 }
13291 }
13292 #endif
13293 return false;
13294 #endif
13295 }
13296
13297 /* ========= Errata 250 ========= */
13298 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13299 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13300 #define NRF52_ERRATA_250_PRESENT 1
13301 #else
13302 #define NRF52_ERRATA_250_PRESENT 0
13303 #endif
13304
13305 #ifndef NRF52_ERRATA_250_ENABLE_WORKAROUND
13306 #define NRF52_ERRATA_250_ENABLE_WORKAROUND NRF52_ERRATA_250_PRESENT
13307 #endif
13308
nrf52_errata_250(void)13309 static bool nrf52_errata_250(void)
13310 {
13311 #ifndef NRF52_SERIES
13312 return false;
13313 #else
13314 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13315 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13316 uint32_t var1 = *(uint32_t *)0x10000130ul;
13317 uint32_t var2 = *(uint32_t *)0x10000134ul;
13318 #endif
13319 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13320 if (var1 == 0x0D)
13321 {
13322 switch(var2)
13323 {
13324 case 0x00ul:
13325 return true;
13326 case 0x01ul:
13327 return true;
13328 default:
13329 return true;
13330 }
13331 }
13332 #endif
13333 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13334 if (var1 == 0x10)
13335 {
13336 switch(var2)
13337 {
13338 case 0x00ul:
13339 return true;
13340 case 0x01ul:
13341 return true;
13342 case 0x02ul:
13343 return true;
13344 case 0x03ul:
13345 return true;
13346 default:
13347 return true;
13348 }
13349 }
13350 #endif
13351 return false;
13352 #endif
13353 }
13354
13355 /* ========= Errata 251 ========= */
13356 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13357 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13358 #define NRF52_ERRATA_251_PRESENT 1
13359 #else
13360 #define NRF52_ERRATA_251_PRESENT 0
13361 #endif
13362
13363 #ifndef NRF52_ERRATA_251_ENABLE_WORKAROUND
13364 #define NRF52_ERRATA_251_ENABLE_WORKAROUND NRF52_ERRATA_251_PRESENT
13365 #endif
13366
nrf52_errata_251(void)13367 static bool nrf52_errata_251(void)
13368 {
13369 #ifndef NRF52_SERIES
13370 return false;
13371 #else
13372 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13373 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13374 uint32_t var1 = *(uint32_t *)0x10000130ul;
13375 uint32_t var2 = *(uint32_t *)0x10000134ul;
13376 #endif
13377 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13378 if (var1 == 0x0D)
13379 {
13380 switch(var2)
13381 {
13382 case 0x00ul:
13383 return true;
13384 case 0x01ul:
13385 return true;
13386 default:
13387 return true;
13388 }
13389 }
13390 #endif
13391 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13392 if (var1 == 0x10)
13393 {
13394 switch(var2)
13395 {
13396 case 0x00ul:
13397 return true;
13398 case 0x01ul:
13399 return true;
13400 case 0x02ul:
13401 return true;
13402 case 0x03ul:
13403 return true;
13404 default:
13405 return true;
13406 }
13407 }
13408 #endif
13409 return false;
13410 #endif
13411 }
13412
13413 /* ========= Errata 252 ========= */
13414 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
13415 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
13416 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13417 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
13418 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
13419 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
13420 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13421 #define NRF52_ERRATA_252_PRESENT 1
13422 #else
13423 #define NRF52_ERRATA_252_PRESENT 0
13424 #endif
13425
13426 #ifndef NRF52_ERRATA_252_ENABLE_WORKAROUND
13427 #define NRF52_ERRATA_252_ENABLE_WORKAROUND NRF52_ERRATA_252_PRESENT
13428 #endif
13429
nrf52_errata_252(void)13430 static bool nrf52_errata_252(void)
13431 {
13432 #ifndef NRF52_SERIES
13433 return false;
13434 #else
13435 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13436 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13437 uint32_t var1;
13438 uint32_t var2;
13439
13440 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
13441 {
13442 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
13443 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
13444 }
13445 else
13446 {
13447 var1 = *(uint32_t *)0x10000130ul;
13448 var2 = *(uint32_t *)0x10000134ul;
13449 }
13450 #elif defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
13451 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
13452 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13453 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
13454 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13455 uint32_t var1 = *(uint32_t *)0x10000130ul;
13456 uint32_t var2 = *(uint32_t *)0x10000134ul;
13457 #endif
13458 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13459 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13460 if (var1 == 0x06)
13461 {
13462 switch(var2)
13463 {
13464 case 0x03ul:
13465 return true;
13466 case 0x04ul:
13467 return true;
13468 case 0x05ul:
13469 return true;
13470 case 0x06ul:
13471 return true;
13472 case 0x07ul:
13473 return true;
13474 default:
13475 return true;
13476 }
13477 }
13478 #endif
13479 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13480 if (var1 == 0x08)
13481 {
13482 switch(var2)
13483 {
13484 case 0x00ul:
13485 return true;
13486 case 0x01ul:
13487 return true;
13488 case 0x02ul:
13489 return true;
13490 case 0x03ul:
13491 return true;
13492 case 0x04ul:
13493 return true;
13494 case 0x05ul:
13495 return true;
13496 default:
13497 return true;
13498 }
13499 }
13500 #endif
13501 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
13502 if (var1 == 0x0A)
13503 {
13504 switch(var2)
13505 {
13506 case 0x00ul:
13507 return true;
13508 case 0x01ul:
13509 return true;
13510 case 0x02ul:
13511 return true;
13512 default:
13513 return true;
13514 }
13515 }
13516 #endif
13517 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13518 if (var1 == 0x0D)
13519 {
13520 switch(var2)
13521 {
13522 case 0x00ul:
13523 return true;
13524 case 0x01ul:
13525 return true;
13526 default:
13527 return true;
13528 }
13529 }
13530 #endif
13531 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13532 if (var1 == 0x0E)
13533 {
13534 switch(var2)
13535 {
13536 case 0x00ul:
13537 return true;
13538 case 0x01ul:
13539 return true;
13540 default:
13541 return true;
13542 }
13543 }
13544 #endif
13545 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13546 if (var1 == 0x10)
13547 {
13548 switch(var2)
13549 {
13550 case 0x00ul:
13551 return true;
13552 case 0x01ul:
13553 return true;
13554 case 0x02ul:
13555 return false;
13556 case 0x03ul:
13557 return false;
13558 default:
13559 return false;
13560 }
13561 }
13562 #endif
13563 return false;
13564 #endif
13565 }
13566
13567 /* ========= Errata 254 ========= */
13568 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13569 #define NRF52_CONFIGURATION_254_PRESENT 1
13570 #else
13571 #define NRF52_CONFIGURATION_254_PRESENT 0
13572 #endif
13573
13574 #ifndef NRF52_CONFIGURATION_254_ENABLE
13575 #define NRF52_CONFIGURATION_254_ENABLE NRF52_CONFIGURATION_254_PRESENT
13576 #endif
13577
nrf52_configuration_254(void)13578 static bool nrf52_configuration_254(void)
13579 {
13580 #ifndef NRF52_SERIES
13581 return false;
13582 #else
13583 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13584 uint32_t var1 = *(uint32_t *)0x10000130ul;
13585 uint32_t var2 = *(uint32_t *)0x10000134ul;
13586 #endif
13587 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13588 if (var1 == 0x08)
13589 {
13590 switch(var2)
13591 {
13592 case 0x00ul:
13593 return false;
13594 case 0x01ul:
13595 return false;
13596 case 0x02ul:
13597 return false;
13598 case 0x03ul:
13599 return false;
13600 case 0x04ul:
13601 return false;
13602 case 0x05ul:
13603 return true;
13604 default:
13605 return true;
13606 }
13607 }
13608 #endif
13609 return false;
13610 #endif
13611 }
13612
13613 /* ========= Errata 255 ========= */
13614 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13615 #define NRF52_CONFIGURATION_255_PRESENT 1
13616 #else
13617 #define NRF52_CONFIGURATION_255_PRESENT 0
13618 #endif
13619
13620 #ifndef NRF52_CONFIGURATION_255_ENABLE
13621 #define NRF52_CONFIGURATION_255_ENABLE NRF52_CONFIGURATION_255_PRESENT
13622 #endif
13623
nrf52_configuration_255(void)13624 static bool nrf52_configuration_255(void)
13625 {
13626 #ifndef NRF52_SERIES
13627 return false;
13628 #else
13629 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13630 uint32_t var1 = *(uint32_t *)0x10000130ul;
13631 uint32_t var2 = *(uint32_t *)0x10000134ul;
13632 #endif
13633 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13634 if (var1 == 0x0D)
13635 {
13636 switch(var2)
13637 {
13638 case 0x00ul:
13639 return false;
13640 case 0x01ul:
13641 return true;
13642 default:
13643 return true;
13644 }
13645 }
13646 #endif
13647 return false;
13648 #endif
13649 }
13650
13651 /* ========= Errata 256 ========= */
13652 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13653 #define NRF52_CONFIGURATION_256_PRESENT 1
13654 #else
13655 #define NRF52_CONFIGURATION_256_PRESENT 0
13656 #endif
13657
13658 #ifndef NRF52_CONFIGURATION_256_ENABLE
13659 #define NRF52_CONFIGURATION_256_ENABLE NRF52_CONFIGURATION_256_PRESENT
13660 #endif
13661
nrf52_configuration_256(void)13662 static bool nrf52_configuration_256(void)
13663 {
13664 #ifndef NRF52_SERIES
13665 return false;
13666 #else
13667 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13668 uint32_t var1 = *(uint32_t *)0x10000130ul;
13669 uint32_t var2 = *(uint32_t *)0x10000134ul;
13670 #endif
13671 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13672 if (var1 == 0x10)
13673 {
13674 switch(var2)
13675 {
13676 case 0x00ul:
13677 return false;
13678 case 0x01ul:
13679 return false;
13680 case 0x02ul:
13681 return false;
13682 case 0x03ul:
13683 return true;
13684 default:
13685 return true;
13686 }
13687 }
13688 #endif
13689 return false;
13690 #endif
13691 }
13692
13693 /* ========= Errata 257 ========= */
13694 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13695 #define NRF52_CONFIGURATION_257_PRESENT 1
13696 #else
13697 #define NRF52_CONFIGURATION_257_PRESENT 0
13698 #endif
13699
13700 #ifndef NRF52_CONFIGURATION_257_ENABLE
13701 #define NRF52_CONFIGURATION_257_ENABLE NRF52_CONFIGURATION_257_PRESENT
13702 #endif
13703
nrf52_configuration_257(void)13704 static bool nrf52_configuration_257(void)
13705 {
13706 #ifndef NRF52_SERIES
13707 return false;
13708 #else
13709 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13710 uint32_t var1 = *(uint32_t *)0x10000130ul;
13711 uint32_t var2 = *(uint32_t *)0x10000134ul;
13712 #endif
13713 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13714 if (var1 == 0x0E)
13715 {
13716 switch(var2)
13717 {
13718 case 0x00ul:
13719 return false;
13720 case 0x01ul:
13721 return true;
13722 default:
13723 return true;
13724 }
13725 }
13726 #endif
13727 return false;
13728 #endif
13729 }
13730
13731 /* ========= Errata 258 ========= */
13732 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
13733 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
13734 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13735 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13736 #define NRF52_ERRATA_258_PRESENT 1
13737 #else
13738 #define NRF52_ERRATA_258_PRESENT 0
13739 #endif
13740
13741 #ifndef NRF52_ERRATA_258_ENABLE_WORKAROUND
13742 #define NRF52_ERRATA_258_ENABLE_WORKAROUND NRF52_ERRATA_258_PRESENT
13743 #endif
13744
nrf52_errata_258(void)13745 static bool nrf52_errata_258(void)
13746 {
13747 #ifndef NRF52_SERIES
13748 return false;
13749 #else
13750 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
13751 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
13752 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13753 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13754 uint32_t var1 = *(uint32_t *)0x10000130ul;
13755 uint32_t var2 = *(uint32_t *)0x10000134ul;
13756 #endif
13757 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
13758 if (var1 == 0x0A)
13759 {
13760 switch(var2)
13761 {
13762 case 0x00ul:
13763 return false;
13764 case 0x01ul:
13765 return true;
13766 case 0x02ul:
13767 return false;
13768 default:
13769 return false;
13770 }
13771 }
13772 #endif
13773 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13774 if (var1 == 0x0D)
13775 {
13776 switch(var2)
13777 {
13778 case 0x00ul:
13779 return true;
13780 case 0x01ul:
13781 return true;
13782 default:
13783 return true;
13784 }
13785 }
13786 #endif
13787 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13788 if (var1 == 0x0E)
13789 {
13790 switch(var2)
13791 {
13792 case 0x00ul:
13793 return true;
13794 case 0x01ul:
13795 return true;
13796 default:
13797 return true;
13798 }
13799 }
13800 #endif
13801 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13802 if (var1 == 0x10)
13803 {
13804 switch(var2)
13805 {
13806 case 0x00ul:
13807 return true;
13808 case 0x01ul:
13809 return true;
13810 case 0x02ul:
13811 return true;
13812 case 0x03ul:
13813 return true;
13814 default:
13815 return true;
13816 }
13817 }
13818 #endif
13819 return false;
13820 #endif
13821 }
13822
13823 /* ========= Errata 259 ========= */
13824 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
13825 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
13826 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13827 #define NRF52_ERRATA_259_PRESENT 1
13828 #else
13829 #define NRF52_ERRATA_259_PRESENT 0
13830 #endif
13831
13832 #ifndef NRF52_ERRATA_259_ENABLE_WORKAROUND
13833 #define NRF52_ERRATA_259_ENABLE_WORKAROUND NRF52_ERRATA_259_PRESENT
13834 #endif
13835
nrf52_errata_259(void)13836 static bool nrf52_errata_259(void)
13837 {
13838 #ifndef NRF52_SERIES
13839 return false;
13840 #else
13841 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
13842 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
13843 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13844 uint32_t var1 = *(uint32_t *)0x10000130ul;
13845 uint32_t var2 = *(uint32_t *)0x10000134ul;
13846 #endif
13847 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
13848 if (var1 == 0x08)
13849 {
13850 switch(var2)
13851 {
13852 case 0x00ul:
13853 return true;
13854 case 0x01ul:
13855 return true;
13856 case 0x02ul:
13857 return true;
13858 case 0x03ul:
13859 return true;
13860 case 0x04ul:
13861 return true;
13862 case 0x05ul:
13863 return true;
13864 default:
13865 return true;
13866 }
13867 }
13868 #endif
13869 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
13870 if (var1 == 0x0D)
13871 {
13872 switch(var2)
13873 {
13874 case 0x00ul:
13875 return true;
13876 case 0x01ul:
13877 return true;
13878 default:
13879 return true;
13880 }
13881 }
13882 #endif
13883 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
13884 if (var1 == 0x10)
13885 {
13886 switch(var2)
13887 {
13888 case 0x00ul:
13889 return true;
13890 case 0x01ul:
13891 return true;
13892 case 0x02ul:
13893 return true;
13894 case 0x03ul:
13895 return true;
13896 default:
13897 return true;
13898 }
13899 }
13900 #endif
13901 return false;
13902 #endif
13903 }
13904
13905 /* ========= Errata 262 ========= */
13906 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
13907 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
13908 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
13909 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
13910 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13911 #define NRF52_ERRATA_262_PRESENT 1
13912 #else
13913 #define NRF52_ERRATA_262_PRESENT 0
13914 #endif
13915
13916 #ifndef NRF52_ERRATA_262_ENABLE_WORKAROUND
13917 #define NRF52_ERRATA_262_ENABLE_WORKAROUND NRF52_ERRATA_262_PRESENT
13918 #endif
13919
nrf52_errata_262(void)13920 static bool nrf52_errata_262(void)
13921 {
13922 #ifndef NRF52_SERIES
13923 return false;
13924 #else
13925 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13926 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13927 uint32_t var1;
13928 uint32_t var2;
13929
13930 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
13931 {
13932 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
13933 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
13934 }
13935 else
13936 {
13937 var1 = *(uint32_t *)0x10000130ul;
13938 var2 = *(uint32_t *)0x10000134ul;
13939 }
13940 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
13941 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
13942 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13943 uint32_t var1 = *(uint32_t *)0x10000130ul;
13944 uint32_t var2 = *(uint32_t *)0x10000134ul;
13945 #endif
13946 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
13947 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
13948 if (var1 == 0x06)
13949 {
13950 switch(var2)
13951 {
13952 case 0x03ul:
13953 return true;
13954 case 0x04ul:
13955 return true;
13956 case 0x05ul:
13957 return true;
13958 case 0x06ul:
13959 return true;
13960 case 0x07ul:
13961 return true;
13962 default:
13963 return true;
13964 }
13965 }
13966 #endif
13967 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
13968 if (var1 == 0x0A)
13969 {
13970 switch(var2)
13971 {
13972 case 0x00ul:
13973 return true;
13974 case 0x01ul:
13975 return true;
13976 case 0x02ul:
13977 return true;
13978 default:
13979 return true;
13980 }
13981 }
13982 #endif
13983 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
13984 if (var1 == 0x0E)
13985 {
13986 switch(var2)
13987 {
13988 case 0x00ul:
13989 return true;
13990 case 0x01ul:
13991 return true;
13992 default:
13993 return true;
13994 }
13995 }
13996 #endif
13997 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
13998 if (var1 == 0x0F)
13999 {
14000 switch(var2)
14001 {
14002 case 0x00ul:
14003 return true;
14004 case 0x01ul:
14005 return true;
14006 default:
14007 return true;
14008 }
14009 }
14010 #endif
14011 return false;
14012 #endif
14013 }
14014
14015 /* ========= Errata 263 ========= */
14016 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
14017 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
14018 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
14019 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14020 #define NRF52_ERRATA_263_PRESENT 1
14021 #else
14022 #define NRF52_ERRATA_263_PRESENT 0
14023 #endif
14024
14025 #ifndef NRF52_ERRATA_263_ENABLE_WORKAROUND
14026 #define NRF52_ERRATA_263_ENABLE_WORKAROUND NRF52_ERRATA_263_PRESENT
14027 #endif
14028
nrf52_errata_263(void)14029 static bool nrf52_errata_263(void)
14030 {
14031 #ifndef NRF52_SERIES
14032 return false;
14033 #else
14034 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
14035 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
14036 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
14037 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14038 uint32_t var1 = *(uint32_t *)0x10000130ul;
14039 uint32_t var2 = *(uint32_t *)0x10000134ul;
14040 #endif
14041 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
14042 if (var1 == 0x0A)
14043 {
14044 switch(var2)
14045 {
14046 case 0x00ul:
14047 return false;
14048 case 0x01ul:
14049 return true;
14050 case 0x02ul:
14051 return false;
14052 default:
14053 return false;
14054 }
14055 }
14056 #endif
14057 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14058 if (var1 == 0x0D)
14059 {
14060 switch(var2)
14061 {
14062 case 0x00ul:
14063 return true;
14064 case 0x01ul:
14065 return true;
14066 default:
14067 return true;
14068 }
14069 }
14070 #endif
14071 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
14072 if (var1 == 0x0E)
14073 {
14074 switch(var2)
14075 {
14076 case 0x00ul:
14077 return true;
14078 case 0x01ul:
14079 return true;
14080 default:
14081 return true;
14082 }
14083 }
14084 #endif
14085 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14086 if (var1 == 0x10)
14087 {
14088 switch(var2)
14089 {
14090 case 0x00ul:
14091 return true;
14092 case 0x01ul:
14093 return true;
14094 case 0x02ul:
14095 return true;
14096 case 0x03ul:
14097 return true;
14098 default:
14099 return true;
14100 }
14101 }
14102 #endif
14103 return false;
14104 #endif
14105 }
14106
14107 /* ========= Errata 265 ========= */
14108 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14109 #define NRF52_ERRATA_265_PRESENT 1
14110 #else
14111 #define NRF52_ERRATA_265_PRESENT 0
14112 #endif
14113
14114 #ifndef NRF52_ERRATA_265_ENABLE_WORKAROUND
14115 #define NRF52_ERRATA_265_ENABLE_WORKAROUND NRF52_ERRATA_265_PRESENT
14116 #endif
14117
nrf52_errata_265(void)14118 static bool nrf52_errata_265(void)
14119 {
14120 #ifndef NRF52_SERIES
14121 return false;
14122 #else
14123 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14124 uint32_t var1 = *(uint32_t *)0x10000130ul;
14125 uint32_t var2 = *(uint32_t *)0x10000134ul;
14126 #endif
14127 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14128 if (var1 == 0x10)
14129 {
14130 switch(var2)
14131 {
14132 case 0x00ul:
14133 return false;
14134 case 0x01ul:
14135 return true;
14136 case 0x02ul:
14137 return true;
14138 case 0x03ul:
14139 return true;
14140 default:
14141 return true;
14142 }
14143 }
14144 #endif
14145 return false;
14146 #endif
14147 }
14148
14149 /* ========= Errata 266 ========= */
14150 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805) \
14151 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
14152 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811) \
14153 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
14154 || defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832) \
14155 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832) \
14156 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833) \
14157 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14158 #define NRF52_ERRATA_266_PRESENT 1
14159 #else
14160 #define NRF52_ERRATA_266_PRESENT 0
14161 #endif
14162
14163 #ifndef NRF52_ERRATA_266_ENABLE_WORKAROUND
14164 #define NRF52_ERRATA_266_ENABLE_WORKAROUND NRF52_ERRATA_266_PRESENT
14165 #endif
14166
nrf52_errata_266(void)14167 static bool nrf52_errata_266(void)
14168 {
14169 #ifndef NRF52_SERIES
14170 return false;
14171 #else
14172 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
14173 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
14174 uint32_t var1;
14175 uint32_t var2;
14176
14177 if (*(uint32_t *)0x10000130ul == 0xFFFFFFFF)
14178 {
14179 var1 = ((*(uint32_t *)0xF0000FE0ul) & 0x000000FFul);
14180 var2 = ((*(uint32_t *)0xF0000FE8ul) & 0x000000F0ul) >> 4;
14181 }
14182 else
14183 {
14184 var1 = *(uint32_t *)0x10000130ul;
14185 var2 = *(uint32_t *)0x10000134ul;
14186 }
14187 #elif defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)\
14188 || defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
14189 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)\
14190 || defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
14191 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)\
14192 || defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14193 uint32_t var1 = *(uint32_t *)0x10000130ul;
14194 uint32_t var2 = *(uint32_t *)0x10000134ul;
14195 #endif
14196 #if defined (NRF52832_XXAA) || defined (DEVELOP_IN_NRF52832)\
14197 || defined (NRF52832_XXAB) || defined (DEVELOP_IN_NRF52832)
14198 if (var1 == 0x06)
14199 {
14200 switch(var2)
14201 {
14202 case 0x03ul:
14203 return false;
14204 case 0x04ul:
14205 return true;
14206 case 0x05ul:
14207 return true;
14208 case 0x06ul:
14209 return true;
14210 case 0x07ul:
14211 return true;
14212 default:
14213 return true;
14214 }
14215 }
14216 #endif
14217 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14218 if (var1 == 0x08)
14219 {
14220 switch(var2)
14221 {
14222 case 0x00ul:
14223 return false;
14224 case 0x01ul:
14225 return false;
14226 case 0x02ul:
14227 return true;
14228 case 0x03ul:
14229 return true;
14230 case 0x04ul:
14231 return true;
14232 case 0x05ul:
14233 return true;
14234 default:
14235 return true;
14236 }
14237 }
14238 #endif
14239 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
14240 if (var1 == 0x0A)
14241 {
14242 switch(var2)
14243 {
14244 case 0x00ul:
14245 return true;
14246 case 0x01ul:
14247 return true;
14248 case 0x02ul:
14249 return true;
14250 default:
14251 return true;
14252 }
14253 }
14254 #endif
14255 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14256 if (var1 == 0x0D)
14257 {
14258 switch(var2)
14259 {
14260 case 0x00ul:
14261 return true;
14262 case 0x01ul:
14263 return true;
14264 default:
14265 return true;
14266 }
14267 }
14268 #endif
14269 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
14270 if (var1 == 0x0E)
14271 {
14272 switch(var2)
14273 {
14274 case 0x00ul:
14275 return true;
14276 case 0x01ul:
14277 return true;
14278 default:
14279 return true;
14280 }
14281 }
14282 #endif
14283 #if defined (NRF52805_XXAA) || defined (DEVELOP_IN_NRF52805)
14284 if (var1 == 0x0F)
14285 {
14286 switch(var2)
14287 {
14288 case 0x00ul:
14289 return true;
14290 case 0x01ul:
14291 return true;
14292 default:
14293 return true;
14294 }
14295 }
14296 #endif
14297 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14298 if (var1 == 0x10)
14299 {
14300 switch(var2)
14301 {
14302 case 0x00ul:
14303 return true;
14304 case 0x01ul:
14305 return true;
14306 case 0x02ul:
14307 return false;
14308 case 0x03ul:
14309 return false;
14310 default:
14311 return false;
14312 }
14313 }
14314 #endif
14315 return false;
14316 #endif
14317 }
14318
14319 /* ========= Errata 267 ========= */
14320 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
14321 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14322 #define NRF52_ERRATA_267_PRESENT 1
14323 #else
14324 #define NRF52_ERRATA_267_PRESENT 0
14325 #endif
14326
14327 #ifndef NRF52_ERRATA_267_ENABLE_WORKAROUND
14328 #define NRF52_ERRATA_267_ENABLE_WORKAROUND NRF52_ERRATA_267_PRESENT
14329 #endif
14330
nrf52_errata_267(void)14331 static bool nrf52_errata_267(void)
14332 {
14333 #ifndef NRF52_SERIES
14334 return false;
14335 #else
14336 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
14337 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14338 uint32_t var1 = *(uint32_t *)0x10000130ul;
14339 uint32_t var2 = *(uint32_t *)0x10000134ul;
14340 #endif
14341 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14342 if (var1 == 0x0D)
14343 {
14344 switch(var2)
14345 {
14346 case 0x00ul:
14347 return true;
14348 case 0x01ul:
14349 return true;
14350 default:
14351 return true;
14352 }
14353 }
14354 #endif
14355 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14356 if (var1 == 0x10)
14357 {
14358 switch(var2)
14359 {
14360 case 0x00ul:
14361 return true;
14362 case 0x01ul:
14363 return true;
14364 case 0x02ul:
14365 return false;
14366 case 0x03ul:
14367 return false;
14368 default:
14369 return false;
14370 }
14371 }
14372 #endif
14373 return false;
14374 #endif
14375 }
14376
14377 /* ========= Errata 268 ========= */
14378 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
14379 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14380 #define NRF52_ERRATA_268_PRESENT 1
14381 #else
14382 #define NRF52_ERRATA_268_PRESENT 0
14383 #endif
14384
14385 #ifndef NRF52_ERRATA_268_ENABLE_WORKAROUND
14386 #define NRF52_ERRATA_268_ENABLE_WORKAROUND NRF52_ERRATA_268_PRESENT
14387 #endif
14388
nrf52_errata_268(void)14389 static bool nrf52_errata_268(void)
14390 {
14391 #ifndef NRF52_SERIES
14392 return false;
14393 #else
14394 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
14395 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14396 uint32_t var1 = *(uint32_t *)0x10000130ul;
14397 uint32_t var2 = *(uint32_t *)0x10000134ul;
14398 #endif
14399 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14400 if (var1 == 0x0D)
14401 {
14402 switch(var2)
14403 {
14404 case 0x00ul:
14405 return true;
14406 case 0x01ul:
14407 return true;
14408 default:
14409 return true;
14410 }
14411 }
14412 #endif
14413 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14414 if (var1 == 0x10)
14415 {
14416 switch(var2)
14417 {
14418 case 0x00ul:
14419 return true;
14420 case 0x01ul:
14421 return true;
14422 case 0x02ul:
14423 return true;
14424 case 0x03ul:
14425 return true;
14426 default:
14427 return true;
14428 }
14429 }
14430 #endif
14431 return false;
14432 #endif
14433 }
14434
14435 /* ========= Errata 269 ========= */
14436 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14437 #define NRF52_ERRATA_269_PRESENT 1
14438 #else
14439 #define NRF52_ERRATA_269_PRESENT 0
14440 #endif
14441
14442 #ifndef NRF52_ERRATA_269_ENABLE_WORKAROUND
14443 #define NRF52_ERRATA_269_ENABLE_WORKAROUND NRF52_ERRATA_269_PRESENT
14444 #endif
14445
nrf52_errata_269(void)14446 static bool nrf52_errata_269(void)
14447 {
14448 #ifndef NRF52_SERIES
14449 return false;
14450 #else
14451 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14452 uint32_t var1 = *(uint32_t *)0x10000130ul;
14453 uint32_t var2 = *(uint32_t *)0x10000134ul;
14454 #endif
14455 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14456 if (var1 == 0x10)
14457 {
14458 switch(var2)
14459 {
14460 case 0x00ul:
14461 return true;
14462 case 0x01ul:
14463 return true;
14464 case 0x02ul:
14465 return true;
14466 case 0x03ul:
14467 return true;
14468 default:
14469 return true;
14470 }
14471 }
14472 #endif
14473 return false;
14474 #endif
14475 }
14476
14477 /* ========= Errata 270 ========= */
14478 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14479 #define NRF52_ERRATA_270_PRESENT 1
14480 #else
14481 #define NRF52_ERRATA_270_PRESENT 0
14482 #endif
14483
14484 #ifndef NRF52_ERRATA_270_ENABLE_WORKAROUND
14485 #define NRF52_ERRATA_270_ENABLE_WORKAROUND NRF52_ERRATA_270_PRESENT
14486 #endif
14487
nrf52_errata_270(void)14488 static bool nrf52_errata_270(void)
14489 {
14490 #ifndef NRF52_SERIES
14491 return false;
14492 #else
14493 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14494 uint32_t var1 = *(uint32_t *)0x10000130ul;
14495 uint32_t var2 = *(uint32_t *)0x10000134ul;
14496 #endif
14497 #if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
14498 if (var1 == 0x08)
14499 {
14500 switch(var2)
14501 {
14502 case 0x00ul:
14503 return false;
14504 case 0x01ul:
14505 return false;
14506 case 0x02ul:
14507 return true;
14508 case 0x03ul:
14509 return true;
14510 case 0x04ul:
14511 return true;
14512 case 0x05ul:
14513 return true;
14514 default:
14515 return true;
14516 }
14517 }
14518 #endif
14519 return false;
14520 #endif
14521 }
14522
14523 /* ========= Errata 271 ========= */
14524 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820) \
14525 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14526 #define NRF52_ERRATA_271_PRESENT 1
14527 #else
14528 #define NRF52_ERRATA_271_PRESENT 0
14529 #endif
14530
14531 #ifndef NRF52_ERRATA_271_ENABLE_WORKAROUND
14532 #define NRF52_ERRATA_271_ENABLE_WORKAROUND NRF52_ERRATA_271_PRESENT
14533 #endif
14534
nrf52_errata_271(void)14535 static bool nrf52_errata_271(void)
14536 {
14537 #ifndef NRF52_SERIES
14538 return false;
14539 #else
14540 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)\
14541 || defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14542 uint32_t var1 = *(uint32_t *)0x10000130ul;
14543 uint32_t var2 = *(uint32_t *)0x10000134ul;
14544 #endif
14545 #if defined (NRF52833_XXAA) || defined (DEVELOP_IN_NRF52833)
14546 if (var1 == 0x0D)
14547 {
14548 switch(var2)
14549 {
14550 case 0x00ul:
14551 return true;
14552 case 0x01ul:
14553 return true;
14554 default:
14555 return true;
14556 }
14557 }
14558 #endif
14559 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14560 if (var1 == 0x10)
14561 {
14562 switch(var2)
14563 {
14564 case 0x00ul:
14565 return true;
14566 case 0x01ul:
14567 return true;
14568 case 0x02ul:
14569 return false;
14570 case 0x03ul:
14571 return false;
14572 default:
14573 return false;
14574 }
14575 }
14576 #endif
14577 return false;
14578 #endif
14579 }
14580
14581 /* ========= Errata 272 ========= */
14582 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14583 #define NRF52_ERRATA_272_PRESENT 1
14584 #else
14585 #define NRF52_ERRATA_272_PRESENT 0
14586 #endif
14587
14588 #ifndef NRF52_ERRATA_272_ENABLE_WORKAROUND
14589 #define NRF52_ERRATA_272_ENABLE_WORKAROUND NRF52_ERRATA_272_PRESENT
14590 #endif
14591
nrf52_errata_272(void)14592 static bool nrf52_errata_272(void)
14593 {
14594 #ifndef NRF52_SERIES
14595 return false;
14596 #else
14597 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14598 uint32_t var1 = *(uint32_t *)0x10000130ul;
14599 uint32_t var2 = *(uint32_t *)0x10000134ul;
14600 #endif
14601 #if defined (NRF52820_XXAA) || defined (DEVELOP_IN_NRF52820)
14602 if (var1 == 0x10)
14603 {
14604 switch(var2)
14605 {
14606 case 0x00ul:
14607 return false;
14608 case 0x01ul:
14609 return true;
14610 case 0x02ul:
14611 return true;
14612 case 0x03ul:
14613 return true;
14614 default:
14615 return true;
14616 }
14617 }
14618 #endif
14619 return false;
14620 #endif
14621 }
14622
14623 /* ========= Errata 273 ========= */
14624 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810) \
14625 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
14626 #define NRF52_ERRATA_273_PRESENT 1
14627 #else
14628 #define NRF52_ERRATA_273_PRESENT 0
14629 #endif
14630
14631 #ifndef NRF52_ERRATA_273_ENABLE_WORKAROUND
14632 #define NRF52_ERRATA_273_ENABLE_WORKAROUND NRF52_ERRATA_273_PRESENT
14633 #endif
14634
nrf52_errata_273(void)14635 static bool nrf52_errata_273(void)
14636 {
14637 #ifndef NRF52_SERIES
14638 return false;
14639 #else
14640 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)\
14641 || defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
14642 uint32_t var1 = *(uint32_t *)0x10000130ul;
14643 uint32_t var2 = *(uint32_t *)0x10000134ul;
14644 #endif
14645 #if defined (NRF52810_XXAA) || defined (DEVELOP_IN_NRF52810)
14646 if (var1 == 0x0A)
14647 {
14648 switch(var2)
14649 {
14650 case 0x00ul:
14651 return false;
14652 case 0x01ul:
14653 return true;
14654 case 0x02ul:
14655 return false;
14656 default:
14657 return false;
14658 }
14659 }
14660 #endif
14661 #if defined (NRF52811_XXAA) || defined (DEVELOP_IN_NRF52811)
14662 if (var1 == 0x0E)
14663 {
14664 switch(var2)
14665 {
14666 case 0x00ul:
14667 return true;
14668 case 0x01ul:
14669 return true;
14670 default:
14671 return true;
14672 }
14673 }
14674 #endif
14675 return false;
14676 #endif
14677 }
14678
14679 #endif /* NRF52_ERRATAS_H */
14680