1#[doc = "Register `ADOVFERSR` reader"]
2pub struct R(crate::R<ADOVFERSR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ADOVFERSR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ADOVFERSR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ADOVFERSR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `ADOVFEF0` reader - A/D Converter Unit 0 (ADC0) Overflow Error Flag"]
17pub type ADOVFEF0_R = crate::BitReader<ADOVFEF0_A>;
18#[doc = "A/D Converter Unit 0 (ADC0) Overflow Error Flag\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum ADOVFEF0_A {
21 #[doc = "0: ADC0 overflow error is not detected"]
22 _0 = 0,
23 #[doc = "1: ADC0 overflow error is detected"]
24 _1 = 1,
25}
26impl From<ADOVFEF0_A> for bool {
27 #[inline(always)]
28 fn from(variant: ADOVFEF0_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl ADOVFEF0_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> ADOVFEF0_A {
36 match self.bits {
37 false => ADOVFEF0_A::_0,
38 true => ADOVFEF0_A::_1,
39 }
40 }
41 #[doc = "Checks if the value of the field is `_0`"]
42 #[inline(always)]
43 pub fn is_0(&self) -> bool {
44 *self == ADOVFEF0_A::_0
45 }
46 #[doc = "Checks if the value of the field is `_1`"]
47 #[inline(always)]
48 pub fn is_1(&self) -> bool {
49 *self == ADOVFEF0_A::_1
50 }
51}
52#[doc = "Field `ADOVFEF1` reader - A/D Converter Unit 1 (ADC1) Overflow Error Flag"]
53pub type ADOVFEF1_R = crate::BitReader<ADOVFEF1_A>;
54#[doc = "A/D Converter Unit 1 (ADC1) Overflow Error Flag\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum ADOVFEF1_A {
57 #[doc = "0: ADC1 overflow error is not detected"]
58 _0 = 0,
59 #[doc = "1: ADC1 overflow error is detected"]
60 _1 = 1,
61}
62impl From<ADOVFEF1_A> for bool {
63 #[inline(always)]
64 fn from(variant: ADOVFEF1_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl ADOVFEF1_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> ADOVFEF1_A {
72 match self.bits {
73 false => ADOVFEF1_A::_0,
74 true => ADOVFEF1_A::_1,
75 }
76 }
77 #[doc = "Checks if the value of the field is `_0`"]
78 #[inline(always)]
79 pub fn is_0(&self) -> bool {
80 *self == ADOVFEF1_A::_0
81 }
82 #[doc = "Checks if the value of the field is `_1`"]
83 #[inline(always)]
84 pub fn is_1(&self) -> bool {
85 *self == ADOVFEF1_A::_1
86 }
87}
88impl R {
89 #[doc = "Bit 0 - A/D Converter Unit 0 (ADC0) Overflow Error Flag"]
90 #[inline(always)]
91 pub fn adovfef0(&self) -> ADOVFEF0_R {
92 ADOVFEF0_R::new((self.bits & 1) != 0)
93 }
94 #[doc = "Bit 1 - A/D Converter Unit 1 (ADC1) Overflow Error Flag"]
95 #[inline(always)]
96 pub fn adovfef1(&self) -> ADOVFEF1_R {
97 ADOVFEF1_R::new(((self.bits >> 1) & 1) != 0)
98 }
99}
100#[doc = "A/D Conversion Overflow Error Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [adovfersr](index.html) module"]
101pub struct ADOVFERSR_SPEC;
102impl crate::RegisterSpec for ADOVFERSR_SPEC {
103 type Ux = u32;
104}
105#[doc = "`read()` method returns [adovfersr::R](R) reader structure"]
106impl crate::Readable for ADOVFERSR_SPEC {
107 type Reader = R;
108}
109#[doc = "`reset()` method sets ADOVFERSR to value 0"]
110impl crate::Resettable for ADOVFERSR_SPEC {
111 const RESET_VALUE: Self::Ux = 0;
112}