efm32gg12b410_pac/usb/
gintsts.rs1#[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 (host and device)"]
38pub type CURMOD_R = crate::BitReader<bool>;
39#[doc = "Field `MODEMIS` reader - Mode Mismatch Interrupt (host and device)"]
40pub type MODEMIS_R = crate::BitReader<bool>;
41#[doc = "Field `MODEMIS` writer - Mode Mismatch Interrupt (host and device)"]
42pub type MODEMIS_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 1>;
43#[doc = "Field `OTGINT` reader - OTG Interrupt (host and device)"]
44pub type OTGINT_R = crate::BitReader<bool>;
45#[doc = "Field `SOF` reader - Start of Frame (host and device)"]
46pub type SOF_R = crate::BitReader<bool>;
47#[doc = "Field `SOF` writer - Start of Frame (host and device)"]
48pub type SOF_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 3>;
49#[doc = "Field `RXFLVL` reader - RxFIFO Non-Empty (host and device)"]
50pub type RXFLVL_R = crate::BitReader<bool>;
51#[doc = "Field `NPTXFEMP` reader - Non-Periodic TxFIFO Empty (host only)"]
52pub type NPTXFEMP_R = crate::BitReader<bool>;
53#[doc = "Field `GINNAKEFF` reader - Global IN Non-periodic NAK Effective (device only)"]
54pub type GINNAKEFF_R = crate::BitReader<bool>;
55#[doc = "Field `GOUTNAKEFF` reader - Global OUT NAK Effective (device only)"]
56pub type GOUTNAKEFF_R = crate::BitReader<bool>;
57#[doc = "Field `ERLYSUSP` reader - Early Suspend (device only)"]
58pub type ERLYSUSP_R = crate::BitReader<bool>;
59#[doc = "Field `ERLYSUSP` writer - Early Suspend (device only)"]
60pub type ERLYSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 10>;
61#[doc = "Field `USBSUSP` reader - USB Suspend (device only)"]
62pub type USBSUSP_R = crate::BitReader<bool>;
63#[doc = "Field `USBSUSP` writer - USB Suspend (device only)"]
64pub type USBSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 11>;
65#[doc = "Field `USBRST` reader - USB Reset (device only)"]
66pub type USBRST_R = crate::BitReader<bool>;
67#[doc = "Field `USBRST` writer - USB Reset (device only)"]
68pub type USBRST_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 12>;
69#[doc = "Field `ENUMDONE` reader - Enumeration Done (device only)"]
70pub type ENUMDONE_R = crate::BitReader<bool>;
71#[doc = "Field `ENUMDONE` writer - Enumeration Done (device only)"]
72pub type ENUMDONE_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 13>;
73#[doc = "Field `ISOOUTDROP` reader - Isochronous OUT Packet Dropped Interrupt (device only)"]
74pub type ISOOUTDROP_R = crate::BitReader<bool>;
75#[doc = "Field `ISOOUTDROP` writer - Isochronous OUT Packet Dropped Interrupt (device only)"]
76pub type ISOOUTDROP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 14>;
77#[doc = "Field `EOPF` reader - End of Periodic Frame Interrupt"]
78pub type EOPF_R = crate::BitReader<bool>;
79#[doc = "Field `EOPF` writer - End of Periodic Frame Interrupt"]
80pub type EOPF_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 15>;
81#[doc = "Field `EPMIS` reader - Endpoint Mismatch Interrupt (device only)"]
82pub type EPMIS_R = crate::BitReader<bool>;
83#[doc = "Field `EPMIS` writer - Endpoint Mismatch Interrupt (device only)"]
84pub type EPMIS_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 17>;
85#[doc = "Field `IEPINT` reader - IN Endpoints Interrupt (device only)"]
86pub type IEPINT_R = crate::BitReader<bool>;
87#[doc = "Field `OEPINT` reader - OUT Endpoints Interrupt (device only)"]
88pub type OEPINT_R = crate::BitReader<bool>;
89#[doc = "Field `INCOMPISOIN` reader - Incomplete Isochronous IN Transfer (device only)"]
90pub type INCOMPISOIN_R = crate::BitReader<bool>;
91#[doc = "Field `INCOMPISOIN` writer - Incomplete Isochronous IN Transfer (device only)"]
92pub type INCOMPISOIN_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 20>;
93#[doc = "Field `INCOMPLP` reader - Incomplete Periodic Transfer (device only)"]
94pub type INCOMPLP_R = crate::BitReader<bool>;
95#[doc = "Field `INCOMPLP` writer - Incomplete Periodic Transfer (device only)"]
96pub type INCOMPLP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 21>;
97#[doc = "Field `FETSUSP` reader - Data Fetch Suspended (device only)"]
98pub type FETSUSP_R = crate::BitReader<bool>;
99#[doc = "Field `FETSUSP` writer - Data Fetch Suspended (device only)"]
100pub type FETSUSP_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 22>;
101#[doc = "Field `RESETDET` reader - Reset detected Interrupt (device only)"]
102pub type RESETDET_R = crate::BitReader<bool>;
103#[doc = "Field `RESETDET` writer - Reset detected Interrupt (device only)"]
104pub type RESETDET_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 23>;
105#[doc = "Field `PRTINT` reader - Host Port Interrupt (host only)"]
106pub type PRTINT_R = crate::BitReader<bool>;
107#[doc = "Field `HCHINT` reader - Host Channels Interrupt (host only)"]
108pub type HCHINT_R = crate::BitReader<bool>;
109#[doc = "Field `PTXFEMP` reader - Periodic TxFIFO Empty (host only)"]
110pub type PTXFEMP_R = crate::BitReader<bool>;
111#[doc = "Field `CONIDSTSCHNG` reader - Connector ID Status Change (host and device)"]
112pub type CONIDSTSCHNG_R = crate::BitReader<bool>;
113#[doc = "Field `CONIDSTSCHNG` writer - Connector ID Status Change (host and device)"]
114pub type CONIDSTSCHNG_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 28>;
115#[doc = "Field `DISCONNINT` reader - Disconnect Detected Interrupt (host only)"]
116pub type DISCONNINT_R = crate::BitReader<bool>;
117#[doc = "Field `DISCONNINT` writer - Disconnect Detected Interrupt (host only)"]
118pub type DISCONNINT_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 29>;
119#[doc = "Field `SESSREQINT` reader - Session Request/New Session Detected Interrupt (host and device)"]
120pub type SESSREQINT_R = crate::BitReader<bool>;
121#[doc = "Field `SESSREQINT` writer - Session Request/New Session Detected Interrupt (host and device)"]
122pub type SESSREQINT_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 30>;
123#[doc = "Field `WKUPINT` reader - Resume/Remote Wakeup Detected Interrupt (host and device)"]
124pub type WKUPINT_R = crate::BitReader<bool>;
125#[doc = "Field `WKUPINT` writer - Resume/Remote Wakeup Detected Interrupt (host and device)"]
126pub type WKUPINT_W<'a> = crate::BitWriter<'a, u32, GINTSTS_SPEC, bool, 31>;
127impl R {
128 #[doc = "Bit 0 - Current Mode of Operation (host and device)"]
129 #[inline(always)]
130 pub fn curmod(&self) -> CURMOD_R {
131 CURMOD_R::new((self.bits & 1) != 0)
132 }
133 #[doc = "Bit 1 - Mode Mismatch Interrupt (host and device)"]
134 #[inline(always)]
135 pub fn modemis(&self) -> MODEMIS_R {
136 MODEMIS_R::new(((self.bits >> 1) & 1) != 0)
137 }
138 #[doc = "Bit 2 - OTG Interrupt (host and device)"]
139 #[inline(always)]
140 pub fn otgint(&self) -> OTGINT_R {
141 OTGINT_R::new(((self.bits >> 2) & 1) != 0)
142 }
143 #[doc = "Bit 3 - Start of Frame (host and device)"]
144 #[inline(always)]
145 pub fn sof(&self) -> SOF_R {
146 SOF_R::new(((self.bits >> 3) & 1) != 0)
147 }
148 #[doc = "Bit 4 - RxFIFO Non-Empty (host and device)"]
149 #[inline(always)]
150 pub fn rxflvl(&self) -> RXFLVL_R {
151 RXFLVL_R::new(((self.bits >> 4) & 1) != 0)
152 }
153 #[doc = "Bit 5 - Non-Periodic TxFIFO Empty (host only)"]
154 #[inline(always)]
155 pub fn nptxfemp(&self) -> NPTXFEMP_R {
156 NPTXFEMP_R::new(((self.bits >> 5) & 1) != 0)
157 }
158 #[doc = "Bit 6 - Global IN Non-periodic NAK Effective (device only)"]
159 #[inline(always)]
160 pub fn ginnakeff(&self) -> GINNAKEFF_R {
161 GINNAKEFF_R::new(((self.bits >> 6) & 1) != 0)
162 }
163 #[doc = "Bit 7 - Global OUT NAK Effective (device only)"]
164 #[inline(always)]
165 pub fn goutnakeff(&self) -> GOUTNAKEFF_R {
166 GOUTNAKEFF_R::new(((self.bits >> 7) & 1) != 0)
167 }
168 #[doc = "Bit 10 - Early Suspend (device only)"]
169 #[inline(always)]
170 pub fn erlysusp(&self) -> ERLYSUSP_R {
171 ERLYSUSP_R::new(((self.bits >> 10) & 1) != 0)
172 }
173 #[doc = "Bit 11 - USB Suspend (device only)"]
174 #[inline(always)]
175 pub fn usbsusp(&self) -> USBSUSP_R {
176 USBSUSP_R::new(((self.bits >> 11) & 1) != 0)
177 }
178 #[doc = "Bit 12 - USB Reset (device only)"]
179 #[inline(always)]
180 pub fn usbrst(&self) -> USBRST_R {
181 USBRST_R::new(((self.bits >> 12) & 1) != 0)
182 }
183 #[doc = "Bit 13 - Enumeration Done (device only)"]
184 #[inline(always)]
185 pub fn enumdone(&self) -> ENUMDONE_R {
186 ENUMDONE_R::new(((self.bits >> 13) & 1) != 0)
187 }
188 #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt (device only)"]
189 #[inline(always)]
190 pub fn isooutdrop(&self) -> ISOOUTDROP_R {
191 ISOOUTDROP_R::new(((self.bits >> 14) & 1) != 0)
192 }
193 #[doc = "Bit 15 - End of Periodic Frame Interrupt"]
194 #[inline(always)]
195 pub fn eopf(&self) -> EOPF_R {
196 EOPF_R::new(((self.bits >> 15) & 1) != 0)
197 }
198 #[doc = "Bit 17 - Endpoint Mismatch Interrupt (device only)"]
199 #[inline(always)]
200 pub fn epmis(&self) -> EPMIS_R {
201 EPMIS_R::new(((self.bits >> 17) & 1) != 0)
202 }
203 #[doc = "Bit 18 - IN Endpoints Interrupt (device only)"]
204 #[inline(always)]
205 pub fn iepint(&self) -> IEPINT_R {
206 IEPINT_R::new(((self.bits >> 18) & 1) != 0)
207 }
208 #[doc = "Bit 19 - OUT Endpoints Interrupt (device only)"]
209 #[inline(always)]
210 pub fn oepint(&self) -> OEPINT_R {
211 OEPINT_R::new(((self.bits >> 19) & 1) != 0)
212 }
213 #[doc = "Bit 20 - Incomplete Isochronous IN Transfer (device only)"]
214 #[inline(always)]
215 pub fn incompisoin(&self) -> INCOMPISOIN_R {
216 INCOMPISOIN_R::new(((self.bits >> 20) & 1) != 0)
217 }
218 #[doc = "Bit 21 - Incomplete Periodic Transfer (device only)"]
219 #[inline(always)]
220 pub fn incomplp(&self) -> INCOMPLP_R {
221 INCOMPLP_R::new(((self.bits >> 21) & 1) != 0)
222 }
223 #[doc = "Bit 22 - Data Fetch Suspended (device only)"]
224 #[inline(always)]
225 pub fn fetsusp(&self) -> FETSUSP_R {
226 FETSUSP_R::new(((self.bits >> 22) & 1) != 0)
227 }
228 #[doc = "Bit 23 - Reset detected Interrupt (device only)"]
229 #[inline(always)]
230 pub fn resetdet(&self) -> RESETDET_R {
231 RESETDET_R::new(((self.bits >> 23) & 1) != 0)
232 }
233 #[doc = "Bit 24 - Host Port Interrupt (host only)"]
234 #[inline(always)]
235 pub fn prtint(&self) -> PRTINT_R {
236 PRTINT_R::new(((self.bits >> 24) & 1) != 0)
237 }
238 #[doc = "Bit 25 - Host Channels Interrupt (host only)"]
239 #[inline(always)]
240 pub fn hchint(&self) -> HCHINT_R {
241 HCHINT_R::new(((self.bits >> 25) & 1) != 0)
242 }
243 #[doc = "Bit 26 - Periodic TxFIFO Empty (host only)"]
244 #[inline(always)]
245 pub fn ptxfemp(&self) -> PTXFEMP_R {
246 PTXFEMP_R::new(((self.bits >> 26) & 1) != 0)
247 }
248 #[doc = "Bit 28 - Connector ID Status Change (host and device)"]
249 #[inline(always)]
250 pub fn conidstschng(&self) -> CONIDSTSCHNG_R {
251 CONIDSTSCHNG_R::new(((self.bits >> 28) & 1) != 0)
252 }
253 #[doc = "Bit 29 - Disconnect Detected Interrupt (host only)"]
254 #[inline(always)]
255 pub fn disconnint(&self) -> DISCONNINT_R {
256 DISCONNINT_R::new(((self.bits >> 29) & 1) != 0)
257 }
258 #[doc = "Bit 30 - Session Request/New Session Detected Interrupt (host and device)"]
259 #[inline(always)]
260 pub fn sessreqint(&self) -> SESSREQINT_R {
261 SESSREQINT_R::new(((self.bits >> 30) & 1) != 0)
262 }
263 #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt (host and device)"]
264 #[inline(always)]
265 pub fn wkupint(&self) -> WKUPINT_R {
266 WKUPINT_R::new(((self.bits >> 31) & 1) != 0)
267 }
268}
269impl W {
270 #[doc = "Bit 1 - Mode Mismatch Interrupt (host and device)"]
271 #[inline(always)]
272 pub fn modemis(&mut self) -> MODEMIS_W {
273 MODEMIS_W::new(self)
274 }
275 #[doc = "Bit 3 - Start of Frame (host and device)"]
276 #[inline(always)]
277 pub fn sof(&mut self) -> SOF_W {
278 SOF_W::new(self)
279 }
280 #[doc = "Bit 10 - Early Suspend (device only)"]
281 #[inline(always)]
282 pub fn erlysusp(&mut self) -> ERLYSUSP_W {
283 ERLYSUSP_W::new(self)
284 }
285 #[doc = "Bit 11 - USB Suspend (device only)"]
286 #[inline(always)]
287 pub fn usbsusp(&mut self) -> USBSUSP_W {
288 USBSUSP_W::new(self)
289 }
290 #[doc = "Bit 12 - USB Reset (device only)"]
291 #[inline(always)]
292 pub fn usbrst(&mut self) -> USBRST_W {
293 USBRST_W::new(self)
294 }
295 #[doc = "Bit 13 - Enumeration Done (device only)"]
296 #[inline(always)]
297 pub fn enumdone(&mut self) -> ENUMDONE_W {
298 ENUMDONE_W::new(self)
299 }
300 #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt (device only)"]
301 #[inline(always)]
302 pub fn isooutdrop(&mut self) -> ISOOUTDROP_W {
303 ISOOUTDROP_W::new(self)
304 }
305 #[doc = "Bit 15 - End of Periodic Frame Interrupt"]
306 #[inline(always)]
307 pub fn eopf(&mut self) -> EOPF_W {
308 EOPF_W::new(self)
309 }
310 #[doc = "Bit 17 - Endpoint Mismatch Interrupt (device only)"]
311 #[inline(always)]
312 pub fn epmis(&mut self) -> EPMIS_W {
313 EPMIS_W::new(self)
314 }
315 #[doc = "Bit 20 - Incomplete Isochronous IN Transfer (device only)"]
316 #[inline(always)]
317 pub fn incompisoin(&mut self) -> INCOMPISOIN_W {
318 INCOMPISOIN_W::new(self)
319 }
320 #[doc = "Bit 21 - Incomplete Periodic Transfer (device only)"]
321 #[inline(always)]
322 pub fn incomplp(&mut self) -> INCOMPLP_W {
323 INCOMPLP_W::new(self)
324 }
325 #[doc = "Bit 22 - Data Fetch Suspended (device only)"]
326 #[inline(always)]
327 pub fn fetsusp(&mut self) -> FETSUSP_W {
328 FETSUSP_W::new(self)
329 }
330 #[doc = "Bit 23 - Reset detected Interrupt (device only)"]
331 #[inline(always)]
332 pub fn resetdet(&mut self) -> RESETDET_W {
333 RESETDET_W::new(self)
334 }
335 #[doc = "Bit 28 - Connector ID Status Change (host and device)"]
336 #[inline(always)]
337 pub fn conidstschng(&mut self) -> CONIDSTSCHNG_W {
338 CONIDSTSCHNG_W::new(self)
339 }
340 #[doc = "Bit 29 - Disconnect Detected Interrupt (host only)"]
341 #[inline(always)]
342 pub fn disconnint(&mut self) -> DISCONNINT_W {
343 DISCONNINT_W::new(self)
344 }
345 #[doc = "Bit 30 - Session Request/New Session Detected Interrupt (host and device)"]
346 #[inline(always)]
347 pub fn sessreqint(&mut self) -> SESSREQINT_W {
348 SESSREQINT_W::new(self)
349 }
350 #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt (host and device)"]
351 #[inline(always)]
352 pub fn wkupint(&mut self) -> WKUPINT_W {
353 WKUPINT_W::new(self)
354 }
355 #[doc = "Writes raw bits to the register."]
356 #[inline(always)]
357 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
358 self.0.bits(bits);
359 self
360 }
361}
362#[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"]
363pub struct GINTSTS_SPEC;
364impl crate::RegisterSpec for GINTSTS_SPEC {
365 type Ux = u32;
366}
367#[doc = "`read()` method returns [gintsts::R](R) reader structure"]
368impl crate::Readable for GINTSTS_SPEC {
369 type Reader = R;
370}
371#[doc = "`write(|w| ..)` method takes [gintsts::W](W) writer structure"]
372impl crate::Writable for GINTSTS_SPEC {
373 type Writer = W;
374}
375#[doc = "`reset()` method sets GINTSTS to value 0x1400_0020"]
376impl crate::Resettable for GINTSTS_SPEC {
377 #[inline(always)]
378 fn reset_value() -> Self::Ux {
379 0x1400_0020
380 }
381}