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