lpc845_pac/adc0/
chan_thrsel.rs1#[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 = "Field `CH1_THRSEL` reader - Threshold select for channel 1. See description for channel 0."]
121pub struct CH1_THRSEL_R(crate::FieldReader<bool, bool>);
122impl CH1_THRSEL_R {
123 pub(crate) fn new(bits: bool) -> Self {
124 CH1_THRSEL_R(crate::FieldReader::new(bits))
125 }
126}
127impl core::ops::Deref for CH1_THRSEL_R {
128 type Target = crate::FieldReader<bool, bool>;
129 #[inline(always)]
130 fn deref(&self) -> &Self::Target {
131 &self.0
132 }
133}
134#[doc = "Field `CH1_THRSEL` writer - Threshold select for channel 1. See description for channel 0."]
135pub struct CH1_THRSEL_W<'a> {
136 w: &'a mut W,
137}
138impl<'a> CH1_THRSEL_W<'a> {
139 #[doc = r"Sets the field bit"]
140 #[inline(always)]
141 pub fn set_bit(self) -> &'a mut W {
142 self.bit(true)
143 }
144 #[doc = r"Clears the field bit"]
145 #[inline(always)]
146 pub fn clear_bit(self) -> &'a mut W {
147 self.bit(false)
148 }
149 #[doc = r"Writes raw bits to the field"]
150 #[inline(always)]
151 pub fn bit(self, value: bool) -> &'a mut W {
152 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
153 self.w
154 }
155}
156#[doc = "Field `CH2_THRSEL` reader - Threshold select for channel 2. See description for channel 0."]
157pub struct CH2_THRSEL_R(crate::FieldReader<bool, bool>);
158impl CH2_THRSEL_R {
159 pub(crate) fn new(bits: bool) -> Self {
160 CH2_THRSEL_R(crate::FieldReader::new(bits))
161 }
162}
163impl core::ops::Deref for CH2_THRSEL_R {
164 type Target = crate::FieldReader<bool, bool>;
165 #[inline(always)]
166 fn deref(&self) -> &Self::Target {
167 &self.0
168 }
169}
170#[doc = "Field `CH2_THRSEL` writer - Threshold select for channel 2. See description for channel 0."]
171pub struct CH2_THRSEL_W<'a> {
172 w: &'a mut W,
173}
174impl<'a> CH2_THRSEL_W<'a> {
175 #[doc = r"Sets the field bit"]
176 #[inline(always)]
177 pub fn set_bit(self) -> &'a mut W {
178 self.bit(true)
179 }
180 #[doc = r"Clears the field bit"]
181 #[inline(always)]
182 pub fn clear_bit(self) -> &'a mut W {
183 self.bit(false)
184 }
185 #[doc = r"Writes raw bits to the field"]
186 #[inline(always)]
187 pub fn bit(self, value: bool) -> &'a mut W {
188 self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
189 self.w
190 }
191}
192#[doc = "Field `CH3_THRSEL` reader - Threshold select for channel 3. See description for channel 0."]
193pub struct CH3_THRSEL_R(crate::FieldReader<bool, bool>);
194impl CH3_THRSEL_R {
195 pub(crate) fn new(bits: bool) -> Self {
196 CH3_THRSEL_R(crate::FieldReader::new(bits))
197 }
198}
199impl core::ops::Deref for CH3_THRSEL_R {
200 type Target = crate::FieldReader<bool, bool>;
201 #[inline(always)]
202 fn deref(&self) -> &Self::Target {
203 &self.0
204 }
205}
206#[doc = "Field `CH3_THRSEL` writer - Threshold select for channel 3. See description for channel 0."]
207pub struct CH3_THRSEL_W<'a> {
208 w: &'a mut W,
209}
210impl<'a> CH3_THRSEL_W<'a> {
211 #[doc = r"Sets the field bit"]
212 #[inline(always)]
213 pub fn set_bit(self) -> &'a mut W {
214 self.bit(true)
215 }
216 #[doc = r"Clears the field bit"]
217 #[inline(always)]
218 pub fn clear_bit(self) -> &'a mut W {
219 self.bit(false)
220 }
221 #[doc = r"Writes raw bits to the field"]
222 #[inline(always)]
223 pub fn bit(self, value: bool) -> &'a mut W {
224 self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
225 self.w
226 }
227}
228#[doc = "Field `CH4_THRSEL` reader - Threshold select for channel 4. See description for channel 0."]
229pub struct CH4_THRSEL_R(crate::FieldReader<bool, bool>);
230impl CH4_THRSEL_R {
231 pub(crate) fn new(bits: bool) -> Self {
232 CH4_THRSEL_R(crate::FieldReader::new(bits))
233 }
234}
235impl core::ops::Deref for CH4_THRSEL_R {
236 type Target = crate::FieldReader<bool, bool>;
237 #[inline(always)]
238 fn deref(&self) -> &Self::Target {
239 &self.0
240 }
241}
242#[doc = "Field `CH4_THRSEL` writer - Threshold select for channel 4. See description for channel 0."]
243pub struct CH4_THRSEL_W<'a> {
244 w: &'a mut W,
245}
246impl<'a> CH4_THRSEL_W<'a> {
247 #[doc = r"Sets the field bit"]
248 #[inline(always)]
249 pub fn set_bit(self) -> &'a mut W {
250 self.bit(true)
251 }
252 #[doc = r"Clears the field bit"]
253 #[inline(always)]
254 pub fn clear_bit(self) -> &'a mut W {
255 self.bit(false)
256 }
257 #[doc = r"Writes raw bits to the field"]
258 #[inline(always)]
259 pub fn bit(self, value: bool) -> &'a mut W {
260 self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
261 self.w
262 }
263}
264#[doc = "Field `CH5_THRSEL` reader - Threshold select for channel 5. See description for channel 0."]
265pub struct CH5_THRSEL_R(crate::FieldReader<bool, bool>);
266impl CH5_THRSEL_R {
267 pub(crate) fn new(bits: bool) -> Self {
268 CH5_THRSEL_R(crate::FieldReader::new(bits))
269 }
270}
271impl core::ops::Deref for CH5_THRSEL_R {
272 type Target = crate::FieldReader<bool, bool>;
273 #[inline(always)]
274 fn deref(&self) -> &Self::Target {
275 &self.0
276 }
277}
278#[doc = "Field `CH5_THRSEL` writer - Threshold select for channel 5. See description for channel 0."]
279pub struct CH5_THRSEL_W<'a> {
280 w: &'a mut W,
281}
282impl<'a> CH5_THRSEL_W<'a> {
283 #[doc = r"Sets the field bit"]
284 #[inline(always)]
285 pub fn set_bit(self) -> &'a mut W {
286 self.bit(true)
287 }
288 #[doc = r"Clears the field bit"]
289 #[inline(always)]
290 pub fn clear_bit(self) -> &'a mut W {
291 self.bit(false)
292 }
293 #[doc = r"Writes raw bits to the field"]
294 #[inline(always)]
295 pub fn bit(self, value: bool) -> &'a mut W {
296 self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
297 self.w
298 }
299}
300#[doc = "Field `CH6_THRSEL` reader - Threshold select for channel 6. See description for channel 0."]
301pub struct CH6_THRSEL_R(crate::FieldReader<bool, bool>);
302impl CH6_THRSEL_R {
303 pub(crate) fn new(bits: bool) -> Self {
304 CH6_THRSEL_R(crate::FieldReader::new(bits))
305 }
306}
307impl core::ops::Deref for CH6_THRSEL_R {
308 type Target = crate::FieldReader<bool, bool>;
309 #[inline(always)]
310 fn deref(&self) -> &Self::Target {
311 &self.0
312 }
313}
314#[doc = "Field `CH6_THRSEL` writer - Threshold select for channel 6. See description for channel 0."]
315pub struct CH6_THRSEL_W<'a> {
316 w: &'a mut W,
317}
318impl<'a> CH6_THRSEL_W<'a> {
319 #[doc = r"Sets the field bit"]
320 #[inline(always)]
321 pub fn set_bit(self) -> &'a mut W {
322 self.bit(true)
323 }
324 #[doc = r"Clears the field bit"]
325 #[inline(always)]
326 pub fn clear_bit(self) -> &'a mut W {
327 self.bit(false)
328 }
329 #[doc = r"Writes raw bits to the field"]
330 #[inline(always)]
331 pub fn bit(self, value: bool) -> &'a mut W {
332 self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
333 self.w
334 }
335}
336#[doc = "Field `CH7_THRSEL` reader - Threshold select for channel 7. See description for channel 0."]
337pub struct CH7_THRSEL_R(crate::FieldReader<bool, bool>);
338impl CH7_THRSEL_R {
339 pub(crate) fn new(bits: bool) -> Self {
340 CH7_THRSEL_R(crate::FieldReader::new(bits))
341 }
342}
343impl core::ops::Deref for CH7_THRSEL_R {
344 type Target = crate::FieldReader<bool, bool>;
345 #[inline(always)]
346 fn deref(&self) -> &Self::Target {
347 &self.0
348 }
349}
350#[doc = "Field `CH7_THRSEL` writer - Threshold select for channel 7. See description for channel 0."]
351pub struct CH7_THRSEL_W<'a> {
352 w: &'a mut W,
353}
354impl<'a> CH7_THRSEL_W<'a> {
355 #[doc = r"Sets the field bit"]
356 #[inline(always)]
357 pub fn set_bit(self) -> &'a mut W {
358 self.bit(true)
359 }
360 #[doc = r"Clears the field bit"]
361 #[inline(always)]
362 pub fn clear_bit(self) -> &'a mut W {
363 self.bit(false)
364 }
365 #[doc = r"Writes raw bits to the field"]
366 #[inline(always)]
367 pub fn bit(self, value: bool) -> &'a mut W {
368 self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
369 self.w
370 }
371}
372#[doc = "Field `CH8_THRSEL` reader - Threshold select for channel 8. See description for channel 0."]
373pub struct CH8_THRSEL_R(crate::FieldReader<bool, bool>);
374impl CH8_THRSEL_R {
375 pub(crate) fn new(bits: bool) -> Self {
376 CH8_THRSEL_R(crate::FieldReader::new(bits))
377 }
378}
379impl core::ops::Deref for CH8_THRSEL_R {
380 type Target = crate::FieldReader<bool, bool>;
381 #[inline(always)]
382 fn deref(&self) -> &Self::Target {
383 &self.0
384 }
385}
386#[doc = "Field `CH8_THRSEL` writer - Threshold select for channel 8. See description for channel 0."]
387pub struct CH8_THRSEL_W<'a> {
388 w: &'a mut W,
389}
390impl<'a> CH8_THRSEL_W<'a> {
391 #[doc = r"Sets the field bit"]
392 #[inline(always)]
393 pub fn set_bit(self) -> &'a mut W {
394 self.bit(true)
395 }
396 #[doc = r"Clears the field bit"]
397 #[inline(always)]
398 pub fn clear_bit(self) -> &'a mut W {
399 self.bit(false)
400 }
401 #[doc = r"Writes raw bits to the field"]
402 #[inline(always)]
403 pub fn bit(self, value: bool) -> &'a mut W {
404 self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
405 self.w
406 }
407}
408#[doc = "Field `CH9_THRSEL` reader - Threshold select for channel 9. See description for channel 0."]
409pub struct CH9_THRSEL_R(crate::FieldReader<bool, bool>);
410impl CH9_THRSEL_R {
411 pub(crate) fn new(bits: bool) -> Self {
412 CH9_THRSEL_R(crate::FieldReader::new(bits))
413 }
414}
415impl core::ops::Deref for CH9_THRSEL_R {
416 type Target = crate::FieldReader<bool, bool>;
417 #[inline(always)]
418 fn deref(&self) -> &Self::Target {
419 &self.0
420 }
421}
422#[doc = "Field `CH9_THRSEL` writer - Threshold select for channel 9. See description for channel 0."]
423pub struct CH9_THRSEL_W<'a> {
424 w: &'a mut W,
425}
426impl<'a> CH9_THRSEL_W<'a> {
427 #[doc = r"Sets the field bit"]
428 #[inline(always)]
429 pub fn set_bit(self) -> &'a mut W {
430 self.bit(true)
431 }
432 #[doc = r"Clears the field bit"]
433 #[inline(always)]
434 pub fn clear_bit(self) -> &'a mut W {
435 self.bit(false)
436 }
437 #[doc = r"Writes raw bits to the field"]
438 #[inline(always)]
439 pub fn bit(self, value: bool) -> &'a mut W {
440 self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
441 self.w
442 }
443}
444#[doc = "Field `CH10_THRSEL` reader - Threshold select for channel 10. See description for channel 0."]
445pub struct CH10_THRSEL_R(crate::FieldReader<bool, bool>);
446impl CH10_THRSEL_R {
447 pub(crate) fn new(bits: bool) -> Self {
448 CH10_THRSEL_R(crate::FieldReader::new(bits))
449 }
450}
451impl core::ops::Deref for CH10_THRSEL_R {
452 type Target = crate::FieldReader<bool, bool>;
453 #[inline(always)]
454 fn deref(&self) -> &Self::Target {
455 &self.0
456 }
457}
458#[doc = "Field `CH10_THRSEL` writer - Threshold select for channel 10. See description for channel 0."]
459pub struct CH10_THRSEL_W<'a> {
460 w: &'a mut W,
461}
462impl<'a> CH10_THRSEL_W<'a> {
463 #[doc = r"Sets the field bit"]
464 #[inline(always)]
465 pub fn set_bit(self) -> &'a mut W {
466 self.bit(true)
467 }
468 #[doc = r"Clears the field bit"]
469 #[inline(always)]
470 pub fn clear_bit(self) -> &'a mut W {
471 self.bit(false)
472 }
473 #[doc = r"Writes raw bits to the field"]
474 #[inline(always)]
475 pub fn bit(self, value: bool) -> &'a mut W {
476 self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
477 self.w
478 }
479}
480#[doc = "Field `CH11_THRSEL` reader - Threshold select for channel 11. See description for channel 0."]
481pub struct CH11_THRSEL_R(crate::FieldReader<bool, bool>);
482impl CH11_THRSEL_R {
483 pub(crate) fn new(bits: bool) -> Self {
484 CH11_THRSEL_R(crate::FieldReader::new(bits))
485 }
486}
487impl core::ops::Deref for CH11_THRSEL_R {
488 type Target = crate::FieldReader<bool, bool>;
489 #[inline(always)]
490 fn deref(&self) -> &Self::Target {
491 &self.0
492 }
493}
494#[doc = "Field `CH11_THRSEL` writer - Threshold select for channel 11. See description for channel 0."]
495pub struct CH11_THRSEL_W<'a> {
496 w: &'a mut W,
497}
498impl<'a> CH11_THRSEL_W<'a> {
499 #[doc = r"Sets the field bit"]
500 #[inline(always)]
501 pub fn set_bit(self) -> &'a mut W {
502 self.bit(true)
503 }
504 #[doc = r"Clears the field bit"]
505 #[inline(always)]
506 pub fn clear_bit(self) -> &'a mut W {
507 self.bit(false)
508 }
509 #[doc = r"Writes raw bits to the field"]
510 #[inline(always)]
511 pub fn bit(self, value: bool) -> &'a mut W {
512 self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
513 self.w
514 }
515}
516impl R {
517 #[doc = "Bit 0 - Threshold select for channel 0."]
518 #[inline(always)]
519 pub fn ch0_thrsel(&self) -> CH0_THRSEL_R {
520 CH0_THRSEL_R::new((self.bits & 0x01) != 0)
521 }
522 #[doc = "Bit 1 - Threshold select for channel 1. See description for channel 0."]
523 #[inline(always)]
524 pub fn ch1_thrsel(&self) -> CH1_THRSEL_R {
525 CH1_THRSEL_R::new(((self.bits >> 1) & 0x01) != 0)
526 }
527 #[doc = "Bit 2 - Threshold select for channel 2. See description for channel 0."]
528 #[inline(always)]
529 pub fn ch2_thrsel(&self) -> CH2_THRSEL_R {
530 CH2_THRSEL_R::new(((self.bits >> 2) & 0x01) != 0)
531 }
532 #[doc = "Bit 3 - Threshold select for channel 3. See description for channel 0."]
533 #[inline(always)]
534 pub fn ch3_thrsel(&self) -> CH3_THRSEL_R {
535 CH3_THRSEL_R::new(((self.bits >> 3) & 0x01) != 0)
536 }
537 #[doc = "Bit 4 - Threshold select for channel 4. See description for channel 0."]
538 #[inline(always)]
539 pub fn ch4_thrsel(&self) -> CH4_THRSEL_R {
540 CH4_THRSEL_R::new(((self.bits >> 4) & 0x01) != 0)
541 }
542 #[doc = "Bit 5 - Threshold select for channel 5. See description for channel 0."]
543 #[inline(always)]
544 pub fn ch5_thrsel(&self) -> CH5_THRSEL_R {
545 CH5_THRSEL_R::new(((self.bits >> 5) & 0x01) != 0)
546 }
547 #[doc = "Bit 6 - Threshold select for channel 6. See description for channel 0."]
548 #[inline(always)]
549 pub fn ch6_thrsel(&self) -> CH6_THRSEL_R {
550 CH6_THRSEL_R::new(((self.bits >> 6) & 0x01) != 0)
551 }
552 #[doc = "Bit 7 - Threshold select for channel 7. See description for channel 0."]
553 #[inline(always)]
554 pub fn ch7_thrsel(&self) -> CH7_THRSEL_R {
555 CH7_THRSEL_R::new(((self.bits >> 7) & 0x01) != 0)
556 }
557 #[doc = "Bit 8 - Threshold select for channel 8. See description for channel 0."]
558 #[inline(always)]
559 pub fn ch8_thrsel(&self) -> CH8_THRSEL_R {
560 CH8_THRSEL_R::new(((self.bits >> 8) & 0x01) != 0)
561 }
562 #[doc = "Bit 9 - Threshold select for channel 9. See description for channel 0."]
563 #[inline(always)]
564 pub fn ch9_thrsel(&self) -> CH9_THRSEL_R {
565 CH9_THRSEL_R::new(((self.bits >> 9) & 0x01) != 0)
566 }
567 #[doc = "Bit 10 - Threshold select for channel 10. See description for channel 0."]
568 #[inline(always)]
569 pub fn ch10_thrsel(&self) -> CH10_THRSEL_R {
570 CH10_THRSEL_R::new(((self.bits >> 10) & 0x01) != 0)
571 }
572 #[doc = "Bit 11 - Threshold select for channel 11. See description for channel 0."]
573 #[inline(always)]
574 pub fn ch11_thrsel(&self) -> CH11_THRSEL_R {
575 CH11_THRSEL_R::new(((self.bits >> 11) & 0x01) != 0)
576 }
577}
578impl W {
579 #[doc = "Bit 0 - Threshold select for channel 0."]
580 #[inline(always)]
581 pub fn ch0_thrsel(&mut self) -> CH0_THRSEL_W {
582 CH0_THRSEL_W { w: self }
583 }
584 #[doc = "Bit 1 - Threshold select for channel 1. See description for channel 0."]
585 #[inline(always)]
586 pub fn ch1_thrsel(&mut self) -> CH1_THRSEL_W {
587 CH1_THRSEL_W { w: self }
588 }
589 #[doc = "Bit 2 - Threshold select for channel 2. See description for channel 0."]
590 #[inline(always)]
591 pub fn ch2_thrsel(&mut self) -> CH2_THRSEL_W {
592 CH2_THRSEL_W { w: self }
593 }
594 #[doc = "Bit 3 - Threshold select for channel 3. See description for channel 0."]
595 #[inline(always)]
596 pub fn ch3_thrsel(&mut self) -> CH3_THRSEL_W {
597 CH3_THRSEL_W { w: self }
598 }
599 #[doc = "Bit 4 - Threshold select for channel 4. See description for channel 0."]
600 #[inline(always)]
601 pub fn ch4_thrsel(&mut self) -> CH4_THRSEL_W {
602 CH4_THRSEL_W { w: self }
603 }
604 #[doc = "Bit 5 - Threshold select for channel 5. See description for channel 0."]
605 #[inline(always)]
606 pub fn ch5_thrsel(&mut self) -> CH5_THRSEL_W {
607 CH5_THRSEL_W { w: self }
608 }
609 #[doc = "Bit 6 - Threshold select for channel 6. See description for channel 0."]
610 #[inline(always)]
611 pub fn ch6_thrsel(&mut self) -> CH6_THRSEL_W {
612 CH6_THRSEL_W { w: self }
613 }
614 #[doc = "Bit 7 - Threshold select for channel 7. See description for channel 0."]
615 #[inline(always)]
616 pub fn ch7_thrsel(&mut self) -> CH7_THRSEL_W {
617 CH7_THRSEL_W { w: self }
618 }
619 #[doc = "Bit 8 - Threshold select for channel 8. See description for channel 0."]
620 #[inline(always)]
621 pub fn ch8_thrsel(&mut self) -> CH8_THRSEL_W {
622 CH8_THRSEL_W { w: self }
623 }
624 #[doc = "Bit 9 - Threshold select for channel 9. See description for channel 0."]
625 #[inline(always)]
626 pub fn ch9_thrsel(&mut self) -> CH9_THRSEL_W {
627 CH9_THRSEL_W { w: self }
628 }
629 #[doc = "Bit 10 - Threshold select for channel 10. See description for channel 0."]
630 #[inline(always)]
631 pub fn ch10_thrsel(&mut self) -> CH10_THRSEL_W {
632 CH10_THRSEL_W { w: self }
633 }
634 #[doc = "Bit 11 - Threshold select for channel 11. See description for channel 0."]
635 #[inline(always)]
636 pub fn ch11_thrsel(&mut self) -> CH11_THRSEL_W {
637 CH11_THRSEL_W { w: self }
638 }
639 #[doc = "Writes raw bits to the register."]
640 #[inline(always)]
641 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
642 self.0.bits(bits);
643 self
644 }
645}
646#[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"]
647pub struct CHAN_THRSEL_SPEC;
648impl crate::RegisterSpec for CHAN_THRSEL_SPEC {
649 type Ux = u32;
650}
651#[doc = "`read()` method returns [chan_thrsel::R](R) reader structure"]
652impl crate::Readable for CHAN_THRSEL_SPEC {
653 type Reader = R;
654}
655#[doc = "`write(|w| ..)` method takes [chan_thrsel::W](W) writer structure"]
656impl crate::Writable for CHAN_THRSEL_SPEC {
657 type Writer = W;
658}
659#[doc = "`reset()` method sets CHAN_THRSEL to value 0"]
660impl crate::Resettable for CHAN_THRSEL_SPEC {
661 #[inline(always)]
662 fn reset_value() -> Self::Ux {
663 0
664 }
665}