stm32f30x/tim8/ccmr3_output/
mod.rs

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