efm32gg12b_pac/efm32gg12b830/adc1/
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, IEN_SPEC, bool, O>;
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    #[must_use]
169    pub fn single(&mut self) -> SINGLE_W<0> {
170        SINGLE_W::new(self)
171    }
172    #[doc = "Bit 1 - SCAN Interrupt Enable"]
173    #[inline(always)]
174    #[must_use]
175    pub fn scan(&mut self) -> SCAN_W<1> {
176        SCAN_W::new(self)
177    }
178    #[doc = "Bit 8 - SINGLEOF Interrupt Enable"]
179    #[inline(always)]
180    #[must_use]
181    pub fn singleof(&mut self) -> SINGLEOF_W<8> {
182        SINGLEOF_W::new(self)
183    }
184    #[doc = "Bit 9 - SCANOF Interrupt Enable"]
185    #[inline(always)]
186    #[must_use]
187    pub fn scanof(&mut self) -> SCANOF_W<9> {
188        SCANOF_W::new(self)
189    }
190    #[doc = "Bit 10 - SINGLEUF Interrupt Enable"]
191    #[inline(always)]
192    #[must_use]
193    pub fn singleuf(&mut self) -> SINGLEUF_W<10> {
194        SINGLEUF_W::new(self)
195    }
196    #[doc = "Bit 11 - SCANUF Interrupt Enable"]
197    #[inline(always)]
198    #[must_use]
199    pub fn scanuf(&mut self) -> SCANUF_W<11> {
200        SCANUF_W::new(self)
201    }
202    #[doc = "Bit 16 - SINGLECMP Interrupt Enable"]
203    #[inline(always)]
204    #[must_use]
205    pub fn singlecmp(&mut self) -> SINGLECMP_W<16> {
206        SINGLECMP_W::new(self)
207    }
208    #[doc = "Bit 17 - SCANCMP Interrupt Enable"]
209    #[inline(always)]
210    #[must_use]
211    pub fn scancmp(&mut self) -> SCANCMP_W<17> {
212        SCANCMP_W::new(self)
213    }
214    #[doc = "Bit 24 - VREFOV Interrupt Enable"]
215    #[inline(always)]
216    #[must_use]
217    pub fn vrefov(&mut self) -> VREFOV_W<24> {
218        VREFOV_W::new(self)
219    }
220    #[doc = "Bit 25 - PROGERR Interrupt Enable"]
221    #[inline(always)]
222    #[must_use]
223    pub fn progerr(&mut self) -> PROGERR_W<25> {
224        PROGERR_W::new(self)
225    }
226    #[doc = "Bit 26 - SCANEXTPEND Interrupt Enable"]
227    #[inline(always)]
228    #[must_use]
229    pub fn scanextpend(&mut self) -> SCANEXTPEND_W<26> {
230        SCANEXTPEND_W::new(self)
231    }
232    #[doc = "Bit 27 - SCANPEND Interrupt Enable"]
233    #[inline(always)]
234    #[must_use]
235    pub fn scanpend(&mut self) -> SCANPEND_W<27> {
236        SCANPEND_W::new(self)
237    }
238    #[doc = "Bit 28 - PRSTIMEDERR Interrupt Enable"]
239    #[inline(always)]
240    #[must_use]
241    pub fn prstimederr(&mut self) -> PRSTIMEDERR_W<28> {
242        PRSTIMEDERR_W::new(self)
243    }
244    #[doc = "Bit 29 - EM23ERR Interrupt Enable"]
245    #[inline(always)]
246    #[must_use]
247    pub fn em23err(&mut self) -> EM23ERR_W<29> {
248        EM23ERR_W::new(self)
249    }
250    #[doc = "Writes raw bits to the register."]
251    #[inline(always)]
252    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
253        self.0.bits(bits);
254        self
255    }
256}
257#[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"]
258pub struct IEN_SPEC;
259impl crate::RegisterSpec for IEN_SPEC {
260    type Ux = u32;
261}
262#[doc = "`read()` method returns [ien::R](R) reader structure"]
263impl crate::Readable for IEN_SPEC {
264    type Reader = R;
265}
266#[doc = "`write(|w| ..)` method takes [ien::W](W) writer structure"]
267impl crate::Writable for IEN_SPEC {
268    type Writer = W;
269    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
270    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
271}
272#[doc = "`reset()` method sets IEN to value 0"]
273impl crate::Resettable for IEN_SPEC {
274    const RESET_VALUE: Self::Ux = 0;
275}