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