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