stm32l4x2_pac/tim1/
ccmr3_output.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::CCMR3_OUTPUT {
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 OC6M_BIT3R {
47 bits: bool,
48}
49impl OC6M_BIT3R {
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 OC5M_BIT3R {
68 bits: u8,
69}
70impl OC5M_BIT3R {
71 #[doc = r" Value of the field as raw bits"]
72 #[inline]
73 pub fn bits(&self) -> u8 {
74 self.bits
75 }
76}
77#[doc = r" Value of the field"]
78pub struct OC6CER {
79 bits: bool,
80}
81impl OC6CER {
82 #[doc = r" Value of the field as raw bits"]
83 #[inline]
84 pub fn bit(&self) -> bool {
85 self.bits
86 }
87 #[doc = r" Returns `true` if the bit is clear (0)"]
88 #[inline]
89 pub fn bit_is_clear(&self) -> bool {
90 !self.bit()
91 }
92 #[doc = r" Returns `true` if the bit is set (1)"]
93 #[inline]
94 pub fn bit_is_set(&self) -> bool {
95 self.bit()
96 }
97}
98#[doc = r" Value of the field"]
99pub struct OC6MR {
100 bits: u8,
101}
102impl OC6MR {
103 #[doc = r" Value of the field as raw bits"]
104 #[inline]
105 pub fn bits(&self) -> u8 {
106 self.bits
107 }
108}
109#[doc = r" Value of the field"]
110pub struct OC6PER {
111 bits: bool,
112}
113impl OC6PER {
114 #[doc = r" Value of the field as raw bits"]
115 #[inline]
116 pub fn bit(&self) -> bool {
117 self.bits
118 }
119 #[doc = r" Returns `true` if the bit is clear (0)"]
120 #[inline]
121 pub fn bit_is_clear(&self) -> bool {
122 !self.bit()
123 }
124 #[doc = r" Returns `true` if the bit is set (1)"]
125 #[inline]
126 pub fn bit_is_set(&self) -> bool {
127 self.bit()
128 }
129}
130#[doc = r" Value of the field"]
131pub struct OC6FER {
132 bits: bool,
133}
134impl OC6FER {
135 #[doc = r" Value of the field as raw bits"]
136 #[inline]
137 pub fn bit(&self) -> bool {
138 self.bits
139 }
140 #[doc = r" Returns `true` if the bit is clear (0)"]
141 #[inline]
142 pub fn bit_is_clear(&self) -> bool {
143 !self.bit()
144 }
145 #[doc = r" Returns `true` if the bit is set (1)"]
146 #[inline]
147 pub fn bit_is_set(&self) -> bool {
148 self.bit()
149 }
150}
151#[doc = r" Value of the field"]
152pub struct OC5CER {
153 bits: bool,
154}
155impl OC5CER {
156 #[doc = r" Value of the field as raw bits"]
157 #[inline]
158 pub fn bit(&self) -> bool {
159 self.bits
160 }
161 #[doc = r" Returns `true` if the bit is clear (0)"]
162 #[inline]
163 pub fn bit_is_clear(&self) -> bool {
164 !self.bit()
165 }
166 #[doc = r" Returns `true` if the bit is set (1)"]
167 #[inline]
168 pub fn bit_is_set(&self) -> bool {
169 self.bit()
170 }
171}
172#[doc = r" Value of the field"]
173pub struct OC5MR {
174 bits: u8,
175}
176impl OC5MR {
177 #[doc = r" Value of the field as raw bits"]
178 #[inline]
179 pub fn bits(&self) -> u8 {
180 self.bits
181 }
182}
183#[doc = r" Value of the field"]
184pub struct OC5PER {
185 bits: bool,
186}
187impl OC5PER {
188 #[doc = r" Value of the field as raw bits"]
189 #[inline]
190 pub fn bit(&self) -> bool {
191 self.bits
192 }
193 #[doc = r" Returns `true` if the bit is clear (0)"]
194 #[inline]
195 pub fn bit_is_clear(&self) -> bool {
196 !self.bit()
197 }
198 #[doc = r" Returns `true` if the bit is set (1)"]
199 #[inline]
200 pub fn bit_is_set(&self) -> bool {
201 self.bit()
202 }
203}
204#[doc = r" Value of the field"]
205pub struct OC5FER {
206 bits: bool,
207}
208impl OC5FER {
209 #[doc = r" Value of the field as raw bits"]
210 #[inline]
211 pub fn bit(&self) -> bool {
212 self.bits
213 }
214 #[doc = r" Returns `true` if the bit is clear (0)"]
215 #[inline]
216 pub fn bit_is_clear(&self) -> bool {
217 !self.bit()
218 }
219 #[doc = r" Returns `true` if the bit is set (1)"]
220 #[inline]
221 pub fn bit_is_set(&self) -> bool {
222 self.bit()
223 }
224}
225#[doc = r" Proxy"]
226pub struct _OC6M_BIT3W<'a> {
227 w: &'a mut W,
228}
229impl<'a> _OC6M_BIT3W<'a> {
230 #[doc = r" Sets the field bit"]
231 pub fn set_bit(self) -> &'a mut W {
232 self.bit(true)
233 }
234 #[doc = r" Clears the field bit"]
235 pub fn clear_bit(self) -> &'a mut W {
236 self.bit(false)
237 }
238 #[doc = r" Writes raw bits to the field"]
239 #[inline]
240 pub fn bit(self, value: bool) -> &'a mut W {
241 const MASK: bool = true;
242 const OFFSET: u8 = 24;
243 self.w.bits &= !((MASK as u32) << OFFSET);
244 self.w.bits |= ((value & MASK) as u32) << OFFSET;
245 self.w
246 }
247}
248#[doc = r" Proxy"]
249pub struct _OC5M_BIT3W<'a> {
250 w: &'a mut W,
251}
252impl<'a> _OC5M_BIT3W<'a> {
253 #[doc = r" Writes raw bits to the field"]
254 #[inline]
255 pub unsafe fn bits(self, value: u8) -> &'a mut W {
256 const MASK: u8 = 7;
257 const OFFSET: u8 = 16;
258 self.w.bits &= !((MASK as u32) << OFFSET);
259 self.w.bits |= ((value & MASK) as u32) << OFFSET;
260 self.w
261 }
262}
263#[doc = r" Proxy"]
264pub struct _OC6CEW<'a> {
265 w: &'a mut W,
266}
267impl<'a> _OC6CEW<'a> {
268 #[doc = r" Sets the field bit"]
269 pub fn set_bit(self) -> &'a mut W {
270 self.bit(true)
271 }
272 #[doc = r" Clears the field bit"]
273 pub fn clear_bit(self) -> &'a mut W {
274 self.bit(false)
275 }
276 #[doc = r" Writes raw bits to the field"]
277 #[inline]
278 pub fn bit(self, value: bool) -> &'a mut W {
279 const MASK: bool = true;
280 const OFFSET: u8 = 15;
281 self.w.bits &= !((MASK as u32) << OFFSET);
282 self.w.bits |= ((value & MASK) as u32) << OFFSET;
283 self.w
284 }
285}
286#[doc = r" Proxy"]
287pub struct _OC6MW<'a> {
288 w: &'a mut W,
289}
290impl<'a> _OC6MW<'a> {
291 #[doc = r" Writes raw bits to the field"]
292 #[inline]
293 pub unsafe fn bits(self, value: u8) -> &'a mut W {
294 const MASK: u8 = 7;
295 const OFFSET: u8 = 12;
296 self.w.bits &= !((MASK as u32) << OFFSET);
297 self.w.bits |= ((value & MASK) as u32) << OFFSET;
298 self.w
299 }
300}
301#[doc = r" Proxy"]
302pub struct _OC6PEW<'a> {
303 w: &'a mut W,
304}
305impl<'a> _OC6PEW<'a> {
306 #[doc = r" Sets the field bit"]
307 pub fn set_bit(self) -> &'a mut W {
308 self.bit(true)
309 }
310 #[doc = r" Clears the field bit"]
311 pub fn clear_bit(self) -> &'a mut W {
312 self.bit(false)
313 }
314 #[doc = r" Writes raw bits to the field"]
315 #[inline]
316 pub fn bit(self, value: bool) -> &'a mut W {
317 const MASK: bool = true;
318 const OFFSET: u8 = 11;
319 self.w.bits &= !((MASK as u32) << OFFSET);
320 self.w.bits |= ((value & MASK) as u32) << OFFSET;
321 self.w
322 }
323}
324#[doc = r" Proxy"]
325pub struct _OC6FEW<'a> {
326 w: &'a mut W,
327}
328impl<'a> _OC6FEW<'a> {
329 #[doc = r" Sets the field bit"]
330 pub fn set_bit(self) -> &'a mut W {
331 self.bit(true)
332 }
333 #[doc = r" Clears the field bit"]
334 pub fn clear_bit(self) -> &'a mut W {
335 self.bit(false)
336 }
337 #[doc = r" Writes raw bits to the field"]
338 #[inline]
339 pub fn bit(self, value: bool) -> &'a mut W {
340 const MASK: bool = true;
341 const OFFSET: u8 = 10;
342 self.w.bits &= !((MASK as u32) << OFFSET);
343 self.w.bits |= ((value & MASK) as u32) << OFFSET;
344 self.w
345 }
346}
347#[doc = r" Proxy"]
348pub struct _OC5CEW<'a> {
349 w: &'a mut W,
350}
351impl<'a> _OC5CEW<'a> {
352 #[doc = r" Sets the field bit"]
353 pub fn set_bit(self) -> &'a mut W {
354 self.bit(true)
355 }
356 #[doc = r" Clears the field bit"]
357 pub fn clear_bit(self) -> &'a mut W {
358 self.bit(false)
359 }
360 #[doc = r" Writes raw bits to the field"]
361 #[inline]
362 pub fn bit(self, value: bool) -> &'a mut W {
363 const MASK: bool = true;
364 const OFFSET: u8 = 7;
365 self.w.bits &= !((MASK as u32) << OFFSET);
366 self.w.bits |= ((value & MASK) as u32) << OFFSET;
367 self.w
368 }
369}
370#[doc = r" Proxy"]
371pub struct _OC5MW<'a> {
372 w: &'a mut W,
373}
374impl<'a> _OC5MW<'a> {
375 #[doc = r" Writes raw bits to the field"]
376 #[inline]
377 pub unsafe fn bits(self, value: u8) -> &'a mut W {
378 const MASK: u8 = 7;
379 const OFFSET: u8 = 4;
380 self.w.bits &= !((MASK as u32) << OFFSET);
381 self.w.bits |= ((value & MASK) as u32) << OFFSET;
382 self.w
383 }
384}
385#[doc = r" Proxy"]
386pub struct _OC5PEW<'a> {
387 w: &'a mut W,
388}
389impl<'a> _OC5PEW<'a> {
390 #[doc = r" Sets the field bit"]
391 pub fn set_bit(self) -> &'a mut W {
392 self.bit(true)
393 }
394 #[doc = r" Clears the field bit"]
395 pub fn clear_bit(self) -> &'a mut W {
396 self.bit(false)
397 }
398 #[doc = r" Writes raw bits to the field"]
399 #[inline]
400 pub fn bit(self, value: bool) -> &'a mut W {
401 const MASK: bool = true;
402 const OFFSET: u8 = 3;
403 self.w.bits &= !((MASK as u32) << OFFSET);
404 self.w.bits |= ((value & MASK) as u32) << OFFSET;
405 self.w
406 }
407}
408#[doc = r" Proxy"]
409pub struct _OC5FEW<'a> {
410 w: &'a mut W,
411}
412impl<'a> _OC5FEW<'a> {
413 #[doc = r" Sets the field bit"]
414 pub fn set_bit(self) -> &'a mut W {
415 self.bit(true)
416 }
417 #[doc = r" Clears the field bit"]
418 pub fn clear_bit(self) -> &'a mut W {
419 self.bit(false)
420 }
421 #[doc = r" Writes raw bits to the field"]
422 #[inline]
423 pub fn bit(self, value: bool) -> &'a mut W {
424 const MASK: bool = true;
425 const OFFSET: u8 = 2;
426 self.w.bits &= !((MASK as u32) << OFFSET);
427 self.w.bits |= ((value & MASK) as u32) << OFFSET;
428 self.w
429 }
430}
431impl R {
432 #[doc = r" Value of the register as raw bits"]
433 #[inline]
434 pub fn bits(&self) -> u32 {
435 self.bits
436 }
437 #[doc = "Bit 24 - Output Compare 6 mode bit 3"]
438 #[inline]
439 pub fn oc6m_bit3(&self) -> OC6M_BIT3R {
440 let bits = {
441 const MASK: bool = true;
442 const OFFSET: u8 = 24;
443 ((self.bits >> OFFSET) & MASK as u32) != 0
444 };
445 OC6M_BIT3R { bits }
446 }
447 #[doc = "Bits 16:18 - Output Compare 5 mode bit 3"]
448 #[inline]
449 pub fn oc5m_bit3(&self) -> OC5M_BIT3R {
450 let bits = {
451 const MASK: u8 = 7;
452 const OFFSET: u8 = 16;
453 ((self.bits >> OFFSET) & MASK as u32) as u8
454 };
455 OC5M_BIT3R { bits }
456 }
457 #[doc = "Bit 15 - Output compare 6 clear enable"]
458 #[inline]
459 pub fn oc6ce(&self) -> OC6CER {
460 let bits = {
461 const MASK: bool = true;
462 const OFFSET: u8 = 15;
463 ((self.bits >> OFFSET) & MASK as u32) != 0
464 };
465 OC6CER { bits }
466 }
467 #[doc = "Bits 12:14 - Output compare 6 mode"]
468 #[inline]
469 pub fn oc6m(&self) -> OC6MR {
470 let bits = {
471 const MASK: u8 = 7;
472 const OFFSET: u8 = 12;
473 ((self.bits >> OFFSET) & MASK as u32) as u8
474 };
475 OC6MR { bits }
476 }
477 #[doc = "Bit 11 - Output compare 6 preload enable"]
478 #[inline]
479 pub fn oc6pe(&self) -> OC6PER {
480 let bits = {
481 const MASK: bool = true;
482 const OFFSET: u8 = 11;
483 ((self.bits >> OFFSET) & MASK as u32) != 0
484 };
485 OC6PER { bits }
486 }
487 #[doc = "Bit 10 - Output compare 6 fast enable"]
488 #[inline]
489 pub fn oc6fe(&self) -> OC6FER {
490 let bits = {
491 const MASK: bool = true;
492 const OFFSET: u8 = 10;
493 ((self.bits >> OFFSET) & MASK as u32) != 0
494 };
495 OC6FER { bits }
496 }
497 #[doc = "Bit 7 - Output compare 5 clear enable"]
498 #[inline]
499 pub fn oc5ce(&self) -> OC5CER {
500 let bits = {
501 const MASK: bool = true;
502 const OFFSET: u8 = 7;
503 ((self.bits >> OFFSET) & MASK as u32) != 0
504 };
505 OC5CER { bits }
506 }
507 #[doc = "Bits 4:6 - Output compare 5 mode"]
508 #[inline]
509 pub fn oc5m(&self) -> OC5MR {
510 let bits = {
511 const MASK: u8 = 7;
512 const OFFSET: u8 = 4;
513 ((self.bits >> OFFSET) & MASK as u32) as u8
514 };
515 OC5MR { bits }
516 }
517 #[doc = "Bit 3 - Output compare 5 preload enable"]
518 #[inline]
519 pub fn oc5pe(&self) -> OC5PER {
520 let bits = {
521 const MASK: bool = true;
522 const OFFSET: u8 = 3;
523 ((self.bits >> OFFSET) & MASK as u32) != 0
524 };
525 OC5PER { bits }
526 }
527 #[doc = "Bit 2 - Output compare 5 fast enable"]
528 #[inline]
529 pub fn oc5fe(&self) -> OC5FER {
530 let bits = {
531 const MASK: bool = true;
532 const OFFSET: u8 = 2;
533 ((self.bits >> OFFSET) & MASK as u32) != 0
534 };
535 OC5FER { bits }
536 }
537}
538impl W {
539 #[doc = r" Reset value of the register"]
540 #[inline]
541 pub fn reset_value() -> W {
542 W { bits: 0 }
543 }
544 #[doc = r" Writes raw bits to the register"]
545 #[inline]
546 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
547 self.bits = bits;
548 self
549 }
550 #[doc = "Bit 24 - Output Compare 6 mode bit 3"]
551 #[inline]
552 pub fn oc6m_bit3(&mut self) -> _OC6M_BIT3W {
553 _OC6M_BIT3W { w: self }
554 }
555 #[doc = "Bits 16:18 - Output Compare 5 mode bit 3"]
556 #[inline]
557 pub fn oc5m_bit3(&mut self) -> _OC5M_BIT3W {
558 _OC5M_BIT3W { w: self }
559 }
560 #[doc = "Bit 15 - Output compare 6 clear enable"]
561 #[inline]
562 pub fn oc6ce(&mut self) -> _OC6CEW {
563 _OC6CEW { w: self }
564 }
565 #[doc = "Bits 12:14 - Output compare 6 mode"]
566 #[inline]
567 pub fn oc6m(&mut self) -> _OC6MW {
568 _OC6MW { w: self }
569 }
570 #[doc = "Bit 11 - Output compare 6 preload enable"]
571 #[inline]
572 pub fn oc6pe(&mut self) -> _OC6PEW {
573 _OC6PEW { w: self }
574 }
575 #[doc = "Bit 10 - Output compare 6 fast enable"]
576 #[inline]
577 pub fn oc6fe(&mut self) -> _OC6FEW {
578 _OC6FEW { w: self }
579 }
580 #[doc = "Bit 7 - Output compare 5 clear enable"]
581 #[inline]
582 pub fn oc5ce(&mut self) -> _OC5CEW {
583 _OC5CEW { w: self }
584 }
585 #[doc = "Bits 4:6 - Output compare 5 mode"]
586 #[inline]
587 pub fn oc5m(&mut self) -> _OC5MW {
588 _OC5MW { w: self }
589 }
590 #[doc = "Bit 3 - Output compare 5 preload enable"]
591 #[inline]
592 pub fn oc5pe(&mut self) -> _OC5PEW {
593 _OC5PEW { w: self }
594 }
595 #[doc = "Bit 2 - Output compare 5 fast enable"]
596 #[inline]
597 pub fn oc5fe(&mut self) -> _OC5FEW {
598 _OC5FEW { w: self }
599 }
600}