This repository has been archived by the owner on Mar 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlib.rs
1658 lines (1658 loc) · 41.6 KB
/
lib.rs
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
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#![doc = "Peripheral access API for STM32F103XX microcontrollers (generated using svd2rust v0.13.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.13.0/svd2rust/#peripheral-api"]
#![deny(missing_docs)]
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![no_std]
extern crate bare_metal;
extern crate cortex_m;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
extern crate vcell;
use core::marker::PhantomData;
use core::ops::Deref;
#[doc = r" Number available in the NVIC for configuring priority"]
pub const NVIC_PRIO_BITS: u8 = 4;
#[cfg(feature = "rt")]
extern "C" {
fn WWDG();
fn PVD();
fn TAMPER();
fn RTC();
fn FLASH();
fn RCC();
fn EXTI0();
fn EXTI1();
fn EXTI2();
fn EXTI3();
fn EXTI4();
fn DMA1_CHANNEL1();
fn DMA1_CHANNEL2();
fn DMA1_CHANNEL3();
fn DMA1_CHANNEL4();
fn DMA1_CHANNEL5();
fn DMA1_CHANNEL6();
fn DMA1_CHANNEL7();
fn ADC();
fn CAN1_TX();
fn CAN1_RX0();
fn CAN1_RX1();
fn CAN1_SCE();
fn EXTI9_5();
fn TIM1_BRK_TIM9();
fn TIM1_UP_TIM10();
fn TIM1_TRG_COM_TIM11();
fn TIM1_CC();
fn TIM2();
fn TIM3();
fn TIM4();
fn I2C1_EV();
fn I2C1_ER();
fn I2C2_EV();
fn I2C2_ER();
fn SPI1();
fn SPI2();
fn USART1();
fn USART2();
fn USART3();
fn EXTI15_10();
fn RTCALARM();
fn USB_FS_WKUP();
fn TIM8_BRK_TIM12();
fn TIM8_UP_TIM13();
fn TIM8_TRG_COM_TIM14();
fn TIM8_CC();
fn ADC3();
fn FSMC();
fn SDIO();
fn TIM5();
fn SPI3();
fn UART4();
fn UART5();
fn TIM6();
fn TIM7();
fn DMA2_CHANNEL1();
fn DMA2_CHANNEL2();
fn DMA2_CHANNEL3();
fn DMA2_CHANNEL4_5();
}
#[doc(hidden)]
pub union Vector {
_handler: unsafe extern "C" fn(),
_reserved: u32,
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 60] = [
Vector { _handler: WWDG },
Vector { _handler: PVD },
Vector { _handler: TAMPER },
Vector { _handler: RTC },
Vector { _handler: FLASH },
Vector { _handler: RCC },
Vector { _handler: EXTI0 },
Vector { _handler: EXTI1 },
Vector { _handler: EXTI2 },
Vector { _handler: EXTI3 },
Vector { _handler: EXTI4 },
Vector {
_handler: DMA1_CHANNEL1,
},
Vector {
_handler: DMA1_CHANNEL2,
},
Vector {
_handler: DMA1_CHANNEL3,
},
Vector {
_handler: DMA1_CHANNEL4,
},
Vector {
_handler: DMA1_CHANNEL5,
},
Vector {
_handler: DMA1_CHANNEL6,
},
Vector {
_handler: DMA1_CHANNEL7,
},
Vector { _handler: ADC },
Vector { _handler: CAN1_TX },
Vector { _handler: CAN1_RX0 },
Vector { _handler: CAN1_RX1 },
Vector { _handler: CAN1_SCE },
Vector { _handler: EXTI9_5 },
Vector {
_handler: TIM1_BRK_TIM9,
},
Vector {
_handler: TIM1_UP_TIM10,
},
Vector {
_handler: TIM1_TRG_COM_TIM11,
},
Vector { _handler: TIM1_CC },
Vector { _handler: TIM2 },
Vector { _handler: TIM3 },
Vector { _handler: TIM4 },
Vector { _handler: I2C1_EV },
Vector { _handler: I2C1_ER },
Vector { _handler: I2C2_EV },
Vector { _handler: I2C2_ER },
Vector { _handler: SPI1 },
Vector { _handler: SPI2 },
Vector { _handler: USART1 },
Vector { _handler: USART2 },
Vector { _handler: USART3 },
Vector {
_handler: EXTI15_10,
},
Vector { _handler: RTCALARM },
Vector {
_handler: USB_FS_WKUP,
},
Vector {
_handler: TIM8_BRK_TIM12,
},
Vector {
_handler: TIM8_UP_TIM13,
},
Vector {
_handler: TIM8_TRG_COM_TIM14,
},
Vector { _handler: TIM8_CC },
Vector { _handler: ADC3 },
Vector { _handler: FSMC },
Vector { _handler: SDIO },
Vector { _handler: TIM5 },
Vector { _handler: SPI3 },
Vector { _handler: UART4 },
Vector { _handler: UART5 },
Vector { _handler: TIM6 },
Vector { _handler: TIM7 },
Vector {
_handler: DMA2_CHANNEL1,
},
Vector {
_handler: DMA2_CHANNEL2,
},
Vector {
_handler: DMA2_CHANNEL3,
},
Vector {
_handler: DMA2_CHANNEL4_5,
},
];
#[doc = r" Macro to override a device specific interrupt handler"]
#[doc = r""]
#[doc = r" # Syntax"]
#[doc = r""]
#[doc = r" ``` ignore"]
#[doc = r" interrupt!("]
#[doc = r" // Name of the interrupt"]
#[doc = r" $Name:ident,"]
#[doc = r""]
#[doc = r" // Path to the interrupt handler (a function)"]
#[doc = r" $handler:path,"]
#[doc = r""]
#[doc = r" // Optional, state preserved across invocations of the handler"]
#[doc = r" state: $State:ty = $initial_state:expr,"]
#[doc = r" );"]
#[doc = r" ```"]
#[doc = r""]
#[doc = r" Where `$Name` must match the name of one of the variants of the `Interrupt`"]
#[doc = r" enum."]
#[doc = r""]
#[doc = r" The handler must have signature `fn()` is no state was associated to it;"]
#[doc = r" otherwise its signature must be `fn(&mut $State)`."]
#[cfg(feature = "rt")]
#[macro_export]
macro_rules! interrupt {
($Name:ident, $handler:path,state: $State:ty = $initial_state:expr) => {
#[allow(unsafe_code)]
#[deny(private_no_mangle_fns)]
#[no_mangle]
pub unsafe extern "C" fn $Name() {
static mut STATE: $State = $initial_state;
let _ = $crate::Interrupt::$Name;
let f: fn(&mut $State) = $handler;
f(&mut STATE)
}
};
($Name:ident, $handler:path) => {
#[allow(unsafe_code)]
#[deny(private_no_mangle_fns)]
#[no_mangle]
pub unsafe extern "C" fn $Name() {
let _ = $crate::Interrupt::$Name;
let f: fn() = $handler;
f()
}
};
}
#[doc = r" Enumeration of all the interrupts"]
pub enum Interrupt {
#[doc = "0 - Window Watchdog interrupt"]
WWDG,
#[doc = "1 - PVD through EXTI line detection interrupt"]
PVD,
#[doc = "2 - Tamper interrupt"]
TAMPER,
#[doc = "3 - RTC global interrupt"]
RTC,
#[doc = "4 - Flash global interrupt"]
FLASH,
#[doc = "5 - RCC global interrupt"]
RCC,
#[doc = "6 - EXTI Line0 interrupt"]
EXTI0,
#[doc = "7 - EXTI Line1 interrupt"]
EXTI1,
#[doc = "8 - EXTI Line2 interrupt"]
EXTI2,
#[doc = "9 - EXTI Line3 interrupt"]
EXTI3,
#[doc = "10 - EXTI Line4 interrupt"]
EXTI4,
#[doc = "11 - DMA1 Channel1 global interrupt"]
DMA1_CHANNEL1,
#[doc = "12 - DMA1 Channel2 global interrupt"]
DMA1_CHANNEL2,
#[doc = "13 - DMA1 Channel3 global interrupt"]
DMA1_CHANNEL3,
#[doc = "14 - DMA1 Channel4 global interrupt"]
DMA1_CHANNEL4,
#[doc = "15 - DMA1 Channel5 global interrupt"]
DMA1_CHANNEL5,
#[doc = "16 - DMA1 Channel6 global interrupt"]
DMA1_CHANNEL6,
#[doc = "17 - DMA1 Channel7 global interrupt"]
DMA1_CHANNEL7,
#[doc = "18 - ADC2 global interrupt"]
ADC,
#[doc = "19 - CAN1 TX interrupts"]
CAN1_TX,
#[doc = "20 - CAN1 RX0 interrupts"]
CAN1_RX0,
#[doc = "21 - CAN1 RX1 interrupt"]
CAN1_RX1,
#[doc = "22 - CAN1 SCE interrupt"]
CAN1_SCE,
#[doc = "23 - EXTI Line[9:5] interrupts"]
EXTI9_5,
#[doc = "24 - TIM1 Break interrupt and TIM9 global interrupt"]
TIM1_BRK_TIM9,
#[doc = "25 - TIM1 Update interrupt and TIM10 global interrupt"]
TIM1_UP_TIM10,
#[doc = "26 - TIM1 Trigger and Commutation interrupts and TIM11 global interrupt"]
TIM1_TRG_COM_TIM11,
#[doc = "27 - TIM1 Capture Compare interrupt"]
TIM1_CC,
#[doc = "28 - TIM2 global interrupt"]
TIM2,
#[doc = "29 - TIM3 global interrupt"]
TIM3,
#[doc = "30 - TIM4 global interrupt"]
TIM4,
#[doc = "31 - I2C1 event interrupt"]
I2C1_EV,
#[doc = "32 - I2C1 error interrupt"]
I2C1_ER,
#[doc = "33 - I2C2 event interrupt"]
I2C2_EV,
#[doc = "34 - I2C2 error interrupt"]
I2C2_ER,
#[doc = "35 - SPI1 global interrupt"]
SPI1,
#[doc = "36 - SPI2 global interrupt"]
SPI2,
#[doc = "37 - USART1 global interrupt"]
USART1,
#[doc = "38 - USART2 global interrupt"]
USART2,
#[doc = "39 - USART3 global interrupt"]
USART3,
#[doc = "40 - EXTI Line[15:10] interrupts"]
EXTI15_10,
#[doc = "41 - RTC Alarms through EXTI line interrupt"]
RTCALARM,
#[doc = "42 - USB Device FS Wakeup through EXTI line interrupt"]
USB_FS_WKUP,
#[doc = "43 - TIM8 Break interrupt and TIM12 global interrupt"]
TIM8_BRK_TIM12,
#[doc = "44 - TIM8 Update interrupt and TIM13 global interrupt"]
TIM8_UP_TIM13,
#[doc = "45 - TIM8 Trigger and Commutation interrupts and TIM14 global interrupt"]
TIM8_TRG_COM_TIM14,
#[doc = "46 - TIM8 Capture Compare interrupt"]
TIM8_CC,
#[doc = "47 - ADC3 global interrupt"]
ADC3,
#[doc = "48 - FSMC global interrupt"]
FSMC,
#[doc = "49 - SDIO global interrupt"]
SDIO,
#[doc = "50 - TIM5 global interrupt"]
TIM5,
#[doc = "51 - SPI3 global interrupt"]
SPI3,
#[doc = "52 - UART4 global interrupt"]
UART4,
#[doc = "53 - UART5 global interrupt"]
UART5,
#[doc = "54 - TIM6 global interrupt"]
TIM6,
#[doc = "55 - TIM7 global interrupt"]
TIM7,
#[doc = "56 - DMA2 Channel1 global interrupt"]
DMA2_CHANNEL1,
#[doc = "57 - DMA2 Channel2 global interrupt"]
DMA2_CHANNEL2,
#[doc = "58 - DMA2 Channel3 global interrupt"]
DMA2_CHANNEL3,
#[doc = "59 - DMA2 Channel4 and DMA2 Channel5 global interrupt"]
DMA2_CHANNEL4_5,
}
unsafe impl ::bare_metal::Nr for Interrupt {
#[inline]
fn nr(&self) -> u8 {
match *self {
Interrupt::WWDG => 0,
Interrupt::PVD => 1,
Interrupt::TAMPER => 2,
Interrupt::RTC => 3,
Interrupt::FLASH => 4,
Interrupt::RCC => 5,
Interrupt::EXTI0 => 6,
Interrupt::EXTI1 => 7,
Interrupt::EXTI2 => 8,
Interrupt::EXTI3 => 9,
Interrupt::EXTI4 => 10,
Interrupt::DMA1_CHANNEL1 => 11,
Interrupt::DMA1_CHANNEL2 => 12,
Interrupt::DMA1_CHANNEL3 => 13,
Interrupt::DMA1_CHANNEL4 => 14,
Interrupt::DMA1_CHANNEL5 => 15,
Interrupt::DMA1_CHANNEL6 => 16,
Interrupt::DMA1_CHANNEL7 => 17,
Interrupt::ADC => 18,
Interrupt::CAN1_TX => 19,
Interrupt::CAN1_RX0 => 20,
Interrupt::CAN1_RX1 => 21,
Interrupt::CAN1_SCE => 22,
Interrupt::EXTI9_5 => 23,
Interrupt::TIM1_BRK_TIM9 => 24,
Interrupt::TIM1_UP_TIM10 => 25,
Interrupt::TIM1_TRG_COM_TIM11 => 26,
Interrupt::TIM1_CC => 27,
Interrupt::TIM2 => 28,
Interrupt::TIM3 => 29,
Interrupt::TIM4 => 30,
Interrupt::I2C1_EV => 31,
Interrupt::I2C1_ER => 32,
Interrupt::I2C2_EV => 33,
Interrupt::I2C2_ER => 34,
Interrupt::SPI1 => 35,
Interrupt::SPI2 => 36,
Interrupt::USART1 => 37,
Interrupt::USART2 => 38,
Interrupt::USART3 => 39,
Interrupt::EXTI15_10 => 40,
Interrupt::RTCALARM => 41,
Interrupt::USB_FS_WKUP => 42,
Interrupt::TIM8_BRK_TIM12 => 43,
Interrupt::TIM8_UP_TIM13 => 44,
Interrupt::TIM8_TRG_COM_TIM14 => 45,
Interrupt::TIM8_CC => 46,
Interrupt::ADC3 => 47,
Interrupt::FSMC => 48,
Interrupt::SDIO => 49,
Interrupt::TIM5 => 50,
Interrupt::SPI3 => 51,
Interrupt::UART4 => 52,
Interrupt::UART5 => 53,
Interrupt::TIM6 => 54,
Interrupt::TIM7 => 55,
Interrupt::DMA2_CHANNEL1 => 56,
Interrupt::DMA2_CHANNEL2 => 57,
Interrupt::DMA2_CHANNEL3 => 58,
Interrupt::DMA2_CHANNEL4_5 => 59,
}
}
}
#[doc(hidden)]
pub mod interrupt;
pub use cortex_m::peripheral::Peripherals as CorePeripherals;
pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
#[doc = "Flexible static memory controller"]
pub struct FSMC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FSMC {}
impl FSMC {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const fsmc::RegisterBlock {
2684354560 as *const _
}
}
impl Deref for FSMC {
type Target = fsmc::RegisterBlock;
fn deref(&self) -> &fsmc::RegisterBlock {
unsafe { &*FSMC::ptr() }
}
}
#[doc = "Flexible static memory controller"]
pub mod fsmc;
#[doc = "Power control"]
pub struct PWR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PWR {}
impl PWR {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const pwr::RegisterBlock {
1073770496 as *const _
}
}
impl Deref for PWR {
type Target = pwr::RegisterBlock;
fn deref(&self) -> &pwr::RegisterBlock {
unsafe { &*PWR::ptr() }
}
}
#[doc = "Power control"]
pub mod pwr;
#[doc = "Reset and clock control"]
pub struct RCC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RCC {}
impl RCC {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const rcc::RegisterBlock {
1073876992 as *const _
}
}
impl Deref for RCC {
type Target = rcc::RegisterBlock;
fn deref(&self) -> &rcc::RegisterBlock {
unsafe { &*RCC::ptr() }
}
}
#[doc = "Reset and clock control"]
pub mod rcc;
#[doc = "General purpose I/O"]
pub struct GPIOA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOA {}
impl GPIOA {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073809408 as *const _
}
}
impl Deref for GPIOA {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOA::ptr() }
}
}
#[doc = "General purpose I/O"]
pub mod gpioa;
#[doc = "GPIOB"]
pub struct GPIOB {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOB {}
impl GPIOB {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073810432 as *const _
}
}
impl Deref for GPIOB {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOB::ptr() }
}
}
#[doc = "GPIOC"]
pub struct GPIOC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOC {}
impl GPIOC {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073811456 as *const _
}
}
impl Deref for GPIOC {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOC::ptr() }
}
}
#[doc = "GPIOD"]
pub struct GPIOD {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOD {}
impl GPIOD {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073812480 as *const _
}
}
impl Deref for GPIOD {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOD::ptr() }
}
}
#[doc = "GPIOE"]
pub struct GPIOE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOE {}
impl GPIOE {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073813504 as *const _
}
}
impl Deref for GPIOE {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOE::ptr() }
}
}
#[doc = "GPIOF"]
pub struct GPIOF {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOF {}
impl GPIOF {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073814528 as *const _
}
}
impl Deref for GPIOF {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOF::ptr() }
}
}
#[doc = "GPIOG"]
pub struct GPIOG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOG {}
impl GPIOG {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const gpioa::RegisterBlock {
1073815552 as *const _
}
}
impl Deref for GPIOG {
type Target = gpioa::RegisterBlock;
fn deref(&self) -> &gpioa::RegisterBlock {
unsafe { &*GPIOG::ptr() }
}
}
#[doc = "Alternate function I/O"]
pub struct AFIO {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for AFIO {}
impl AFIO {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const afio::RegisterBlock {
1073807360 as *const _
}
}
impl Deref for AFIO {
type Target = afio::RegisterBlock;
fn deref(&self) -> &afio::RegisterBlock {
unsafe { &*AFIO::ptr() }
}
}
#[doc = "Alternate function I/O"]
pub mod afio;
#[doc = "EXTI"]
pub struct EXTI {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for EXTI {}
impl EXTI {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const exti::RegisterBlock {
1073808384 as *const _
}
}
impl Deref for EXTI {
type Target = exti::RegisterBlock;
fn deref(&self) -> &exti::RegisterBlock {
unsafe { &*EXTI::ptr() }
}
}
#[doc = "EXTI"]
pub mod exti;
#[doc = "DMA controller"]
pub struct DMA1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA1 {}
impl DMA1 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const dma1::RegisterBlock {
1073872896 as *const _
}
}
impl Deref for DMA1 {
type Target = dma1::RegisterBlock;
fn deref(&self) -> &dma1::RegisterBlock {
unsafe { &*DMA1::ptr() }
}
}
#[doc = "DMA controller"]
pub mod dma1;
#[doc = "DMA2"]
pub struct DMA2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA2 {}
impl DMA2 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const dma1::RegisterBlock {
1073873920 as *const _
}
}
impl Deref for DMA2 {
type Target = dma1::RegisterBlock;
fn deref(&self) -> &dma1::RegisterBlock {
unsafe { &*DMA2::ptr() }
}
}
#[doc = "Secure digital input/output interface"]
pub struct SDIO {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SDIO {}
impl SDIO {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const sdio::RegisterBlock {
1073840128 as *const _
}
}
impl Deref for SDIO {
type Target = sdio::RegisterBlock;
fn deref(&self) -> &sdio::RegisterBlock {
unsafe { &*SDIO::ptr() }
}
}
#[doc = "Secure digital input/output interface"]
pub mod sdio;
#[doc = "Real time clock"]
pub struct RTC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RTC {}
impl RTC {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const rtc::RegisterBlock {
1073752064 as *const _
}
}
impl Deref for RTC {
type Target = rtc::RegisterBlock;
fn deref(&self) -> &rtc::RegisterBlock {
unsafe { &*RTC::ptr() }
}
}
#[doc = "Real time clock"]
pub mod rtc;
#[doc = "Backup registers"]
pub struct BKP {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for BKP {}
impl BKP {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const bkp::RegisterBlock {
1073769476 as *const _
}
}
impl Deref for BKP {
type Target = bkp::RegisterBlock;
fn deref(&self) -> &bkp::RegisterBlock {
unsafe { &*BKP::ptr() }
}
}
#[doc = "Backup registers"]
pub mod bkp;
#[doc = "Independent watchdog"]
pub struct IWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for IWDG {}
impl IWDG {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const iwdg::RegisterBlock {
1073754112 as *const _
}
}
impl Deref for IWDG {
type Target = iwdg::RegisterBlock;
fn deref(&self) -> &iwdg::RegisterBlock {
unsafe { &*IWDG::ptr() }
}
}
#[doc = "Independent watchdog"]
pub mod iwdg;
#[doc = "Window watchdog"]
pub struct WWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WWDG {}
impl WWDG {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const wwdg::RegisterBlock {
1073753088 as *const _
}
}
impl Deref for WWDG {
type Target = wwdg::RegisterBlock;
fn deref(&self) -> &wwdg::RegisterBlock {
unsafe { &*WWDG::ptr() }
}
}
#[doc = "Window watchdog"]
pub mod wwdg;
#[doc = "Advanced timer"]
pub struct TIM1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM1 {}
impl TIM1 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim1::RegisterBlock {
1073818624 as *const _
}
}
impl Deref for TIM1 {
type Target = tim1::RegisterBlock;
fn deref(&self) -> &tim1::RegisterBlock {
unsafe { &*TIM1::ptr() }
}
}
#[doc = "Advanced timer"]
pub mod tim1;
#[doc = "TIM8"]
pub struct TIM8 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM8 {}
impl TIM8 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim1::RegisterBlock {
1073820672 as *const _
}
}
impl Deref for TIM8 {
type Target = tim1::RegisterBlock;
fn deref(&self) -> &tim1::RegisterBlock {
unsafe { &*TIM8::ptr() }
}
}
#[doc = "General purpose timer"]
pub struct TIM2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM2 {}
impl TIM2 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim2::RegisterBlock {
1073741824 as *const _
}
}
impl Deref for TIM2 {
type Target = tim2::RegisterBlock;
fn deref(&self) -> &tim2::RegisterBlock {
unsafe { &*TIM2::ptr() }
}
}
#[doc = "General purpose timer"]
pub mod tim2;
#[doc = "TIM3"]
pub struct TIM3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM3 {}
impl TIM3 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim2::RegisterBlock {
1073742848 as *const _
}
}
impl Deref for TIM3 {
type Target = tim2::RegisterBlock;
fn deref(&self) -> &tim2::RegisterBlock {
unsafe { &*TIM3::ptr() }
}
}
#[doc = "TIM4"]
pub struct TIM4 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM4 {}
impl TIM4 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim2::RegisterBlock {
1073743872 as *const _
}
}
impl Deref for TIM4 {
type Target = tim2::RegisterBlock;
fn deref(&self) -> &tim2::RegisterBlock {
unsafe { &*TIM4::ptr() }
}
}
#[doc = "TIM5"]
pub struct TIM5 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM5 {}
impl TIM5 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim2::RegisterBlock {
1073744896 as *const _
}
}
impl Deref for TIM5 {
type Target = tim2::RegisterBlock;
fn deref(&self) -> &tim2::RegisterBlock {
unsafe { &*TIM5::ptr() }
}
}
#[doc = "General purpose timer"]
pub struct TIM9 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM9 {}
impl TIM9 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim9::RegisterBlock {
1073826816 as *const _
}
}
impl Deref for TIM9 {
type Target = tim9::RegisterBlock;
fn deref(&self) -> &tim9::RegisterBlock {
unsafe { &*TIM9::ptr() }
}
}
#[doc = "General purpose timer"]
pub mod tim9;
#[doc = "TIM12"]
pub struct TIM12 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM12 {}
impl TIM12 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim9::RegisterBlock {
1073747968 as *const _
}
}
impl Deref for TIM12 {
type Target = tim9::RegisterBlock;
fn deref(&self) -> &tim9::RegisterBlock {
unsafe { &*TIM12::ptr() }
}
}
#[doc = "General purpose timer"]
pub struct TIM10 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM10 {}
impl TIM10 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim10::RegisterBlock {
1073827840 as *const _
}
}
impl Deref for TIM10 {
type Target = tim10::RegisterBlock;
fn deref(&self) -> &tim10::RegisterBlock {
unsafe { &*TIM10::ptr() }
}
}
#[doc = "General purpose timer"]
pub mod tim10;
#[doc = "TIM11"]
pub struct TIM11 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM11 {}
impl TIM11 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim10::RegisterBlock {
1073828864 as *const _
}
}
impl Deref for TIM11 {
type Target = tim10::RegisterBlock;
fn deref(&self) -> &tim10::RegisterBlock {
unsafe { &*TIM11::ptr() }
}
}
#[doc = "TIM13"]
pub struct TIM13 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM13 {}
impl TIM13 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim10::RegisterBlock {
1073748992 as *const _
}
}
impl Deref for TIM13 {
type Target = tim10::RegisterBlock;
fn deref(&self) -> &tim10::RegisterBlock {
unsafe { &*TIM13::ptr() }
}
}
#[doc = "TIM14"]
pub struct TIM14 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM14 {}
impl TIM14 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim10::RegisterBlock {
1073750016 as *const _
}
}
impl Deref for TIM14 {
type Target = tim10::RegisterBlock;
fn deref(&self) -> &tim10::RegisterBlock {
unsafe { &*TIM14::ptr() }
}
}
#[doc = "Basic timer"]
pub struct TIM6 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM6 {}
impl TIM6 {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const tim6::RegisterBlock {
1073745920 as *const _
}
}
impl Deref for TIM6 {
type Target = tim6::RegisterBlock;
fn deref(&self) -> &tim6::RegisterBlock {