msp430f5529/comparator_b/
cbctl1.rs1#[doc = "Register `CBCTL1` reader"]
2pub struct R(crate::R<CBCTL1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CBCTL1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CBCTL1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CBCTL1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CBCTL1` writer"]
17pub struct W(crate::W<CBCTL1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CBCTL1_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<CBCTL1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CBCTL1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CBOUT` reader - Comp. B Output"]
38pub struct CBOUT_R(crate::FieldReader<bool, bool>);
39impl CBOUT_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: bool) -> Self {
42 CBOUT_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for CBOUT_R {
46 type Target = crate::FieldReader<bool, bool>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `CBOUT` writer - Comp. B Output"]
53pub struct CBOUT_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> CBOUT_W<'a> {
57 #[doc = r"Sets the field bit"]
58 #[inline(always)]
59 pub fn set_bit(self) -> &'a mut W {
60 self.bit(true)
61 }
62 #[doc = r"Clears the field bit"]
63 #[inline(always)]
64 pub fn clear_bit(self) -> &'a mut W {
65 self.bit(false)
66 }
67 #[doc = r"Writes raw bits to the field"]
68 #[inline(always)]
69 pub fn bit(self, value: bool) -> &'a mut W {
70 self.w.bits = (self.w.bits & !0x01) | (value as u16 & 0x01);
71 self.w
72 }
73}
74#[doc = "Field `CBOUTPOL` reader - Comp. B Output Polarity"]
75pub struct CBOUTPOL_R(crate::FieldReader<bool, bool>);
76impl CBOUTPOL_R {
77 #[inline(always)]
78 pub(crate) fn new(bits: bool) -> Self {
79 CBOUTPOL_R(crate::FieldReader::new(bits))
80 }
81}
82impl core::ops::Deref for CBOUTPOL_R {
83 type Target = crate::FieldReader<bool, bool>;
84 #[inline(always)]
85 fn deref(&self) -> &Self::Target {
86 &self.0
87 }
88}
89#[doc = "Field `CBOUTPOL` writer - Comp. B Output Polarity"]
90pub struct CBOUTPOL_W<'a> {
91 w: &'a mut W,
92}
93impl<'a> CBOUTPOL_W<'a> {
94 #[doc = r"Sets the field bit"]
95 #[inline(always)]
96 pub fn set_bit(self) -> &'a mut W {
97 self.bit(true)
98 }
99 #[doc = r"Clears the field bit"]
100 #[inline(always)]
101 pub fn clear_bit(self) -> &'a mut W {
102 self.bit(false)
103 }
104 #[doc = r"Writes raw bits to the field"]
105 #[inline(always)]
106 pub fn bit(self, value: bool) -> &'a mut W {
107 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u16 & 0x01) << 1);
108 self.w
109 }
110}
111#[doc = "Field `CBF` reader - Comp. B Enable Output Filter"]
112pub struct CBF_R(crate::FieldReader<bool, bool>);
113impl CBF_R {
114 #[inline(always)]
115 pub(crate) fn new(bits: bool) -> Self {
116 CBF_R(crate::FieldReader::new(bits))
117 }
118}
119impl core::ops::Deref for CBF_R {
120 type Target = crate::FieldReader<bool, bool>;
121 #[inline(always)]
122 fn deref(&self) -> &Self::Target {
123 &self.0
124 }
125}
126#[doc = "Field `CBF` writer - Comp. B Enable Output Filter"]
127pub struct CBF_W<'a> {
128 w: &'a mut W,
129}
130impl<'a> CBF_W<'a> {
131 #[doc = r"Sets the field bit"]
132 #[inline(always)]
133 pub fn set_bit(self) -> &'a mut W {
134 self.bit(true)
135 }
136 #[doc = r"Clears the field bit"]
137 #[inline(always)]
138 pub fn clear_bit(self) -> &'a mut W {
139 self.bit(false)
140 }
141 #[doc = r"Writes raw bits to the field"]
142 #[inline(always)]
143 pub fn bit(self, value: bool) -> &'a mut W {
144 self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u16 & 0x01) << 2);
145 self.w
146 }
147}
148#[doc = "Field `CBIES` reader - Comp. B Interrupt Edge Select"]
149pub struct CBIES_R(crate::FieldReader<bool, bool>);
150impl CBIES_R {
151 #[inline(always)]
152 pub(crate) fn new(bits: bool) -> Self {
153 CBIES_R(crate::FieldReader::new(bits))
154 }
155}
156impl core::ops::Deref for CBIES_R {
157 type Target = crate::FieldReader<bool, bool>;
158 #[inline(always)]
159 fn deref(&self) -> &Self::Target {
160 &self.0
161 }
162}
163#[doc = "Field `CBIES` writer - Comp. B Interrupt Edge Select"]
164pub struct CBIES_W<'a> {
165 w: &'a mut W,
166}
167impl<'a> CBIES_W<'a> {
168 #[doc = r"Sets the field bit"]
169 #[inline(always)]
170 pub fn set_bit(self) -> &'a mut W {
171 self.bit(true)
172 }
173 #[doc = r"Clears the field bit"]
174 #[inline(always)]
175 pub fn clear_bit(self) -> &'a mut W {
176 self.bit(false)
177 }
178 #[doc = r"Writes raw bits to the field"]
179 #[inline(always)]
180 pub fn bit(self, value: bool) -> &'a mut W {
181 self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u16 & 0x01) << 3);
182 self.w
183 }
184}
185#[doc = "Field `CBSHORT` reader - Comp. B Input Short"]
186pub struct CBSHORT_R(crate::FieldReader<bool, bool>);
187impl CBSHORT_R {
188 #[inline(always)]
189 pub(crate) fn new(bits: bool) -> Self {
190 CBSHORT_R(crate::FieldReader::new(bits))
191 }
192}
193impl core::ops::Deref for CBSHORT_R {
194 type Target = crate::FieldReader<bool, bool>;
195 #[inline(always)]
196 fn deref(&self) -> &Self::Target {
197 &self.0
198 }
199}
200#[doc = "Field `CBSHORT` writer - Comp. B Input Short"]
201pub struct CBSHORT_W<'a> {
202 w: &'a mut W,
203}
204impl<'a> CBSHORT_W<'a> {
205 #[doc = r"Sets the field bit"]
206 #[inline(always)]
207 pub fn set_bit(self) -> &'a mut W {
208 self.bit(true)
209 }
210 #[doc = r"Clears the field bit"]
211 #[inline(always)]
212 pub fn clear_bit(self) -> &'a mut W {
213 self.bit(false)
214 }
215 #[doc = r"Writes raw bits to the field"]
216 #[inline(always)]
217 pub fn bit(self, value: bool) -> &'a mut W {
218 self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u16 & 0x01) << 4);
219 self.w
220 }
221}
222#[doc = "Field `CBEX` reader - Comp. B Exchange Inputs"]
223pub struct CBEX_R(crate::FieldReader<bool, bool>);
224impl CBEX_R {
225 #[inline(always)]
226 pub(crate) fn new(bits: bool) -> Self {
227 CBEX_R(crate::FieldReader::new(bits))
228 }
229}
230impl core::ops::Deref for CBEX_R {
231 type Target = crate::FieldReader<bool, bool>;
232 #[inline(always)]
233 fn deref(&self) -> &Self::Target {
234 &self.0
235 }
236}
237#[doc = "Field `CBEX` writer - Comp. B Exchange Inputs"]
238pub struct CBEX_W<'a> {
239 w: &'a mut W,
240}
241impl<'a> CBEX_W<'a> {
242 #[doc = r"Sets the field bit"]
243 #[inline(always)]
244 pub fn set_bit(self) -> &'a mut W {
245 self.bit(true)
246 }
247 #[doc = r"Clears the field bit"]
248 #[inline(always)]
249 pub fn clear_bit(self) -> &'a mut W {
250 self.bit(false)
251 }
252 #[doc = r"Writes raw bits to the field"]
253 #[inline(always)]
254 pub fn bit(self, value: bool) -> &'a mut W {
255 self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u16 & 0x01) << 5);
256 self.w
257 }
258}
259#[doc = "Comp. B Filter delay Bit 0\n\nValue on reset: 0"]
260#[derive(Clone, Copy, Debug, PartialEq)]
261#[repr(u8)]
262pub enum CBFDLY_A {
263 #[doc = "0: Comp. B Filter delay 0 : 450ns"]
264 CBFDLY_0 = 0,
265 #[doc = "1: Comp. B Filter delay 1 : 900ns"]
266 CBFDLY_1 = 1,
267 #[doc = "2: Comp. B Filter delay 2 : 1800ns"]
268 CBFDLY_2 = 2,
269 #[doc = "3: Comp. B Filter delay 3 : 3600ns"]
270 CBFDLY_3 = 3,
271}
272impl From<CBFDLY_A> for u8 {
273 #[inline(always)]
274 fn from(variant: CBFDLY_A) -> Self {
275 variant as _
276 }
277}
278#[doc = "Field `CBFDLY` reader - Comp. B Filter delay Bit 0"]
279pub struct CBFDLY_R(crate::FieldReader<u8, CBFDLY_A>);
280impl CBFDLY_R {
281 #[inline(always)]
282 pub(crate) fn new(bits: u8) -> Self {
283 CBFDLY_R(crate::FieldReader::new(bits))
284 }
285 #[doc = r"Get enumerated values variant"]
286 #[inline(always)]
287 pub fn variant(&self) -> CBFDLY_A {
288 match self.bits {
289 0 => CBFDLY_A::CBFDLY_0,
290 1 => CBFDLY_A::CBFDLY_1,
291 2 => CBFDLY_A::CBFDLY_2,
292 3 => CBFDLY_A::CBFDLY_3,
293 _ => unreachable!(),
294 }
295 }
296 #[doc = "Checks if the value of the field is `CBFDLY_0`"]
297 #[inline(always)]
298 pub fn is_cbfdly_0(&self) -> bool {
299 **self == CBFDLY_A::CBFDLY_0
300 }
301 #[doc = "Checks if the value of the field is `CBFDLY_1`"]
302 #[inline(always)]
303 pub fn is_cbfdly_1(&self) -> bool {
304 **self == CBFDLY_A::CBFDLY_1
305 }
306 #[doc = "Checks if the value of the field is `CBFDLY_2`"]
307 #[inline(always)]
308 pub fn is_cbfdly_2(&self) -> bool {
309 **self == CBFDLY_A::CBFDLY_2
310 }
311 #[doc = "Checks if the value of the field is `CBFDLY_3`"]
312 #[inline(always)]
313 pub fn is_cbfdly_3(&self) -> bool {
314 **self == CBFDLY_A::CBFDLY_3
315 }
316}
317impl core::ops::Deref for CBFDLY_R {
318 type Target = crate::FieldReader<u8, CBFDLY_A>;
319 #[inline(always)]
320 fn deref(&self) -> &Self::Target {
321 &self.0
322 }
323}
324#[doc = "Field `CBFDLY` writer - Comp. B Filter delay Bit 0"]
325pub struct CBFDLY_W<'a> {
326 w: &'a mut W,
327}
328impl<'a> CBFDLY_W<'a> {
329 #[doc = r"Writes `variant` to the field"]
330 #[inline(always)]
331 pub fn variant(self, variant: CBFDLY_A) -> &'a mut W {
332 self.bits(variant.into())
333 }
334 #[doc = "Comp. B Filter delay 0 : 450ns"]
335 #[inline(always)]
336 pub fn cbfdly_0(self) -> &'a mut W {
337 self.variant(CBFDLY_A::CBFDLY_0)
338 }
339 #[doc = "Comp. B Filter delay 1 : 900ns"]
340 #[inline(always)]
341 pub fn cbfdly_1(self) -> &'a mut W {
342 self.variant(CBFDLY_A::CBFDLY_1)
343 }
344 #[doc = "Comp. B Filter delay 2 : 1800ns"]
345 #[inline(always)]
346 pub fn cbfdly_2(self) -> &'a mut W {
347 self.variant(CBFDLY_A::CBFDLY_2)
348 }
349 #[doc = "Comp. B Filter delay 3 : 3600ns"]
350 #[inline(always)]
351 pub fn cbfdly_3(self) -> &'a mut W {
352 self.variant(CBFDLY_A::CBFDLY_3)
353 }
354 #[doc = r"Writes raw bits to the field"]
355 #[inline(always)]
356 pub fn bits(self, value: u8) -> &'a mut W {
357 self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u16 & 0x03) << 6);
358 self.w
359 }
360}
361#[doc = "Comp. B Power Mode Bit 0\n\nValue on reset: 0"]
362#[derive(Clone, Copy, Debug, PartialEq)]
363#[repr(u8)]
364pub enum CBPWRMD_A {
365 #[doc = "0: Comp. B Power Mode 0 : High speed"]
366 CBPWRMD_0 = 0,
367 #[doc = "1: Comp. B Power Mode 1 : Normal"]
368 CBPWRMD_1 = 1,
369 #[doc = "2: Comp. B Power Mode 2 : Ultra-Low"]
370 CBPWRMD_2 = 2,
371 #[doc = "3: Comp. B Power Mode 3 : Reserved"]
372 CBPWRMD_3 = 3,
373}
374impl From<CBPWRMD_A> for u8 {
375 #[inline(always)]
376 fn from(variant: CBPWRMD_A) -> Self {
377 variant as _
378 }
379}
380#[doc = "Field `CBPWRMD` reader - Comp. B Power Mode Bit 0"]
381pub struct CBPWRMD_R(crate::FieldReader<u8, CBPWRMD_A>);
382impl CBPWRMD_R {
383 #[inline(always)]
384 pub(crate) fn new(bits: u8) -> Self {
385 CBPWRMD_R(crate::FieldReader::new(bits))
386 }
387 #[doc = r"Get enumerated values variant"]
388 #[inline(always)]
389 pub fn variant(&self) -> CBPWRMD_A {
390 match self.bits {
391 0 => CBPWRMD_A::CBPWRMD_0,
392 1 => CBPWRMD_A::CBPWRMD_1,
393 2 => CBPWRMD_A::CBPWRMD_2,
394 3 => CBPWRMD_A::CBPWRMD_3,
395 _ => unreachable!(),
396 }
397 }
398 #[doc = "Checks if the value of the field is `CBPWRMD_0`"]
399 #[inline(always)]
400 pub fn is_cbpwrmd_0(&self) -> bool {
401 **self == CBPWRMD_A::CBPWRMD_0
402 }
403 #[doc = "Checks if the value of the field is `CBPWRMD_1`"]
404 #[inline(always)]
405 pub fn is_cbpwrmd_1(&self) -> bool {
406 **self == CBPWRMD_A::CBPWRMD_1
407 }
408 #[doc = "Checks if the value of the field is `CBPWRMD_2`"]
409 #[inline(always)]
410 pub fn is_cbpwrmd_2(&self) -> bool {
411 **self == CBPWRMD_A::CBPWRMD_2
412 }
413 #[doc = "Checks if the value of the field is `CBPWRMD_3`"]
414 #[inline(always)]
415 pub fn is_cbpwrmd_3(&self) -> bool {
416 **self == CBPWRMD_A::CBPWRMD_3
417 }
418}
419impl core::ops::Deref for CBPWRMD_R {
420 type Target = crate::FieldReader<u8, CBPWRMD_A>;
421 #[inline(always)]
422 fn deref(&self) -> &Self::Target {
423 &self.0
424 }
425}
426#[doc = "Field `CBPWRMD` writer - Comp. B Power Mode Bit 0"]
427pub struct CBPWRMD_W<'a> {
428 w: &'a mut W,
429}
430impl<'a> CBPWRMD_W<'a> {
431 #[doc = r"Writes `variant` to the field"]
432 #[inline(always)]
433 pub fn variant(self, variant: CBPWRMD_A) -> &'a mut W {
434 self.bits(variant.into())
435 }
436 #[doc = "Comp. B Power Mode 0 : High speed"]
437 #[inline(always)]
438 pub fn cbpwrmd_0(self) -> &'a mut W {
439 self.variant(CBPWRMD_A::CBPWRMD_0)
440 }
441 #[doc = "Comp. B Power Mode 1 : Normal"]
442 #[inline(always)]
443 pub fn cbpwrmd_1(self) -> &'a mut W {
444 self.variant(CBPWRMD_A::CBPWRMD_1)
445 }
446 #[doc = "Comp. B Power Mode 2 : Ultra-Low"]
447 #[inline(always)]
448 pub fn cbpwrmd_2(self) -> &'a mut W {
449 self.variant(CBPWRMD_A::CBPWRMD_2)
450 }
451 #[doc = "Comp. B Power Mode 3 : Reserved"]
452 #[inline(always)]
453 pub fn cbpwrmd_3(self) -> &'a mut W {
454 self.variant(CBPWRMD_A::CBPWRMD_3)
455 }
456 #[doc = r"Writes raw bits to the field"]
457 #[inline(always)]
458 pub fn bits(self, value: u8) -> &'a mut W {
459 self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u16 & 0x03) << 8);
460 self.w
461 }
462}
463#[doc = "Field `CBON` reader - Comp. B enable"]
464pub struct CBON_R(crate::FieldReader<bool, bool>);
465impl CBON_R {
466 #[inline(always)]
467 pub(crate) fn new(bits: bool) -> Self {
468 CBON_R(crate::FieldReader::new(bits))
469 }
470}
471impl core::ops::Deref for CBON_R {
472 type Target = crate::FieldReader<bool, bool>;
473 #[inline(always)]
474 fn deref(&self) -> &Self::Target {
475 &self.0
476 }
477}
478#[doc = "Field `CBON` writer - Comp. B enable"]
479pub struct CBON_W<'a> {
480 w: &'a mut W,
481}
482impl<'a> CBON_W<'a> {
483 #[doc = r"Sets the field bit"]
484 #[inline(always)]
485 pub fn set_bit(self) -> &'a mut W {
486 self.bit(true)
487 }
488 #[doc = r"Clears the field bit"]
489 #[inline(always)]
490 pub fn clear_bit(self) -> &'a mut W {
491 self.bit(false)
492 }
493 #[doc = r"Writes raw bits to the field"]
494 #[inline(always)]
495 pub fn bit(self, value: bool) -> &'a mut W {
496 self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u16 & 0x01) << 10);
497 self.w
498 }
499}
500#[doc = "Field `CBMRVL` reader - Comp. B CBMRV Level"]
501pub struct CBMRVL_R(crate::FieldReader<bool, bool>);
502impl CBMRVL_R {
503 #[inline(always)]
504 pub(crate) fn new(bits: bool) -> Self {
505 CBMRVL_R(crate::FieldReader::new(bits))
506 }
507}
508impl core::ops::Deref for CBMRVL_R {
509 type Target = crate::FieldReader<bool, bool>;
510 #[inline(always)]
511 fn deref(&self) -> &Self::Target {
512 &self.0
513 }
514}
515#[doc = "Field `CBMRVL` writer - Comp. B CBMRV Level"]
516pub struct CBMRVL_W<'a> {
517 w: &'a mut W,
518}
519impl<'a> CBMRVL_W<'a> {
520 #[doc = r"Sets the field bit"]
521 #[inline(always)]
522 pub fn set_bit(self) -> &'a mut W {
523 self.bit(true)
524 }
525 #[doc = r"Clears the field bit"]
526 #[inline(always)]
527 pub fn clear_bit(self) -> &'a mut W {
528 self.bit(false)
529 }
530 #[doc = r"Writes raw bits to the field"]
531 #[inline(always)]
532 pub fn bit(self, value: bool) -> &'a mut W {
533 self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u16 & 0x01) << 11);
534 self.w
535 }
536}
537#[doc = "Field `CBMRVS` reader - Comp. B Output selects between VREF0 or VREF1"]
538pub struct CBMRVS_R(crate::FieldReader<bool, bool>);
539impl CBMRVS_R {
540 #[inline(always)]
541 pub(crate) fn new(bits: bool) -> Self {
542 CBMRVS_R(crate::FieldReader::new(bits))
543 }
544}
545impl core::ops::Deref for CBMRVS_R {
546 type Target = crate::FieldReader<bool, bool>;
547 #[inline(always)]
548 fn deref(&self) -> &Self::Target {
549 &self.0
550 }
551}
552#[doc = "Field `CBMRVS` writer - Comp. B Output selects between VREF0 or VREF1"]
553pub struct CBMRVS_W<'a> {
554 w: &'a mut W,
555}
556impl<'a> CBMRVS_W<'a> {
557 #[doc = r"Sets the field bit"]
558 #[inline(always)]
559 pub fn set_bit(self) -> &'a mut W {
560 self.bit(true)
561 }
562 #[doc = r"Clears the field bit"]
563 #[inline(always)]
564 pub fn clear_bit(self) -> &'a mut W {
565 self.bit(false)
566 }
567 #[doc = r"Writes raw bits to the field"]
568 #[inline(always)]
569 pub fn bit(self, value: bool) -> &'a mut W {
570 self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u16 & 0x01) << 12);
571 self.w
572 }
573}
574impl R {
575 #[doc = "Bit 0 - Comp. B Output"]
576 #[inline(always)]
577 pub fn cbout(&self) -> CBOUT_R {
578 CBOUT_R::new((self.bits & 0x01) != 0)
579 }
580 #[doc = "Bit 1 - Comp. B Output Polarity"]
581 #[inline(always)]
582 pub fn cboutpol(&self) -> CBOUTPOL_R {
583 CBOUTPOL_R::new(((self.bits >> 1) & 0x01) != 0)
584 }
585 #[doc = "Bit 2 - Comp. B Enable Output Filter"]
586 #[inline(always)]
587 pub fn cbf(&self) -> CBF_R {
588 CBF_R::new(((self.bits >> 2) & 0x01) != 0)
589 }
590 #[doc = "Bit 3 - Comp. B Interrupt Edge Select"]
591 #[inline(always)]
592 pub fn cbies(&self) -> CBIES_R {
593 CBIES_R::new(((self.bits >> 3) & 0x01) != 0)
594 }
595 #[doc = "Bit 4 - Comp. B Input Short"]
596 #[inline(always)]
597 pub fn cbshort(&self) -> CBSHORT_R {
598 CBSHORT_R::new(((self.bits >> 4) & 0x01) != 0)
599 }
600 #[doc = "Bit 5 - Comp. B Exchange Inputs"]
601 #[inline(always)]
602 pub fn cbex(&self) -> CBEX_R {
603 CBEX_R::new(((self.bits >> 5) & 0x01) != 0)
604 }
605 #[doc = "Bits 6:7 - Comp. B Filter delay Bit 0"]
606 #[inline(always)]
607 pub fn cbfdly(&self) -> CBFDLY_R {
608 CBFDLY_R::new(((self.bits >> 6) & 0x03) as u8)
609 }
610 #[doc = "Bits 8:9 - Comp. B Power Mode Bit 0"]
611 #[inline(always)]
612 pub fn cbpwrmd(&self) -> CBPWRMD_R {
613 CBPWRMD_R::new(((self.bits >> 8) & 0x03) as u8)
614 }
615 #[doc = "Bit 10 - Comp. B enable"]
616 #[inline(always)]
617 pub fn cbon(&self) -> CBON_R {
618 CBON_R::new(((self.bits >> 10) & 0x01) != 0)
619 }
620 #[doc = "Bit 11 - Comp. B CBMRV Level"]
621 #[inline(always)]
622 pub fn cbmrvl(&self) -> CBMRVL_R {
623 CBMRVL_R::new(((self.bits >> 11) & 0x01) != 0)
624 }
625 #[doc = "Bit 12 - Comp. B Output selects between VREF0 or VREF1"]
626 #[inline(always)]
627 pub fn cbmrvs(&self) -> CBMRVS_R {
628 CBMRVS_R::new(((self.bits >> 12) & 0x01) != 0)
629 }
630}
631impl W {
632 #[doc = "Bit 0 - Comp. B Output"]
633 #[inline(always)]
634 pub fn cbout(&mut self) -> CBOUT_W {
635 CBOUT_W { w: self }
636 }
637 #[doc = "Bit 1 - Comp. B Output Polarity"]
638 #[inline(always)]
639 pub fn cboutpol(&mut self) -> CBOUTPOL_W {
640 CBOUTPOL_W { w: self }
641 }
642 #[doc = "Bit 2 - Comp. B Enable Output Filter"]
643 #[inline(always)]
644 pub fn cbf(&mut self) -> CBF_W {
645 CBF_W { w: self }
646 }
647 #[doc = "Bit 3 - Comp. B Interrupt Edge Select"]
648 #[inline(always)]
649 pub fn cbies(&mut self) -> CBIES_W {
650 CBIES_W { w: self }
651 }
652 #[doc = "Bit 4 - Comp. B Input Short"]
653 #[inline(always)]
654 pub fn cbshort(&mut self) -> CBSHORT_W {
655 CBSHORT_W { w: self }
656 }
657 #[doc = "Bit 5 - Comp. B Exchange Inputs"]
658 #[inline(always)]
659 pub fn cbex(&mut self) -> CBEX_W {
660 CBEX_W { w: self }
661 }
662 #[doc = "Bits 6:7 - Comp. B Filter delay Bit 0"]
663 #[inline(always)]
664 pub fn cbfdly(&mut self) -> CBFDLY_W {
665 CBFDLY_W { w: self }
666 }
667 #[doc = "Bits 8:9 - Comp. B Power Mode Bit 0"]
668 #[inline(always)]
669 pub fn cbpwrmd(&mut self) -> CBPWRMD_W {
670 CBPWRMD_W { w: self }
671 }
672 #[doc = "Bit 10 - Comp. B enable"]
673 #[inline(always)]
674 pub fn cbon(&mut self) -> CBON_W {
675 CBON_W { w: self }
676 }
677 #[doc = "Bit 11 - Comp. B CBMRV Level"]
678 #[inline(always)]
679 pub fn cbmrvl(&mut self) -> CBMRVL_W {
680 CBMRVL_W { w: self }
681 }
682 #[doc = "Bit 12 - Comp. B Output selects between VREF0 or VREF1"]
683 #[inline(always)]
684 pub fn cbmrvs(&mut self) -> CBMRVS_W {
685 CBMRVS_W { w: self }
686 }
687 #[doc = "Writes raw bits to the register."]
688 #[inline(always)]
689 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
690 self.0.bits(bits);
691 self
692 }
693}
694#[doc = "Comparator B Control Register 1\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 [cbctl1](index.html) module"]
695pub struct CBCTL1_SPEC;
696impl crate::RegisterSpec for CBCTL1_SPEC {
697 type Ux = u16;
698}
699#[doc = "`read()` method returns [cbctl1::R](R) reader structure"]
700impl crate::Readable for CBCTL1_SPEC {
701 type Reader = R;
702}
703#[doc = "`write(|w| ..)` method takes [cbctl1::W](W) writer structure"]
704impl crate::Writable for CBCTL1_SPEC {
705 type Writer = W;
706}
707#[doc = "`reset()` method sets CBCTL1 to value 0"]
708impl crate::Resettable for CBCTL1_SPEC {
709 #[inline(always)]
710 fn reset_value() -> Self::Ux {
711 0
712 }
713}