efm32pg12_pac/vdac0/
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 `CH0CD`"]
12pub struct CH0CD_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> CH0CD_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 `CH1CD`"]
34pub struct CH1CD_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> CH1CD_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 `CH0OF`"]
56pub struct CH0OF_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> CH0OF_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 << 2)) | (((value as u32) & 0x01) << 2);
74        self.w
75    }
76}
77#[doc = "Write proxy for field `CH1OF`"]
78pub struct CH1OF_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> CH1OF_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 << 3)) | (((value as u32) & 0x01) << 3);
96        self.w
97    }
98}
99#[doc = "Write proxy for field `CH0UF`"]
100pub struct CH0UF_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> CH0UF_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 << 4)) | (((value as u32) & 0x01) << 4);
118        self.w
119    }
120}
121#[doc = "Write proxy for field `CH1UF`"]
122pub struct CH1UF_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> CH1UF_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 << 5)) | (((value as u32) & 0x01) << 5);
140        self.w
141    }
142}
143#[doc = "Write proxy for field `EM23ERR`"]
144pub struct EM23ERR_W<'a> {
145    w: &'a mut W,
146}
147impl<'a> EM23ERR_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 << 15)) | (((value as u32) & 0x01) << 15);
162        self.w
163    }
164}
165#[doc = "Write proxy for field `OPA0APORTCONFLICT`"]
166pub struct OPA0APORTCONFLICT_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> OPA0APORTCONFLICT_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 << 16)) | (((value as u32) & 0x01) << 16);
184        self.w
185    }
186}
187#[doc = "Write proxy for field `OPA1APORTCONFLICT`"]
188pub struct OPA1APORTCONFLICT_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> OPA1APORTCONFLICT_W<'a> {
192    #[doc = r"Sets the field bit"]
193    #[inline(always)]
194    pub fn set_bit(self) -> &'a mut W {
195        self.bit(true)
196    }
197    #[doc = r"Clears the field bit"]
198    #[inline(always)]
199    pub fn clear_bit(self) -> &'a mut W {
200        self.bit(false)
201    }
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub fn bit(self, value: bool) -> &'a mut W {
205        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
206        self.w
207    }
208}
209#[doc = "Write proxy for field `OPA2APORTCONFLICT`"]
210pub struct OPA2APORTCONFLICT_W<'a> {
211    w: &'a mut W,
212}
213impl<'a> OPA2APORTCONFLICT_W<'a> {
214    #[doc = r"Sets the field bit"]
215    #[inline(always)]
216    pub fn set_bit(self) -> &'a mut W {
217        self.bit(true)
218    }
219    #[doc = r"Clears the field bit"]
220    #[inline(always)]
221    pub fn clear_bit(self) -> &'a mut W {
222        self.bit(false)
223    }
224    #[doc = r"Writes raw bits to the field"]
225    #[inline(always)]
226    pub fn bit(self, value: bool) -> &'a mut W {
227        self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
228        self.w
229    }
230}
231#[doc = "Write proxy for field `OPA0PRSTIMEDERR`"]
232pub struct OPA0PRSTIMEDERR_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> OPA0PRSTIMEDERR_W<'a> {
236    #[doc = r"Sets the field bit"]
237    #[inline(always)]
238    pub fn set_bit(self) -> &'a mut W {
239        self.bit(true)
240    }
241    #[doc = r"Clears the field bit"]
242    #[inline(always)]
243    pub fn clear_bit(self) -> &'a mut W {
244        self.bit(false)
245    }
246    #[doc = r"Writes raw bits to the field"]
247    #[inline(always)]
248    pub fn bit(self, value: bool) -> &'a mut W {
249        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
250        self.w
251    }
252}
253#[doc = "Write proxy for field `OPA1PRSTIMEDERR`"]
254pub struct OPA1PRSTIMEDERR_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> OPA1PRSTIMEDERR_W<'a> {
258    #[doc = r"Sets the field bit"]
259    #[inline(always)]
260    pub fn set_bit(self) -> &'a mut W {
261        self.bit(true)
262    }
263    #[doc = r"Clears the field bit"]
264    #[inline(always)]
265    pub fn clear_bit(self) -> &'a mut W {
266        self.bit(false)
267    }
268    #[doc = r"Writes raw bits to the field"]
269    #[inline(always)]
270    pub fn bit(self, value: bool) -> &'a mut W {
271        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
272        self.w
273    }
274}
275#[doc = "Write proxy for field `OPA2PRSTIMEDERR`"]
276pub struct OPA2PRSTIMEDERR_W<'a> {
277    w: &'a mut W,
278}
279impl<'a> OPA2PRSTIMEDERR_W<'a> {
280    #[doc = r"Sets the field bit"]
281    #[inline(always)]
282    pub fn set_bit(self) -> &'a mut W {
283        self.bit(true)
284    }
285    #[doc = r"Clears the field bit"]
286    #[inline(always)]
287    pub fn clear_bit(self) -> &'a mut W {
288        self.bit(false)
289    }
290    #[doc = r"Writes raw bits to the field"]
291    #[inline(always)]
292    pub fn bit(self, value: bool) -> &'a mut W {
293        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
294        self.w
295    }
296}
297#[doc = "Write proxy for field `OPA0OUTVALID`"]
298pub struct OPA0OUTVALID_W<'a> {
299    w: &'a mut W,
300}
301impl<'a> OPA0OUTVALID_W<'a> {
302    #[doc = r"Sets the field bit"]
303    #[inline(always)]
304    pub fn set_bit(self) -> &'a mut W {
305        self.bit(true)
306    }
307    #[doc = r"Clears the field bit"]
308    #[inline(always)]
309    pub fn clear_bit(self) -> &'a mut W {
310        self.bit(false)
311    }
312    #[doc = r"Writes raw bits to the field"]
313    #[inline(always)]
314    pub fn bit(self, value: bool) -> &'a mut W {
315        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
316        self.w
317    }
318}
319#[doc = "Write proxy for field `OPA1OUTVALID`"]
320pub struct OPA1OUTVALID_W<'a> {
321    w: &'a mut W,
322}
323impl<'a> OPA1OUTVALID_W<'a> {
324    #[doc = r"Sets the field bit"]
325    #[inline(always)]
326    pub fn set_bit(self) -> &'a mut W {
327        self.bit(true)
328    }
329    #[doc = r"Clears the field bit"]
330    #[inline(always)]
331    pub fn clear_bit(self) -> &'a mut W {
332        self.bit(false)
333    }
334    #[doc = r"Writes raw bits to the field"]
335    #[inline(always)]
336    pub fn bit(self, value: bool) -> &'a mut W {
337        self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
338        self.w
339    }
340}
341#[doc = "Write proxy for field `OPA2OUTVALID`"]
342pub struct OPA2OUTVALID_W<'a> {
343    w: &'a mut W,
344}
345impl<'a> OPA2OUTVALID_W<'a> {
346    #[doc = r"Sets the field bit"]
347    #[inline(always)]
348    pub fn set_bit(self) -> &'a mut W {
349        self.bit(true)
350    }
351    #[doc = r"Clears the field bit"]
352    #[inline(always)]
353    pub fn clear_bit(self) -> &'a mut W {
354        self.bit(false)
355    }
356    #[doc = r"Writes raw bits to the field"]
357    #[inline(always)]
358    pub fn bit(self, value: bool) -> &'a mut W {
359        self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30);
360        self.w
361    }
362}
363impl W {
364    #[doc = "Bit 0 - Clear CH0CD Interrupt Flag"]
365    #[inline(always)]
366    pub fn ch0cd(&mut self) -> CH0CD_W {
367        CH0CD_W { w: self }
368    }
369    #[doc = "Bit 1 - Clear CH1CD Interrupt Flag"]
370    #[inline(always)]
371    pub fn ch1cd(&mut self) -> CH1CD_W {
372        CH1CD_W { w: self }
373    }
374    #[doc = "Bit 2 - Clear CH0OF Interrupt Flag"]
375    #[inline(always)]
376    pub fn ch0of(&mut self) -> CH0OF_W {
377        CH0OF_W { w: self }
378    }
379    #[doc = "Bit 3 - Clear CH1OF Interrupt Flag"]
380    #[inline(always)]
381    pub fn ch1of(&mut self) -> CH1OF_W {
382        CH1OF_W { w: self }
383    }
384    #[doc = "Bit 4 - Clear CH0UF Interrupt Flag"]
385    #[inline(always)]
386    pub fn ch0uf(&mut self) -> CH0UF_W {
387        CH0UF_W { w: self }
388    }
389    #[doc = "Bit 5 - Clear CH1UF Interrupt Flag"]
390    #[inline(always)]
391    pub fn ch1uf(&mut self) -> CH1UF_W {
392        CH1UF_W { w: self }
393    }
394    #[doc = "Bit 15 - Clear EM23ERR Interrupt Flag"]
395    #[inline(always)]
396    pub fn em23err(&mut self) -> EM23ERR_W {
397        EM23ERR_W { w: self }
398    }
399    #[doc = "Bit 16 - Clear OPA0APORTCONFLICT Interrupt Flag"]
400    #[inline(always)]
401    pub fn opa0aportconflict(&mut self) -> OPA0APORTCONFLICT_W {
402        OPA0APORTCONFLICT_W { w: self }
403    }
404    #[doc = "Bit 17 - Clear OPA1APORTCONFLICT Interrupt Flag"]
405    #[inline(always)]
406    pub fn opa1aportconflict(&mut self) -> OPA1APORTCONFLICT_W {
407        OPA1APORTCONFLICT_W { w: self }
408    }
409    #[doc = "Bit 18 - Clear OPA2APORTCONFLICT Interrupt Flag"]
410    #[inline(always)]
411    pub fn opa2aportconflict(&mut self) -> OPA2APORTCONFLICT_W {
412        OPA2APORTCONFLICT_W { w: self }
413    }
414    #[doc = "Bit 20 - Clear OPA0PRSTIMEDERR Interrupt Flag"]
415    #[inline(always)]
416    pub fn opa0prstimederr(&mut self) -> OPA0PRSTIMEDERR_W {
417        OPA0PRSTIMEDERR_W { w: self }
418    }
419    #[doc = "Bit 21 - Clear OPA1PRSTIMEDERR Interrupt Flag"]
420    #[inline(always)]
421    pub fn opa1prstimederr(&mut self) -> OPA1PRSTIMEDERR_W {
422        OPA1PRSTIMEDERR_W { w: self }
423    }
424    #[doc = "Bit 22 - Clear OPA2PRSTIMEDERR Interrupt Flag"]
425    #[inline(always)]
426    pub fn opa2prstimederr(&mut self) -> OPA2PRSTIMEDERR_W {
427        OPA2PRSTIMEDERR_W { w: self }
428    }
429    #[doc = "Bit 28 - Clear OPA0OUTVALID Interrupt Flag"]
430    #[inline(always)]
431    pub fn opa0outvalid(&mut self) -> OPA0OUTVALID_W {
432        OPA0OUTVALID_W { w: self }
433    }
434    #[doc = "Bit 29 - Clear OPA1OUTVALID Interrupt Flag"]
435    #[inline(always)]
436    pub fn opa1outvalid(&mut self) -> OPA1OUTVALID_W {
437        OPA1OUTVALID_W { w: self }
438    }
439    #[doc = "Bit 30 - Clear OPA2OUTVALID Interrupt Flag"]
440    #[inline(always)]
441    pub fn opa2outvalid(&mut self) -> OPA2OUTVALID_W {
442        OPA2OUTVALID_W { w: self }
443    }
444}