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
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
use crate::{RWRegister, WORegister};
#[cfg(not(feature = "nosync"))]
use core::marker::PhantomData;
pub mod DR {
pub mod DR {
pub const offset: u32 = 0;
pub const mask: u32 = 0xffffffff << offset;
pub mod R {}
pub mod W {}
pub mod RW {}
}
}
pub mod IDR {
pub mod IDR {
pub const offset: u32 = 0;
pub const mask: u32 = 0xff << offset;
pub mod R {}
pub mod W {}
pub mod RW {}
}
}
pub mod CR {
pub mod RESET {
pub const offset: u32 = 0;
pub const mask: u32 = 1 << offset;
pub mod R {}
pub mod W {
pub const Reset: u32 = 0b1;
}
pub mod RW {}
}
}
#[repr(C)]
pub struct RegisterBlock {
pub DR: RWRegister<u32>,
pub IDR: RWRegister<u32>,
pub CR: WORegister<u32>,
}
pub struct ResetValues {
pub DR: u32,
pub IDR: u32,
pub CR: u32,
}
#[cfg(not(feature = "nosync"))]
pub struct Instance {
pub(crate) addr: u32,
pub(crate) _marker: PhantomData<*const RegisterBlock>,
}
#[cfg(not(feature = "nosync"))]
impl ::core::ops::Deref for Instance {
type Target = RegisterBlock;
#[inline(always)]
fn deref(&self) -> &RegisterBlock {
unsafe { &*(self.addr as *const _) }
}
}
#[cfg(feature = "rtic")]
unsafe impl Send for Instance {}