efm32hg310_pac/usb/
gintsts.rs

1#[doc = "Register `GINTSTS` reader"]
2pub struct R(crate::R<GINTSTS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<GINTSTS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<GINTSTS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<GINTSTS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `GINTSTS` writer"]
17pub struct W(crate::W<GINTSTS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<GINTSTS_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<GINTSTS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<GINTSTS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CURMOD` reader - Current Mode of Operation"]
38pub type CURMOD_R = crate::BitReader<bool>;
39#[doc = "Field `SOF` reader - Start of Frame"]
40pub type SOF_R = crate::BitReader<bool>;
41#[doc = "Field `SOF` writer - Start of Frame"]
42pub type SOF_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 3>;
43#[doc = "Field `RXFLVL` reader - RxFIFO Non-Empty"]
44pub type RXFLVL_R = crate::BitReader<bool>;
45#[doc = "Field `GINNAKEFF` reader - Global IN Non-periodic NAK Effective"]
46pub type GINNAKEFF_R = crate::BitReader<bool>;
47#[doc = "Field `GOUTNAKEFF` reader - Global OUT NAK Effective"]
48pub type GOUTNAKEFF_R = crate::BitReader<bool>;
49#[doc = "Field `ERLYSUSP` reader - Early Suspend"]
50pub type ERLYSUSP_R = crate::BitReader<bool>;
51#[doc = "Field `ERLYSUSP` writer - Early Suspend"]
52pub type ERLYSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 10>;
53#[doc = "Field `USBSUSP` reader - USB Suspend"]
54pub type USBSUSP_R = crate::BitReader<bool>;
55#[doc = "Field `USBSUSP` writer - USB Suspend"]
56pub type USBSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 11>;
57#[doc = "Field `USBRST` reader - USB Reset"]
58pub type USBRST_R = crate::BitReader<bool>;
59#[doc = "Field `USBRST` writer - USB Reset"]
60pub type USBRST_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 12>;
61#[doc = "Field `ENUMDONE` reader - Enumeration Done"]
62pub type ENUMDONE_R = crate::BitReader<bool>;
63#[doc = "Field `ENUMDONE` writer - Enumeration Done"]
64pub type ENUMDONE_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 13>;
65#[doc = "Field `ISOOUTDROP` reader - Isochronous OUT Packet Dropped Interrupt"]
66pub type ISOOUTDROP_R = crate::BitReader<bool>;
67#[doc = "Field `ISOOUTDROP` writer - Isochronous OUT Packet Dropped Interrupt"]
68pub type ISOOUTDROP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 14>;
69#[doc = "Field `EOPF` reader - End of Periodic Frame Interrupt"]
70pub type EOPF_R = crate::BitReader<bool>;
71#[doc = "Field `EOPF` writer - End of Periodic Frame Interrupt"]
72pub type EOPF_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 15>;
73#[doc = "Field `IEPINT` reader - IN Endpoints Interrupt"]
74pub type IEPINT_R = crate::BitReader<bool>;
75#[doc = "Field `OEPINT` reader - OUT Endpoints Interrupt"]
76pub type OEPINT_R = crate::BitReader<bool>;
77#[doc = "Field `INCOMPISOIN` reader - Incomplete Isochronous IN Transfer"]
78pub type INCOMPISOIN_R = crate::BitReader<bool>;
79#[doc = "Field `INCOMPISOIN` writer - Incomplete Isochronous IN Transfer"]
80pub type INCOMPISOIN_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 20>;
81#[doc = "Field `INCOMPLP` reader - Incomplete Periodic Transfer"]
82pub type INCOMPLP_R = crate::BitReader<bool>;
83#[doc = "Field `INCOMPLP` writer - Incomplete Periodic Transfer"]
84pub type INCOMPLP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 21>;
85#[doc = "Field `FETSUSP` reader - Data Fetch Suspended"]
86pub type FETSUSP_R = crate::BitReader<bool>;
87#[doc = "Field `FETSUSP` writer - Data Fetch Suspended"]
88pub type FETSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 22>;
89#[doc = "Field `RESETDET` reader - Reset detected Interrupt"]
90pub type RESETDET_R = crate::BitReader<bool>;
91#[doc = "Field `RESETDET` writer - Reset detected Interrupt"]
92pub type RESETDET_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 23>;
93#[doc = "Field `WKUPINT` reader - Resume/Remote Wakeup Detected Interrupt"]
94pub type WKUPINT_R = crate::BitReader<bool>;
95#[doc = "Field `WKUPINT` writer - Resume/Remote Wakeup Detected Interrupt"]
96pub type WKUPINT_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 31>;
97impl R {
98    #[doc = "Bit 0 - Current Mode of Operation"]
99    #[inline(always)]
100    pub fn curmod(&self) -> CURMOD_R {
101        CURMOD_R::new((self.bits & 1) != 0)
102    }
103    #[doc = "Bit 3 - Start of Frame"]
104    #[inline(always)]
105    pub fn sof(&self) -> SOF_R {
106        SOF_R::new(((self.bits >> 3) & 1) != 0)
107    }
108    #[doc = "Bit 4 - RxFIFO Non-Empty"]
109    #[inline(always)]
110    pub fn rxflvl(&self) -> RXFLVL_R {
111        RXFLVL_R::new(((self.bits >> 4) & 1) != 0)
112    }
113    #[doc = "Bit 6 - Global IN Non-periodic NAK Effective"]
114    #[inline(always)]
115    pub fn ginnakeff(&self) -> GINNAKEFF_R {
116        GINNAKEFF_R::new(((self.bits >> 6) & 1) != 0)
117    }
118    #[doc = "Bit 7 - Global OUT NAK Effective"]
119    #[inline(always)]
120    pub fn goutnakeff(&self) -> GOUTNAKEFF_R {
121        GOUTNAKEFF_R::new(((self.bits >> 7) & 1) != 0)
122    }
123    #[doc = "Bit 10 - Early Suspend"]
124    #[inline(always)]
125    pub fn erlysusp(&self) -> ERLYSUSP_R {
126        ERLYSUSP_R::new(((self.bits >> 10) & 1) != 0)
127    }
128    #[doc = "Bit 11 - USB Suspend"]
129    #[inline(always)]
130    pub fn usbsusp(&self) -> USBSUSP_R {
131        USBSUSP_R::new(((self.bits >> 11) & 1) != 0)
132    }
133    #[doc = "Bit 12 - USB Reset"]
134    #[inline(always)]
135    pub fn usbrst(&self) -> USBRST_R {
136        USBRST_R::new(((self.bits >> 12) & 1) != 0)
137    }
138    #[doc = "Bit 13 - Enumeration Done"]
139    #[inline(always)]
140    pub fn enumdone(&self) -> ENUMDONE_R {
141        ENUMDONE_R::new(((self.bits >> 13) & 1) != 0)
142    }
143    #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt"]
144    #[inline(always)]
145    pub fn isooutdrop(&self) -> ISOOUTDROP_R {
146        ISOOUTDROP_R::new(((self.bits >> 14) & 1) != 0)
147    }
148    #[doc = "Bit 15 - End of Periodic Frame Interrupt"]
149    #[inline(always)]
150    pub fn eopf(&self) -> EOPF_R {
151        EOPF_R::new(((self.bits >> 15) & 1) != 0)
152    }
153    #[doc = "Bit 18 - IN Endpoints Interrupt"]
154    #[inline(always)]
155    pub fn iepint(&self) -> IEPINT_R {
156        IEPINT_R::new(((self.bits >> 18) & 1) != 0)
157    }
158    #[doc = "Bit 19 - OUT Endpoints Interrupt"]
159    #[inline(always)]
160    pub fn oepint(&self) -> OEPINT_R {
161        OEPINT_R::new(((self.bits >> 19) & 1) != 0)
162    }
163    #[doc = "Bit 20 - Incomplete Isochronous IN Transfer"]
164    #[inline(always)]
165    pub fn incompisoin(&self) -> INCOMPISOIN_R {
166        INCOMPISOIN_R::new(((self.bits >> 20) & 1) != 0)
167    }
168    #[doc = "Bit 21 - Incomplete Periodic Transfer"]
169    #[inline(always)]
170    pub fn incomplp(&self) -> INCOMPLP_R {
171        INCOMPLP_R::new(((self.bits >> 21) & 1) != 0)
172    }
173    #[doc = "Bit 22 - Data Fetch Suspended"]
174    #[inline(always)]
175    pub fn fetsusp(&self) -> FETSUSP_R {
176        FETSUSP_R::new(((self.bits >> 22) & 1) != 0)
177    }
178    #[doc = "Bit 23 - Reset detected Interrupt"]
179    #[inline(always)]
180    pub fn resetdet(&self) -> RESETDET_R {
181        RESETDET_R::new(((self.bits >> 23) & 1) != 0)
182    }
183    #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt"]
184    #[inline(always)]
185    pub fn wkupint(&self) -> WKUPINT_R {
186        WKUPINT_R::new(((self.bits >> 31) & 1) != 0)
187    }
188}
189impl W {
190    #[doc = "Bit 3 - Start of Frame"]
191    #[inline(always)]
192    pub fn sof(&mut self) -> SOF_W {
193        SOF_W::new(self)
194    }
195    #[doc = "Bit 10 - Early Suspend"]
196    #[inline(always)]
197    pub fn erlysusp(&mut self) -> ERLYSUSP_W {
198        ERLYSUSP_W::new(self)
199    }
200    #[doc = "Bit 11 - USB Suspend"]
201    #[inline(always)]
202    pub fn usbsusp(&mut self) -> USBSUSP_W {
203        USBSUSP_W::new(self)
204    }
205    #[doc = "Bit 12 - USB Reset"]
206    #[inline(always)]
207    pub fn usbrst(&mut self) -> USBRST_W {
208        USBRST_W::new(self)
209    }
210    #[doc = "Bit 13 - Enumeration Done"]
211    #[inline(always)]
212    pub fn enumdone(&mut self) -> ENUMDONE_W {
213        ENUMDONE_W::new(self)
214    }
215    #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt"]
216    #[inline(always)]
217    pub fn isooutdrop(&mut self) -> ISOOUTDROP_W {
218        ISOOUTDROP_W::new(self)
219    }
220    #[doc = "Bit 15 - End of Periodic Frame Interrupt"]
221    #[inline(always)]
222    pub fn eopf(&mut self) -> EOPF_W {
223        EOPF_W::new(self)
224    }
225    #[doc = "Bit 20 - Incomplete Isochronous IN Transfer"]
226    #[inline(always)]
227    pub fn incompisoin(&mut self) -> INCOMPISOIN_W {
228        INCOMPISOIN_W::new(self)
229    }
230    #[doc = "Bit 21 - Incomplete Periodic Transfer"]
231    #[inline(always)]
232    pub fn incomplp(&mut self) -> INCOMPLP_W {
233        INCOMPLP_W::new(self)
234    }
235    #[doc = "Bit 22 - Data Fetch Suspended"]
236    #[inline(always)]
237    pub fn fetsusp(&mut self) -> FETSUSP_W {
238        FETSUSP_W::new(self)
239    }
240    #[doc = "Bit 23 - Reset detected Interrupt"]
241    #[inline(always)]
242    pub fn resetdet(&mut self) -> RESETDET_W {
243        RESETDET_W::new(self)
244    }
245    #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt"]
246    #[inline(always)]
247    pub fn wkupint(&mut self) -> WKUPINT_W {
248        WKUPINT_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 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 [gintsts](index.html) module"]
258pub struct GINTSTS_SPEC;
259impl crate::RegisterSpec for GINTSTS_SPEC {
260    type Ux = u32;
261}
262#[doc = "`read()` method returns [gintsts::R](R) reader structure"]
263impl crate::Readable for GINTSTS_SPEC {
264    type Reader = R;
265}
266#[doc = "`write(|w| ..)` method takes [gintsts::W](W) writer structure"]
267impl crate::Writable for GINTSTS_SPEC {
268    type Writer = W;
269}
270#[doc = "`reset()` method sets GINTSTS to value 0"]
271impl crate::Resettable for GINTSTS_SPEC {
272    #[inline(always)]
273    fn reset_value() -> Self::Ux {
274        0
275    }
276}