stm32l4x2_pac/tim1/
or3.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::OR3 {
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 BK2INER {
47    bits: bool,
48}
49impl BK2INER {
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 BK2CMP1ER {
68    bits: bool,
69}
70impl BK2CMP1ER {
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 BK2CMP2ER {
89    bits: bool,
90}
91impl BK2CMP2ER {
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 BK2DFBK0ER {
110    bits: bool,
111}
112impl BK2DFBK0ER {
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 BK2INPR {
131    bits: bool,
132}
133impl BK2INPR {
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 BK2CMP1PR {
152    bits: bool,
153}
154impl BK2CMP1PR {
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 BK2CMP2PR {
173    bits: bool,
174}
175impl BK2CMP2PR {
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 _BK2INEW<'a> {
194    w: &'a mut W,
195}
196impl<'a> _BK2INEW<'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 _BK2CMP1EW<'a> {
217    w: &'a mut W,
218}
219impl<'a> _BK2CMP1EW<'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 _BK2CMP2EW<'a> {
240    w: &'a mut W,
241}
242impl<'a> _BK2CMP2EW<'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 _BK2DFBK0EW<'a> {
263    w: &'a mut W,
264}
265impl<'a> _BK2DFBK0EW<'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 _BK2INPW<'a> {
286    w: &'a mut W,
287}
288impl<'a> _BK2INPW<'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 _BK2CMP1PW<'a> {
309    w: &'a mut W,
310}
311impl<'a> _BK2CMP1PW<'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 _BK2CMP2PW<'a> {
332    w: &'a mut W,
333}
334impl<'a> _BK2CMP2PW<'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 - BRK2 BKIN input enable"]
360    #[inline]
361    pub fn bk2ine(&self) -> BK2INER {
362        let bits = {
363            const MASK: bool = true;
364            const OFFSET: u8 = 0;
365            ((self.bits >> OFFSET) & MASK as u32) != 0
366        };
367        BK2INER { bits }
368    }
369    #[doc = "Bit 1 - BRK2 COMP1 enable"]
370    #[inline]
371    pub fn bk2cmp1e(&self) -> BK2CMP1ER {
372        let bits = {
373            const MASK: bool = true;
374            const OFFSET: u8 = 1;
375            ((self.bits >> OFFSET) & MASK as u32) != 0
376        };
377        BK2CMP1ER { bits }
378    }
379    #[doc = "Bit 2 - BRK2 COMP2 enable"]
380    #[inline]
381    pub fn bk2cmp2e(&self) -> BK2CMP2ER {
382        let bits = {
383            const MASK: bool = true;
384            const OFFSET: u8 = 2;
385            ((self.bits >> OFFSET) & MASK as u32) != 0
386        };
387        BK2CMP2ER { bits }
388    }
389    #[doc = "Bit 8 - BRK2 DFSDM_BREAK0 enable"]
390    #[inline]
391    pub fn bk2dfbk0e(&self) -> BK2DFBK0ER {
392        let bits = {
393            const MASK: bool = true;
394            const OFFSET: u8 = 8;
395            ((self.bits >> OFFSET) & MASK as u32) != 0
396        };
397        BK2DFBK0ER { bits }
398    }
399    #[doc = "Bit 9 - BRK2 BKIN input polarity"]
400    #[inline]
401    pub fn bk2inp(&self) -> BK2INPR {
402        let bits = {
403            const MASK: bool = true;
404            const OFFSET: u8 = 9;
405            ((self.bits >> OFFSET) & MASK as u32) != 0
406        };
407        BK2INPR { bits }
408    }
409    #[doc = "Bit 10 - BRK2 COMP1 input polarity"]
410    #[inline]
411    pub fn bk2cmp1p(&self) -> BK2CMP1PR {
412        let bits = {
413            const MASK: bool = true;
414            const OFFSET: u8 = 10;
415            ((self.bits >> OFFSET) & MASK as u32) != 0
416        };
417        BK2CMP1PR { bits }
418    }
419    #[doc = "Bit 11 - BRK2 COMP2 input polarity"]
420    #[inline]
421    pub fn bk2cmp2p(&self) -> BK2CMP2PR {
422        let bits = {
423            const MASK: bool = true;
424            const OFFSET: u8 = 11;
425            ((self.bits >> OFFSET) & MASK as u32) != 0
426        };
427        BK2CMP2PR { bits }
428    }
429}
430impl W {
431    #[doc = r" Reset value of the register"]
432    #[inline]
433    pub fn reset_value() -> W {
434        W { bits: 1 }
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 - BRK2 BKIN input enable"]
443    #[inline]
444    pub fn bk2ine(&mut self) -> _BK2INEW {
445        _BK2INEW { w: self }
446    }
447    #[doc = "Bit 1 - BRK2 COMP1 enable"]
448    #[inline]
449    pub fn bk2cmp1e(&mut self) -> _BK2CMP1EW {
450        _BK2CMP1EW { w: self }
451    }
452    #[doc = "Bit 2 - BRK2 COMP2 enable"]
453    #[inline]
454    pub fn bk2cmp2e(&mut self) -> _BK2CMP2EW {
455        _BK2CMP2EW { w: self }
456    }
457    #[doc = "Bit 8 - BRK2 DFSDM_BREAK0 enable"]
458    #[inline]
459    pub fn bk2dfbk0e(&mut self) -> _BK2DFBK0EW {
460        _BK2DFBK0EW { w: self }
461    }
462    #[doc = "Bit 9 - BRK2 BKIN input polarity"]
463    #[inline]
464    pub fn bk2inp(&mut self) -> _BK2INPW {
465        _BK2INPW { w: self }
466    }
467    #[doc = "Bit 10 - BRK2 COMP1 input polarity"]
468    #[inline]
469    pub fn bk2cmp1p(&mut self) -> _BK2CMP1PW {
470        _BK2CMP1PW { w: self }
471    }
472    #[doc = "Bit 11 - BRK2 COMP2 input polarity"]
473    #[inline]
474    pub fn bk2cmp2p(&mut self) -> _BK2CMP2PW {
475        _BK2CMP2PW { w: self }
476    }
477}