efm32gg12b130_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>;
77#[doc = "Field `SCANEXTPEND` reader - SCANEXTPEND Interrupt Enable"]
78pub type SCANEXTPEND_R = crate::BitReader<bool>;
79#[doc = "Field `SCANEXTPEND` writer - SCANEXTPEND Interrupt Enable"]
80pub type SCANEXTPEND_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 26>;
81#[doc = "Field `SCANPEND` reader - SCANPEND Interrupt Enable"]
82pub type SCANPEND_R = crate::BitReader<bool>;
83#[doc = "Field `SCANPEND` writer - SCANPEND Interrupt Enable"]
84pub type SCANPEND_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 27>;
85#[doc = "Field `PRSTIMEDERR` reader - PRSTIMEDERR Interrupt Enable"]
86pub type PRSTIMEDERR_R = crate::BitReader<bool>;
87#[doc = "Field `PRSTIMEDERR` writer - PRSTIMEDERR Interrupt Enable"]
88pub type PRSTIMEDERR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 28>;
89#[doc = "Field `EM23ERR` reader - EM23ERR Interrupt Enable"]
90pub type EM23ERR_R = crate::BitReader<bool>;
91#[doc = "Field `EM23ERR` writer - EM23ERR Interrupt Enable"]
92pub type EM23ERR_W<'a> = crate::BitWriter<'a, u32, IEN_SPEC, bool, 29>;
93impl R {
94    #[doc = "Bit 0 - SINGLE Interrupt Enable"]
95    #[inline(always)]
96    pub fn single(&self) -> SINGLE_R {
97        SINGLE_R::new((self.bits & 1) != 0)
98    }
99    #[doc = "Bit 1 - SCAN Interrupt Enable"]
100    #[inline(always)]
101    pub fn scan(&self) -> SCAN_R {
102        SCAN_R::new(((self.bits >> 1) & 1) != 0)
103    }
104    #[doc = "Bit 8 - SINGLEOF Interrupt Enable"]
105    #[inline(always)]
106    pub fn singleof(&self) -> SINGLEOF_R {
107        SINGLEOF_R::new(((self.bits >> 8) & 1) != 0)
108    }
109    #[doc = "Bit 9 - SCANOF Interrupt Enable"]
110    #[inline(always)]
111    pub fn scanof(&self) -> SCANOF_R {
112        SCANOF_R::new(((self.bits >> 9) & 1) != 0)
113    }
114    #[doc = "Bit 10 - SINGLEUF Interrupt Enable"]
115    #[inline(always)]
116    pub fn singleuf(&self) -> SINGLEUF_R {
117        SINGLEUF_R::new(((self.bits >> 10) & 1) != 0)
118    }
119    #[doc = "Bit 11 - SCANUF Interrupt Enable"]
120    #[inline(always)]
121    pub fn scanuf(&self) -> SCANUF_R {
122        SCANUF_R::new(((self.bits >> 11) & 1) != 0)
123    }
124    #[doc = "Bit 16 - SINGLECMP Interrupt Enable"]
125    #[inline(always)]
126    pub fn singlecmp(&self) -> SINGLECMP_R {
127        SINGLECMP_R::new(((self.bits >> 16) & 1) != 0)
128    }
129    #[doc = "Bit 17 - SCANCMP Interrupt Enable"]
130    #[inline(always)]
131    pub fn scancmp(&self) -> SCANCMP_R {
132        SCANCMP_R::new(((self.bits >> 17) & 1) != 0)
133    }
134    #[doc = "Bit 24 - VREFOV Interrupt Enable"]
135    #[inline(always)]
136    pub fn vrefov(&self) -> VREFOV_R {
137        VREFOV_R::new(((self.bits >> 24) & 1) != 0)
138    }
139    #[doc = "Bit 25 - PROGERR Interrupt Enable"]
140    #[inline(always)]
141    pub fn progerr(&self) -> PROGERR_R {
142        PROGERR_R::new(((self.bits >> 25) & 1) != 0)
143    }
144    #[doc = "Bit 26 - SCANEXTPEND Interrupt Enable"]
145    #[inline(always)]
146    pub fn scanextpend(&self) -> SCANEXTPEND_R {
147        SCANEXTPEND_R::new(((self.bits >> 26) & 1) != 0)
148    }
149    #[doc = "Bit 27 - SCANPEND Interrupt Enable"]
150    #[inline(always)]
151    pub fn scanpend(&self) -> SCANPEND_R {
152        SCANPEND_R::new(((self.bits >> 27) & 1) != 0)
153    }
154    #[doc = "Bit 28 - PRSTIMEDERR Interrupt Enable"]
155    #[inline(always)]
156    pub fn prstimederr(&self) -> PRSTIMEDERR_R {
157        PRSTIMEDERR_R::new(((self.bits >> 28) & 1) != 0)
158    }
159    #[doc = "Bit 29 - EM23ERR Interrupt Enable"]
160    #[inline(always)]
161    pub fn em23err(&self) -> EM23ERR_R {
162        EM23ERR_R::new(((self.bits >> 29) & 1) != 0)
163    }
164}
165impl W {
166    #[doc = "Bit 0 - SINGLE Interrupt Enable"]
167    #[inline(always)]
168    pub fn single(&mut self) -> SINGLE_W {
169        SINGLE_W::new(self)
170    }
171    #[doc = "Bit 1 - SCAN Interrupt Enable"]
172    #[inline(always)]
173    pub fn scan(&mut self) -> SCAN_W {
174        SCAN_W::new(self)
175    }
176    #[doc = "Bit 8 - SINGLEOF Interrupt Enable"]
177    #[inline(always)]
178    pub fn singleof(&mut self) -> SINGLEOF_W {
179        SINGLEOF_W::new(self)
180    }
181    #[doc = "Bit 9 - SCANOF Interrupt Enable"]
182    #[inline(always)]
183    pub fn scanof(&mut self) -> SCANOF_W {
184        SCANOF_W::new(self)
185    }
186    #[doc = "Bit 10 - SINGLEUF Interrupt Enable"]
187    #[inline(always)]
188    pub fn singleuf(&mut self) -> SINGLEUF_W {
189        SINGLEUF_W::new(self)
190    }
191    #[doc = "Bit 11 - SCANUF Interrupt Enable"]
192    #[inline(always)]
193    pub fn scanuf(&mut self) -> SCANUF_W {
194        SCANUF_W::new(self)
195    }
196    #[doc = "Bit 16 - SINGLECMP Interrupt Enable"]
197    #[inline(always)]
198    pub fn singlecmp(&mut self) -> SINGLECMP_W {
199        SINGLECMP_W::new(self)
200    }
201    #[doc = "Bit 17 - SCANCMP Interrupt Enable"]
202    #[inline(always)]
203    pub fn scancmp(&mut self) -> SCANCMP_W {
204        SCANCMP_W::new(self)
205    }
206    #[doc = "Bit 24 - VREFOV Interrupt Enable"]
207    #[inline(always)]
208    pub fn vrefov(&mut self) -> VREFOV_W {
209        VREFOV_W::new(self)
210    }
211    #[doc = "Bit 25 - PROGERR Interrupt Enable"]
212    #[inline(always)]
213    pub fn progerr(&mut self) -> PROGERR_W {
214        PROGERR_W::new(self)
215    }
216    #[doc = "Bit 26 - SCANEXTPEND Interrupt Enable"]
217    #[inline(always)]
218    pub fn scanextpend(&mut self) -> SCANEXTPEND_W {
219        SCANEXTPEND_W::new(self)
220    }
221    #[doc = "Bit 27 - SCANPEND Interrupt Enable"]
222    #[inline(always)]
223    pub fn scanpend(&mut self) -> SCANPEND_W {
224        SCANPEND_W::new(self)
225    }
226    #[doc = "Bit 28 - PRSTIMEDERR Interrupt Enable"]
227    #[inline(always)]
228    pub fn prstimederr(&mut self) -> PRSTIMEDERR_W {
229        PRSTIMEDERR_W::new(self)
230    }
231    #[doc = "Bit 29 - EM23ERR Interrupt Enable"]
232    #[inline(always)]
233    pub fn em23err(&mut self) -> EM23ERR_W {
234        EM23ERR_W::new(self)
235    }
236    #[doc = "Writes raw bits to the register."]
237    #[inline(always)]
238    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
239        self.0.bits(bits);
240        self
241    }
242}
243#[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"]
244pub struct IEN_SPEC;
245impl crate::RegisterSpec for IEN_SPEC {
246    type Ux = u32;
247}
248#[doc = "`read()` method returns [ien::R](R) reader structure"]
249impl crate::Readable for IEN_SPEC {
250    type Reader = R;
251}
252#[doc = "`write(|w| ..)` method takes [ien::W](W) writer structure"]
253impl crate::Writable for IEN_SPEC {
254    type Writer = W;
255}
256#[doc = "`reset()` method sets IEN to value 0"]
257impl crate::Resettable for IEN_SPEC {
258    #[inline(always)]
259    fn reset_value() -> Self::Ux {
260        0
261    }
262}