lpc82x_pac/adc0/
chan_thrsel.rs

1#[doc = "Register `CHAN_THRSEL` reader"]
2pub struct R(crate::R<CHAN_THRSEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CHAN_THRSEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CHAN_THRSEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CHAN_THRSEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CHAN_THRSEL` writer"]
17pub struct W(crate::W<CHAN_THRSEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CHAN_THRSEL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CHAN_THRSEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CHAN_THRSEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Threshold select for channel 0.\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum CH0_THRSEL_A {
40    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
41    THRESHOLD0 = 0,
42    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
43    THRESHOLD1 = 1,
44}
45impl From<CH0_THRSEL_A> for bool {
46    #[inline(always)]
47    fn from(variant: CH0_THRSEL_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `CH0_THRSEL` reader - Threshold select for channel 0."]
52pub struct CH0_THRSEL_R(crate::FieldReader<bool, CH0_THRSEL_A>);
53impl CH0_THRSEL_R {
54    pub(crate) fn new(bits: bool) -> Self {
55        CH0_THRSEL_R(crate::FieldReader::new(bits))
56    }
57    #[doc = r"Get enumerated values variant"]
58    #[inline(always)]
59    pub fn variant(&self) -> CH0_THRSEL_A {
60        match self.bits {
61            false => CH0_THRSEL_A::THRESHOLD0,
62            true => CH0_THRSEL_A::THRESHOLD1,
63        }
64    }
65    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
66    #[inline(always)]
67    pub fn is_threshold0(&self) -> bool {
68        **self == CH0_THRSEL_A::THRESHOLD0
69    }
70    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
71    #[inline(always)]
72    pub fn is_threshold1(&self) -> bool {
73        **self == CH0_THRSEL_A::THRESHOLD1
74    }
75}
76impl core::ops::Deref for CH0_THRSEL_R {
77    type Target = crate::FieldReader<bool, CH0_THRSEL_A>;
78    #[inline(always)]
79    fn deref(&self) -> &Self::Target {
80        &self.0
81    }
82}
83#[doc = "Field `CH0_THRSEL` writer - Threshold select for channel 0."]
84pub struct CH0_THRSEL_W<'a> {
85    w: &'a mut W,
86}
87impl<'a> CH0_THRSEL_W<'a> {
88    #[doc = r"Writes `variant` to the field"]
89    #[inline(always)]
90    pub fn variant(self, variant: CH0_THRSEL_A) -> &'a mut W {
91        self.bit(variant.into())
92    }
93    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
94    #[inline(always)]
95    pub fn threshold0(self) -> &'a mut W {
96        self.variant(CH0_THRSEL_A::THRESHOLD0)
97    }
98    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
99    #[inline(always)]
100    pub fn threshold1(self) -> &'a mut W {
101        self.variant(CH0_THRSEL_A::THRESHOLD1)
102    }
103    #[doc = r"Sets the field bit"]
104    #[inline(always)]
105    pub fn set_bit(self) -> &'a mut W {
106        self.bit(true)
107    }
108    #[doc = r"Clears the field bit"]
109    #[inline(always)]
110    pub fn clear_bit(self) -> &'a mut W {
111        self.bit(false)
112    }
113    #[doc = r"Writes raw bits to the field"]
114    #[inline(always)]
115    pub fn bit(self, value: bool) -> &'a mut W {
116        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
117        self.w
118    }
119}
120#[doc = "Threshold select for channel 1\n\nValue on reset: 0"]
121#[derive(Clone, Copy, Debug, PartialEq)]
122pub enum CH1_THRSEL_A {
123    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
124    THRESHOLD0 = 0,
125    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
126    THRESHOLD1 = 1,
127}
128impl From<CH1_THRSEL_A> for bool {
129    #[inline(always)]
130    fn from(variant: CH1_THRSEL_A) -> Self {
131        variant as u8 != 0
132    }
133}
134#[doc = "Field `CH1_THRSEL` reader - Threshold select for channel 1"]
135pub struct CH1_THRSEL_R(crate::FieldReader<bool, CH1_THRSEL_A>);
136impl CH1_THRSEL_R {
137    pub(crate) fn new(bits: bool) -> Self {
138        CH1_THRSEL_R(crate::FieldReader::new(bits))
139    }
140    #[doc = r"Get enumerated values variant"]
141    #[inline(always)]
142    pub fn variant(&self) -> CH1_THRSEL_A {
143        match self.bits {
144            false => CH1_THRSEL_A::THRESHOLD0,
145            true => CH1_THRSEL_A::THRESHOLD1,
146        }
147    }
148    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
149    #[inline(always)]
150    pub fn is_threshold0(&self) -> bool {
151        **self == CH1_THRSEL_A::THRESHOLD0
152    }
153    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
154    #[inline(always)]
155    pub fn is_threshold1(&self) -> bool {
156        **self == CH1_THRSEL_A::THRESHOLD1
157    }
158}
159impl core::ops::Deref for CH1_THRSEL_R {
160    type Target = crate::FieldReader<bool, CH1_THRSEL_A>;
161    #[inline(always)]
162    fn deref(&self) -> &Self::Target {
163        &self.0
164    }
165}
166#[doc = "Field `CH1_THRSEL` writer - Threshold select for channel 1"]
167pub struct CH1_THRSEL_W<'a> {
168    w: &'a mut W,
169}
170impl<'a> CH1_THRSEL_W<'a> {
171    #[doc = r"Writes `variant` to the field"]
172    #[inline(always)]
173    pub fn variant(self, variant: CH1_THRSEL_A) -> &'a mut W {
174        self.bit(variant.into())
175    }
176    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
177    #[inline(always)]
178    pub fn threshold0(self) -> &'a mut W {
179        self.variant(CH1_THRSEL_A::THRESHOLD0)
180    }
181    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
182    #[inline(always)]
183    pub fn threshold1(self) -> &'a mut W {
184        self.variant(CH1_THRSEL_A::THRESHOLD1)
185    }
186    #[doc = r"Sets the field bit"]
187    #[inline(always)]
188    pub fn set_bit(self) -> &'a mut W {
189        self.bit(true)
190    }
191    #[doc = r"Clears the field bit"]
192    #[inline(always)]
193    pub fn clear_bit(self) -> &'a mut W {
194        self.bit(false)
195    }
196    #[doc = r"Writes raw bits to the field"]
197    #[inline(always)]
198    pub fn bit(self, value: bool) -> &'a mut W {
199        self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
200        self.w
201    }
202}
203#[doc = "Threshold select for channel 2.\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq)]
205pub enum CH2_THRSEL_A {
206    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
207    THRESHOLD0 = 0,
208    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
209    THRESHOLD1 = 1,
210}
211impl From<CH2_THRSEL_A> for bool {
212    #[inline(always)]
213    fn from(variant: CH2_THRSEL_A) -> Self {
214        variant as u8 != 0
215    }
216}
217#[doc = "Field `CH2_THRSEL` reader - Threshold select for channel 2."]
218pub struct CH2_THRSEL_R(crate::FieldReader<bool, CH2_THRSEL_A>);
219impl CH2_THRSEL_R {
220    pub(crate) fn new(bits: bool) -> Self {
221        CH2_THRSEL_R(crate::FieldReader::new(bits))
222    }
223    #[doc = r"Get enumerated values variant"]
224    #[inline(always)]
225    pub fn variant(&self) -> CH2_THRSEL_A {
226        match self.bits {
227            false => CH2_THRSEL_A::THRESHOLD0,
228            true => CH2_THRSEL_A::THRESHOLD1,
229        }
230    }
231    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
232    #[inline(always)]
233    pub fn is_threshold0(&self) -> bool {
234        **self == CH2_THRSEL_A::THRESHOLD0
235    }
236    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
237    #[inline(always)]
238    pub fn is_threshold1(&self) -> bool {
239        **self == CH2_THRSEL_A::THRESHOLD1
240    }
241}
242impl core::ops::Deref for CH2_THRSEL_R {
243    type Target = crate::FieldReader<bool, CH2_THRSEL_A>;
244    #[inline(always)]
245    fn deref(&self) -> &Self::Target {
246        &self.0
247    }
248}
249#[doc = "Field `CH2_THRSEL` writer - Threshold select for channel 2."]
250pub struct CH2_THRSEL_W<'a> {
251    w: &'a mut W,
252}
253impl<'a> CH2_THRSEL_W<'a> {
254    #[doc = r"Writes `variant` to the field"]
255    #[inline(always)]
256    pub fn variant(self, variant: CH2_THRSEL_A) -> &'a mut W {
257        self.bit(variant.into())
258    }
259    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
260    #[inline(always)]
261    pub fn threshold0(self) -> &'a mut W {
262        self.variant(CH2_THRSEL_A::THRESHOLD0)
263    }
264    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
265    #[inline(always)]
266    pub fn threshold1(self) -> &'a mut W {
267        self.variant(CH2_THRSEL_A::THRESHOLD1)
268    }
269    #[doc = r"Sets the field bit"]
270    #[inline(always)]
271    pub fn set_bit(self) -> &'a mut W {
272        self.bit(true)
273    }
274    #[doc = r"Clears the field bit"]
275    #[inline(always)]
276    pub fn clear_bit(self) -> &'a mut W {
277        self.bit(false)
278    }
279    #[doc = r"Writes raw bits to the field"]
280    #[inline(always)]
281    pub fn bit(self, value: bool) -> &'a mut W {
282        self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
283        self.w
284    }
285}
286#[doc = "Threshold select for channel 3.\n\nValue on reset: 0"]
287#[derive(Clone, Copy, Debug, PartialEq)]
288pub enum CH3_THRSEL_A {
289    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
290    THRESHOLD0 = 0,
291    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
292    THRESHOLD1 = 1,
293}
294impl From<CH3_THRSEL_A> for bool {
295    #[inline(always)]
296    fn from(variant: CH3_THRSEL_A) -> Self {
297        variant as u8 != 0
298    }
299}
300#[doc = "Field `CH3_THRSEL` reader - Threshold select for channel 3."]
301pub struct CH3_THRSEL_R(crate::FieldReader<bool, CH3_THRSEL_A>);
302impl CH3_THRSEL_R {
303    pub(crate) fn new(bits: bool) -> Self {
304        CH3_THRSEL_R(crate::FieldReader::new(bits))
305    }
306    #[doc = r"Get enumerated values variant"]
307    #[inline(always)]
308    pub fn variant(&self) -> CH3_THRSEL_A {
309        match self.bits {
310            false => CH3_THRSEL_A::THRESHOLD0,
311            true => CH3_THRSEL_A::THRESHOLD1,
312        }
313    }
314    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
315    #[inline(always)]
316    pub fn is_threshold0(&self) -> bool {
317        **self == CH3_THRSEL_A::THRESHOLD0
318    }
319    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
320    #[inline(always)]
321    pub fn is_threshold1(&self) -> bool {
322        **self == CH3_THRSEL_A::THRESHOLD1
323    }
324}
325impl core::ops::Deref for CH3_THRSEL_R {
326    type Target = crate::FieldReader<bool, CH3_THRSEL_A>;
327    #[inline(always)]
328    fn deref(&self) -> &Self::Target {
329        &self.0
330    }
331}
332#[doc = "Field `CH3_THRSEL` writer - Threshold select for channel 3."]
333pub struct CH3_THRSEL_W<'a> {
334    w: &'a mut W,
335}
336impl<'a> CH3_THRSEL_W<'a> {
337    #[doc = r"Writes `variant` to the field"]
338    #[inline(always)]
339    pub fn variant(self, variant: CH3_THRSEL_A) -> &'a mut W {
340        self.bit(variant.into())
341    }
342    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
343    #[inline(always)]
344    pub fn threshold0(self) -> &'a mut W {
345        self.variant(CH3_THRSEL_A::THRESHOLD0)
346    }
347    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
348    #[inline(always)]
349    pub fn threshold1(self) -> &'a mut W {
350        self.variant(CH3_THRSEL_A::THRESHOLD1)
351    }
352    #[doc = r"Sets the field bit"]
353    #[inline(always)]
354    pub fn set_bit(self) -> &'a mut W {
355        self.bit(true)
356    }
357    #[doc = r"Clears the field bit"]
358    #[inline(always)]
359    pub fn clear_bit(self) -> &'a mut W {
360        self.bit(false)
361    }
362    #[doc = r"Writes raw bits to the field"]
363    #[inline(always)]
364    pub fn bit(self, value: bool) -> &'a mut W {
365        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
366        self.w
367    }
368}
369#[doc = "Threshold select for channel 4.\n\nValue on reset: 0"]
370#[derive(Clone, Copy, Debug, PartialEq)]
371pub enum CH4_THRSEL_A {
372    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
373    THRESHOLD0 = 0,
374    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
375    THRESHOLD1 = 1,
376}
377impl From<CH4_THRSEL_A> for bool {
378    #[inline(always)]
379    fn from(variant: CH4_THRSEL_A) -> Self {
380        variant as u8 != 0
381    }
382}
383#[doc = "Field `CH4_THRSEL` reader - Threshold select for channel 4."]
384pub struct CH4_THRSEL_R(crate::FieldReader<bool, CH4_THRSEL_A>);
385impl CH4_THRSEL_R {
386    pub(crate) fn new(bits: bool) -> Self {
387        CH4_THRSEL_R(crate::FieldReader::new(bits))
388    }
389    #[doc = r"Get enumerated values variant"]
390    #[inline(always)]
391    pub fn variant(&self) -> CH4_THRSEL_A {
392        match self.bits {
393            false => CH4_THRSEL_A::THRESHOLD0,
394            true => CH4_THRSEL_A::THRESHOLD1,
395        }
396    }
397    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
398    #[inline(always)]
399    pub fn is_threshold0(&self) -> bool {
400        **self == CH4_THRSEL_A::THRESHOLD0
401    }
402    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
403    #[inline(always)]
404    pub fn is_threshold1(&self) -> bool {
405        **self == CH4_THRSEL_A::THRESHOLD1
406    }
407}
408impl core::ops::Deref for CH4_THRSEL_R {
409    type Target = crate::FieldReader<bool, CH4_THRSEL_A>;
410    #[inline(always)]
411    fn deref(&self) -> &Self::Target {
412        &self.0
413    }
414}
415#[doc = "Field `CH4_THRSEL` writer - Threshold select for channel 4."]
416pub struct CH4_THRSEL_W<'a> {
417    w: &'a mut W,
418}
419impl<'a> CH4_THRSEL_W<'a> {
420    #[doc = r"Writes `variant` to the field"]
421    #[inline(always)]
422    pub fn variant(self, variant: CH4_THRSEL_A) -> &'a mut W {
423        self.bit(variant.into())
424    }
425    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
426    #[inline(always)]
427    pub fn threshold0(self) -> &'a mut W {
428        self.variant(CH4_THRSEL_A::THRESHOLD0)
429    }
430    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
431    #[inline(always)]
432    pub fn threshold1(self) -> &'a mut W {
433        self.variant(CH4_THRSEL_A::THRESHOLD1)
434    }
435    #[doc = r"Sets the field bit"]
436    #[inline(always)]
437    pub fn set_bit(self) -> &'a mut W {
438        self.bit(true)
439    }
440    #[doc = r"Clears the field bit"]
441    #[inline(always)]
442    pub fn clear_bit(self) -> &'a mut W {
443        self.bit(false)
444    }
445    #[doc = r"Writes raw bits to the field"]
446    #[inline(always)]
447    pub fn bit(self, value: bool) -> &'a mut W {
448        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
449        self.w
450    }
451}
452#[doc = "Threshold select for channel 5.\n\nValue on reset: 0"]
453#[derive(Clone, Copy, Debug, PartialEq)]
454pub enum CH5_THRSEL_A {
455    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
456    THRESHOLD0 = 0,
457    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
458    THRESHOLD1 = 1,
459}
460impl From<CH5_THRSEL_A> for bool {
461    #[inline(always)]
462    fn from(variant: CH5_THRSEL_A) -> Self {
463        variant as u8 != 0
464    }
465}
466#[doc = "Field `CH5_THRSEL` reader - Threshold select for channel 5."]
467pub struct CH5_THRSEL_R(crate::FieldReader<bool, CH5_THRSEL_A>);
468impl CH5_THRSEL_R {
469    pub(crate) fn new(bits: bool) -> Self {
470        CH5_THRSEL_R(crate::FieldReader::new(bits))
471    }
472    #[doc = r"Get enumerated values variant"]
473    #[inline(always)]
474    pub fn variant(&self) -> CH5_THRSEL_A {
475        match self.bits {
476            false => CH5_THRSEL_A::THRESHOLD0,
477            true => CH5_THRSEL_A::THRESHOLD1,
478        }
479    }
480    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
481    #[inline(always)]
482    pub fn is_threshold0(&self) -> bool {
483        **self == CH5_THRSEL_A::THRESHOLD0
484    }
485    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
486    #[inline(always)]
487    pub fn is_threshold1(&self) -> bool {
488        **self == CH5_THRSEL_A::THRESHOLD1
489    }
490}
491impl core::ops::Deref for CH5_THRSEL_R {
492    type Target = crate::FieldReader<bool, CH5_THRSEL_A>;
493    #[inline(always)]
494    fn deref(&self) -> &Self::Target {
495        &self.0
496    }
497}
498#[doc = "Field `CH5_THRSEL` writer - Threshold select for channel 5."]
499pub struct CH5_THRSEL_W<'a> {
500    w: &'a mut W,
501}
502impl<'a> CH5_THRSEL_W<'a> {
503    #[doc = r"Writes `variant` to the field"]
504    #[inline(always)]
505    pub fn variant(self, variant: CH5_THRSEL_A) -> &'a mut W {
506        self.bit(variant.into())
507    }
508    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
509    #[inline(always)]
510    pub fn threshold0(self) -> &'a mut W {
511        self.variant(CH5_THRSEL_A::THRESHOLD0)
512    }
513    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
514    #[inline(always)]
515    pub fn threshold1(self) -> &'a mut W {
516        self.variant(CH5_THRSEL_A::THRESHOLD1)
517    }
518    #[doc = r"Sets the field bit"]
519    #[inline(always)]
520    pub fn set_bit(self) -> &'a mut W {
521        self.bit(true)
522    }
523    #[doc = r"Clears the field bit"]
524    #[inline(always)]
525    pub fn clear_bit(self) -> &'a mut W {
526        self.bit(false)
527    }
528    #[doc = r"Writes raw bits to the field"]
529    #[inline(always)]
530    pub fn bit(self, value: bool) -> &'a mut W {
531        self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
532        self.w
533    }
534}
535#[doc = "Threshold select for channel 6.\n\nValue on reset: 0"]
536#[derive(Clone, Copy, Debug, PartialEq)]
537pub enum CH6_THRSEL_A {
538    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
539    THRESHOLD0 = 0,
540    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
541    THRESHOLD1 = 1,
542}
543impl From<CH6_THRSEL_A> for bool {
544    #[inline(always)]
545    fn from(variant: CH6_THRSEL_A) -> Self {
546        variant as u8 != 0
547    }
548}
549#[doc = "Field `CH6_THRSEL` reader - Threshold select for channel 6."]
550pub struct CH6_THRSEL_R(crate::FieldReader<bool, CH6_THRSEL_A>);
551impl CH6_THRSEL_R {
552    pub(crate) fn new(bits: bool) -> Self {
553        CH6_THRSEL_R(crate::FieldReader::new(bits))
554    }
555    #[doc = r"Get enumerated values variant"]
556    #[inline(always)]
557    pub fn variant(&self) -> CH6_THRSEL_A {
558        match self.bits {
559            false => CH6_THRSEL_A::THRESHOLD0,
560            true => CH6_THRSEL_A::THRESHOLD1,
561        }
562    }
563    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
564    #[inline(always)]
565    pub fn is_threshold0(&self) -> bool {
566        **self == CH6_THRSEL_A::THRESHOLD0
567    }
568    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
569    #[inline(always)]
570    pub fn is_threshold1(&self) -> bool {
571        **self == CH6_THRSEL_A::THRESHOLD1
572    }
573}
574impl core::ops::Deref for CH6_THRSEL_R {
575    type Target = crate::FieldReader<bool, CH6_THRSEL_A>;
576    #[inline(always)]
577    fn deref(&self) -> &Self::Target {
578        &self.0
579    }
580}
581#[doc = "Field `CH6_THRSEL` writer - Threshold select for channel 6."]
582pub struct CH6_THRSEL_W<'a> {
583    w: &'a mut W,
584}
585impl<'a> CH6_THRSEL_W<'a> {
586    #[doc = r"Writes `variant` to the field"]
587    #[inline(always)]
588    pub fn variant(self, variant: CH6_THRSEL_A) -> &'a mut W {
589        self.bit(variant.into())
590    }
591    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
592    #[inline(always)]
593    pub fn threshold0(self) -> &'a mut W {
594        self.variant(CH6_THRSEL_A::THRESHOLD0)
595    }
596    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
597    #[inline(always)]
598    pub fn threshold1(self) -> &'a mut W {
599        self.variant(CH6_THRSEL_A::THRESHOLD1)
600    }
601    #[doc = r"Sets the field bit"]
602    #[inline(always)]
603    pub fn set_bit(self) -> &'a mut W {
604        self.bit(true)
605    }
606    #[doc = r"Clears the field bit"]
607    #[inline(always)]
608    pub fn clear_bit(self) -> &'a mut W {
609        self.bit(false)
610    }
611    #[doc = r"Writes raw bits to the field"]
612    #[inline(always)]
613    pub fn bit(self, value: bool) -> &'a mut W {
614        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
615        self.w
616    }
617}
618#[doc = "Threshold select for channel 7.\n\nValue on reset: 0"]
619#[derive(Clone, Copy, Debug, PartialEq)]
620pub enum CH7_THRSEL_A {
621    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
622    THRESHOLD0 = 0,
623    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
624    THRESHOLD1 = 1,
625}
626impl From<CH7_THRSEL_A> for bool {
627    #[inline(always)]
628    fn from(variant: CH7_THRSEL_A) -> Self {
629        variant as u8 != 0
630    }
631}
632#[doc = "Field `CH7_THRSEL` reader - Threshold select for channel 7."]
633pub struct CH7_THRSEL_R(crate::FieldReader<bool, CH7_THRSEL_A>);
634impl CH7_THRSEL_R {
635    pub(crate) fn new(bits: bool) -> Self {
636        CH7_THRSEL_R(crate::FieldReader::new(bits))
637    }
638    #[doc = r"Get enumerated values variant"]
639    #[inline(always)]
640    pub fn variant(&self) -> CH7_THRSEL_A {
641        match self.bits {
642            false => CH7_THRSEL_A::THRESHOLD0,
643            true => CH7_THRSEL_A::THRESHOLD1,
644        }
645    }
646    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
647    #[inline(always)]
648    pub fn is_threshold0(&self) -> bool {
649        **self == CH7_THRSEL_A::THRESHOLD0
650    }
651    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
652    #[inline(always)]
653    pub fn is_threshold1(&self) -> bool {
654        **self == CH7_THRSEL_A::THRESHOLD1
655    }
656}
657impl core::ops::Deref for CH7_THRSEL_R {
658    type Target = crate::FieldReader<bool, CH7_THRSEL_A>;
659    #[inline(always)]
660    fn deref(&self) -> &Self::Target {
661        &self.0
662    }
663}
664#[doc = "Field `CH7_THRSEL` writer - Threshold select for channel 7."]
665pub struct CH7_THRSEL_W<'a> {
666    w: &'a mut W,
667}
668impl<'a> CH7_THRSEL_W<'a> {
669    #[doc = r"Writes `variant` to the field"]
670    #[inline(always)]
671    pub fn variant(self, variant: CH7_THRSEL_A) -> &'a mut W {
672        self.bit(variant.into())
673    }
674    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
675    #[inline(always)]
676    pub fn threshold0(self) -> &'a mut W {
677        self.variant(CH7_THRSEL_A::THRESHOLD0)
678    }
679    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
680    #[inline(always)]
681    pub fn threshold1(self) -> &'a mut W {
682        self.variant(CH7_THRSEL_A::THRESHOLD1)
683    }
684    #[doc = r"Sets the field bit"]
685    #[inline(always)]
686    pub fn set_bit(self) -> &'a mut W {
687        self.bit(true)
688    }
689    #[doc = r"Clears the field bit"]
690    #[inline(always)]
691    pub fn clear_bit(self) -> &'a mut W {
692        self.bit(false)
693    }
694    #[doc = r"Writes raw bits to the field"]
695    #[inline(always)]
696    pub fn bit(self, value: bool) -> &'a mut W {
697        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
698        self.w
699    }
700}
701#[doc = "Threshold select for channel 8.\n\nValue on reset: 0"]
702#[derive(Clone, Copy, Debug, PartialEq)]
703pub enum CH8_THRSEL_A {
704    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
705    THRESHOLD0 = 0,
706    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
707    THRESHOLD1 = 1,
708}
709impl From<CH8_THRSEL_A> for bool {
710    #[inline(always)]
711    fn from(variant: CH8_THRSEL_A) -> Self {
712        variant as u8 != 0
713    }
714}
715#[doc = "Field `CH8_THRSEL` reader - Threshold select for channel 8."]
716pub struct CH8_THRSEL_R(crate::FieldReader<bool, CH8_THRSEL_A>);
717impl CH8_THRSEL_R {
718    pub(crate) fn new(bits: bool) -> Self {
719        CH8_THRSEL_R(crate::FieldReader::new(bits))
720    }
721    #[doc = r"Get enumerated values variant"]
722    #[inline(always)]
723    pub fn variant(&self) -> CH8_THRSEL_A {
724        match self.bits {
725            false => CH8_THRSEL_A::THRESHOLD0,
726            true => CH8_THRSEL_A::THRESHOLD1,
727        }
728    }
729    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
730    #[inline(always)]
731    pub fn is_threshold0(&self) -> bool {
732        **self == CH8_THRSEL_A::THRESHOLD0
733    }
734    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
735    #[inline(always)]
736    pub fn is_threshold1(&self) -> bool {
737        **self == CH8_THRSEL_A::THRESHOLD1
738    }
739}
740impl core::ops::Deref for CH8_THRSEL_R {
741    type Target = crate::FieldReader<bool, CH8_THRSEL_A>;
742    #[inline(always)]
743    fn deref(&self) -> &Self::Target {
744        &self.0
745    }
746}
747#[doc = "Field `CH8_THRSEL` writer - Threshold select for channel 8."]
748pub struct CH8_THRSEL_W<'a> {
749    w: &'a mut W,
750}
751impl<'a> CH8_THRSEL_W<'a> {
752    #[doc = r"Writes `variant` to the field"]
753    #[inline(always)]
754    pub fn variant(self, variant: CH8_THRSEL_A) -> &'a mut W {
755        self.bit(variant.into())
756    }
757    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
758    #[inline(always)]
759    pub fn threshold0(self) -> &'a mut W {
760        self.variant(CH8_THRSEL_A::THRESHOLD0)
761    }
762    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
763    #[inline(always)]
764    pub fn threshold1(self) -> &'a mut W {
765        self.variant(CH8_THRSEL_A::THRESHOLD1)
766    }
767    #[doc = r"Sets the field bit"]
768    #[inline(always)]
769    pub fn set_bit(self) -> &'a mut W {
770        self.bit(true)
771    }
772    #[doc = r"Clears the field bit"]
773    #[inline(always)]
774    pub fn clear_bit(self) -> &'a mut W {
775        self.bit(false)
776    }
777    #[doc = r"Writes raw bits to the field"]
778    #[inline(always)]
779    pub fn bit(self, value: bool) -> &'a mut W {
780        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
781        self.w
782    }
783}
784#[doc = "Threshold select for channel 9.\n\nValue on reset: 0"]
785#[derive(Clone, Copy, Debug, PartialEq)]
786pub enum CH9_THRSEL_A {
787    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
788    THRESHOLD0 = 0,
789    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
790    THRESHOLD1 = 1,
791}
792impl From<CH9_THRSEL_A> for bool {
793    #[inline(always)]
794    fn from(variant: CH9_THRSEL_A) -> Self {
795        variant as u8 != 0
796    }
797}
798#[doc = "Field `CH9_THRSEL` reader - Threshold select for channel 9."]
799pub struct CH9_THRSEL_R(crate::FieldReader<bool, CH9_THRSEL_A>);
800impl CH9_THRSEL_R {
801    pub(crate) fn new(bits: bool) -> Self {
802        CH9_THRSEL_R(crate::FieldReader::new(bits))
803    }
804    #[doc = r"Get enumerated values variant"]
805    #[inline(always)]
806    pub fn variant(&self) -> CH9_THRSEL_A {
807        match self.bits {
808            false => CH9_THRSEL_A::THRESHOLD0,
809            true => CH9_THRSEL_A::THRESHOLD1,
810        }
811    }
812    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
813    #[inline(always)]
814    pub fn is_threshold0(&self) -> bool {
815        **self == CH9_THRSEL_A::THRESHOLD0
816    }
817    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
818    #[inline(always)]
819    pub fn is_threshold1(&self) -> bool {
820        **self == CH9_THRSEL_A::THRESHOLD1
821    }
822}
823impl core::ops::Deref for CH9_THRSEL_R {
824    type Target = crate::FieldReader<bool, CH9_THRSEL_A>;
825    #[inline(always)]
826    fn deref(&self) -> &Self::Target {
827        &self.0
828    }
829}
830#[doc = "Field `CH9_THRSEL` writer - Threshold select for channel 9."]
831pub struct CH9_THRSEL_W<'a> {
832    w: &'a mut W,
833}
834impl<'a> CH9_THRSEL_W<'a> {
835    #[doc = r"Writes `variant` to the field"]
836    #[inline(always)]
837    pub fn variant(self, variant: CH9_THRSEL_A) -> &'a mut W {
838        self.bit(variant.into())
839    }
840    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
841    #[inline(always)]
842    pub fn threshold0(self) -> &'a mut W {
843        self.variant(CH9_THRSEL_A::THRESHOLD0)
844    }
845    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
846    #[inline(always)]
847    pub fn threshold1(self) -> &'a mut W {
848        self.variant(CH9_THRSEL_A::THRESHOLD1)
849    }
850    #[doc = r"Sets the field bit"]
851    #[inline(always)]
852    pub fn set_bit(self) -> &'a mut W {
853        self.bit(true)
854    }
855    #[doc = r"Clears the field bit"]
856    #[inline(always)]
857    pub fn clear_bit(self) -> &'a mut W {
858        self.bit(false)
859    }
860    #[doc = r"Writes raw bits to the field"]
861    #[inline(always)]
862    pub fn bit(self, value: bool) -> &'a mut W {
863        self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
864        self.w
865    }
866}
867#[doc = "Threshold select for channel 10.\n\nValue on reset: 0"]
868#[derive(Clone, Copy, Debug, PartialEq)]
869pub enum CH10_THRSEL_A {
870    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
871    THRESHOLD0 = 0,
872    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
873    THRESHOLD1 = 1,
874}
875impl From<CH10_THRSEL_A> for bool {
876    #[inline(always)]
877    fn from(variant: CH10_THRSEL_A) -> Self {
878        variant as u8 != 0
879    }
880}
881#[doc = "Field `CH10_THRSEL` reader - Threshold select for channel 10."]
882pub struct CH10_THRSEL_R(crate::FieldReader<bool, CH10_THRSEL_A>);
883impl CH10_THRSEL_R {
884    pub(crate) fn new(bits: bool) -> Self {
885        CH10_THRSEL_R(crate::FieldReader::new(bits))
886    }
887    #[doc = r"Get enumerated values variant"]
888    #[inline(always)]
889    pub fn variant(&self) -> CH10_THRSEL_A {
890        match self.bits {
891            false => CH10_THRSEL_A::THRESHOLD0,
892            true => CH10_THRSEL_A::THRESHOLD1,
893        }
894    }
895    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
896    #[inline(always)]
897    pub fn is_threshold0(&self) -> bool {
898        **self == CH10_THRSEL_A::THRESHOLD0
899    }
900    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
901    #[inline(always)]
902    pub fn is_threshold1(&self) -> bool {
903        **self == CH10_THRSEL_A::THRESHOLD1
904    }
905}
906impl core::ops::Deref for CH10_THRSEL_R {
907    type Target = crate::FieldReader<bool, CH10_THRSEL_A>;
908    #[inline(always)]
909    fn deref(&self) -> &Self::Target {
910        &self.0
911    }
912}
913#[doc = "Field `CH10_THRSEL` writer - Threshold select for channel 10."]
914pub struct CH10_THRSEL_W<'a> {
915    w: &'a mut W,
916}
917impl<'a> CH10_THRSEL_W<'a> {
918    #[doc = r"Writes `variant` to the field"]
919    #[inline(always)]
920    pub fn variant(self, variant: CH10_THRSEL_A) -> &'a mut W {
921        self.bit(variant.into())
922    }
923    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
924    #[inline(always)]
925    pub fn threshold0(self) -> &'a mut W {
926        self.variant(CH10_THRSEL_A::THRESHOLD0)
927    }
928    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
929    #[inline(always)]
930    pub fn threshold1(self) -> &'a mut W {
931        self.variant(CH10_THRSEL_A::THRESHOLD1)
932    }
933    #[doc = r"Sets the field bit"]
934    #[inline(always)]
935    pub fn set_bit(self) -> &'a mut W {
936        self.bit(true)
937    }
938    #[doc = r"Clears the field bit"]
939    #[inline(always)]
940    pub fn clear_bit(self) -> &'a mut W {
941        self.bit(false)
942    }
943    #[doc = r"Writes raw bits to the field"]
944    #[inline(always)]
945    pub fn bit(self, value: bool) -> &'a mut W {
946        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
947        self.w
948    }
949}
950#[doc = "Threshold select for channel 11.\n\nValue on reset: 0"]
951#[derive(Clone, Copy, Debug, PartialEq)]
952pub enum CH11_THRSEL_A {
953    #[doc = "0: Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
954    THRESHOLD0 = 0,
955    #[doc = "1: Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
956    THRESHOLD1 = 1,
957}
958impl From<CH11_THRSEL_A> for bool {
959    #[inline(always)]
960    fn from(variant: CH11_THRSEL_A) -> Self {
961        variant as u8 != 0
962    }
963}
964#[doc = "Field `CH11_THRSEL` reader - Threshold select for channel 11."]
965pub struct CH11_THRSEL_R(crate::FieldReader<bool, CH11_THRSEL_A>);
966impl CH11_THRSEL_R {
967    pub(crate) fn new(bits: bool) -> Self {
968        CH11_THRSEL_R(crate::FieldReader::new(bits))
969    }
970    #[doc = r"Get enumerated values variant"]
971    #[inline(always)]
972    pub fn variant(&self) -> CH11_THRSEL_A {
973        match self.bits {
974            false => CH11_THRSEL_A::THRESHOLD0,
975            true => CH11_THRSEL_A::THRESHOLD1,
976        }
977    }
978    #[doc = "Checks if the value of the field is `THRESHOLD0`"]
979    #[inline(always)]
980    pub fn is_threshold0(&self) -> bool {
981        **self == CH11_THRSEL_A::THRESHOLD0
982    }
983    #[doc = "Checks if the value of the field is `THRESHOLD1`"]
984    #[inline(always)]
985    pub fn is_threshold1(&self) -> bool {
986        **self == CH11_THRSEL_A::THRESHOLD1
987    }
988}
989impl core::ops::Deref for CH11_THRSEL_R {
990    type Target = crate::FieldReader<bool, CH11_THRSEL_A>;
991    #[inline(always)]
992    fn deref(&self) -> &Self::Target {
993        &self.0
994    }
995}
996#[doc = "Field `CH11_THRSEL` writer - Threshold select for channel 11."]
997pub struct CH11_THRSEL_W<'a> {
998    w: &'a mut W,
999}
1000impl<'a> CH11_THRSEL_W<'a> {
1001    #[doc = r"Writes `variant` to the field"]
1002    #[inline(always)]
1003    pub fn variant(self, variant: CH11_THRSEL_A) -> &'a mut W {
1004        self.bit(variant.into())
1005    }
1006    #[doc = "Threshold 0. Results for this channel will be compared against the threshold levels indicated in the THR0_LOW and THR0_HIGH registers."]
1007    #[inline(always)]
1008    pub fn threshold0(self) -> &'a mut W {
1009        self.variant(CH11_THRSEL_A::THRESHOLD0)
1010    }
1011    #[doc = "Threshold 1. Results for this channel will be compared against the threshold levels indicated in the THR1_LOW and THR1_HIGH registers."]
1012    #[inline(always)]
1013    pub fn threshold1(self) -> &'a mut W {
1014        self.variant(CH11_THRSEL_A::THRESHOLD1)
1015    }
1016    #[doc = r"Sets the field bit"]
1017    #[inline(always)]
1018    pub fn set_bit(self) -> &'a mut W {
1019        self.bit(true)
1020    }
1021    #[doc = r"Clears the field bit"]
1022    #[inline(always)]
1023    pub fn clear_bit(self) -> &'a mut W {
1024        self.bit(false)
1025    }
1026    #[doc = r"Writes raw bits to the field"]
1027    #[inline(always)]
1028    pub fn bit(self, value: bool) -> &'a mut W {
1029        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
1030        self.w
1031    }
1032}
1033impl R {
1034    #[doc = "Bit 0 - Threshold select for channel 0."]
1035    #[inline(always)]
1036    pub fn ch0_thrsel(&self) -> CH0_THRSEL_R {
1037        CH0_THRSEL_R::new((self.bits & 0x01) != 0)
1038    }
1039    #[doc = "Bit 1 - Threshold select for channel 1"]
1040    #[inline(always)]
1041    pub fn ch1_thrsel(&self) -> CH1_THRSEL_R {
1042        CH1_THRSEL_R::new(((self.bits >> 1) & 0x01) != 0)
1043    }
1044    #[doc = "Bit 2 - Threshold select for channel 2."]
1045    #[inline(always)]
1046    pub fn ch2_thrsel(&self) -> CH2_THRSEL_R {
1047        CH2_THRSEL_R::new(((self.bits >> 2) & 0x01) != 0)
1048    }
1049    #[doc = "Bit 3 - Threshold select for channel 3."]
1050    #[inline(always)]
1051    pub fn ch3_thrsel(&self) -> CH3_THRSEL_R {
1052        CH3_THRSEL_R::new(((self.bits >> 3) & 0x01) != 0)
1053    }
1054    #[doc = "Bit 4 - Threshold select for channel 4."]
1055    #[inline(always)]
1056    pub fn ch4_thrsel(&self) -> CH4_THRSEL_R {
1057        CH4_THRSEL_R::new(((self.bits >> 4) & 0x01) != 0)
1058    }
1059    #[doc = "Bit 5 - Threshold select for channel 5."]
1060    #[inline(always)]
1061    pub fn ch5_thrsel(&self) -> CH5_THRSEL_R {
1062        CH5_THRSEL_R::new(((self.bits >> 5) & 0x01) != 0)
1063    }
1064    #[doc = "Bit 6 - Threshold select for channel 6."]
1065    #[inline(always)]
1066    pub fn ch6_thrsel(&self) -> CH6_THRSEL_R {
1067        CH6_THRSEL_R::new(((self.bits >> 6) & 0x01) != 0)
1068    }
1069    #[doc = "Bit 7 - Threshold select for channel 7."]
1070    #[inline(always)]
1071    pub fn ch7_thrsel(&self) -> CH7_THRSEL_R {
1072        CH7_THRSEL_R::new(((self.bits >> 7) & 0x01) != 0)
1073    }
1074    #[doc = "Bit 8 - Threshold select for channel 8."]
1075    #[inline(always)]
1076    pub fn ch8_thrsel(&self) -> CH8_THRSEL_R {
1077        CH8_THRSEL_R::new(((self.bits >> 8) & 0x01) != 0)
1078    }
1079    #[doc = "Bit 9 - Threshold select for channel 9."]
1080    #[inline(always)]
1081    pub fn ch9_thrsel(&self) -> CH9_THRSEL_R {
1082        CH9_THRSEL_R::new(((self.bits >> 9) & 0x01) != 0)
1083    }
1084    #[doc = "Bit 10 - Threshold select for channel 10."]
1085    #[inline(always)]
1086    pub fn ch10_thrsel(&self) -> CH10_THRSEL_R {
1087        CH10_THRSEL_R::new(((self.bits >> 10) & 0x01) != 0)
1088    }
1089    #[doc = "Bit 11 - Threshold select for channel 11."]
1090    #[inline(always)]
1091    pub fn ch11_thrsel(&self) -> CH11_THRSEL_R {
1092        CH11_THRSEL_R::new(((self.bits >> 11) & 0x01) != 0)
1093    }
1094}
1095impl W {
1096    #[doc = "Bit 0 - Threshold select for channel 0."]
1097    #[inline(always)]
1098    pub fn ch0_thrsel(&mut self) -> CH0_THRSEL_W {
1099        CH0_THRSEL_W { w: self }
1100    }
1101    #[doc = "Bit 1 - Threshold select for channel 1"]
1102    #[inline(always)]
1103    pub fn ch1_thrsel(&mut self) -> CH1_THRSEL_W {
1104        CH1_THRSEL_W { w: self }
1105    }
1106    #[doc = "Bit 2 - Threshold select for channel 2."]
1107    #[inline(always)]
1108    pub fn ch2_thrsel(&mut self) -> CH2_THRSEL_W {
1109        CH2_THRSEL_W { w: self }
1110    }
1111    #[doc = "Bit 3 - Threshold select for channel 3."]
1112    #[inline(always)]
1113    pub fn ch3_thrsel(&mut self) -> CH3_THRSEL_W {
1114        CH3_THRSEL_W { w: self }
1115    }
1116    #[doc = "Bit 4 - Threshold select for channel 4."]
1117    #[inline(always)]
1118    pub fn ch4_thrsel(&mut self) -> CH4_THRSEL_W {
1119        CH4_THRSEL_W { w: self }
1120    }
1121    #[doc = "Bit 5 - Threshold select for channel 5."]
1122    #[inline(always)]
1123    pub fn ch5_thrsel(&mut self) -> CH5_THRSEL_W {
1124        CH5_THRSEL_W { w: self }
1125    }
1126    #[doc = "Bit 6 - Threshold select for channel 6."]
1127    #[inline(always)]
1128    pub fn ch6_thrsel(&mut self) -> CH6_THRSEL_W {
1129        CH6_THRSEL_W { w: self }
1130    }
1131    #[doc = "Bit 7 - Threshold select for channel 7."]
1132    #[inline(always)]
1133    pub fn ch7_thrsel(&mut self) -> CH7_THRSEL_W {
1134        CH7_THRSEL_W { w: self }
1135    }
1136    #[doc = "Bit 8 - Threshold select for channel 8."]
1137    #[inline(always)]
1138    pub fn ch8_thrsel(&mut self) -> CH8_THRSEL_W {
1139        CH8_THRSEL_W { w: self }
1140    }
1141    #[doc = "Bit 9 - Threshold select for channel 9."]
1142    #[inline(always)]
1143    pub fn ch9_thrsel(&mut self) -> CH9_THRSEL_W {
1144        CH9_THRSEL_W { w: self }
1145    }
1146    #[doc = "Bit 10 - Threshold select for channel 10."]
1147    #[inline(always)]
1148    pub fn ch10_thrsel(&mut self) -> CH10_THRSEL_W {
1149        CH10_THRSEL_W { w: self }
1150    }
1151    #[doc = "Bit 11 - Threshold select for channel 11."]
1152    #[inline(always)]
1153    pub fn ch11_thrsel(&mut self) -> CH11_THRSEL_W {
1154        CH11_THRSEL_W { w: self }
1155    }
1156    #[doc = "Writes raw bits to the register."]
1157    #[inline(always)]
1158    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1159        self.0.bits(bits);
1160        self
1161    }
1162}
1163#[doc = "ADC Channel-Threshold Select register. Specifies which set of threshold compare registers are to be used for each channel\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chan_thrsel](index.html) module"]
1164pub struct CHAN_THRSEL_SPEC;
1165impl crate::RegisterSpec for CHAN_THRSEL_SPEC {
1166    type Ux = u32;
1167}
1168#[doc = "`read()` method returns [chan_thrsel::R](R) reader structure"]
1169impl crate::Readable for CHAN_THRSEL_SPEC {
1170    type Reader = R;
1171}
1172#[doc = "`write(|w| ..)` method takes [chan_thrsel::W](W) writer structure"]
1173impl crate::Writable for CHAN_THRSEL_SPEC {
1174    type Writer = W;
1175}
1176#[doc = "`reset()` method sets CHAN_THRSEL to value 0"]
1177impl crate::Resettable for CHAN_THRSEL_SPEC {
1178    #[inline(always)]
1179    fn reset_value() -> Self::Ux {
1180        0
1181    }
1182}