stm32l4x2_pac/tim16/
or2.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::OR2 {
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 BKINER {
47 bits: bool,
48}
49impl BKINER {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bit(&self) -> bool {
53 self.bits
54 }
55 #[doc = r" Returns `true` if the bit is clear (0)"]
56 #[inline]
57 pub fn bit_is_clear(&self) -> bool {
58 !self.bit()
59 }
60 #[doc = r" Returns `true` if the bit is set (1)"]
61 #[inline]
62 pub fn bit_is_set(&self) -> bool {
63 self.bit()
64 }
65}
66#[doc = r" Value of the field"]
67pub struct BKCMP1ER {
68 bits: bool,
69}
70impl BKCMP1ER {
71 #[doc = r" Value of the field as raw bits"]
72 #[inline]
73 pub fn bit(&self) -> bool {
74 self.bits
75 }
76 #[doc = r" Returns `true` if the bit is clear (0)"]
77 #[inline]
78 pub fn bit_is_clear(&self) -> bool {
79 !self.bit()
80 }
81 #[doc = r" Returns `true` if the bit is set (1)"]
82 #[inline]
83 pub fn bit_is_set(&self) -> bool {
84 self.bit()
85 }
86}
87#[doc = r" Value of the field"]
88pub struct BKCMP2ER {
89 bits: bool,
90}
91impl BKCMP2ER {
92 #[doc = r" Value of the field as raw bits"]
93 #[inline]
94 pub fn bit(&self) -> bool {
95 self.bits
96 }
97 #[doc = r" Returns `true` if the bit is clear (0)"]
98 #[inline]
99 pub fn bit_is_clear(&self) -> bool {
100 !self.bit()
101 }
102 #[doc = r" Returns `true` if the bit is set (1)"]
103 #[inline]
104 pub fn bit_is_set(&self) -> bool {
105 self.bit()
106 }
107}
108#[doc = r" Value of the field"]
109pub struct BKDFBK1ER {
110 bits: bool,
111}
112impl BKDFBK1ER {
113 #[doc = r" Value of the field as raw bits"]
114 #[inline]
115 pub fn bit(&self) -> bool {
116 self.bits
117 }
118 #[doc = r" Returns `true` if the bit is clear (0)"]
119 #[inline]
120 pub fn bit_is_clear(&self) -> bool {
121 !self.bit()
122 }
123 #[doc = r" Returns `true` if the bit is set (1)"]
124 #[inline]
125 pub fn bit_is_set(&self) -> bool {
126 self.bit()
127 }
128}
129#[doc = r" Value of the field"]
130pub struct BKINPR {
131 bits: bool,
132}
133impl BKINPR {
134 #[doc = r" Value of the field as raw bits"]
135 #[inline]
136 pub fn bit(&self) -> bool {
137 self.bits
138 }
139 #[doc = r" Returns `true` if the bit is clear (0)"]
140 #[inline]
141 pub fn bit_is_clear(&self) -> bool {
142 !self.bit()
143 }
144 #[doc = r" Returns `true` if the bit is set (1)"]
145 #[inline]
146 pub fn bit_is_set(&self) -> bool {
147 self.bit()
148 }
149}
150#[doc = r" Value of the field"]
151pub struct BKCMP1PR {
152 bits: bool,
153}
154impl BKCMP1PR {
155 #[doc = r" Value of the field as raw bits"]
156 #[inline]
157 pub fn bit(&self) -> bool {
158 self.bits
159 }
160 #[doc = r" Returns `true` if the bit is clear (0)"]
161 #[inline]
162 pub fn bit_is_clear(&self) -> bool {
163 !self.bit()
164 }
165 #[doc = r" Returns `true` if the bit is set (1)"]
166 #[inline]
167 pub fn bit_is_set(&self) -> bool {
168 self.bit()
169 }
170}
171#[doc = r" Value of the field"]
172pub struct BKCMP2PR {
173 bits: bool,
174}
175impl BKCMP2PR {
176 #[doc = r" Value of the field as raw bits"]
177 #[inline]
178 pub fn bit(&self) -> bool {
179 self.bits
180 }
181 #[doc = r" Returns `true` if the bit is clear (0)"]
182 #[inline]
183 pub fn bit_is_clear(&self) -> bool {
184 !self.bit()
185 }
186 #[doc = r" Returns `true` if the bit is set (1)"]
187 #[inline]
188 pub fn bit_is_set(&self) -> bool {
189 self.bit()
190 }
191}
192#[doc = r" Proxy"]
193pub struct _BKINEW<'a> {
194 w: &'a mut W,
195}
196impl<'a> _BKINEW<'a> {
197 #[doc = r" Sets the field bit"]
198 pub fn set_bit(self) -> &'a mut W {
199 self.bit(true)
200 }
201 #[doc = r" Clears the field bit"]
202 pub fn clear_bit(self) -> &'a mut W {
203 self.bit(false)
204 }
205 #[doc = r" Writes raw bits to the field"]
206 #[inline]
207 pub fn bit(self, value: bool) -> &'a mut W {
208 const MASK: bool = true;
209 const OFFSET: u8 = 0;
210 self.w.bits &= !((MASK as u32) << OFFSET);
211 self.w.bits |= ((value & MASK) as u32) << OFFSET;
212 self.w
213 }
214}
215#[doc = r" Proxy"]
216pub struct _BKCMP1EW<'a> {
217 w: &'a mut W,
218}
219impl<'a> _BKCMP1EW<'a> {
220 #[doc = r" Sets the field bit"]
221 pub fn set_bit(self) -> &'a mut W {
222 self.bit(true)
223 }
224 #[doc = r" Clears the field bit"]
225 pub fn clear_bit(self) -> &'a mut W {
226 self.bit(false)
227 }
228 #[doc = r" Writes raw bits to the field"]
229 #[inline]
230 pub fn bit(self, value: bool) -> &'a mut W {
231 const MASK: bool = true;
232 const OFFSET: u8 = 1;
233 self.w.bits &= !((MASK as u32) << OFFSET);
234 self.w.bits |= ((value & MASK) as u32) << OFFSET;
235 self.w
236 }
237}
238#[doc = r" Proxy"]
239pub struct _BKCMP2EW<'a> {
240 w: &'a mut W,
241}
242impl<'a> _BKCMP2EW<'a> {
243 #[doc = r" Sets the field bit"]
244 pub fn set_bit(self) -> &'a mut W {
245 self.bit(true)
246 }
247 #[doc = r" Clears the field bit"]
248 pub fn clear_bit(self) -> &'a mut W {
249 self.bit(false)
250 }
251 #[doc = r" Writes raw bits to the field"]
252 #[inline]
253 pub fn bit(self, value: bool) -> &'a mut W {
254 const MASK: bool = true;
255 const OFFSET: u8 = 2;
256 self.w.bits &= !((MASK as u32) << OFFSET);
257 self.w.bits |= ((value & MASK) as u32) << OFFSET;
258 self.w
259 }
260}
261#[doc = r" Proxy"]
262pub struct _BKDFBK1EW<'a> {
263 w: &'a mut W,
264}
265impl<'a> _BKDFBK1EW<'a> {
266 #[doc = r" Sets the field bit"]
267 pub fn set_bit(self) -> &'a mut W {
268 self.bit(true)
269 }
270 #[doc = r" Clears the field bit"]
271 pub fn clear_bit(self) -> &'a mut W {
272 self.bit(false)
273 }
274 #[doc = r" Writes raw bits to the field"]
275 #[inline]
276 pub fn bit(self, value: bool) -> &'a mut W {
277 const MASK: bool = true;
278 const OFFSET: u8 = 8;
279 self.w.bits &= !((MASK as u32) << OFFSET);
280 self.w.bits |= ((value & MASK) as u32) << OFFSET;
281 self.w
282 }
283}
284#[doc = r" Proxy"]
285pub struct _BKINPW<'a> {
286 w: &'a mut W,
287}
288impl<'a> _BKINPW<'a> {
289 #[doc = r" Sets the field bit"]
290 pub fn set_bit(self) -> &'a mut W {
291 self.bit(true)
292 }
293 #[doc = r" Clears the field bit"]
294 pub fn clear_bit(self) -> &'a mut W {
295 self.bit(false)
296 }
297 #[doc = r" Writes raw bits to the field"]
298 #[inline]
299 pub fn bit(self, value: bool) -> &'a mut W {
300 const MASK: bool = true;
301 const OFFSET: u8 = 9;
302 self.w.bits &= !((MASK as u32) << OFFSET);
303 self.w.bits |= ((value & MASK) as u32) << OFFSET;
304 self.w
305 }
306}
307#[doc = r" Proxy"]
308pub struct _BKCMP1PW<'a> {
309 w: &'a mut W,
310}
311impl<'a> _BKCMP1PW<'a> {
312 #[doc = r" Sets the field bit"]
313 pub fn set_bit(self) -> &'a mut W {
314 self.bit(true)
315 }
316 #[doc = r" Clears the field bit"]
317 pub fn clear_bit(self) -> &'a mut W {
318 self.bit(false)
319 }
320 #[doc = r" Writes raw bits to the field"]
321 #[inline]
322 pub fn bit(self, value: bool) -> &'a mut W {
323 const MASK: bool = true;
324 const OFFSET: u8 = 10;
325 self.w.bits &= !((MASK as u32) << OFFSET);
326 self.w.bits |= ((value & MASK) as u32) << OFFSET;
327 self.w
328 }
329}
330#[doc = r" Proxy"]
331pub struct _BKCMP2PW<'a> {
332 w: &'a mut W,
333}
334impl<'a> _BKCMP2PW<'a> {
335 #[doc = r" Sets the field bit"]
336 pub fn set_bit(self) -> &'a mut W {
337 self.bit(true)
338 }
339 #[doc = r" Clears the field bit"]
340 pub fn clear_bit(self) -> &'a mut W {
341 self.bit(false)
342 }
343 #[doc = r" Writes raw bits to the field"]
344 #[inline]
345 pub fn bit(self, value: bool) -> &'a mut W {
346 const MASK: bool = true;
347 const OFFSET: u8 = 11;
348 self.w.bits &= !((MASK as u32) << OFFSET);
349 self.w.bits |= ((value & MASK) as u32) << OFFSET;
350 self.w
351 }
352}
353impl R {
354 #[doc = r" Value of the register as raw bits"]
355 #[inline]
356 pub fn bits(&self) -> u32 {
357 self.bits
358 }
359 #[doc = "Bit 0 - BRK BKIN input enable"]
360 #[inline]
361 pub fn bkine(&self) -> BKINER {
362 let bits = {
363 const MASK: bool = true;
364 const OFFSET: u8 = 0;
365 ((self.bits >> OFFSET) & MASK as u32) != 0
366 };
367 BKINER { bits }
368 }
369 #[doc = "Bit 1 - BRK COMP1 enable"]
370 #[inline]
371 pub fn bkcmp1e(&self) -> BKCMP1ER {
372 let bits = {
373 const MASK: bool = true;
374 const OFFSET: u8 = 1;
375 ((self.bits >> OFFSET) & MASK as u32) != 0
376 };
377 BKCMP1ER { bits }
378 }
379 #[doc = "Bit 2 - BRK COMP2 enable"]
380 #[inline]
381 pub fn bkcmp2e(&self) -> BKCMP2ER {
382 let bits = {
383 const MASK: bool = true;
384 const OFFSET: u8 = 2;
385 ((self.bits >> OFFSET) & MASK as u32) != 0
386 };
387 BKCMP2ER { bits }
388 }
389 #[doc = "Bit 8 - BRK DFSDM_BREAK1 enable"]
390 #[inline]
391 pub fn bkdfbk1e(&self) -> BKDFBK1ER {
392 let bits = {
393 const MASK: bool = true;
394 const OFFSET: u8 = 8;
395 ((self.bits >> OFFSET) & MASK as u32) != 0
396 };
397 BKDFBK1ER { bits }
398 }
399 #[doc = "Bit 9 - BRK BKIN input polarity"]
400 #[inline]
401 pub fn bkinp(&self) -> BKINPR {
402 let bits = {
403 const MASK: bool = true;
404 const OFFSET: u8 = 9;
405 ((self.bits >> OFFSET) & MASK as u32) != 0
406 };
407 BKINPR { bits }
408 }
409 #[doc = "Bit 10 - BRK COMP1 input polarity"]
410 #[inline]
411 pub fn bkcmp1p(&self) -> BKCMP1PR {
412 let bits = {
413 const MASK: bool = true;
414 const OFFSET: u8 = 10;
415 ((self.bits >> OFFSET) & MASK as u32) != 0
416 };
417 BKCMP1PR { bits }
418 }
419 #[doc = "Bit 11 - BRK COMP2 input polarit"]
420 #[inline]
421 pub fn bkcmp2p(&self) -> BKCMP2PR {
422 let bits = {
423 const MASK: bool = true;
424 const OFFSET: u8 = 11;
425 ((self.bits >> OFFSET) & MASK as u32) != 0
426 };
427 BKCMP2PR { bits }
428 }
429}
430impl W {
431 #[doc = r" Reset value of the register"]
432 #[inline]
433 pub fn reset_value() -> W {
434 W { bits: 0 }
435 }
436 #[doc = r" Writes raw bits to the register"]
437 #[inline]
438 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
439 self.bits = bits;
440 self
441 }
442 #[doc = "Bit 0 - BRK BKIN input enable"]
443 #[inline]
444 pub fn bkine(&mut self) -> _BKINEW {
445 _BKINEW { w: self }
446 }
447 #[doc = "Bit 1 - BRK COMP1 enable"]
448 #[inline]
449 pub fn bkcmp1e(&mut self) -> _BKCMP1EW {
450 _BKCMP1EW { w: self }
451 }
452 #[doc = "Bit 2 - BRK COMP2 enable"]
453 #[inline]
454 pub fn bkcmp2e(&mut self) -> _BKCMP2EW {
455 _BKCMP2EW { w: self }
456 }
457 #[doc = "Bit 8 - BRK DFSDM_BREAK1 enable"]
458 #[inline]
459 pub fn bkdfbk1e(&mut self) -> _BKDFBK1EW {
460 _BKDFBK1EW { w: self }
461 }
462 #[doc = "Bit 9 - BRK BKIN input polarity"]
463 #[inline]
464 pub fn bkinp(&mut self) -> _BKINPW {
465 _BKINPW { w: self }
466 }
467 #[doc = "Bit 10 - BRK COMP1 input polarity"]
468 #[inline]
469 pub fn bkcmp1p(&mut self) -> _BKCMP1PW {
470 _BKCMP1PW { w: self }
471 }
472 #[doc = "Bit 11 - BRK COMP2 input polarit"]
473 #[inline]
474 pub fn bkcmp2p(&mut self) -> _BKCMP2PW {
475 _BKCMP2PW { w: self }
476 }
477}