efm32pg1b200_pac/adc0/
ien.rs

1#[doc = "Register `IEN` reader"]
2pub struct R(crate::R<IEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `IEN` writer"]
17pub struct W(crate::W<IEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IEN_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<IEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SINGLE` reader - SINGLE Interrupt Enable"]
38pub type SINGLE_R = crate::BitReader<bool>;
39#[doc = "Field `SINGLE` writer - SINGLE Interrupt Enable"]
40pub type SINGLE_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 0>;
41#[doc = "Field `SCAN` reader - SCAN Interrupt Enable"]
42pub type SCAN_R = crate::BitReader<bool>;
43#[doc = "Field `SCAN` writer - SCAN Interrupt Enable"]
44pub type SCAN_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 1>;
45#[doc = "Field `SINGLEOF` reader - SINGLEOF Interrupt Enable"]
46pub type SINGLEOF_R = crate::BitReader<bool>;
47#[doc = "Field `SINGLEOF` writer - SINGLEOF Interrupt Enable"]
48pub type SINGLEOF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 8>;
49#[doc = "Field `SCANOF` reader - SCANOF Interrupt Enable"]
50pub type SCANOF_R = crate::BitReader<bool>;
51#[doc = "Field `SCANOF` writer - SCANOF Interrupt Enable"]
52pub type SCANOF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 9>;
53#[doc = "Field `SINGLEUF` reader - SINGLEUF Interrupt Enable"]
54pub type SINGLEUF_R = crate::BitReader<bool>;
55#[doc = "Field `SINGLEUF` writer - SINGLEUF Interrupt Enable"]
56pub type SINGLEUF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 10>;
57#[doc = "Field `SCANUF` reader - SCANUF Interrupt Enable"]
58pub type SCANUF_R = crate::BitReader<bool>;
59#[doc = "Field `SCANUF` writer - SCANUF Interrupt Enable"]
60pub type SCANUF_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 11>;
61#[doc = "Field `SINGLECMP` reader - SINGLECMP Interrupt Enable"]
62pub type SINGLECMP_R = crate::BitReader<bool>;
63#[doc = "Field `SINGLECMP` writer - SINGLECMP Interrupt Enable"]
64pub type SINGLECMP_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 16>;
65#[doc = "Field `SCANCMP` reader - SCANCMP Interrupt Enable"]
66pub type SCANCMP_R = crate::BitReader<bool>;
67#[doc = "Field `SCANCMP` writer - SCANCMP Interrupt Enable"]
68pub type SCANCMP_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 17>;
69#[doc = "Field `VREFOV` reader - VREFOV Interrupt Enable"]
70pub type VREFOV_R = crate::BitReader<bool>;
71#[doc = "Field `VREFOV` writer - VREFOV Interrupt Enable"]
72pub type VREFOV_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 24>;
73#[doc = "Field `PROGERR` reader - PROGERR Interrupt Enable"]
74pub type PROGERR_R = crate::BitReader<bool>;
75#[doc = "Field `PROGERR` writer - PROGERR Interrupt Enable"]
76pub type PROGERR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 25>;
77impl R {
78    #[doc = "Bit 0 - SINGLE Interrupt Enable"]
79    #[inline(always)]
80    pub fn single(&self) -> SINGLE_R {
81        SINGLE_R::new((self.bits & 1) != 0)
82    }
83    #[doc = "Bit 1 - SCAN Interrupt Enable"]
84    #[inline(always)]
85    pub fn scan(&self) -> SCAN_R {
86        SCAN_R::new(((self.bits >> 1) & 1) != 0)
87    }
88    #[doc = "Bit 8 - SINGLEOF Interrupt Enable"]
89    #[inline(always)]
90    pub fn singleof(&self) -> SINGLEOF_R {
91        SINGLEOF_R::new(((self.bits >> 8) & 1) != 0)
92    }
93    #[doc = "Bit 9 - SCANOF Interrupt Enable"]
94    #[inline(always)]
95    pub fn scanof(&self) -> SCANOF_R {
96        SCANOF_R::new(((self.bits >> 9) & 1) != 0)
97    }
98    #[doc = "Bit 10 - SINGLEUF Interrupt Enable"]
99    #[inline(always)]
100    pub fn singleuf(&self) -> SINGLEUF_R {
101        SINGLEUF_R::new(((self.bits >> 10) & 1) != 0)
102    }
103    #[doc = "Bit 11 - SCANUF Interrupt Enable"]
104    #[inline(always)]
105    pub fn scanuf(&self) -> SCANUF_R {
106        SCANUF_R::new(((self.bits >> 11) & 1) != 0)
107    }
108    #[doc = "Bit 16 - SINGLECMP Interrupt Enable"]
109    #[inline(always)]
110    pub fn singlecmp(&self) -> SINGLECMP_R {
111        SINGLECMP_R::new(((self.bits >> 16) & 1) != 0)
112    }
113    #[doc = "Bit 17 - SCANCMP Interrupt Enable"]
114    #[inline(always)]
115    pub fn scancmp(&self) -> SCANCMP_R {
116        SCANCMP_R::new(((self.bits >> 17) & 1) != 0)
117    }
118    #[doc = "Bit 24 - VREFOV Interrupt Enable"]
119    #[inline(always)]
120    pub fn vrefov(&self) -> VREFOV_R {
121        VREFOV_R::new(((self.bits >> 24) & 1) != 0)
122    }
123    #[doc = "Bit 25 - PROGERR Interrupt Enable"]
124    #[inline(always)]
125    pub fn progerr(&self) -> PROGERR_R {
126        PROGERR_R::new(((self.bits >> 25) & 1) != 0)
127    }
128}
129impl W {
130    #[doc = "Bit 0 - SINGLE Interrupt Enable"]
131    #[inline(always)]
132    pub fn single(&mut self) -> SINGLE_W {
133        SINGLE_W::new(self)
134    }
135    #[doc = "Bit 1 - SCAN Interrupt Enable"]
136    #[inline(always)]
137    pub fn scan(&mut self) -> SCAN_W {
138        SCAN_W::new(self)
139    }
140    #[doc = "Bit 8 - SINGLEOF Interrupt Enable"]
141    #[inline(always)]
142    pub fn singleof(&mut self) -> SINGLEOF_W {
143        SINGLEOF_W::new(self)
144    }
145    #[doc = "Bit 9 - SCANOF Interrupt Enable"]
146    #[inline(always)]
147    pub fn scanof(&mut self) -> SCANOF_W {
148        SCANOF_W::new(self)
149    }
150    #[doc = "Bit 10 - SINGLEUF Interrupt Enable"]
151    #[inline(always)]
152    pub fn singleuf(&mut self) -> SINGLEUF_W {
153        SINGLEUF_W::new(self)
154    }
155    #[doc = "Bit 11 - SCANUF Interrupt Enable"]
156    #[inline(always)]
157    pub fn scanuf(&mut self) -> SCANUF_W {
158        SCANUF_W::new(self)
159    }
160    #[doc = "Bit 16 - SINGLECMP Interrupt Enable"]
161    #[inline(always)]
162    pub fn singlecmp(&mut self) -> SINGLECMP_W {
163        SINGLECMP_W::new(self)
164    }
165    #[doc = "Bit 17 - SCANCMP Interrupt Enable"]
166    #[inline(always)]
167    pub fn scancmp(&mut self) -> SCANCMP_W {
168        SCANCMP_W::new(self)
169    }
170    #[doc = "Bit 24 - VREFOV Interrupt Enable"]
171    #[inline(always)]
172    pub fn vrefov(&mut self) -> VREFOV_W {
173        VREFOV_W::new(self)
174    }
175    #[doc = "Bit 25 - PROGERR Interrupt Enable"]
176    #[inline(always)]
177    pub fn progerr(&mut self) -> PROGERR_W {
178        PROGERR_W::new(self)
179    }
180    #[doc = "Writes raw bits to the register."]
181    #[inline(always)]
182    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
183        self.0.bits(bits);
184        self
185    }
186}
187#[doc = "Interrupt Enable Register\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 [ien](index.html) module"]
188pub struct IEN_SPEC;
189impl crate::RegisterSpec for IEN_SPEC {
190    type Ux = u32;
191}
192#[doc = "`read()` method returns [ien::R](R) reader structure"]
193impl crate::Readable for IEN_SPEC {
194    type Reader = R;
195}
196#[doc = "`write(|w| ..)` method takes [ien::W](W) writer structure"]
197impl crate::Writable for IEN_SPEC {
198    type Writer = W;
199}
200#[doc = "`reset()` method sets IEN to value 0"]
201impl crate::Resettable for IEN_SPEC {
202    #[inline(always)]
203    fn reset_value() -> Self::Ux {
204        0
205    }
206}