atsamd51j/usb/device/
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 `SUSPEND` reader - Suspend"]
6pub type SuspendR = crate::BitReader;
7#[doc = "Field `SUSPEND` writer - Suspend"]
8pub type SuspendW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SOF` reader - Start Of Frame"]
10pub type SofR = crate::BitReader;
11#[doc = "Field `SOF` writer - Start Of Frame"]
12pub type SofW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `EORST` reader - End of Reset"]
14pub type EorstR = crate::BitReader;
15#[doc = "Field `EORST` writer - End of Reset"]
16pub type EorstW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `WAKEUP` reader - Wake Up"]
18pub type WakeupR = crate::BitReader;
19#[doc = "Field `WAKEUP` writer - Wake Up"]
20pub type WakeupW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `EORSM` reader - End Of Resume"]
22pub type EorsmR = crate::BitReader;
23#[doc = "Field `EORSM` writer - End Of Resume"]
24pub type EorsmW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `UPRSM` reader - Upstream Resume"]
26pub type UprsmR = crate::BitReader;
27#[doc = "Field `UPRSM` writer - Upstream Resume"]
28pub type UprsmW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `RAMACER` reader - Ram Access"]
30pub type RamacerR = crate::BitReader;
31#[doc = "Field `RAMACER` writer - Ram Access"]
32pub type RamacerW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `LPMNYET` reader - Link Power Management Not Yet"]
34pub type LpmnyetR = crate::BitReader;
35#[doc = "Field `LPMNYET` writer - Link Power Management Not Yet"]
36pub type LpmnyetW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `LPMSUSP` reader - Link Power Management Suspend"]
38pub type LpmsuspR = crate::BitReader;
39#[doc = "Field `LPMSUSP` writer - Link Power Management Suspend"]
40pub type LpmsuspW<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42 #[doc = "Bit 0 - Suspend"]
43 #[inline(always)]
44 pub fn suspend(&self) -> SuspendR {
45 SuspendR::new((self.bits & 1) != 0)
46 }
47 #[doc = "Bit 2 - Start Of Frame"]
48 #[inline(always)]
49 pub fn sof(&self) -> SofR {
50 SofR::new(((self.bits >> 2) & 1) != 0)
51 }
52 #[doc = "Bit 3 - End of Reset"]
53 #[inline(always)]
54 pub fn eorst(&self) -> EorstR {
55 EorstR::new(((self.bits >> 3) & 1) != 0)
56 }
57 #[doc = "Bit 4 - Wake Up"]
58 #[inline(always)]
59 pub fn wakeup(&self) -> WakeupR {
60 WakeupR::new(((self.bits >> 4) & 1) != 0)
61 }
62 #[doc = "Bit 5 - End Of Resume"]
63 #[inline(always)]
64 pub fn eorsm(&self) -> EorsmR {
65 EorsmR::new(((self.bits >> 5) & 1) != 0)
66 }
67 #[doc = "Bit 6 - Upstream Resume"]
68 #[inline(always)]
69 pub fn uprsm(&self) -> UprsmR {
70 UprsmR::new(((self.bits >> 6) & 1) != 0)
71 }
72 #[doc = "Bit 7 - Ram Access"]
73 #[inline(always)]
74 pub fn ramacer(&self) -> RamacerR {
75 RamacerR::new(((self.bits >> 7) & 1) != 0)
76 }
77 #[doc = "Bit 8 - Link Power Management Not Yet"]
78 #[inline(always)]
79 pub fn lpmnyet(&self) -> LpmnyetR {
80 LpmnyetR::new(((self.bits >> 8) & 1) != 0)
81 }
82 #[doc = "Bit 9 - Link Power Management Suspend"]
83 #[inline(always)]
84 pub fn lpmsusp(&self) -> LpmsuspR {
85 LpmsuspR::new(((self.bits >> 9) & 1) != 0)
86 }
87}
88impl W {
89 #[doc = "Bit 0 - Suspend"]
90 #[inline(always)]
91 #[must_use]
92 pub fn suspend(&mut self) -> SuspendW<IntflagSpec> {
93 SuspendW::new(self, 0)
94 }
95 #[doc = "Bit 2 - Start Of Frame"]
96 #[inline(always)]
97 #[must_use]
98 pub fn sof(&mut self) -> SofW<IntflagSpec> {
99 SofW::new(self, 2)
100 }
101 #[doc = "Bit 3 - End of Reset"]
102 #[inline(always)]
103 #[must_use]
104 pub fn eorst(&mut self) -> EorstW<IntflagSpec> {
105 EorstW::new(self, 3)
106 }
107 #[doc = "Bit 4 - Wake Up"]
108 #[inline(always)]
109 #[must_use]
110 pub fn wakeup(&mut self) -> WakeupW<IntflagSpec> {
111 WakeupW::new(self, 4)
112 }
113 #[doc = "Bit 5 - End Of Resume"]
114 #[inline(always)]
115 #[must_use]
116 pub fn eorsm(&mut self) -> EorsmW<IntflagSpec> {
117 EorsmW::new(self, 5)
118 }
119 #[doc = "Bit 6 - Upstream Resume"]
120 #[inline(always)]
121 #[must_use]
122 pub fn uprsm(&mut self) -> UprsmW<IntflagSpec> {
123 UprsmW::new(self, 6)
124 }
125 #[doc = "Bit 7 - Ram Access"]
126 #[inline(always)]
127 #[must_use]
128 pub fn ramacer(&mut self) -> RamacerW<IntflagSpec> {
129 RamacerW::new(self, 7)
130 }
131 #[doc = "Bit 8 - Link Power Management Not Yet"]
132 #[inline(always)]
133 #[must_use]
134 pub fn lpmnyet(&mut self) -> LpmnyetW<IntflagSpec> {
135 LpmnyetW::new(self, 8)
136 }
137 #[doc = "Bit 9 - Link Power Management Suspend"]
138 #[inline(always)]
139 #[must_use]
140 pub fn lpmsusp(&mut self) -> LpmsuspW<IntflagSpec> {
141 LpmsuspW::new(self, 9)
142 }
143}
144#[doc = "DEVICE Device 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)."]
145pub struct IntflagSpec;
146impl crate::RegisterSpec for IntflagSpec {
147 type Ux = u16;
148}
149#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
150impl crate::Readable for IntflagSpec {}
151#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
152impl crate::Writable for IntflagSpec {
153 type Safety = crate::Unsafe;
154 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
155 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
156}
157#[doc = "`reset()` method sets INTFLAG to value 0"]
158impl crate::Resettable for IntflagSpec {
159 const RESET_VALUE: u16 = 0;
160}