atsamd21g/usb/host/
intflag.rs
1#[doc = "Register `INTFLAG` reader"]
2pub type R = crate::R<IntflagSpec>;
3#[doc = "Register `INTFLAG` writer"]
4pub type W = crate::W<IntflagSpec>;
5#[doc = "Field `HSOF` reader - Host Start Of Frame"]
6pub type HsofR = crate::BitReader;
7#[doc = "Field `HSOF` writer - Host Start Of Frame"]
8pub type HsofW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `RST` reader - Bus Reset"]
10pub type RstR = crate::BitReader;
11#[doc = "Field `RST` writer - Bus Reset"]
12pub type RstW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WAKEUP` reader - Wake Up"]
14pub type WakeupR = crate::BitReader;
15#[doc = "Field `WAKEUP` writer - Wake Up"]
16pub type WakeupW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DNRSM` reader - Downstream"]
18pub type DnrsmR = crate::BitReader;
19#[doc = "Field `DNRSM` writer - Downstream"]
20pub type DnrsmW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `UPRSM` reader - Upstream Resume from the Device"]
22pub type UprsmR = crate::BitReader;
23#[doc = "Field `UPRSM` writer - Upstream Resume from the Device"]
24pub type UprsmW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `RAMACER` reader - Ram Access"]
26pub type RamacerR = crate::BitReader;
27#[doc = "Field `RAMACER` writer - Ram Access"]
28pub type RamacerW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `DCONN` reader - Device Connection"]
30pub type DconnR = crate::BitReader;
31#[doc = "Field `DCONN` writer - Device Connection"]
32pub type DconnW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `DDISC` reader - Device Disconnection"]
34pub type DdiscR = crate::BitReader;
35#[doc = "Field `DDISC` writer - Device Disconnection"]
36pub type DdiscW<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38 #[doc = "Bit 2 - Host Start Of Frame"]
39 #[inline(always)]
40 pub fn hsof(&self) -> HsofR {
41 HsofR::new(((self.bits >> 2) & 1) != 0)
42 }
43 #[doc = "Bit 3 - Bus Reset"]
44 #[inline(always)]
45 pub fn rst(&self) -> RstR {
46 RstR::new(((self.bits >> 3) & 1) != 0)
47 }
48 #[doc = "Bit 4 - Wake Up"]
49 #[inline(always)]
50 pub fn wakeup(&self) -> WakeupR {
51 WakeupR::new(((self.bits >> 4) & 1) != 0)
52 }
53 #[doc = "Bit 5 - Downstream"]
54 #[inline(always)]
55 pub fn dnrsm(&self) -> DnrsmR {
56 DnrsmR::new(((self.bits >> 5) & 1) != 0)
57 }
58 #[doc = "Bit 6 - Upstream Resume from the Device"]
59 #[inline(always)]
60 pub fn uprsm(&self) -> UprsmR {
61 UprsmR::new(((self.bits >> 6) & 1) != 0)
62 }
63 #[doc = "Bit 7 - Ram Access"]
64 #[inline(always)]
65 pub fn ramacer(&self) -> RamacerR {
66 RamacerR::new(((self.bits >> 7) & 1) != 0)
67 }
68 #[doc = "Bit 8 - Device Connection"]
69 #[inline(always)]
70 pub fn dconn(&self) -> DconnR {
71 DconnR::new(((self.bits >> 8) & 1) != 0)
72 }
73 #[doc = "Bit 9 - Device Disconnection"]
74 #[inline(always)]
75 pub fn ddisc(&self) -> DdiscR {
76 DdiscR::new(((self.bits >> 9) & 1) != 0)
77 }
78}
79impl W {
80 #[doc = "Bit 2 - Host Start Of Frame"]
81 #[inline(always)]
82 #[must_use]
83 pub fn hsof(&mut self) -> HsofW<IntflagSpec> {
84 HsofW::new(self, 2)
85 }
86 #[doc = "Bit 3 - Bus Reset"]
87 #[inline(always)]
88 #[must_use]
89 pub fn rst(&mut self) -> RstW<IntflagSpec> {
90 RstW::new(self, 3)
91 }
92 #[doc = "Bit 4 - Wake Up"]
93 #[inline(always)]
94 #[must_use]
95 pub fn wakeup(&mut self) -> WakeupW<IntflagSpec> {
96 WakeupW::new(self, 4)
97 }
98 #[doc = "Bit 5 - Downstream"]
99 #[inline(always)]
100 #[must_use]
101 pub fn dnrsm(&mut self) -> DnrsmW<IntflagSpec> {
102 DnrsmW::new(self, 5)
103 }
104 #[doc = "Bit 6 - Upstream Resume from the Device"]
105 #[inline(always)]
106 #[must_use]
107 pub fn uprsm(&mut self) -> UprsmW<IntflagSpec> {
108 UprsmW::new(self, 6)
109 }
110 #[doc = "Bit 7 - Ram Access"]
111 #[inline(always)]
112 #[must_use]
113 pub fn ramacer(&mut self) -> RamacerW<IntflagSpec> {
114 RamacerW::new(self, 7)
115 }
116 #[doc = "Bit 8 - Device Connection"]
117 #[inline(always)]
118 #[must_use]
119 pub fn dconn(&mut self) -> DconnW<IntflagSpec> {
120 DconnW::new(self, 8)
121 }
122 #[doc = "Bit 9 - Device Disconnection"]
123 #[inline(always)]
124 #[must_use]
125 pub fn ddisc(&mut self) -> DdiscW<IntflagSpec> {
126 DdiscW::new(self, 9)
127 }
128}
129#[doc = "HOST Host Interrupt Flag\n\nYou can [`read`](crate::Reg::read) this register and get [`intflag::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intflag::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
130pub struct IntflagSpec;
131impl crate::RegisterSpec for IntflagSpec {
132 type Ux = u16;
133}
134#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
135impl crate::Readable for IntflagSpec {}
136#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
137impl crate::Writable for IntflagSpec {
138 type Safety = crate::Unsafe;
139 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
140 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
141}
142#[doc = "`reset()` method sets INTFLAG to value 0"]
143impl crate::Resettable for IntflagSpec {
144 const RESET_VALUE: u16 = 0;
145}