stm32ral/stm32f2/peripherals/
crc.rs1#![allow(non_snake_case, non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3use crate::{RWRegister, WORegister};
8#[cfg(not(feature = "nosync"))]
9use core::marker::PhantomData;
10
11pub mod DR {
13
14 pub mod DR {
16 pub const offset: u32 = 0;
18 pub const mask: u32 = 0xffffffff << offset;
20 pub mod R {}
22 pub mod W {}
24 pub mod RW {}
26 }
27}
28
29pub mod IDR {
31
32 pub mod IDR {
34 pub const offset: u32 = 0;
36 pub const mask: u32 = 0xff << offset;
38 pub mod R {}
40 pub mod W {}
42 pub mod RW {}
44 }
45}
46
47pub mod CR {
49
50 pub mod RESET {
52 pub const offset: u32 = 0;
54 pub const mask: u32 = 1 << offset;
56 pub mod R {}
58 pub mod W {
60
61 pub const Reset: u32 = 0b1;
63 }
64 pub mod RW {}
66 }
67}
68#[repr(C)]
69pub struct RegisterBlock {
70 pub DR: RWRegister<u32>,
72
73 pub IDR: RWRegister<u32>,
75
76 pub CR: WORegister<u32>,
78}
79pub struct ResetValues {
80 pub DR: u32,
81 pub IDR: u32,
82 pub CR: u32,
83}
84#[cfg(not(feature = "nosync"))]
85pub struct Instance {
86 pub(crate) addr: u32,
87 pub(crate) _marker: PhantomData<*const RegisterBlock>,
88}
89#[cfg(not(feature = "nosync"))]
90impl ::core::ops::Deref for Instance {
91 type Target = RegisterBlock;
92 #[inline(always)]
93 fn deref(&self) -> &RegisterBlock {
94 unsafe { &*(self.addr as *const _) }
95 }
96}
97#[cfg(feature = "rtic")]
98unsafe impl Send for Instance {}