ra4m1 0.2.0

Peripheral access API for ra4m1 microcontrollers (generated using svd2rust)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
#[doc = "Register `INTSTS0` reader"]
pub struct R(crate::R<INTSTS0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<INTSTS0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<INTSTS0_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<INTSTS0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `INTSTS0` writer"]
pub struct W(crate::W<INTSTS0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<INTSTS0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<INTSTS0_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<INTSTS0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `CTSQ` reader - Control Transfer Stage"]
pub type CTSQ_R = crate::FieldReader<u8, CTSQ_A>;
#[doc = "Control Transfer Stage\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CTSQ_A {
    #[doc = "0: Idle or setup stage"]
    _000 = 0,
    #[doc = "1: Control read data stage"]
    _001 = 1,
    #[doc = "2: Control read status stage"]
    _010 = 2,
    #[doc = "3: Control write data stage"]
    _011 = 3,
    #[doc = "4: Control write status stage"]
    _100 = 4,
    #[doc = "5: Control write (no data) status stage"]
    _101 = 5,
    #[doc = "6: Control transfer sequence error"]
    _110 = 6,
}
impl From<CTSQ_A> for u8 {
    #[inline(always)]
    fn from(variant: CTSQ_A) -> Self {
        variant as _
    }
}
impl CTSQ_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CTSQ_A {
        match self.bits {
            0 => CTSQ_A::_000,
            1 => CTSQ_A::_001,
            2 => CTSQ_A::_010,
            3 => CTSQ_A::_011,
            4 => CTSQ_A::_100,
            5 => CTSQ_A::_101,
            6 => CTSQ_A::_110,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_000`"]
    #[inline(always)]
    pub fn is_000(&self) -> bool {
        *self == CTSQ_A::_000
    }
    #[doc = "Checks if the value of the field is `_001`"]
    #[inline(always)]
    pub fn is_001(&self) -> bool {
        *self == CTSQ_A::_001
    }
    #[doc = "Checks if the value of the field is `_010`"]
    #[inline(always)]
    pub fn is_010(&self) -> bool {
        *self == CTSQ_A::_010
    }
    #[doc = "Checks if the value of the field is `_011`"]
    #[inline(always)]
    pub fn is_011(&self) -> bool {
        *self == CTSQ_A::_011
    }
    #[doc = "Checks if the value of the field is `_100`"]
    #[inline(always)]
    pub fn is_100(&self) -> bool {
        *self == CTSQ_A::_100
    }
    #[doc = "Checks if the value of the field is `_101`"]
    #[inline(always)]
    pub fn is_101(&self) -> bool {
        *self == CTSQ_A::_101
    }
    #[doc = "Checks if the value of the field is `_110`"]
    #[inline(always)]
    pub fn is_110(&self) -> bool {
        *self == CTSQ_A::_110
    }
}
#[doc = "Field `VALID` reader - USB Request Reception"]
pub type VALID_R = crate::BitReader<VALID_A>;
#[doc = "USB Request Reception\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VALID_A {
    #[doc = "0: Setup packet is not received"]
    _0 = 0,
    #[doc = "1: Setup packet is received"]
    _1 = 1,
}
impl From<VALID_A> for bool {
    #[inline(always)]
    fn from(variant: VALID_A) -> Self {
        variant as u8 != 0
    }
}
impl VALID_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VALID_A {
        match self.bits {
            false => VALID_A::_0,
            true => VALID_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == VALID_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == VALID_A::_1
    }
}
#[doc = "Field `VALID` writer - USB Request Reception"]
pub type VALID_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTSTS0_SPEC, VALID_A, O>;
impl<'a, const O: u8> VALID_W<'a, O> {
    #[doc = "Setup packet is not received"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(VALID_A::_0)
    }
    #[doc = "Setup packet is received"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(VALID_A::_1)
    }
}
#[doc = "Field `DVSQ` reader - Device State"]
pub type DVSQ_R = crate::FieldReader<u8, DVSQ_A>;
#[doc = "Device State\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DVSQ_A {
    #[doc = "0: Powered state"]
    _000 = 0,
    #[doc = "1: Default state"]
    _001 = 1,
    #[doc = "2: Address state"]
    _010 = 2,
    #[doc = "3: Configured state"]
    _011 = 3,
}
impl From<DVSQ_A> for u8 {
    #[inline(always)]
    fn from(variant: DVSQ_A) -> Self {
        variant as _
    }
}
impl DVSQ_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<DVSQ_A> {
        match self.bits {
            0 => Some(DVSQ_A::_000),
            1 => Some(DVSQ_A::_001),
            2 => Some(DVSQ_A::_010),
            3 => Some(DVSQ_A::_011),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `_000`"]
    #[inline(always)]
    pub fn is_000(&self) -> bool {
        *self == DVSQ_A::_000
    }
    #[doc = "Checks if the value of the field is `_001`"]
    #[inline(always)]
    pub fn is_001(&self) -> bool {
        *self == DVSQ_A::_001
    }
    #[doc = "Checks if the value of the field is `_010`"]
    #[inline(always)]
    pub fn is_010(&self) -> bool {
        *self == DVSQ_A::_010
    }
    #[doc = "Checks if the value of the field is `_011`"]
    #[inline(always)]
    pub fn is_011(&self) -> bool {
        *self == DVSQ_A::_011
    }
}
#[doc = "Field `VBSTS` reader - VBUS Input Status"]
pub type VBSTS_R = crate::BitReader<VBSTS_A>;
#[doc = "VBUS Input Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VBSTS_A {
    #[doc = "0: USB_VBUS pin is low."]
    _0 = 0,
    #[doc = "1: USB_VBUS pin is high."]
    _1 = 1,
}
impl From<VBSTS_A> for bool {
    #[inline(always)]
    fn from(variant: VBSTS_A) -> Self {
        variant as u8 != 0
    }
}
impl VBSTS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VBSTS_A {
        match self.bits {
            false => VBSTS_A::_0,
            true => VBSTS_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == VBSTS_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == VBSTS_A::_1
    }
}
#[doc = "Field `BRDY` reader - Buffer Ready Interrupt Status"]
pub type BRDY_R = crate::BitReader<BRDY_A>;
#[doc = "Buffer Ready Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BRDY_A {
    #[doc = "0: BRDY interrupts are not generated."]
    _0 = 0,
    #[doc = "1: BRDY interrupts are generated."]
    _1 = 1,
}
impl From<BRDY_A> for bool {
    #[inline(always)]
    fn from(variant: BRDY_A) -> Self {
        variant as u8 != 0
    }
}
impl BRDY_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BRDY_A {
        match self.bits {
            false => BRDY_A::_0,
            true => BRDY_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == BRDY_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == BRDY_A::_1
    }
}
#[doc = "Field `NRDY` reader - Buffer Not Ready Interrupt Status"]
pub type NRDY_R = crate::BitReader<NRDY_A>;
#[doc = "Buffer Not Ready Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NRDY_A {
    #[doc = "0: NRDY interrupts are not generated."]
    _0 = 0,
    #[doc = "1: NRDY interrupts are generated."]
    _1 = 1,
}
impl From<NRDY_A> for bool {
    #[inline(always)]
    fn from(variant: NRDY_A) -> Self {
        variant as u8 != 0
    }
}
impl NRDY_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NRDY_A {
        match self.bits {
            false => NRDY_A::_0,
            true => NRDY_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == NRDY_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == NRDY_A::_1
    }
}
#[doc = "Field `BEMP` reader - Buffer Empty Interrupt Status"]
pub type BEMP_R = crate::BitReader<BEMP_A>;
#[doc = "Buffer Empty Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BEMP_A {
    #[doc = "0: BEMP interrupts are not generated."]
    _0 = 0,
    #[doc = "1: BEMP interrupts are generated."]
    _1 = 1,
}
impl From<BEMP_A> for bool {
    #[inline(always)]
    fn from(variant: BEMP_A) -> Self {
        variant as u8 != 0
    }
}
impl BEMP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BEMP_A {
        match self.bits {
            false => BEMP_A::_0,
            true => BEMP_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == BEMP_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == BEMP_A::_1
    }
}
#[doc = "Field `CTRT` reader - Control Transfer Stage Transition Interrupt Status\n\nThe field is **modified** in some way after a read operation."]
pub type CTRT_R = crate::BitReader<CTRT_A>;
#[doc = "Control Transfer Stage Transition Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTRT_A {
    #[doc = "0: Control transfer stage transition interrupts are not generated."]
    _0 = 0,
    #[doc = "1: Control transfer stage transition interrupts are generated."]
    _1 = 1,
}
impl From<CTRT_A> for bool {
    #[inline(always)]
    fn from(variant: CTRT_A) -> Self {
        variant as u8 != 0
    }
}
impl CTRT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CTRT_A {
        match self.bits {
            false => CTRT_A::_0,
            true => CTRT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == CTRT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == CTRT_A::_1
    }
}
#[doc = "Field `CTRT` writer - Control Transfer Stage Transition Interrupt Status"]
pub type CTRT_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, INTSTS0_SPEC, CTRT_A, O>;
impl<'a, const O: u8> CTRT_W<'a, O> {
    #[doc = "Control transfer stage transition interrupts are not generated."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(CTRT_A::_0)
    }
    #[doc = "Control transfer stage transition interrupts are generated."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(CTRT_A::_1)
    }
}
#[doc = "Field `DVST` reader - Device State Transition Interrupt Status\n\nThe field is **modified** in some way after a read operation."]
pub type DVST_R = crate::BitReader<DVST_A>;
#[doc = "Device State Transition Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DVST_A {
    #[doc = "0: Device state transition interrupts are not generated."]
    _0 = 0,
    #[doc = "1: Device state transition interrupts are generated."]
    _1 = 1,
}
impl From<DVST_A> for bool {
    #[inline(always)]
    fn from(variant: DVST_A) -> Self {
        variant as u8 != 0
    }
}
impl DVST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DVST_A {
        match self.bits {
            false => DVST_A::_0,
            true => DVST_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == DVST_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == DVST_A::_1
    }
}
#[doc = "Field `DVST` writer - Device State Transition Interrupt Status"]
pub type DVST_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, INTSTS0_SPEC, DVST_A, O>;
impl<'a, const O: u8> DVST_W<'a, O> {
    #[doc = "Device state transition interrupts are not generated."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(DVST_A::_0)
    }
    #[doc = "Device state transition interrupts are generated."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(DVST_A::_1)
    }
}
#[doc = "Field `SOFR` reader - Frame Number Refresh Interrupt Status\n\nThe field is **modified** in some way after a read operation."]
pub type SOFR_R = crate::BitReader<SOFR_A>;
#[doc = "Frame Number Refresh Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFR_A {
    #[doc = "0: SOF interrupts are not generated."]
    _0 = 0,
    #[doc = "1: SOF interrupts are generated."]
    _1 = 1,
}
impl From<SOFR_A> for bool {
    #[inline(always)]
    fn from(variant: SOFR_A) -> Self {
        variant as u8 != 0
    }
}
impl SOFR_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SOFR_A {
        match self.bits {
            false => SOFR_A::_0,
            true => SOFR_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == SOFR_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == SOFR_A::_1
    }
}
#[doc = "Field `SOFR` writer - Frame Number Refresh Interrupt Status"]
pub type SOFR_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, INTSTS0_SPEC, SOFR_A, O>;
impl<'a, const O: u8> SOFR_W<'a, O> {
    #[doc = "SOF interrupts are not generated."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(SOFR_A::_0)
    }
    #[doc = "SOF interrupts are generated."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(SOFR_A::_1)
    }
}
#[doc = "Field `RESM` reader - Resume Interrupt Status\n\nThe field is **modified** in some way after a read operation."]
pub type RESM_R = crate::BitReader<RESM_A>;
#[doc = "Resume Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESM_A {
    #[doc = "0: Resume interrupts are not generated."]
    _0 = 0,
    #[doc = "1: Resume interrupts are generated."]
    _1 = 1,
}
impl From<RESM_A> for bool {
    #[inline(always)]
    fn from(variant: RESM_A) -> Self {
        variant as u8 != 0
    }
}
impl RESM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RESM_A {
        match self.bits {
            false => RESM_A::_0,
            true => RESM_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == RESM_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == RESM_A::_1
    }
}
#[doc = "Field `RESM` writer - Resume Interrupt Status"]
pub type RESM_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, INTSTS0_SPEC, RESM_A, O>;
impl<'a, const O: u8> RESM_W<'a, O> {
    #[doc = "Resume interrupts are not generated."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(RESM_A::_0)
    }
    #[doc = "Resume interrupts are generated."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(RESM_A::_1)
    }
}
#[doc = "Field `VBINT` reader - VBUS Interrupt Status\n\nThe field is **modified** in some way after a read operation."]
pub type VBINT_R = crate::BitReader<VBINT_A>;
#[doc = "VBUS Interrupt Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VBINT_A {
    #[doc = "0: VBUS interrupts are not generated."]
    _0 = 0,
    #[doc = "1: VBUS interrupts are generated."]
    _1 = 1,
}
impl From<VBINT_A> for bool {
    #[inline(always)]
    fn from(variant: VBINT_A) -> Self {
        variant as u8 != 0
    }
}
impl VBINT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VBINT_A {
        match self.bits {
            false => VBINT_A::_0,
            true => VBINT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == VBINT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == VBINT_A::_1
    }
}
#[doc = "Field `VBINT` writer - VBUS Interrupt Status"]
pub type VBINT_W<'a, const O: u8> = crate::BitWriter0C<'a, u16, INTSTS0_SPEC, VBINT_A, O>;
impl<'a, const O: u8> VBINT_W<'a, O> {
    #[doc = "VBUS interrupts are not generated."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(VBINT_A::_0)
    }
    #[doc = "VBUS interrupts are generated."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(VBINT_A::_1)
    }
}
impl R {
    #[doc = "Bits 0:2 - Control Transfer Stage"]
    #[inline(always)]
    pub fn ctsq(&self) -> CTSQ_R {
        CTSQ_R::new((self.bits & 7) as u8)
    }
    #[doc = "Bit 3 - USB Request Reception"]
    #[inline(always)]
    pub fn valid(&self) -> VALID_R {
        VALID_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bits 4:6 - Device State"]
    #[inline(always)]
    pub fn dvsq(&self) -> DVSQ_R {
        DVSQ_R::new(((self.bits >> 4) & 7) as u8)
    }
    #[doc = "Bit 7 - VBUS Input Status"]
    #[inline(always)]
    pub fn vbsts(&self) -> VBSTS_R {
        VBSTS_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Buffer Ready Interrupt Status"]
    #[inline(always)]
    pub fn brdy(&self) -> BRDY_R {
        BRDY_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Buffer Not Ready Interrupt Status"]
    #[inline(always)]
    pub fn nrdy(&self) -> NRDY_R {
        NRDY_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Buffer Empty Interrupt Status"]
    #[inline(always)]
    pub fn bemp(&self) -> BEMP_R {
        BEMP_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Control Transfer Stage Transition Interrupt Status"]
    #[inline(always)]
    pub fn ctrt(&self) -> CTRT_R {
        CTRT_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Device State Transition Interrupt Status"]
    #[inline(always)]
    pub fn dvst(&self) -> DVST_R {
        DVST_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Frame Number Refresh Interrupt Status"]
    #[inline(always)]
    pub fn sofr(&self) -> SOFR_R {
        SOFR_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Resume Interrupt Status"]
    #[inline(always)]
    pub fn resm(&self) -> RESM_R {
        RESM_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - VBUS Interrupt Status"]
    #[inline(always)]
    pub fn vbint(&self) -> VBINT_R {
        VBINT_R::new(((self.bits >> 15) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 3 - USB Request Reception"]
    #[inline(always)]
    #[must_use]
    pub fn valid(&mut self) -> VALID_W<3> {
        VALID_W::new(self)
    }
    #[doc = "Bit 11 - Control Transfer Stage Transition Interrupt Status"]
    #[inline(always)]
    #[must_use]
    pub fn ctrt(&mut self) -> CTRT_W<11> {
        CTRT_W::new(self)
    }
    #[doc = "Bit 12 - Device State Transition Interrupt Status"]
    #[inline(always)]
    #[must_use]
    pub fn dvst(&mut self) -> DVST_W<12> {
        DVST_W::new(self)
    }
    #[doc = "Bit 13 - Frame Number Refresh Interrupt Status"]
    #[inline(always)]
    #[must_use]
    pub fn sofr(&mut self) -> SOFR_W<13> {
        SOFR_W::new(self)
    }
    #[doc = "Bit 14 - Resume Interrupt Status"]
    #[inline(always)]
    #[must_use]
    pub fn resm(&mut self) -> RESM_W<14> {
        RESM_W::new(self)
    }
    #[doc = "Bit 15 - VBUS Interrupt Status"]
    #[inline(always)]
    #[must_use]
    pub fn vbint(&mut self) -> VBINT_W<15> {
        VBINT_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Interrupt Status Register 0\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 [intsts0](index.html) module"]
pub struct INTSTS0_SPEC;
impl crate::RegisterSpec for INTSTS0_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [intsts0::R](R) reader structure"]
impl crate::Readable for INTSTS0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [intsts0::W](W) writer structure"]
impl crate::Writable for INTSTS0_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0xf800;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets INTSTS0 to value 0"]
impl crate::Resettable for INTSTS0_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}