efm32gg11b820/usb/
doep2_int.rs1#[doc = "Reader of register DOEP2_INT"]
2pub type R = crate::R<u32, super::DOEP2_INT>;
3#[doc = "Writer for register DOEP2_INT"]
4pub type W = crate::W<u32, super::DOEP2_INT>;
5#[doc = "Register DOEP2_INT `reset()`'s with value 0"]
6impl crate::ResetValue for super::DOEP2_INT {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `XFERCOMPL`"]
14pub type XFERCOMPL_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `XFERCOMPL`"]
16pub struct XFERCOMPL_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> XFERCOMPL_W<'a> {
20 #[doc = r"Sets the field bit"]
21 #[inline(always)]
22 pub fn set_bit(self) -> &'a mut W {
23 self.bit(true)
24 }
25 #[doc = r"Clears the field bit"]
26 #[inline(always)]
27 pub fn clear_bit(self) -> &'a mut W {
28 self.bit(false)
29 }
30 #[doc = r"Writes raw bits to the field"]
31 #[inline(always)]
32 pub fn bit(self, value: bool) -> &'a mut W {
33 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
34 self.w
35 }
36}
37#[doc = "Reader of field `EPDISBLD`"]
38pub type EPDISBLD_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `EPDISBLD`"]
40pub struct EPDISBLD_W<'a> {
41 w: &'a mut W,
42}
43impl<'a> EPDISBLD_W<'a> {
44 #[doc = r"Sets the field bit"]
45 #[inline(always)]
46 pub fn set_bit(self) -> &'a mut W {
47 self.bit(true)
48 }
49 #[doc = r"Clears the field bit"]
50 #[inline(always)]
51 pub fn clear_bit(self) -> &'a mut W {
52 self.bit(false)
53 }
54 #[doc = r"Writes raw bits to the field"]
55 #[inline(always)]
56 pub fn bit(self, value: bool) -> &'a mut W {
57 self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
58 self.w
59 }
60}
61#[doc = "Reader of field `AHBERR`"]
62pub type AHBERR_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `AHBERR`"]
64pub struct AHBERR_W<'a> {
65 w: &'a mut W,
66}
67impl<'a> AHBERR_W<'a> {
68 #[doc = r"Sets the field bit"]
69 #[inline(always)]
70 pub fn set_bit(self) -> &'a mut W {
71 self.bit(true)
72 }
73 #[doc = r"Clears the field bit"]
74 #[inline(always)]
75 pub fn clear_bit(self) -> &'a mut W {
76 self.bit(false)
77 }
78 #[doc = r"Writes raw bits to the field"]
79 #[inline(always)]
80 pub fn bit(self, value: bool) -> &'a mut W {
81 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
82 self.w
83 }
84}
85#[doc = "Reader of field `SETUP`"]
86pub type SETUP_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `SETUP`"]
88pub struct SETUP_W<'a> {
89 w: &'a mut W,
90}
91impl<'a> SETUP_W<'a> {
92 #[doc = r"Sets the field bit"]
93 #[inline(always)]
94 pub fn set_bit(self) -> &'a mut W {
95 self.bit(true)
96 }
97 #[doc = r"Clears the field bit"]
98 #[inline(always)]
99 pub fn clear_bit(self) -> &'a mut W {
100 self.bit(false)
101 }
102 #[doc = r"Writes raw bits to the field"]
103 #[inline(always)]
104 pub fn bit(self, value: bool) -> &'a mut W {
105 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
106 self.w
107 }
108}
109#[doc = "Reader of field `OUTTKNEPDIS`"]
110pub type OUTTKNEPDIS_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `OUTTKNEPDIS`"]
112pub struct OUTTKNEPDIS_W<'a> {
113 w: &'a mut W,
114}
115impl<'a> OUTTKNEPDIS_W<'a> {
116 #[doc = r"Sets the field bit"]
117 #[inline(always)]
118 pub fn set_bit(self) -> &'a mut W {
119 self.bit(true)
120 }
121 #[doc = r"Clears the field bit"]
122 #[inline(always)]
123 pub fn clear_bit(self) -> &'a mut W {
124 self.bit(false)
125 }
126 #[doc = r"Writes raw bits to the field"]
127 #[inline(always)]
128 pub fn bit(self, value: bool) -> &'a mut W {
129 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
130 self.w
131 }
132}
133#[doc = "Reader of field `STSPHSERCVD`"]
134pub type STSPHSERCVD_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `STSPHSERCVD`"]
136pub struct STSPHSERCVD_W<'a> {
137 w: &'a mut W,
138}
139impl<'a> STSPHSERCVD_W<'a> {
140 #[doc = r"Sets the field bit"]
141 #[inline(always)]
142 pub fn set_bit(self) -> &'a mut W {
143 self.bit(true)
144 }
145 #[doc = r"Clears the field bit"]
146 #[inline(always)]
147 pub fn clear_bit(self) -> &'a mut W {
148 self.bit(false)
149 }
150 #[doc = r"Writes raw bits to the field"]
151 #[inline(always)]
152 pub fn bit(self, value: bool) -> &'a mut W {
153 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
154 self.w
155 }
156}
157#[doc = "Reader of field `BACK2BACKSETUP`"]
158pub type BACK2BACKSETUP_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `BACK2BACKSETUP`"]
160pub struct BACK2BACKSETUP_W<'a> {
161 w: &'a mut W,
162}
163impl<'a> BACK2BACKSETUP_W<'a> {
164 #[doc = r"Sets the field bit"]
165 #[inline(always)]
166 pub fn set_bit(self) -> &'a mut W {
167 self.bit(true)
168 }
169 #[doc = r"Clears the field bit"]
170 #[inline(always)]
171 pub fn clear_bit(self) -> &'a mut W {
172 self.bit(false)
173 }
174 #[doc = r"Writes raw bits to the field"]
175 #[inline(always)]
176 pub fn bit(self, value: bool) -> &'a mut W {
177 self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
178 self.w
179 }
180}
181#[doc = "Reader of field `OUTPKTERR`"]
182pub type OUTPKTERR_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `OUTPKTERR`"]
184pub struct OUTPKTERR_W<'a> {
185 w: &'a mut W,
186}
187impl<'a> OUTPKTERR_W<'a> {
188 #[doc = r"Sets the field bit"]
189 #[inline(always)]
190 pub fn set_bit(self) -> &'a mut W {
191 self.bit(true)
192 }
193 #[doc = r"Clears the field bit"]
194 #[inline(always)]
195 pub fn clear_bit(self) -> &'a mut W {
196 self.bit(false)
197 }
198 #[doc = r"Writes raw bits to the field"]
199 #[inline(always)]
200 pub fn bit(self, value: bool) -> &'a mut W {
201 self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
202 self.w
203 }
204}
205#[doc = "Reader of field `PKTDRPSTS`"]
206pub type PKTDRPSTS_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `PKTDRPSTS`"]
208pub struct PKTDRPSTS_W<'a> {
209 w: &'a mut W,
210}
211impl<'a> PKTDRPSTS_W<'a> {
212 #[doc = r"Sets the field bit"]
213 #[inline(always)]
214 pub fn set_bit(self) -> &'a mut W {
215 self.bit(true)
216 }
217 #[doc = r"Clears the field bit"]
218 #[inline(always)]
219 pub fn clear_bit(self) -> &'a mut W {
220 self.bit(false)
221 }
222 #[doc = r"Writes raw bits to the field"]
223 #[inline(always)]
224 pub fn bit(self, value: bool) -> &'a mut W {
225 self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
226 self.w
227 }
228}
229#[doc = "Reader of field `BBLEERR`"]
230pub type BBLEERR_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `BBLEERR`"]
232pub struct BBLEERR_W<'a> {
233 w: &'a mut W,
234}
235impl<'a> BBLEERR_W<'a> {
236 #[doc = r"Sets the field bit"]
237 #[inline(always)]
238 pub fn set_bit(self) -> &'a mut W {
239 self.bit(true)
240 }
241 #[doc = r"Clears the field bit"]
242 #[inline(always)]
243 pub fn clear_bit(self) -> &'a mut W {
244 self.bit(false)
245 }
246 #[doc = r"Writes raw bits to the field"]
247 #[inline(always)]
248 pub fn bit(self, value: bool) -> &'a mut W {
249 self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
250 self.w
251 }
252}
253#[doc = "Reader of field `NAKINTRPT`"]
254pub type NAKINTRPT_R = crate::R<bool, bool>;
255#[doc = "Write proxy for field `NAKINTRPT`"]
256pub struct NAKINTRPT_W<'a> {
257 w: &'a mut W,
258}
259impl<'a> NAKINTRPT_W<'a> {
260 #[doc = r"Sets the field bit"]
261 #[inline(always)]
262 pub fn set_bit(self) -> &'a mut W {
263 self.bit(true)
264 }
265 #[doc = r"Clears the field bit"]
266 #[inline(always)]
267 pub fn clear_bit(self) -> &'a mut W {
268 self.bit(false)
269 }
270 #[doc = r"Writes raw bits to the field"]
271 #[inline(always)]
272 pub fn bit(self, value: bool) -> &'a mut W {
273 self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
274 self.w
275 }
276}
277#[doc = "Reader of field `STUPPKTRCVD`"]
278pub type STUPPKTRCVD_R = crate::R<bool, bool>;
279#[doc = "Write proxy for field `STUPPKTRCVD`"]
280pub struct STUPPKTRCVD_W<'a> {
281 w: &'a mut W,
282}
283impl<'a> STUPPKTRCVD_W<'a> {
284 #[doc = r"Sets the field bit"]
285 #[inline(always)]
286 pub fn set_bit(self) -> &'a mut W {
287 self.bit(true)
288 }
289 #[doc = r"Clears the field bit"]
290 #[inline(always)]
291 pub fn clear_bit(self) -> &'a mut W {
292 self.bit(false)
293 }
294 #[doc = r"Writes raw bits to the field"]
295 #[inline(always)]
296 pub fn bit(self, value: bool) -> &'a mut W {
297 self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
298 self.w
299 }
300}
301impl R {
302 #[doc = "Bit 0 - Transfer Completed Interrupt"]
303 #[inline(always)]
304 pub fn xfercompl(&self) -> XFERCOMPL_R {
305 XFERCOMPL_R::new((self.bits & 0x01) != 0)
306 }
307 #[doc = "Bit 1 - Endpoint Disabled Interrupt"]
308 #[inline(always)]
309 pub fn epdisbld(&self) -> EPDISBLD_R {
310 EPDISBLD_R::new(((self.bits >> 1) & 0x01) != 0)
311 }
312 #[doc = "Bit 2 - AHB Error"]
313 #[inline(always)]
314 pub fn ahberr(&self) -> AHBERR_R {
315 AHBERR_R::new(((self.bits >> 2) & 0x01) != 0)
316 }
317 #[doc = "Bit 3 - Phase Done"]
318 #[inline(always)]
319 pub fn setup(&self) -> SETUP_R {
320 SETUP_R::new(((self.bits >> 3) & 0x01) != 0)
321 }
322 #[doc = "Bit 4 - OUT Token Received When Endpoint Disabled"]
323 #[inline(always)]
324 pub fn outtknepdis(&self) -> OUTTKNEPDIS_R {
325 OUTTKNEPDIS_R::new(((self.bits >> 4) & 0x01) != 0)
326 }
327 #[doc = "Bit 5 - Status Phase Received for Control Write"]
328 #[inline(always)]
329 pub fn stsphsercvd(&self) -> STSPHSERCVD_R {
330 STSPHSERCVD_R::new(((self.bits >> 5) & 0x01) != 0)
331 }
332 #[doc = "Bit 6 - Back-to-Back SETUP Packets Received"]
333 #[inline(always)]
334 pub fn back2backsetup(&self) -> BACK2BACKSETUP_R {
335 BACK2BACKSETUP_R::new(((self.bits >> 6) & 0x01) != 0)
336 }
337 #[doc = "Bit 8 - OUT Packet Error"]
338 #[inline(always)]
339 pub fn outpkterr(&self) -> OUTPKTERR_R {
340 OUTPKTERR_R::new(((self.bits >> 8) & 0x01) != 0)
341 }
342 #[doc = "Bit 11 - Packet Drop Status"]
343 #[inline(always)]
344 pub fn pktdrpsts(&self) -> PKTDRPSTS_R {
345 PKTDRPSTS_R::new(((self.bits >> 11) & 0x01) != 0)
346 }
347 #[doc = "Bit 12 - NAK Interrupt"]
348 #[inline(always)]
349 pub fn bbleerr(&self) -> BBLEERR_R {
350 BBLEERR_R::new(((self.bits >> 12) & 0x01) != 0)
351 }
352 #[doc = "Bit 13"]
353 #[inline(always)]
354 pub fn nakintrpt(&self) -> NAKINTRPT_R {
355 NAKINTRPT_R::new(((self.bits >> 13) & 0x01) != 0)
356 }
357 #[doc = "Bit 15"]
358 #[inline(always)]
359 pub fn stuppktrcvd(&self) -> STUPPKTRCVD_R {
360 STUPPKTRCVD_R::new(((self.bits >> 15) & 0x01) != 0)
361 }
362}
363impl W {
364 #[doc = "Bit 0 - Transfer Completed Interrupt"]
365 #[inline(always)]
366 pub fn xfercompl(&mut self) -> XFERCOMPL_W {
367 XFERCOMPL_W { w: self }
368 }
369 #[doc = "Bit 1 - Endpoint Disabled Interrupt"]
370 #[inline(always)]
371 pub fn epdisbld(&mut self) -> EPDISBLD_W {
372 EPDISBLD_W { w: self }
373 }
374 #[doc = "Bit 2 - AHB Error"]
375 #[inline(always)]
376 pub fn ahberr(&mut self) -> AHBERR_W {
377 AHBERR_W { w: self }
378 }
379 #[doc = "Bit 3 - Phase Done"]
380 #[inline(always)]
381 pub fn setup(&mut self) -> SETUP_W {
382 SETUP_W { w: self }
383 }
384 #[doc = "Bit 4 - OUT Token Received When Endpoint Disabled"]
385 #[inline(always)]
386 pub fn outtknepdis(&mut self) -> OUTTKNEPDIS_W {
387 OUTTKNEPDIS_W { w: self }
388 }
389 #[doc = "Bit 5 - Status Phase Received for Control Write"]
390 #[inline(always)]
391 pub fn stsphsercvd(&mut self) -> STSPHSERCVD_W {
392 STSPHSERCVD_W { w: self }
393 }
394 #[doc = "Bit 6 - Back-to-Back SETUP Packets Received"]
395 #[inline(always)]
396 pub fn back2backsetup(&mut self) -> BACK2BACKSETUP_W {
397 BACK2BACKSETUP_W { w: self }
398 }
399 #[doc = "Bit 8 - OUT Packet Error"]
400 #[inline(always)]
401 pub fn outpkterr(&mut self) -> OUTPKTERR_W {
402 OUTPKTERR_W { w: self }
403 }
404 #[doc = "Bit 11 - Packet Drop Status"]
405 #[inline(always)]
406 pub fn pktdrpsts(&mut self) -> PKTDRPSTS_W {
407 PKTDRPSTS_W { w: self }
408 }
409 #[doc = "Bit 12 - NAK Interrupt"]
410 #[inline(always)]
411 pub fn bbleerr(&mut self) -> BBLEERR_W {
412 BBLEERR_W { w: self }
413 }
414 #[doc = "Bit 13"]
415 #[inline(always)]
416 pub fn nakintrpt(&mut self) -> NAKINTRPT_W {
417 NAKINTRPT_W { w: self }
418 }
419 #[doc = "Bit 15"]
420 #[inline(always)]
421 pub fn stuppktrcvd(&mut self) -> STUPPKTRCVD_W {
422 STUPPKTRCVD_W { w: self }
423 }
424}