stm32f429/otg_hs_host/
otg_hs_hcintmsk3.rs1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::OTG_HS_HCINTMSK3 {
10 #[doc = r" Modifies the contents of the register"]
11 #[inline]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 let r = R { bits: bits };
18 let mut w = W { bits: bits };
19 f(&r, &mut w);
20 self.register.set(w.bits);
21 }
22 #[doc = r" Reads the contents of the register"]
23 #[inline]
24 pub fn read(&self) -> R {
25 R {
26 bits: self.register.get(),
27 }
28 }
29 #[doc = r" Writes to the register"]
30 #[inline]
31 pub fn write<F>(&self, f: F)
32 where
33 F: FnOnce(&mut W) -> &mut W,
34 {
35 let mut w = W::reset_value();
36 f(&mut w);
37 self.register.set(w.bits);
38 }
39 #[doc = r" Writes the reset value to the register"]
40 #[inline]
41 pub fn reset(&self) {
42 self.write(|w| w)
43 }
44}
45#[doc = r" Value of the field"]
46pub struct XFRCMR {
47 bits: bool,
48}
49impl XFRCMR {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bit(&self) -> bool {
53 self.bits
54 }
55 #[doc = r" Returns `true` if the bit is clear (0)"]
56 #[inline]
57 pub fn bit_is_clear(&self) -> bool {
58 !self.bit()
59 }
60 #[doc = r" Returns `true` if the bit is set (1)"]
61 #[inline]
62 pub fn bit_is_set(&self) -> bool {
63 self.bit()
64 }
65}
66#[doc = r" Value of the field"]
67pub struct CHHMR {
68 bits: bool,
69}
70impl CHHMR {
71 #[doc = r" Value of the field as raw bits"]
72 #[inline]
73 pub fn bit(&self) -> bool {
74 self.bits
75 }
76 #[doc = r" Returns `true` if the bit is clear (0)"]
77 #[inline]
78 pub fn bit_is_clear(&self) -> bool {
79 !self.bit()
80 }
81 #[doc = r" Returns `true` if the bit is set (1)"]
82 #[inline]
83 pub fn bit_is_set(&self) -> bool {
84 self.bit()
85 }
86}
87#[doc = r" Value of the field"]
88pub struct AHBERRR {
89 bits: bool,
90}
91impl AHBERRR {
92 #[doc = r" Value of the field as raw bits"]
93 #[inline]
94 pub fn bit(&self) -> bool {
95 self.bits
96 }
97 #[doc = r" Returns `true` if the bit is clear (0)"]
98 #[inline]
99 pub fn bit_is_clear(&self) -> bool {
100 !self.bit()
101 }
102 #[doc = r" Returns `true` if the bit is set (1)"]
103 #[inline]
104 pub fn bit_is_set(&self) -> bool {
105 self.bit()
106 }
107}
108#[doc = r" Value of the field"]
109pub struct STALLMR {
110 bits: bool,
111}
112impl STALLMR {
113 #[doc = r" Value of the field as raw bits"]
114 #[inline]
115 pub fn bit(&self) -> bool {
116 self.bits
117 }
118 #[doc = r" Returns `true` if the bit is clear (0)"]
119 #[inline]
120 pub fn bit_is_clear(&self) -> bool {
121 !self.bit()
122 }
123 #[doc = r" Returns `true` if the bit is set (1)"]
124 #[inline]
125 pub fn bit_is_set(&self) -> bool {
126 self.bit()
127 }
128}
129#[doc = r" Value of the field"]
130pub struct NAKMR {
131 bits: bool,
132}
133impl NAKMR {
134 #[doc = r" Value of the field as raw bits"]
135 #[inline]
136 pub fn bit(&self) -> bool {
137 self.bits
138 }
139 #[doc = r" Returns `true` if the bit is clear (0)"]
140 #[inline]
141 pub fn bit_is_clear(&self) -> bool {
142 !self.bit()
143 }
144 #[doc = r" Returns `true` if the bit is set (1)"]
145 #[inline]
146 pub fn bit_is_set(&self) -> bool {
147 self.bit()
148 }
149}
150#[doc = r" Value of the field"]
151pub struct ACKMR {
152 bits: bool,
153}
154impl ACKMR {
155 #[doc = r" Value of the field as raw bits"]
156 #[inline]
157 pub fn bit(&self) -> bool {
158 self.bits
159 }
160 #[doc = r" Returns `true` if the bit is clear (0)"]
161 #[inline]
162 pub fn bit_is_clear(&self) -> bool {
163 !self.bit()
164 }
165 #[doc = r" Returns `true` if the bit is set (1)"]
166 #[inline]
167 pub fn bit_is_set(&self) -> bool {
168 self.bit()
169 }
170}
171#[doc = r" Value of the field"]
172pub struct NYETR {
173 bits: bool,
174}
175impl NYETR {
176 #[doc = r" Value of the field as raw bits"]
177 #[inline]
178 pub fn bit(&self) -> bool {
179 self.bits
180 }
181 #[doc = r" Returns `true` if the bit is clear (0)"]
182 #[inline]
183 pub fn bit_is_clear(&self) -> bool {
184 !self.bit()
185 }
186 #[doc = r" Returns `true` if the bit is set (1)"]
187 #[inline]
188 pub fn bit_is_set(&self) -> bool {
189 self.bit()
190 }
191}
192#[doc = r" Value of the field"]
193pub struct TXERRMR {
194 bits: bool,
195}
196impl TXERRMR {
197 #[doc = r" Value of the field as raw bits"]
198 #[inline]
199 pub fn bit(&self) -> bool {
200 self.bits
201 }
202 #[doc = r" Returns `true` if the bit is clear (0)"]
203 #[inline]
204 pub fn bit_is_clear(&self) -> bool {
205 !self.bit()
206 }
207 #[doc = r" Returns `true` if the bit is set (1)"]
208 #[inline]
209 pub fn bit_is_set(&self) -> bool {
210 self.bit()
211 }
212}
213#[doc = r" Value of the field"]
214pub struct BBERRMR {
215 bits: bool,
216}
217impl BBERRMR {
218 #[doc = r" Value of the field as raw bits"]
219 #[inline]
220 pub fn bit(&self) -> bool {
221 self.bits
222 }
223 #[doc = r" Returns `true` if the bit is clear (0)"]
224 #[inline]
225 pub fn bit_is_clear(&self) -> bool {
226 !self.bit()
227 }
228 #[doc = r" Returns `true` if the bit is set (1)"]
229 #[inline]
230 pub fn bit_is_set(&self) -> bool {
231 self.bit()
232 }
233}
234#[doc = r" Value of the field"]
235pub struct FRMORMR {
236 bits: bool,
237}
238impl FRMORMR {
239 #[doc = r" Value of the field as raw bits"]
240 #[inline]
241 pub fn bit(&self) -> bool {
242 self.bits
243 }
244 #[doc = r" Returns `true` if the bit is clear (0)"]
245 #[inline]
246 pub fn bit_is_clear(&self) -> bool {
247 !self.bit()
248 }
249 #[doc = r" Returns `true` if the bit is set (1)"]
250 #[inline]
251 pub fn bit_is_set(&self) -> bool {
252 self.bit()
253 }
254}
255#[doc = r" Value of the field"]
256pub struct DTERRMR {
257 bits: bool,
258}
259impl DTERRMR {
260 #[doc = r" Value of the field as raw bits"]
261 #[inline]
262 pub fn bit(&self) -> bool {
263 self.bits
264 }
265 #[doc = r" Returns `true` if the bit is clear (0)"]
266 #[inline]
267 pub fn bit_is_clear(&self) -> bool {
268 !self.bit()
269 }
270 #[doc = r" Returns `true` if the bit is set (1)"]
271 #[inline]
272 pub fn bit_is_set(&self) -> bool {
273 self.bit()
274 }
275}
276#[doc = r" Proxy"]
277pub struct _XFRCMW<'a> {
278 w: &'a mut W,
279}
280impl<'a> _XFRCMW<'a> {
281 #[doc = r" Sets the field bit"]
282 pub fn set_bit(self) -> &'a mut W {
283 self.bit(true)
284 }
285 #[doc = r" Clears the field bit"]
286 pub fn clear_bit(self) -> &'a mut W {
287 self.bit(false)
288 }
289 #[doc = r" Writes raw bits to the field"]
290 #[inline]
291 pub fn bit(self, value: bool) -> &'a mut W {
292 const MASK: bool = true;
293 const OFFSET: u8 = 0;
294 self.w.bits &= !((MASK as u32) << OFFSET);
295 self.w.bits |= ((value & MASK) as u32) << OFFSET;
296 self.w
297 }
298}
299#[doc = r" Proxy"]
300pub struct _CHHMW<'a> {
301 w: &'a mut W,
302}
303impl<'a> _CHHMW<'a> {
304 #[doc = r" Sets the field bit"]
305 pub fn set_bit(self) -> &'a mut W {
306 self.bit(true)
307 }
308 #[doc = r" Clears the field bit"]
309 pub fn clear_bit(self) -> &'a mut W {
310 self.bit(false)
311 }
312 #[doc = r" Writes raw bits to the field"]
313 #[inline]
314 pub fn bit(self, value: bool) -> &'a mut W {
315 const MASK: bool = true;
316 const OFFSET: u8 = 1;
317 self.w.bits &= !((MASK as u32) << OFFSET);
318 self.w.bits |= ((value & MASK) as u32) << OFFSET;
319 self.w
320 }
321}
322#[doc = r" Proxy"]
323pub struct _AHBERRW<'a> {
324 w: &'a mut W,
325}
326impl<'a> _AHBERRW<'a> {
327 #[doc = r" Sets the field bit"]
328 pub fn set_bit(self) -> &'a mut W {
329 self.bit(true)
330 }
331 #[doc = r" Clears the field bit"]
332 pub fn clear_bit(self) -> &'a mut W {
333 self.bit(false)
334 }
335 #[doc = r" Writes raw bits to the field"]
336 #[inline]
337 pub fn bit(self, value: bool) -> &'a mut W {
338 const MASK: bool = true;
339 const OFFSET: u8 = 2;
340 self.w.bits &= !((MASK as u32) << OFFSET);
341 self.w.bits |= ((value & MASK) as u32) << OFFSET;
342 self.w
343 }
344}
345#[doc = r" Proxy"]
346pub struct _STALLMW<'a> {
347 w: &'a mut W,
348}
349impl<'a> _STALLMW<'a> {
350 #[doc = r" Sets the field bit"]
351 pub fn set_bit(self) -> &'a mut W {
352 self.bit(true)
353 }
354 #[doc = r" Clears the field bit"]
355 pub fn clear_bit(self) -> &'a mut W {
356 self.bit(false)
357 }
358 #[doc = r" Writes raw bits to the field"]
359 #[inline]
360 pub fn bit(self, value: bool) -> &'a mut W {
361 const MASK: bool = true;
362 const OFFSET: u8 = 3;
363 self.w.bits &= !((MASK as u32) << OFFSET);
364 self.w.bits |= ((value & MASK) as u32) << OFFSET;
365 self.w
366 }
367}
368#[doc = r" Proxy"]
369pub struct _NAKMW<'a> {
370 w: &'a mut W,
371}
372impl<'a> _NAKMW<'a> {
373 #[doc = r" Sets the field bit"]
374 pub fn set_bit(self) -> &'a mut W {
375 self.bit(true)
376 }
377 #[doc = r" Clears the field bit"]
378 pub fn clear_bit(self) -> &'a mut W {
379 self.bit(false)
380 }
381 #[doc = r" Writes raw bits to the field"]
382 #[inline]
383 pub fn bit(self, value: bool) -> &'a mut W {
384 const MASK: bool = true;
385 const OFFSET: u8 = 4;
386 self.w.bits &= !((MASK as u32) << OFFSET);
387 self.w.bits |= ((value & MASK) as u32) << OFFSET;
388 self.w
389 }
390}
391#[doc = r" Proxy"]
392pub struct _ACKMW<'a> {
393 w: &'a mut W,
394}
395impl<'a> _ACKMW<'a> {
396 #[doc = r" Sets the field bit"]
397 pub fn set_bit(self) -> &'a mut W {
398 self.bit(true)
399 }
400 #[doc = r" Clears the field bit"]
401 pub fn clear_bit(self) -> &'a mut W {
402 self.bit(false)
403 }
404 #[doc = r" Writes raw bits to the field"]
405 #[inline]
406 pub fn bit(self, value: bool) -> &'a mut W {
407 const MASK: bool = true;
408 const OFFSET: u8 = 5;
409 self.w.bits &= !((MASK as u32) << OFFSET);
410 self.w.bits |= ((value & MASK) as u32) << OFFSET;
411 self.w
412 }
413}
414#[doc = r" Proxy"]
415pub struct _NYETW<'a> {
416 w: &'a mut W,
417}
418impl<'a> _NYETW<'a> {
419 #[doc = r" Sets the field bit"]
420 pub fn set_bit(self) -> &'a mut W {
421 self.bit(true)
422 }
423 #[doc = r" Clears the field bit"]
424 pub fn clear_bit(self) -> &'a mut W {
425 self.bit(false)
426 }
427 #[doc = r" Writes raw bits to the field"]
428 #[inline]
429 pub fn bit(self, value: bool) -> &'a mut W {
430 const MASK: bool = true;
431 const OFFSET: u8 = 6;
432 self.w.bits &= !((MASK as u32) << OFFSET);
433 self.w.bits |= ((value & MASK) as u32) << OFFSET;
434 self.w
435 }
436}
437#[doc = r" Proxy"]
438pub struct _TXERRMW<'a> {
439 w: &'a mut W,
440}
441impl<'a> _TXERRMW<'a> {
442 #[doc = r" Sets the field bit"]
443 pub fn set_bit(self) -> &'a mut W {
444 self.bit(true)
445 }
446 #[doc = r" Clears the field bit"]
447 pub fn clear_bit(self) -> &'a mut W {
448 self.bit(false)
449 }
450 #[doc = r" Writes raw bits to the field"]
451 #[inline]
452 pub fn bit(self, value: bool) -> &'a mut W {
453 const MASK: bool = true;
454 const OFFSET: u8 = 7;
455 self.w.bits &= !((MASK as u32) << OFFSET);
456 self.w.bits |= ((value & MASK) as u32) << OFFSET;
457 self.w
458 }
459}
460#[doc = r" Proxy"]
461pub struct _BBERRMW<'a> {
462 w: &'a mut W,
463}
464impl<'a> _BBERRMW<'a> {
465 #[doc = r" Sets the field bit"]
466 pub fn set_bit(self) -> &'a mut W {
467 self.bit(true)
468 }
469 #[doc = r" Clears the field bit"]
470 pub fn clear_bit(self) -> &'a mut W {
471 self.bit(false)
472 }
473 #[doc = r" Writes raw bits to the field"]
474 #[inline]
475 pub fn bit(self, value: bool) -> &'a mut W {
476 const MASK: bool = true;
477 const OFFSET: u8 = 8;
478 self.w.bits &= !((MASK as u32) << OFFSET);
479 self.w.bits |= ((value & MASK) as u32) << OFFSET;
480 self.w
481 }
482}
483#[doc = r" Proxy"]
484pub struct _FRMORMW<'a> {
485 w: &'a mut W,
486}
487impl<'a> _FRMORMW<'a> {
488 #[doc = r" Sets the field bit"]
489 pub fn set_bit(self) -> &'a mut W {
490 self.bit(true)
491 }
492 #[doc = r" Clears the field bit"]
493 pub fn clear_bit(self) -> &'a mut W {
494 self.bit(false)
495 }
496 #[doc = r" Writes raw bits to the field"]
497 #[inline]
498 pub fn bit(self, value: bool) -> &'a mut W {
499 const MASK: bool = true;
500 const OFFSET: u8 = 9;
501 self.w.bits &= !((MASK as u32) << OFFSET);
502 self.w.bits |= ((value & MASK) as u32) << OFFSET;
503 self.w
504 }
505}
506#[doc = r" Proxy"]
507pub struct _DTERRMW<'a> {
508 w: &'a mut W,
509}
510impl<'a> _DTERRMW<'a> {
511 #[doc = r" Sets the field bit"]
512 pub fn set_bit(self) -> &'a mut W {
513 self.bit(true)
514 }
515 #[doc = r" Clears the field bit"]
516 pub fn clear_bit(self) -> &'a mut W {
517 self.bit(false)
518 }
519 #[doc = r" Writes raw bits to the field"]
520 #[inline]
521 pub fn bit(self, value: bool) -> &'a mut W {
522 const MASK: bool = true;
523 const OFFSET: u8 = 10;
524 self.w.bits &= !((MASK as u32) << OFFSET);
525 self.w.bits |= ((value & MASK) as u32) << OFFSET;
526 self.w
527 }
528}
529impl R {
530 #[doc = r" Value of the register as raw bits"]
531 #[inline]
532 pub fn bits(&self) -> u32 {
533 self.bits
534 }
535 #[doc = "Bit 0 - Transfer completed mask"]
536 #[inline]
537 pub fn xfrcm(&self) -> XFRCMR {
538 let bits = {
539 const MASK: bool = true;
540 const OFFSET: u8 = 0;
541 ((self.bits >> OFFSET) & MASK as u32) != 0
542 };
543 XFRCMR { bits }
544 }
545 #[doc = "Bit 1 - Channel halted mask"]
546 #[inline]
547 pub fn chhm(&self) -> CHHMR {
548 let bits = {
549 const MASK: bool = true;
550 const OFFSET: u8 = 1;
551 ((self.bits >> OFFSET) & MASK as u32) != 0
552 };
553 CHHMR { bits }
554 }
555 #[doc = "Bit 2 - AHB error"]
556 #[inline]
557 pub fn ahberr(&self) -> AHBERRR {
558 let bits = {
559 const MASK: bool = true;
560 const OFFSET: u8 = 2;
561 ((self.bits >> OFFSET) & MASK as u32) != 0
562 };
563 AHBERRR { bits }
564 }
565 #[doc = "Bit 3 - STALL response received interrupt mask"]
566 #[inline]
567 pub fn stallm(&self) -> STALLMR {
568 let bits = {
569 const MASK: bool = true;
570 const OFFSET: u8 = 3;
571 ((self.bits >> OFFSET) & MASK as u32) != 0
572 };
573 STALLMR { bits }
574 }
575 #[doc = "Bit 4 - NAK response received interrupt mask"]
576 #[inline]
577 pub fn nakm(&self) -> NAKMR {
578 let bits = {
579 const MASK: bool = true;
580 const OFFSET: u8 = 4;
581 ((self.bits >> OFFSET) & MASK as u32) != 0
582 };
583 NAKMR { bits }
584 }
585 #[doc = "Bit 5 - ACK response received/transmitted interrupt mask"]
586 #[inline]
587 pub fn ackm(&self) -> ACKMR {
588 let bits = {
589 const MASK: bool = true;
590 const OFFSET: u8 = 5;
591 ((self.bits >> OFFSET) & MASK as u32) != 0
592 };
593 ACKMR { bits }
594 }
595 #[doc = "Bit 6 - response received interrupt mask"]
596 #[inline]
597 pub fn nyet(&self) -> NYETR {
598 let bits = {
599 const MASK: bool = true;
600 const OFFSET: u8 = 6;
601 ((self.bits >> OFFSET) & MASK as u32) != 0
602 };
603 NYETR { bits }
604 }
605 #[doc = "Bit 7 - Transaction error mask"]
606 #[inline]
607 pub fn txerrm(&self) -> TXERRMR {
608 let bits = {
609 const MASK: bool = true;
610 const OFFSET: u8 = 7;
611 ((self.bits >> OFFSET) & MASK as u32) != 0
612 };
613 TXERRMR { bits }
614 }
615 #[doc = "Bit 8 - Babble error mask"]
616 #[inline]
617 pub fn bberrm(&self) -> BBERRMR {
618 let bits = {
619 const MASK: bool = true;
620 const OFFSET: u8 = 8;
621 ((self.bits >> OFFSET) & MASK as u32) != 0
622 };
623 BBERRMR { bits }
624 }
625 #[doc = "Bit 9 - Frame overrun mask"]
626 #[inline]
627 pub fn frmorm(&self) -> FRMORMR {
628 let bits = {
629 const MASK: bool = true;
630 const OFFSET: u8 = 9;
631 ((self.bits >> OFFSET) & MASK as u32) != 0
632 };
633 FRMORMR { bits }
634 }
635 #[doc = "Bit 10 - Data toggle error mask"]
636 #[inline]
637 pub fn dterrm(&self) -> DTERRMR {
638 let bits = {
639 const MASK: bool = true;
640 const OFFSET: u8 = 10;
641 ((self.bits >> OFFSET) & MASK as u32) != 0
642 };
643 DTERRMR { bits }
644 }
645}
646impl W {
647 #[doc = r" Reset value of the register"]
648 #[inline]
649 pub fn reset_value() -> W {
650 W { bits: 0 }
651 }
652 #[doc = r" Writes raw bits to the register"]
653 #[inline]
654 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
655 self.bits = bits;
656 self
657 }
658 #[doc = "Bit 0 - Transfer completed mask"]
659 #[inline]
660 pub fn xfrcm(&mut self) -> _XFRCMW {
661 _XFRCMW { w: self }
662 }
663 #[doc = "Bit 1 - Channel halted mask"]
664 #[inline]
665 pub fn chhm(&mut self) -> _CHHMW {
666 _CHHMW { w: self }
667 }
668 #[doc = "Bit 2 - AHB error"]
669 #[inline]
670 pub fn ahberr(&mut self) -> _AHBERRW {
671 _AHBERRW { w: self }
672 }
673 #[doc = "Bit 3 - STALL response received interrupt mask"]
674 #[inline]
675 pub fn stallm(&mut self) -> _STALLMW {
676 _STALLMW { w: self }
677 }
678 #[doc = "Bit 4 - NAK response received interrupt mask"]
679 #[inline]
680 pub fn nakm(&mut self) -> _NAKMW {
681 _NAKMW { w: self }
682 }
683 #[doc = "Bit 5 - ACK response received/transmitted interrupt mask"]
684 #[inline]
685 pub fn ackm(&mut self) -> _ACKMW {
686 _ACKMW { w: self }
687 }
688 #[doc = "Bit 6 - response received interrupt mask"]
689 #[inline]
690 pub fn nyet(&mut self) -> _NYETW {
691 _NYETW { w: self }
692 }
693 #[doc = "Bit 7 - Transaction error mask"]
694 #[inline]
695 pub fn txerrm(&mut self) -> _TXERRMW {
696 _TXERRMW { w: self }
697 }
698 #[doc = "Bit 8 - Babble error mask"]
699 #[inline]
700 pub fn bberrm(&mut self) -> _BBERRMW {
701 _BBERRMW { w: self }
702 }
703 #[doc = "Bit 9 - Frame overrun mask"]
704 #[inline]
705 pub fn frmorm(&mut self) -> _FRMORMW {
706 _FRMORMW { w: self }
707 }
708 #[doc = "Bit 10 - Data toggle error mask"]
709 #[inline]
710 pub fn dterrm(&mut self) -> _DTERRMW {
711 _DTERRMW { w: self }
712 }
713}