efm32hg309f64/timer0/
ifc.rs

1#[doc = "Writer for register IFC"]
2pub type W = crate::W<u32, super::IFC>;
3#[doc = "Register IFC `reset()`'s with value 0"]
4impl crate::ResetValue for super::IFC {
5    type Type = u32;
6    #[inline(always)]
7    fn reset_value() -> Self::Type {
8        0
9    }
10}
11#[doc = "Write proxy for field `OF`"]
12pub struct OF_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> OF_W<'a> {
16    #[doc = r"Sets the field bit"]
17    #[inline(always)]
18    pub fn set_bit(self) -> &'a mut W {
19        self.bit(true)
20    }
21    #[doc = r"Clears the field bit"]
22    #[inline(always)]
23    pub fn clear_bit(self) -> &'a mut W {
24        self.bit(false)
25    }
26    #[doc = r"Writes raw bits to the field"]
27    #[inline(always)]
28    pub fn bit(self, value: bool) -> &'a mut W {
29        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
30        self.w
31    }
32}
33#[doc = "Write proxy for field `UF`"]
34pub struct UF_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> UF_W<'a> {
38    #[doc = r"Sets the field bit"]
39    #[inline(always)]
40    pub fn set_bit(self) -> &'a mut W {
41        self.bit(true)
42    }
43    #[doc = r"Clears the field bit"]
44    #[inline(always)]
45    pub fn clear_bit(self) -> &'a mut W {
46        self.bit(false)
47    }
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub fn bit(self, value: bool) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
52        self.w
53    }
54}
55#[doc = "Write proxy for field `CC0`"]
56pub struct CC0_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> CC0_W<'a> {
60    #[doc = r"Sets the field bit"]
61    #[inline(always)]
62    pub fn set_bit(self) -> &'a mut W {
63        self.bit(true)
64    }
65    #[doc = r"Clears the field bit"]
66    #[inline(always)]
67    pub fn clear_bit(self) -> &'a mut W {
68        self.bit(false)
69    }
70    #[doc = r"Writes raw bits to the field"]
71    #[inline(always)]
72    pub fn bit(self, value: bool) -> &'a mut W {
73        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
74        self.w
75    }
76}
77#[doc = "Write proxy for field `CC1`"]
78pub struct CC1_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> CC1_W<'a> {
82    #[doc = r"Sets the field bit"]
83    #[inline(always)]
84    pub fn set_bit(self) -> &'a mut W {
85        self.bit(true)
86    }
87    #[doc = r"Clears the field bit"]
88    #[inline(always)]
89    pub fn clear_bit(self) -> &'a mut W {
90        self.bit(false)
91    }
92    #[doc = r"Writes raw bits to the field"]
93    #[inline(always)]
94    pub fn bit(self, value: bool) -> &'a mut W {
95        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
96        self.w
97    }
98}
99#[doc = "Write proxy for field `CC2`"]
100pub struct CC2_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> CC2_W<'a> {
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
118        self.w
119    }
120}
121#[doc = "Write proxy for field `ICBOF0`"]
122pub struct ICBOF0_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> ICBOF0_W<'a> {
126    #[doc = r"Sets the field bit"]
127    #[inline(always)]
128    pub fn set_bit(self) -> &'a mut W {
129        self.bit(true)
130    }
131    #[doc = r"Clears the field bit"]
132    #[inline(always)]
133    pub fn clear_bit(self) -> &'a mut W {
134        self.bit(false)
135    }
136    #[doc = r"Writes raw bits to the field"]
137    #[inline(always)]
138    pub fn bit(self, value: bool) -> &'a mut W {
139        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
140        self.w
141    }
142}
143#[doc = "Write proxy for field `ICBOF1`"]
144pub struct ICBOF1_W<'a> {
145    w: &'a mut W,
146}
147impl<'a> ICBOF1_W<'a> {
148    #[doc = r"Sets the field bit"]
149    #[inline(always)]
150    pub fn set_bit(self) -> &'a mut W {
151        self.bit(true)
152    }
153    #[doc = r"Clears the field bit"]
154    #[inline(always)]
155    pub fn clear_bit(self) -> &'a mut W {
156        self.bit(false)
157    }
158    #[doc = r"Writes raw bits to the field"]
159    #[inline(always)]
160    pub fn bit(self, value: bool) -> &'a mut W {
161        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
162        self.w
163    }
164}
165#[doc = "Write proxy for field `ICBOF2`"]
166pub struct ICBOF2_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> ICBOF2_W<'a> {
170    #[doc = r"Sets the field bit"]
171    #[inline(always)]
172    pub fn set_bit(self) -> &'a mut W {
173        self.bit(true)
174    }
175    #[doc = r"Clears the field bit"]
176    #[inline(always)]
177    pub fn clear_bit(self) -> &'a mut W {
178        self.bit(false)
179    }
180    #[doc = r"Writes raw bits to the field"]
181    #[inline(always)]
182    pub fn bit(self, value: bool) -> &'a mut W {
183        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
184        self.w
185    }
186}
187impl W {
188    #[doc = "Bit 0 - Overflow Interrupt Flag Clear"]
189    #[inline(always)]
190    pub fn of(&mut self) -> OF_W {
191        OF_W { w: self }
192    }
193    #[doc = "Bit 1 - Underflow Interrupt Flag Clear"]
194    #[inline(always)]
195    pub fn uf(&mut self) -> UF_W {
196        UF_W { w: self }
197    }
198    #[doc = "Bit 4 - CC Channel 0 Interrupt Flag Clear"]
199    #[inline(always)]
200    pub fn cc0(&mut self) -> CC0_W {
201        CC0_W { w: self }
202    }
203    #[doc = "Bit 5 - CC Channel 1 Interrupt Flag Clear"]
204    #[inline(always)]
205    pub fn cc1(&mut self) -> CC1_W {
206        CC1_W { w: self }
207    }
208    #[doc = "Bit 6 - CC Channel 2 Interrupt Flag Clear"]
209    #[inline(always)]
210    pub fn cc2(&mut self) -> CC2_W {
211        CC2_W { w: self }
212    }
213    #[doc = "Bit 8 - CC Channel 0 Input Capture Buffer Overflow Interrupt Flag Clear"]
214    #[inline(always)]
215    pub fn icbof0(&mut self) -> ICBOF0_W {
216        ICBOF0_W { w: self }
217    }
218    #[doc = "Bit 9 - CC Channel 1 Input Capture Buffer Overflow Interrupt Flag Clear"]
219    #[inline(always)]
220    pub fn icbof1(&mut self) -> ICBOF1_W {
221        ICBOF1_W { w: self }
222    }
223    #[doc = "Bit 10 - CC Channel 2 Input Capture Buffer Overflow Interrupt Flag Clear"]
224    #[inline(always)]
225    pub fn icbof2(&mut self) -> ICBOF2_W {
226        ICBOF2_W { w: self }
227    }
228}