efm32pg12_pac/lesense/
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 `CH0`"]
12pub struct CH0_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> CH0_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 `CH1`"]
34pub struct CH1_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> CH1_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 `CH2`"]
56pub struct CH2_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> CH2_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 `CH3`"]
78pub struct CH3_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> CH3_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 `CH4`"]
100pub struct CH4_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> CH4_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 `CH5`"]
122pub struct CH5_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> CH5_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 `CH6`"]
144pub struct CH6_W<'a> {
145    w: &'a mut W,
146}
147impl<'a> CH6_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 << 6)) | (((value as u32) & 0x01) << 6);
162        self.w
163    }
164}
165#[doc = "Write proxy for field `CH7`"]
166pub struct CH7_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> CH7_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 << 7)) | (((value as u32) & 0x01) << 7);
184        self.w
185    }
186}
187#[doc = "Write proxy for field `CH8`"]
188pub struct CH8_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> CH8_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 << 8)) | (((value as u32) & 0x01) << 8);
206        self.w
207    }
208}
209#[doc = "Write proxy for field `CH9`"]
210pub struct CH9_W<'a> {
211    w: &'a mut W,
212}
213impl<'a> CH9_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 << 9)) | (((value as u32) & 0x01) << 9);
228        self.w
229    }
230}
231#[doc = "Write proxy for field `CH10`"]
232pub struct CH10_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> CH10_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 << 10)) | (((value as u32) & 0x01) << 10);
250        self.w
251    }
252}
253#[doc = "Write proxy for field `CH11`"]
254pub struct CH11_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> CH11_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 << 11)) | (((value as u32) & 0x01) << 11);
272        self.w
273    }
274}
275#[doc = "Write proxy for field `CH12`"]
276pub struct CH12_W<'a> {
277    w: &'a mut W,
278}
279impl<'a> CH12_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 << 12)) | (((value as u32) & 0x01) << 12);
294        self.w
295    }
296}
297#[doc = "Write proxy for field `CH13`"]
298pub struct CH13_W<'a> {
299    w: &'a mut W,
300}
301impl<'a> CH13_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 << 13)) | (((value as u32) & 0x01) << 13);
316        self.w
317    }
318}
319#[doc = "Write proxy for field `CH14`"]
320pub struct CH14_W<'a> {
321    w: &'a mut W,
322}
323impl<'a> CH14_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 << 14)) | (((value as u32) & 0x01) << 14);
338        self.w
339    }
340}
341#[doc = "Write proxy for field `CH15`"]
342pub struct CH15_W<'a> {
343    w: &'a mut W,
344}
345impl<'a> CH15_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 << 15)) | (((value as u32) & 0x01) << 15);
360        self.w
361    }
362}
363#[doc = "Write proxy for field `SCANCOMPLETE`"]
364pub struct SCANCOMPLETE_W<'a> {
365    w: &'a mut W,
366}
367impl<'a> SCANCOMPLETE_W<'a> {
368    #[doc = r"Sets the field bit"]
369    #[inline(always)]
370    pub fn set_bit(self) -> &'a mut W {
371        self.bit(true)
372    }
373    #[doc = r"Clears the field bit"]
374    #[inline(always)]
375    pub fn clear_bit(self) -> &'a mut W {
376        self.bit(false)
377    }
378    #[doc = r"Writes raw bits to the field"]
379    #[inline(always)]
380    pub fn bit(self, value: bool) -> &'a mut W {
381        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
382        self.w
383    }
384}
385#[doc = "Write proxy for field `DEC`"]
386pub struct DEC_W<'a> {
387    w: &'a mut W,
388}
389impl<'a> DEC_W<'a> {
390    #[doc = r"Sets the field bit"]
391    #[inline(always)]
392    pub fn set_bit(self) -> &'a mut W {
393        self.bit(true)
394    }
395    #[doc = r"Clears the field bit"]
396    #[inline(always)]
397    pub fn clear_bit(self) -> &'a mut W {
398        self.bit(false)
399    }
400    #[doc = r"Writes raw bits to the field"]
401    #[inline(always)]
402    pub fn bit(self, value: bool) -> &'a mut W {
403        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
404        self.w
405    }
406}
407#[doc = "Write proxy for field `DECERR`"]
408pub struct DECERR_W<'a> {
409    w: &'a mut W,
410}
411impl<'a> DECERR_W<'a> {
412    #[doc = r"Sets the field bit"]
413    #[inline(always)]
414    pub fn set_bit(self) -> &'a mut W {
415        self.bit(true)
416    }
417    #[doc = r"Clears the field bit"]
418    #[inline(always)]
419    pub fn clear_bit(self) -> &'a mut W {
420        self.bit(false)
421    }
422    #[doc = r"Writes raw bits to the field"]
423    #[inline(always)]
424    pub fn bit(self, value: bool) -> &'a mut W {
425        self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
426        self.w
427    }
428}
429#[doc = "Write proxy for field `BUFDATAV`"]
430pub struct BUFDATAV_W<'a> {
431    w: &'a mut W,
432}
433impl<'a> BUFDATAV_W<'a> {
434    #[doc = r"Sets the field bit"]
435    #[inline(always)]
436    pub fn set_bit(self) -> &'a mut W {
437        self.bit(true)
438    }
439    #[doc = r"Clears the field bit"]
440    #[inline(always)]
441    pub fn clear_bit(self) -> &'a mut W {
442        self.bit(false)
443    }
444    #[doc = r"Writes raw bits to the field"]
445    #[inline(always)]
446    pub fn bit(self, value: bool) -> &'a mut W {
447        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
448        self.w
449    }
450}
451#[doc = "Write proxy for field `BUFLEVEL`"]
452pub struct BUFLEVEL_W<'a> {
453    w: &'a mut W,
454}
455impl<'a> BUFLEVEL_W<'a> {
456    #[doc = r"Sets the field bit"]
457    #[inline(always)]
458    pub fn set_bit(self) -> &'a mut W {
459        self.bit(true)
460    }
461    #[doc = r"Clears the field bit"]
462    #[inline(always)]
463    pub fn clear_bit(self) -> &'a mut W {
464        self.bit(false)
465    }
466    #[doc = r"Writes raw bits to the field"]
467    #[inline(always)]
468    pub fn bit(self, value: bool) -> &'a mut W {
469        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
470        self.w
471    }
472}
473#[doc = "Write proxy for field `BUFOF`"]
474pub struct BUFOF_W<'a> {
475    w: &'a mut W,
476}
477impl<'a> BUFOF_W<'a> {
478    #[doc = r"Sets the field bit"]
479    #[inline(always)]
480    pub fn set_bit(self) -> &'a mut W {
481        self.bit(true)
482    }
483    #[doc = r"Clears the field bit"]
484    #[inline(always)]
485    pub fn clear_bit(self) -> &'a mut W {
486        self.bit(false)
487    }
488    #[doc = r"Writes raw bits to the field"]
489    #[inline(always)]
490    pub fn bit(self, value: bool) -> &'a mut W {
491        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
492        self.w
493    }
494}
495#[doc = "Write proxy for field `CNTOF`"]
496pub struct CNTOF_W<'a> {
497    w: &'a mut W,
498}
499impl<'a> CNTOF_W<'a> {
500    #[doc = r"Sets the field bit"]
501    #[inline(always)]
502    pub fn set_bit(self) -> &'a mut W {
503        self.bit(true)
504    }
505    #[doc = r"Clears the field bit"]
506    #[inline(always)]
507    pub fn clear_bit(self) -> &'a mut W {
508        self.bit(false)
509    }
510    #[doc = r"Writes raw bits to the field"]
511    #[inline(always)]
512    pub fn bit(self, value: bool) -> &'a mut W {
513        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
514        self.w
515    }
516}
517impl W {
518    #[doc = "Bit 0 - Clear CH0 Interrupt Flag"]
519    #[inline(always)]
520    pub fn ch0(&mut self) -> CH0_W {
521        CH0_W { w: self }
522    }
523    #[doc = "Bit 1 - Clear CH1 Interrupt Flag"]
524    #[inline(always)]
525    pub fn ch1(&mut self) -> CH1_W {
526        CH1_W { w: self }
527    }
528    #[doc = "Bit 2 - Clear CH2 Interrupt Flag"]
529    #[inline(always)]
530    pub fn ch2(&mut self) -> CH2_W {
531        CH2_W { w: self }
532    }
533    #[doc = "Bit 3 - Clear CH3 Interrupt Flag"]
534    #[inline(always)]
535    pub fn ch3(&mut self) -> CH3_W {
536        CH3_W { w: self }
537    }
538    #[doc = "Bit 4 - Clear CH4 Interrupt Flag"]
539    #[inline(always)]
540    pub fn ch4(&mut self) -> CH4_W {
541        CH4_W { w: self }
542    }
543    #[doc = "Bit 5 - Clear CH5 Interrupt Flag"]
544    #[inline(always)]
545    pub fn ch5(&mut self) -> CH5_W {
546        CH5_W { w: self }
547    }
548    #[doc = "Bit 6 - Clear CH6 Interrupt Flag"]
549    #[inline(always)]
550    pub fn ch6(&mut self) -> CH6_W {
551        CH6_W { w: self }
552    }
553    #[doc = "Bit 7 - Clear CH7 Interrupt Flag"]
554    #[inline(always)]
555    pub fn ch7(&mut self) -> CH7_W {
556        CH7_W { w: self }
557    }
558    #[doc = "Bit 8 - Clear CH8 Interrupt Flag"]
559    #[inline(always)]
560    pub fn ch8(&mut self) -> CH8_W {
561        CH8_W { w: self }
562    }
563    #[doc = "Bit 9 - Clear CH9 Interrupt Flag"]
564    #[inline(always)]
565    pub fn ch9(&mut self) -> CH9_W {
566        CH9_W { w: self }
567    }
568    #[doc = "Bit 10 - Clear CH10 Interrupt Flag"]
569    #[inline(always)]
570    pub fn ch10(&mut self) -> CH10_W {
571        CH10_W { w: self }
572    }
573    #[doc = "Bit 11 - Clear CH11 Interrupt Flag"]
574    #[inline(always)]
575    pub fn ch11(&mut self) -> CH11_W {
576        CH11_W { w: self }
577    }
578    #[doc = "Bit 12 - Clear CH12 Interrupt Flag"]
579    #[inline(always)]
580    pub fn ch12(&mut self) -> CH12_W {
581        CH12_W { w: self }
582    }
583    #[doc = "Bit 13 - Clear CH13 Interrupt Flag"]
584    #[inline(always)]
585    pub fn ch13(&mut self) -> CH13_W {
586        CH13_W { w: self }
587    }
588    #[doc = "Bit 14 - Clear CH14 Interrupt Flag"]
589    #[inline(always)]
590    pub fn ch14(&mut self) -> CH14_W {
591        CH14_W { w: self }
592    }
593    #[doc = "Bit 15 - Clear CH15 Interrupt Flag"]
594    #[inline(always)]
595    pub fn ch15(&mut self) -> CH15_W {
596        CH15_W { w: self }
597    }
598    #[doc = "Bit 16 - Clear SCANCOMPLETE Interrupt Flag"]
599    #[inline(always)]
600    pub fn scancomplete(&mut self) -> SCANCOMPLETE_W {
601        SCANCOMPLETE_W { w: self }
602    }
603    #[doc = "Bit 17 - Clear DEC Interrupt Flag"]
604    #[inline(always)]
605    pub fn dec(&mut self) -> DEC_W {
606        DEC_W { w: self }
607    }
608    #[doc = "Bit 18 - Clear DECERR Interrupt Flag"]
609    #[inline(always)]
610    pub fn decerr(&mut self) -> DECERR_W {
611        DECERR_W { w: self }
612    }
613    #[doc = "Bit 19 - Clear BUFDATAV Interrupt Flag"]
614    #[inline(always)]
615    pub fn bufdatav(&mut self) -> BUFDATAV_W {
616        BUFDATAV_W { w: self }
617    }
618    #[doc = "Bit 20 - Clear BUFLEVEL Interrupt Flag"]
619    #[inline(always)]
620    pub fn buflevel(&mut self) -> BUFLEVEL_W {
621        BUFLEVEL_W { w: self }
622    }
623    #[doc = "Bit 21 - Clear BUFOF Interrupt Flag"]
624    #[inline(always)]
625    pub fn bufof(&mut self) -> BUFOF_W {
626        BUFOF_W { w: self }
627    }
628    #[doc = "Bit 22 - Clear CNTOF Interrupt Flag"]
629    #[inline(always)]
630    pub fn cntof(&mut self) -> CNTOF_W {
631        CNTOF_W { w: self }
632    }
633}