aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/chips/nrf54lm20_app.rs
blob: c5fdf02e45804ab40f2b3c219c0bd5f0281be733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
/// Peripheral Access Crate
#[allow(unused_imports)]
#[rustfmt::skip]
pub mod pac {
    pub use nrf_pac::*;

    #[cfg(feature = "_ns")]
    #[doc(no_inline)]
    pub use nrf_pac::{
        FICR_NS as FICR,
        DPPIC00_NS as DPPIC00,
        PPIB00_NS as PPIB00,
        PPIB01_NS as PPIB01,
        AAR00_NS as AAR00,
        CCM00_NS as CCM00,
        ECB00_NS as ECB00,
        SPIM00_NS as SPIM00,
        SPIS00_NS as SPIS00,
        UARTE00_NS as UARTE00,
        VPR00_NS as VPR00,
        P2_NS as P2,
        CTRLAP_NS as CTRLAP,
        TAD_NS as TAD,
        TIMER00_NS as TIMER00,
        DPPIC10_NS as DPPIC10,
        PPIB10_NS as PPIB10,
        PPIB11_NS as PPIB11,
        TIMER10_NS as TIMER10,
        EGU10_NS as EGU10,
        RADIO_NS as RADIO,
        DPPIC20_NS as DPPIC20,
        PPIB20_NS as PPIB20,
        PPIB21_NS as PPIB21,
        PPIB22_NS as PPIB22,
        SPIM20_NS as SPIM20,
        SPIS20_NS as SPIS20,
        TWIM20_NS as TWIM20,
        TWIS20_NS as TWIS20,
        UARTE20_NS as UARTE20,
        SPIM21_NS as SPIM21,
        SPIS21_NS as SPIS21,
        TWIM21_NS as TWIM21,
        TWIS21_NS as TWIS21,
        UARTE21_NS as UARTE21,
        SPIM22_NS as SPIM22,
        SPIS22_NS as SPIS22,
        TWIM22_NS as TWIM22,
        TWIS22_NS as TWIS22,
        UARTE22_NS as UARTE22,
        EGU20_NS as EGU20,
        TIMER20_NS as TIMER20,
        TIMER21_NS as TIMER21,
        TIMER22_NS as TIMER22,
        TIMER23_NS as TIMER23,
        TIMER24_NS as TIMER24,
        MEMCONF_NS as MEMCONF,
        PDM20_NS as PDM20,
        PDM21_NS as PDM21,
        PWM20_NS as PWM20,
        PWM21_NS as PWM21,
        PWM22_NS as PWM22,
        SAADC_NS as SAADC,
        NFCT_NS as NFCT,
        TEMP_NS as TEMP,
        P1_NS as P1,
        GPIOTE20_NS as GPIOTE20,
        I2S20_NS as I2S20,
        QDEC20_NS as QDEC20,
        QDEC21_NS as QDEC21,
        GRTC_NS as GRTC,
        DPPIC30_NS as DPPIC30,
        PPIB30_NS as PPIB30,
        SPIM30_NS as SPIM30,
        SPIS30_NS as SPIS30,
        TWIM30_NS as TWIM30,
        TWIS30_NS as TWIS30,
        UARTE30_NS as UARTE30,
        COMP_NS as COMP,
        LPCOMP_NS as LPCOMP,
        WDT31_NS as WDT31,
        P0_NS as P0,
        GPIOTE30_NS as GPIOTE30,
        CLOCK_NS as CLOCK,
        POWER_NS as POWER,
        RESET_NS as RESET,
        OSCILLATORS_NS as OSCILLATORS,
        REGULATORS_NS as REGULATORS,
        TPIU_NS as TPIU,
        ETM_NS as ETM,
    };

    #[cfg(feature = "_s")]
    #[doc(no_inline)]
    pub use nrf_pac::{
        FICR_NS as FICR,
        SICR_S as SICR,
        ICACHEDATA_S as ICACHEDATA,
        ICACHEINFO_S as ICACHEINFO,
        SWI00_S as SWI00,
        SWI01_S as SWI01,
        SWI02_S as SWI02,
        SWI03_S as SWI03,
        SPU00_S as SPU00,
        MPC00_S as MPC00,
        DPPIC00_S as DPPIC00,
        PPIB00_S as PPIB00,
        PPIB01_S as PPIB01,
        KMU_S as KMU,
        AAR00_S as AAR00,
        CCM00_S as CCM00,
        ECB00_S as ECB00,
        CRACEN_S as CRACEN,
        SPIM00_S as SPIM00,
        SPIS00_S as SPIS00,
        UARTE00_S as UARTE00,
        GLITCHDET_S as GLITCHDET,
        RRAMC_S as RRAMC,
        VPR00_S as VPR00,
        P2_S as P2,
        CTRLAP_S as CTRLAP,
        TAD_S as TAD,
        TIMER00_S as TIMER00,
        SPU10_S as SPU10,
        DPPIC10_S as DPPIC10,
        PPIB10_S as PPIB10,
        PPIB11_S as PPIB11,
        TIMER10_S as TIMER10,
        EGU10_S as EGU10,
        RADIO_S as RADIO,
        SPU20_S as SPU20,
        DPPIC20_S as DPPIC20,
        PPIB20_S as PPIB20,
        PPIB21_S as PPIB21,
        PPIB22_S as PPIB22,
        SPIM20_S as SPIM20,
        SPIS20_S as SPIS20,
        TWIM20_S as TWIM20,
        TWIS20_S as TWIS20,
        UARTE20_S as UARTE20,
        SPIM21_S as SPIM21,
        SPIS21_S as SPIS21,
        TWIM21_S as TWIM21,
        TWIS21_S as TWIS21,
        UARTE21_S as UARTE21,
        SPIM22_S as SPIM22,
        SPIS22_S as SPIS22,
        TWIM22_S as TWIM22,
        TWIS22_S as TWIS22,
        UARTE22_S as UARTE22,
        EGU20_S as EGU20,
        TIMER20_S as TIMER20,
        TIMER21_S as TIMER21,
        TIMER22_S as TIMER22,
        TIMER23_S as TIMER23,
        TIMER24_S as TIMER24,
        MEMCONF_S as MEMCONF,
        PDM20_S as PDM20,
        PDM21_S as PDM21,
        PWM20_S as PWM20,
        PWM21_S as PWM21,
        PWM22_S as PWM22,
        SAADC_S as SAADC,
        NFCT_S as NFCT,
        TEMP_S as TEMP,
        P1_S as P1,
        GPIOTE20_S as GPIOTE20,
        TAMPC_S as TAMPC,
        QDEC20_S as QDEC20,
        QDEC21_S as QDEC21,
        GRTC_S as GRTC,
        SPU30_S as SPU30,
        DPPIC30_S as DPPIC30,
        PPIB30_S as PPIB30,
        SPIM30_S as SPIM30,
        SPIS30_S as SPIS30,
        TWIM30_S as TWIM30,
        TWIS30_S as TWIS30,
        UARTE30_S as UARTE30,
        COMP_S as COMP,
        LPCOMP_S as LPCOMP,
        WDT30_S as WDT30,
        WDT31_S as WDT31,
        P0_S as P0,
        GPIOTE30_S as GPIOTE30,
        CLOCK_S as CLOCK,
        POWER_S as POWER,
        RESET_S as RESET,
        OSCILLATORS_S as OSCILLATORS,
        REGULATORS_S as REGULATORS,
        CRACENCORE_S as CRACENCORE,
        CPUC_S as CPUC,
        ICACHE_S as ICACHE,
    };
}

/// The maximum buffer size that the EasyDMA can send/recv in one operation.
pub const EASY_DMA_SIZE: usize = (1 << 16) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 1024;

// 2 MB NVM
#[allow(unused)]
pub const FLASH_SIZE: usize = 2048 * 1024;

embassy_hal_internal::peripherals! {
    // PPI
    PPI00_CH0,
    PPI00_CH1,
    PPI00_CH2,
    PPI00_CH3,
    PPI00_CH4,
    PPI00_CH5,
    PPI00_CH6,
    PPI00_CH7,

    PPI10_CH0,
    PPI10_CH1,
    PPI10_CH2,
    PPI10_CH3,
    PPI10_CH4,
    PPI10_CH5,
    PPI10_CH6,
    PPI10_CH7,
    PPI10_CH8,
    PPI10_CH9,
    PPI10_CH10,
    PPI10_CH11,
    PPI10_CH12,
    PPI10_CH13,
    PPI10_CH14,
    PPI10_CH15,
    PPI10_CH16,
    PPI10_CH17,
    PPI10_CH18,
    PPI10_CH19,
    PPI10_CH20,
    PPI10_CH21,
    PPI10_CH22,
    PPI10_CH23,

    PPI20_CH0,
    PPI20_CH1,
    PPI20_CH2,
    PPI20_CH3,
    PPI20_CH4,
    PPI20_CH5,
    PPI20_CH6,
    PPI20_CH7,
    PPI20_CH8,
    PPI20_CH9,
    PPI20_CH10,
    PPI20_CH11,
    PPI20_CH12,
    PPI20_CH13,
    PPI20_CH14,
    PPI20_CH15,

    PPI30_CH0,
    PPI30_CH1,
    PPI30_CH2,
    PPI30_CH3,

    PPI00_GROUP0,
    PPI00_GROUP1,

    PPI10_GROUP0,
    PPI10_GROUP1,
    PPI10_GROUP2,
    PPI10_GROUP3,
    PPI10_GROUP4,
    PPI10_GROUP5,

    PPI20_GROUP0,
    PPI20_GROUP1,
    PPI20_GROUP2,
    PPI20_GROUP3,
    PPI20_GROUP4,
    PPI20_GROUP5,

    PPI30_GROUP0,
    PPI30_GROUP1,

    // PPI BRIDGE channels
    PPIB00_CH0,
    PPIB00_CH1,
    PPIB00_CH2,
    PPIB00_CH3,
    PPIB00_CH4,
    PPIB00_CH5,
    PPIB00_CH6,
    PPIB00_CH7,

    PPIB01_CH0,
    PPIB01_CH1,
    PPIB01_CH2,
    PPIB01_CH3,
    PPIB01_CH4,
    PPIB01_CH5,
    PPIB01_CH6,
    PPIB01_CH7,

    PPIB10_CH0,
    PPIB10_CH1,
    PPIB10_CH2,
    PPIB10_CH3,
    PPIB10_CH4,
    PPIB10_CH5,
    PPIB10_CH6,
    PPIB10_CH7,

    PPIB11_CH0,
    PPIB11_CH1,
    PPIB11_CH2,
    PPIB11_CH3,
    PPIB11_CH4,
    PPIB11_CH5,
    PPIB11_CH6,
    PPIB11_CH7,
    PPIB11_CH8,
    PPIB11_CH9,
    PPIB11_CH10,
    PPIB11_CH11,
    PPIB11_CH12,
    PPIB11_CH13,
    PPIB11_CH14,
    PPIB11_CH15,

    PPIB20_CH0,
    PPIB20_CH1,
    PPIB20_CH2,
    PPIB20_CH3,
    PPIB20_CH4,
    PPIB20_CH5,
    PPIB20_CH6,
    PPIB20_CH7,

    PPIB21_CH0,
    PPIB21_CH1,
    PPIB21_CH2,
    PPIB21_CH3,
    PPIB21_CH4,
    PPIB21_CH5,
    PPIB21_CH6,
    PPIB21_CH7,
    PPIB21_CH8,
    PPIB21_CH9,
    PPIB21_CH10,
    PPIB21_CH11,
    PPIB21_CH12,
    PPIB21_CH13,
    PPIB21_CH14,
    PPIB21_CH15,

    PPIB22_CH0,
    PPIB22_CH1,
    PPIB22_CH2,
    PPIB22_CH3,

    PPIB30_CH0,
    PPIB30_CH1,
    PPIB30_CH2,
    PPIB30_CH3,

    // Timers
    TIMER00,
    TIMER10,
    TIMER20,
    TIMER21,
    TIMER22,
    TIMER23,
    TIMER24,

    // GPIO port 0
    P0_00,
    P0_01,
    P0_02,
    P0_03,
    P0_04,
    P0_05,
    P0_06,
    P0_07,
    P0_08,
    P0_09,

    // GPIO port 1
    P1_00,
    P1_01,
    P1_02,
    P1_03,
    P1_04,
    P1_05,
    P1_06,
    P1_07,
    P1_08,
    P1_09,
    P1_10,
    P1_11,
    P1_12,
    P1_13,
    P1_14,
    P1_15,
    P1_16,
    P1_17,
    P1_18,
    P1_19,
    P1_20,
    P1_21,
    P1_22,
    P1_23,
    P1_24,
    P1_25,
    P1_26,
    P1_27,
    P1_28,
    P1_29,
    P1_30,
    P1_31,


    // GPIO port 2
    P2_00,
    P2_01,
    P2_02,
    P2_03,
    P2_04,
    P2_05,
    P2_06,
    P2_07,
    P2_08,
    P2_09,
    P2_10,

    // GPIO port 3
    P3_00,
    P3_01,
    P3_02,
    P3_03,
    P3_04,
    P3_05,
    P3_06,
    P3_07,
    P3_08,
    P3_09,
    P3_10,
    P3_11,
    P3_12,

    // GRTC
    GRTC_CH0,
    #[cfg(not(feature = "time-driver-grtc"))]
    GRTC_CH1,
    GRTC_CH2,
    GRTC_CH3,
    GRTC_CH4,
    GRTC_CH5,
    GRTC_CH6,
    GRTC_CH7,
    GRTC_CH8,
    GRTC_CH9,
    GRTC_CH10,
    GRTC_CH11,

    // PWM
    PWM20,
    PWM21,
    PWM22,

    // SERIAL
    SERIAL00,
    SERIAL20,
    SERIAL21,
    SERIAL22,
    SERIAL30,

    // SAADC
    SAADC,

    // RADIO
    RADIO,


    // GPIOTE instances
    GPIOTE20,
    GPIOTE30,

    // GPIOTE channels
    GPIOTE20_CH0,
    GPIOTE20_CH1,
    GPIOTE20_CH2,
    GPIOTE20_CH3,
    GPIOTE20_CH4,
    GPIOTE20_CH5,
    GPIOTE20_CH6,
    GPIOTE20_CH7,
    GPIOTE30_CH0,
    GPIOTE30_CH1,
    GPIOTE30_CH2,
    GPIOTE30_CH3,

    // CRACEN
    #[cfg(feature = "_s")]
    CRACEN,

    #[cfg(feature = "_s")]
    // RRAMC
    RRAMC,

    // TEMP
    TEMP,

    // WDT
    #[cfg(feature = "_ns")]
    WDT,
    #[cfg(feature = "_s")]
    WDT0,
    #[cfg(feature = "_s")]
    WDT1,
}

impl_pin!(P0_00, 0, 0);
impl_pin!(P0_01, 0, 1);
impl_pin!(P0_02, 0, 2);
impl_pin!(P0_03, 0, 3);
impl_pin!(P0_04, 0, 4);
impl_pin!(P0_05, 0, 5);
impl_pin!(P0_06, 0, 6);
impl_pin!(P0_07, 0, 7);
impl_pin!(P0_08, 0, 8);
impl_pin!(P0_09, 0, 9);

impl_pin!(P1_00, 1, 0);
impl_pin!(P1_01, 1, 1);
impl_pin!(P1_02, 1, 2);
impl_pin!(P1_03, 1, 3);
impl_pin!(P1_04, 1, 4);
impl_pin!(P1_05, 1, 5);
impl_pin!(P1_06, 1, 6);
impl_pin!(P1_07, 1, 7);
impl_pin!(P1_08, 1, 8);
impl_pin!(P1_09, 1, 9);
impl_pin!(P1_10, 1, 10);
impl_pin!(P1_11, 1, 11);
impl_pin!(P1_12, 1, 12);
impl_pin!(P1_13, 1, 13);
impl_pin!(P1_14, 1, 14);
impl_pin!(P1_15, 1, 15);
impl_pin!(P1_16, 1, 16);
impl_pin!(P1_17, 1, 17);
impl_pin!(P1_18, 1, 18);
impl_pin!(P1_19, 1, 19);
impl_pin!(P1_20, 1, 20);
impl_pin!(P1_21, 1, 21);
impl_pin!(P1_22, 1, 22);
impl_pin!(P1_23, 1, 23);
impl_pin!(P1_24, 1, 24);
impl_pin!(P1_25, 1, 25);
impl_pin!(P1_26, 1, 26);
impl_pin!(P1_27, 1, 27);
impl_pin!(P1_28, 1, 28);
impl_pin!(P1_29, 1, 29);
impl_pin!(P1_30, 1, 30);
impl_pin!(P1_31, 1, 31);

impl_pin!(P2_00, 2, 0);
impl_pin!(P2_01, 2, 1);
impl_pin!(P2_02, 2, 2);
impl_pin!(P2_03, 2, 3);
impl_pin!(P2_04, 2, 4);
impl_pin!(P2_05, 2, 5);
impl_pin!(P2_06, 2, 6);
impl_pin!(P2_07, 2, 7);
impl_pin!(P2_08, 2, 8);
impl_pin!(P2_09, 2, 9);
impl_pin!(P2_10, 2, 10);

impl_pin!(P3_00, 3, 0);
impl_pin!(P3_01, 3, 1);
impl_pin!(P3_02, 3, 2);
impl_pin!(P3_03, 3, 3);
impl_pin!(P3_04, 3, 4);
impl_pin!(P3_05, 3, 5);
impl_pin!(P3_06, 3, 6);
impl_pin!(P3_07, 3, 7);
impl_pin!(P3_08, 3, 8);
impl_pin!(P3_09, 3, 9);
impl_pin!(P3_10, 3, 10);
impl_pin!(P3_11, 3, 11);
impl_pin!(P3_12, 3, 12);

cfg_if::cfg_if! {
    if #[cfg(feature = "gpiote")] {
        impl_gpiote_pin!(P0_00, GPIOTE30);
        impl_gpiote_pin!(P0_01, GPIOTE30);
        impl_gpiote_pin!(P0_02, GPIOTE30);
        impl_gpiote_pin!(P0_03, GPIOTE30);
        impl_gpiote_pin!(P0_04, GPIOTE30);
        impl_gpiote_pin!(P0_05, GPIOTE30);
        impl_gpiote_pin!(P0_06, GPIOTE30);
        impl_gpiote_pin!(P0_07, GPIOTE30);
        impl_gpiote_pin!(P0_08, GPIOTE30);
        impl_gpiote_pin!(P0_09, GPIOTE30);

        impl_gpiote_pin!(P1_00, GPIOTE20);
        impl_gpiote_pin!(P1_01, GPIOTE20);
        impl_gpiote_pin!(P1_02, GPIOTE20);
        impl_gpiote_pin!(P1_03, GPIOTE20);
        impl_gpiote_pin!(P1_04, GPIOTE20);
        impl_gpiote_pin!(P1_05, GPIOTE20);
        impl_gpiote_pin!(P1_06, GPIOTE20);
        impl_gpiote_pin!(P1_07, GPIOTE20);
        impl_gpiote_pin!(P1_08, GPIOTE20);
        impl_gpiote_pin!(P1_09, GPIOTE20);
        impl_gpiote_pin!(P1_10, GPIOTE20);
        impl_gpiote_pin!(P1_11, GPIOTE20);
        impl_gpiote_pin!(P1_12, GPIOTE20);
        impl_gpiote_pin!(P1_13, GPIOTE20);
        impl_gpiote_pin!(P1_14, GPIOTE20);
        impl_gpiote_pin!(P1_15, GPIOTE20);
        impl_gpiote_pin!(P1_16, GPIOTE20);
        impl_gpiote_pin!(P1_17, GPIOTE20);
        impl_gpiote_pin!(P1_18, GPIOTE20);
        impl_gpiote_pin!(P1_19, GPIOTE20);
        impl_gpiote_pin!(P1_20, GPIOTE20);
        impl_gpiote_pin!(P1_21, GPIOTE20);
        impl_gpiote_pin!(P1_22, GPIOTE20);
        impl_gpiote_pin!(P1_23, GPIOTE20);
        impl_gpiote_pin!(P1_24, GPIOTE20);
        impl_gpiote_pin!(P1_25, GPIOTE20);
        impl_gpiote_pin!(P1_26, GPIOTE20);
        impl_gpiote_pin!(P1_27, GPIOTE20);
        impl_gpiote_pin!(P1_28, GPIOTE20);
        impl_gpiote_pin!(P1_29, GPIOTE20);
        impl_gpiote_pin!(P1_30, GPIOTE20);
        impl_gpiote_pin!(P1_31, GPIOTE20);

        impl_gpiote_pin!(P3_00, GPIOTE20);
        impl_gpiote_pin!(P3_01, GPIOTE20);
        impl_gpiote_pin!(P3_02, GPIOTE20);
        impl_gpiote_pin!(P3_03, GPIOTE20);
        impl_gpiote_pin!(P3_04, GPIOTE20);
        impl_gpiote_pin!(P3_05, GPIOTE20);
        impl_gpiote_pin!(P3_06, GPIOTE20);
        impl_gpiote_pin!(P3_07, GPIOTE20);
        impl_gpiote_pin!(P3_08, GPIOTE20);
        impl_gpiote_pin!(P3_09, GPIOTE20);
        impl_gpiote_pin!(P3_10, GPIOTE20);
        impl_gpiote_pin!(P3_11, GPIOTE20);
        impl_gpiote_pin!(P3_12, GPIOTE20);
    }
}

#[cfg(feature = "_ns")]
impl_wdt!(WDT, WDT31, WDT31, 0);
#[cfg(feature = "_s")]
impl_wdt!(WDT0, WDT31, WDT31, 0);
#[cfg(feature = "_s")]
impl_wdt!(WDT1, WDT30, WDT30, 1);
// DPPI00 channels
impl_ppi_channel!(PPI00_CH0, DPPIC00, 0 => configurable);
impl_ppi_channel!(PPI00_CH1, DPPIC00, 1 => configurable);
impl_ppi_channel!(PPI00_CH2, DPPIC00, 2 => configurable);
impl_ppi_channel!(PPI00_CH3, DPPIC00, 3 => configurable);
impl_ppi_channel!(PPI00_CH4, DPPIC00, 4 => configurable);
impl_ppi_channel!(PPI00_CH5, DPPIC00, 5 => configurable);
impl_ppi_channel!(PPI00_CH6, DPPIC00, 6 => configurable);
impl_ppi_channel!(PPI00_CH7, DPPIC00, 7 => configurable);

// DPPI10 channels
impl_ppi_channel!(PPI10_CH0, DPPIC10, 0 => static);

// DPPI20 channels
impl_ppi_channel!(PPI20_CH0, DPPIC20, 0 => configurable);
impl_ppi_channel!(PPI20_CH1, DPPIC20, 1 => configurable);
impl_ppi_channel!(PPI20_CH2, DPPIC20, 2 => configurable);
impl_ppi_channel!(PPI20_CH3, DPPIC20, 3 => configurable);
impl_ppi_channel!(PPI20_CH4, DPPIC20, 4 => configurable);
impl_ppi_channel!(PPI20_CH5, DPPIC20, 5 => configurable);
impl_ppi_channel!(PPI20_CH6, DPPIC20, 6 => configurable);
impl_ppi_channel!(PPI20_CH7, DPPIC20, 7 => configurable);
impl_ppi_channel!(PPI20_CH8, DPPIC20, 8 => configurable);
impl_ppi_channel!(PPI20_CH9, DPPIC20, 9 => configurable);
impl_ppi_channel!(PPI20_CH10, DPPIC20, 10 => configurable);
impl_ppi_channel!(PPI20_CH11, DPPIC20, 11 => configurable);
impl_ppi_channel!(PPI20_CH12, DPPIC20, 12 => configurable);
impl_ppi_channel!(PPI20_CH13, DPPIC20, 13 => configurable);
impl_ppi_channel!(PPI20_CH14, DPPIC20, 14 => configurable);
impl_ppi_channel!(PPI20_CH15, DPPIC20, 15 => configurable);

// DPPI30 channels
impl_ppi_channel!(PPI30_CH0, DPPIC30, 0 => configurable);
impl_ppi_channel!(PPI30_CH1, DPPIC30, 1 => configurable);
impl_ppi_channel!(PPI30_CH2, DPPIC30, 2 => configurable);
impl_ppi_channel!(PPI30_CH3, DPPIC30, 3 => configurable);

// DPPI00 groups
impl_ppi_group!(PPI00_GROUP0, DPPIC00, 0);
impl_ppi_group!(PPI00_GROUP1, DPPIC00, 1);

// DPPI10 groups
impl_ppi_group!(PPI10_GROUP0, DPPIC10, 0);

// DPPI20 groups
impl_ppi_group!(PPI20_GROUP0, DPPIC20, 0);
impl_ppi_group!(PPI20_GROUP1, DPPIC20, 1);
impl_ppi_group!(PPI20_GROUP2, DPPIC20, 2);
impl_ppi_group!(PPI20_GROUP3, DPPIC20, 3);
impl_ppi_group!(PPI20_GROUP4, DPPIC20, 4);
impl_ppi_group!(PPI20_GROUP5, DPPIC20, 5);

// DPPI30 groups
impl_ppi_group!(PPI30_GROUP0, DPPIC30, 0);
impl_ppi_group!(PPI30_GROUP1, DPPIC30, 1);

impl_timer!(TIMER00, TIMER00, TIMER00);
impl_timer!(TIMER10, TIMER10, TIMER10);
impl_timer!(TIMER20, TIMER20, TIMER20);
impl_timer!(TIMER21, TIMER21, TIMER21);
impl_timer!(TIMER22, TIMER22, TIMER22);
impl_timer!(TIMER23, TIMER23, TIMER23);
impl_timer!(TIMER24, TIMER24, TIMER24);

impl_twim!(SERIAL20, TWIM20, SERIAL20);
impl_twim!(SERIAL21, TWIM21, SERIAL21);
impl_twim!(SERIAL22, TWIM22, SERIAL22);
impl_twim!(SERIAL30, TWIM30, SERIAL30);

impl_twis!(SERIAL20, TWIS20, SERIAL20);
impl_twis!(SERIAL21, TWIS21, SERIAL21);
impl_twis!(SERIAL22, TWIS22, SERIAL22);
impl_twis!(SERIAL30, TWIS30, SERIAL30);

impl_pwm!(PWM20, PWM20, PWM20);
impl_pwm!(PWM21, PWM21, PWM21);
impl_pwm!(PWM22, PWM22, PWM22);

#[cfg(feature = "_s")]
impl_spim!(
    SERIAL00,
    SPIM00,
    SERIAL00,
    match pac::OSCILLATORS_S.pll().currentfreq().read().currentfreq() {
        pac::oscillators::vals::Currentfreq::CK128M => 128_000_000,
        pac::oscillators::vals::Currentfreq::CK64M => 64_000_000,
        _ => unreachable!(),
    }
);
#[cfg(feature = "_ns")]
impl_spim!(
    SERIAL00,
    SPIM00,
    SERIAL00,
    match pac::OSCILLATORS_NS.pll().currentfreq().read().currentfreq() {
        pac::oscillators::vals::Currentfreq::CK128M => 128_000_000,
        pac::oscillators::vals::Currentfreq::CK64M => 64_000_000,
        _ => unreachable!(),
    }
);
impl_spim!(SERIAL20, SPIM20, SERIAL20, 16_000_000);
impl_spim!(SERIAL21, SPIM21, SERIAL21, 16_000_000);
impl_spim!(SERIAL22, SPIM22, SERIAL22, 16_000_000);
impl_spim!(SERIAL30, SPIM30, SERIAL30, 16_000_000);

impl_spis!(SERIAL20, SPIS20, SERIAL20);
impl_spis!(SERIAL21, SPIS21, SERIAL21);
impl_spis!(SERIAL22, SPIS22, SERIAL22);
impl_spis!(SERIAL30, SPIS30, SERIAL30);

impl_uarte!(SERIAL00, UARTE00, SERIAL00);
impl_uarte!(SERIAL20, UARTE20, SERIAL20);
impl_uarte!(SERIAL21, UARTE21, SERIAL21);
impl_uarte!(SERIAL22, UARTE22, SERIAL22);
impl_uarte!(SERIAL30, UARTE30, SERIAL30);

// NB: SAADC uses "pin" abstraction, not "AIN"
impl_saadc_input!(P1_04, 1, 4);
impl_saadc_input!(P1_05, 1, 5);
impl_saadc_input!(P1_06, 1, 6);
impl_saadc_input!(P1_07, 1, 7);
impl_saadc_input!(P1_11, 1, 11);
impl_saadc_input!(P1_12, 1, 12);
impl_saadc_input!(P1_13, 1, 13);
impl_saadc_input!(P1_14, 1, 14);

#[cfg(feature = "_s")]
impl_cracen!(CRACEN, CRACEN, CRACEN);

embassy_hal_internal::interrupt_mod!(
    SWI00,
    SWI01,
    SWI02,
    SWI03,
    SPU00,
    MPC00,
    AAR00_CCM00,
    ECB00,
    CRACEN,
    SERIAL00,
    RRAMC,
    VPR00,
    CTRLAP,
    TIMER00,
    SPU10,
    TIMER10,
    EGU10,
    RADIO_0,
    RADIO_1,
    SPU20,
    SERIAL20,
    SERIAL21,
    SERIAL22,
    EGU20,
    TIMER20,
    TIMER21,
    TIMER22,
    TIMER23,
    TIMER24,
    PDM20,
    PDM21,
    PWM20,
    PWM21,
    PWM22,
    SAADC,
    NFCT,
    TEMP,
    GPIOTE20_0,
    GPIOTE20_1,
    TAMPC,
    QDEC20,
    QDEC21,
    GRTC_0,
    GRTC_1,
    GRTC_2,
    GRTC_3,
    SPU30,
    SERIAL30,
    COMP_LPCOMP,
    WDT30,
    WDT31,
    GPIOTE30_0,
    GPIOTE30_1,
    CLOCK_POWER,
);