efm32pg12_pac/adc0/
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 `SINGLEOF`"]
12pub struct SINGLEOF_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> SINGLEOF_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 << 8)) | (((value as u32) & 0x01) << 8);
30        self.w
31    }
32}
33#[doc = "Write proxy for field `SCANOF`"]
34pub struct SCANOF_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> SCANOF_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 << 9)) | (((value as u32) & 0x01) << 9);
52        self.w
53    }
54}
55#[doc = "Write proxy for field `SINGLEUF`"]
56pub struct SINGLEUF_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> SINGLEUF_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 << 10)) | (((value as u32) & 0x01) << 10);
74        self.w
75    }
76}
77#[doc = "Write proxy for field `SCANUF`"]
78pub struct SCANUF_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> SCANUF_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 << 11)) | (((value as u32) & 0x01) << 11);
96        self.w
97    }
98}
99#[doc = "Write proxy for field `SINGLECMP`"]
100pub struct SINGLECMP_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> SINGLECMP_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 << 16)) | (((value as u32) & 0x01) << 16);
118        self.w
119    }
120}
121#[doc = "Write proxy for field `SCANCMP`"]
122pub struct SCANCMP_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> SCANCMP_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 << 17)) | (((value as u32) & 0x01) << 17);
140        self.w
141    }
142}
143#[doc = "Write proxy for field `VREFOV`"]
144pub struct VREFOV_W<'a> {
145    w: &'a mut W,
146}
147impl<'a> VREFOV_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 << 24)) | (((value as u32) & 0x01) << 24);
162        self.w
163    }
164}
165#[doc = "Write proxy for field `PROGERR`"]
166pub struct PROGERR_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> PROGERR_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 << 25)) | (((value as u32) & 0x01) << 25);
184        self.w
185    }
186}
187#[doc = "Write proxy for field `SCANEXTPEND`"]
188pub struct SCANEXTPEND_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> SCANEXTPEND_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 << 26)) | (((value as u32) & 0x01) << 26);
206        self.w
207    }
208}
209#[doc = "Write proxy for field `SCANPEND`"]
210pub struct SCANPEND_W<'a> {
211    w: &'a mut W,
212}
213impl<'a> SCANPEND_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 << 27)) | (((value as u32) & 0x01) << 27);
228        self.w
229    }
230}
231#[doc = "Write proxy for field `PRSTIMEDERR`"]
232pub struct PRSTIMEDERR_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> PRSTIMEDERR_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 << 28)) | (((value as u32) & 0x01) << 28);
250        self.w
251    }
252}
253#[doc = "Write proxy for field `EM23ERR`"]
254pub struct EM23ERR_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> EM23ERR_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 << 29)) | (((value as u32) & 0x01) << 29);
272        self.w
273    }
274}
275impl W {
276    #[doc = "Bit 8 - Clear SINGLEOF Interrupt Flag"]
277    #[inline(always)]
278    pub fn singleof(&mut self) -> SINGLEOF_W {
279        SINGLEOF_W { w: self }
280    }
281    #[doc = "Bit 9 - Clear SCANOF Interrupt Flag"]
282    #[inline(always)]
283    pub fn scanof(&mut self) -> SCANOF_W {
284        SCANOF_W { w: self }
285    }
286    #[doc = "Bit 10 - Clear SINGLEUF Interrupt Flag"]
287    #[inline(always)]
288    pub fn singleuf(&mut self) -> SINGLEUF_W {
289        SINGLEUF_W { w: self }
290    }
291    #[doc = "Bit 11 - Clear SCANUF Interrupt Flag"]
292    #[inline(always)]
293    pub fn scanuf(&mut self) -> SCANUF_W {
294        SCANUF_W { w: self }
295    }
296    #[doc = "Bit 16 - Clear SINGLECMP Interrupt Flag"]
297    #[inline(always)]
298    pub fn singlecmp(&mut self) -> SINGLECMP_W {
299        SINGLECMP_W { w: self }
300    }
301    #[doc = "Bit 17 - Clear SCANCMP Interrupt Flag"]
302    #[inline(always)]
303    pub fn scancmp(&mut self) -> SCANCMP_W {
304        SCANCMP_W { w: self }
305    }
306    #[doc = "Bit 24 - Clear VREFOV Interrupt Flag"]
307    #[inline(always)]
308    pub fn vrefov(&mut self) -> VREFOV_W {
309        VREFOV_W { w: self }
310    }
311    #[doc = "Bit 25 - Clear PROGERR Interrupt Flag"]
312    #[inline(always)]
313    pub fn progerr(&mut self) -> PROGERR_W {
314        PROGERR_W { w: self }
315    }
316    #[doc = "Bit 26 - Clear SCANEXTPEND Interrupt Flag"]
317    #[inline(always)]
318    pub fn scanextpend(&mut self) -> SCANEXTPEND_W {
319        SCANEXTPEND_W { w: self }
320    }
321    #[doc = "Bit 27 - Clear SCANPEND Interrupt Flag"]
322    #[inline(always)]
323    pub fn scanpend(&mut self) -> SCANPEND_W {
324        SCANPEND_W { w: self }
325    }
326    #[doc = "Bit 28 - Clear PRSTIMEDERR Interrupt Flag"]
327    #[inline(always)]
328    pub fn prstimederr(&mut self) -> PRSTIMEDERR_W {
329        PRSTIMEDERR_W { w: self }
330    }
331    #[doc = "Bit 29 - Clear EM23ERR Interrupt Flag"]
332    #[inline(always)]
333    pub fn em23err(&mut self) -> EM23ERR_W {
334        EM23ERR_W { w: self }
335    }
336}