stm32l4x6/dfsdm/
awscd6r.rs1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::AWSCD6R {
10 #[doc = r" Modifies the contents of the register"]
11 #[inline]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 let r = R { bits: bits };
18 let mut w = W { bits: bits };
19 f(&r, &mut w);
20 self.register.set(w.bits);
21 }
22 #[doc = r" Reads the contents of the register"]
23 #[inline]
24 pub fn read(&self) -> R {
25 R {
26 bits: self.register.get(),
27 }
28 }
29 #[doc = r" Writes to the register"]
30 #[inline]
31 pub fn write<F>(&self, f: F)
32 where
33 F: FnOnce(&mut W) -> &mut W,
34 {
35 let mut w = W::reset_value();
36 f(&mut w);
37 self.register.set(w.bits);
38 }
39 #[doc = r" Writes the reset value to the register"]
40 #[inline]
41 pub fn reset(&self) {
42 self.write(|w| w)
43 }
44}
45#[doc = r" Value of the field"]
46pub struct AWFORDR {
47 bits: u8,
48}
49impl AWFORDR {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bits(&self) -> u8 {
53 self.bits
54 }
55}
56#[doc = r" Value of the field"]
57pub struct AWFOSRR {
58 bits: u8,
59}
60impl AWFOSRR {
61 #[doc = r" Value of the field as raw bits"]
62 #[inline]
63 pub fn bits(&self) -> u8 {
64 self.bits
65 }
66}
67#[doc = r" Value of the field"]
68pub struct BKSCDR {
69 bits: u8,
70}
71impl BKSCDR {
72 #[doc = r" Value of the field as raw bits"]
73 #[inline]
74 pub fn bits(&self) -> u8 {
75 self.bits
76 }
77}
78#[doc = r" Value of the field"]
79pub struct SCDTR {
80 bits: u8,
81}
82impl SCDTR {
83 #[doc = r" Value of the field as raw bits"]
84 #[inline]
85 pub fn bits(&self) -> u8 {
86 self.bits
87 }
88}
89#[doc = r" Proxy"]
90pub struct _AWFORDW<'a> {
91 w: &'a mut W,
92}
93impl<'a> _AWFORDW<'a> {
94 #[doc = r" Writes raw bits to the field"]
95 #[inline]
96 pub unsafe fn bits(self, value: u8) -> &'a mut W {
97 const MASK: u8 = 3;
98 const OFFSET: u8 = 22;
99 self.w.bits &= !((MASK as u32) << OFFSET);
100 self.w.bits |= ((value & MASK) as u32) << OFFSET;
101 self.w
102 }
103}
104#[doc = r" Proxy"]
105pub struct _AWFOSRW<'a> {
106 w: &'a mut W,
107}
108impl<'a> _AWFOSRW<'a> {
109 #[doc = r" Writes raw bits to the field"]
110 #[inline]
111 pub unsafe fn bits(self, value: u8) -> &'a mut W {
112 const MASK: u8 = 31;
113 const OFFSET: u8 = 16;
114 self.w.bits &= !((MASK as u32) << OFFSET);
115 self.w.bits |= ((value & MASK) as u32) << OFFSET;
116 self.w
117 }
118}
119#[doc = r" Proxy"]
120pub struct _BKSCDW<'a> {
121 w: &'a mut W,
122}
123impl<'a> _BKSCDW<'a> {
124 #[doc = r" Writes raw bits to the field"]
125 #[inline]
126 pub unsafe fn bits(self, value: u8) -> &'a mut W {
127 const MASK: u8 = 15;
128 const OFFSET: u8 = 12;
129 self.w.bits &= !((MASK as u32) << OFFSET);
130 self.w.bits |= ((value & MASK) as u32) << OFFSET;
131 self.w
132 }
133}
134#[doc = r" Proxy"]
135pub struct _SCDTW<'a> {
136 w: &'a mut W,
137}
138impl<'a> _SCDTW<'a> {
139 #[doc = r" Writes raw bits to the field"]
140 #[inline]
141 pub unsafe fn bits(self, value: u8) -> &'a mut W {
142 const MASK: u8 = 255;
143 const OFFSET: u8 = 0;
144 self.w.bits &= !((MASK as u32) << OFFSET);
145 self.w.bits |= ((value & MASK) as u32) << OFFSET;
146 self.w
147 }
148}
149impl R {
150 #[doc = r" Value of the register as raw bits"]
151 #[inline]
152 pub fn bits(&self) -> u32 {
153 self.bits
154 }
155 #[doc = "Bits 22:23 - AWFORD"]
156 #[inline]
157 pub fn awford(&self) -> AWFORDR {
158 let bits = {
159 const MASK: u8 = 3;
160 const OFFSET: u8 = 22;
161 ((self.bits >> OFFSET) & MASK as u32) as u8
162 };
163 AWFORDR { bits }
164 }
165 #[doc = "Bits 16:20 - AWFOSR"]
166 #[inline]
167 pub fn awfosr(&self) -> AWFOSRR {
168 let bits = {
169 const MASK: u8 = 31;
170 const OFFSET: u8 = 16;
171 ((self.bits >> OFFSET) & MASK as u32) as u8
172 };
173 AWFOSRR { bits }
174 }
175 #[doc = "Bits 12:15 - BKSCD"]
176 #[inline]
177 pub fn bkscd(&self) -> BKSCDR {
178 let bits = {
179 const MASK: u8 = 15;
180 const OFFSET: u8 = 12;
181 ((self.bits >> OFFSET) & MASK as u32) as u8
182 };
183 BKSCDR { bits }
184 }
185 #[doc = "Bits 0:7 - SCDT"]
186 #[inline]
187 pub fn scdt(&self) -> SCDTR {
188 let bits = {
189 const MASK: u8 = 255;
190 const OFFSET: u8 = 0;
191 ((self.bits >> OFFSET) & MASK as u32) as u8
192 };
193 SCDTR { bits }
194 }
195}
196impl W {
197 #[doc = r" Reset value of the register"]
198 #[inline]
199 pub fn reset_value() -> W {
200 W { bits: 0 }
201 }
202 #[doc = r" Writes raw bits to the register"]
203 #[inline]
204 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
205 self.bits = bits;
206 self
207 }
208 #[doc = "Bits 22:23 - AWFORD"]
209 #[inline]
210 pub fn awford(&mut self) -> _AWFORDW {
211 _AWFORDW { w: self }
212 }
213 #[doc = "Bits 16:20 - AWFOSR"]
214 #[inline]
215 pub fn awfosr(&mut self) -> _AWFOSRW {
216 _AWFOSRW { w: self }
217 }
218 #[doc = "Bits 12:15 - BKSCD"]
219 #[inline]
220 pub fn bkscd(&mut self) -> _BKSCDW {
221 _BKSCDW { w: self }
222 }
223 #[doc = "Bits 0:7 - SCDT"]
224 #[inline]
225 pub fn scdt(&mut self) -> _SCDTW {
226 _SCDTW { w: self }
227 }
228}