1#[doc = "Register `DPUSR1R` reader"]
2pub struct R(crate::R<DPUSR1R_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DPUSR1R_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DPUSR1R_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DPUSR1R_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `DPUSR1R` writer"]
17pub struct W(crate::W<DPUSR1R_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DPUSR1R_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<DPUSR1R_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DPUSR1R_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `DPINTE0` reader - USB DP Interrupt Enable/Clear"]
38pub type DPINTE0_R = crate::BitReader<DPINTE0_A>;
39#[doc = "USB DP Interrupt Enable/Clear\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum DPINTE0_A {
42 #[doc = "0: Disable recovery from Deep Software Standby mode by DP input"]
43 _0 = 0,
44 #[doc = "1: Enable recovery from Deep Software Standby mode by DP input"]
45 _1 = 1,
46}
47impl From<DPINTE0_A> for bool {
48 #[inline(always)]
49 fn from(variant: DPINTE0_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl DPINTE0_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> DPINTE0_A {
57 match self.bits {
58 false => DPINTE0_A::_0,
59 true => DPINTE0_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == DPINTE0_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == DPINTE0_A::_1
71 }
72}
73#[doc = "Field `DPINTE0` writer - USB DP Interrupt Enable/Clear"]
74pub type DPINTE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, DPUSR1R_SPEC, DPINTE0_A, O>;
75impl<'a, const O: u8> DPINTE0_W<'a, O> {
76 #[doc = "Disable recovery from Deep Software Standby mode by DP input"]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(DPINTE0_A::_0)
80 }
81 #[doc = "Enable recovery from Deep Software Standby mode by DP input"]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(DPINTE0_A::_1)
85 }
86}
87#[doc = "Field `DMINTE0` reader - USB DM Interrupt Enable/Clear"]
88pub type DMINTE0_R = crate::BitReader<DMINTE0_A>;
89#[doc = "USB DM Interrupt Enable/Clear\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum DMINTE0_A {
92 #[doc = "0: Disable recovery from Deep Software Standby mode by DM input"]
93 _0 = 0,
94 #[doc = "1: Enable recovery from Deep Software Standby mode by DM input"]
95 _1 = 1,
96}
97impl From<DMINTE0_A> for bool {
98 #[inline(always)]
99 fn from(variant: DMINTE0_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl DMINTE0_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> DMINTE0_A {
107 match self.bits {
108 false => DMINTE0_A::_0,
109 true => DMINTE0_A::_1,
110 }
111 }
112 #[doc = "Checks if the value of the field is `_0`"]
113 #[inline(always)]
114 pub fn is_0(&self) -> bool {
115 *self == DMINTE0_A::_0
116 }
117 #[doc = "Checks if the value of the field is `_1`"]
118 #[inline(always)]
119 pub fn is_1(&self) -> bool {
120 *self == DMINTE0_A::_1
121 }
122}
123#[doc = "Field `DMINTE0` writer - USB DM Interrupt Enable/Clear"]
124pub type DMINTE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, DPUSR1R_SPEC, DMINTE0_A, O>;
125impl<'a, const O: u8> DMINTE0_W<'a, O> {
126 #[doc = "Disable recovery from Deep Software Standby mode by DM input"]
127 #[inline(always)]
128 pub fn _0(self) -> &'a mut W {
129 self.variant(DMINTE0_A::_0)
130 }
131 #[doc = "Enable recovery from Deep Software Standby mode by DM input"]
132 #[inline(always)]
133 pub fn _1(self) -> &'a mut W {
134 self.variant(DMINTE0_A::_1)
135 }
136}
137#[doc = "Field `DOVRCRAE0` reader - USB OVRCURA Interrupt Enable/Clear"]
138pub type DOVRCRAE0_R = crate::BitReader<DOVRCRAE0_A>;
139#[doc = "USB OVRCURA Interrupt Enable/Clear\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum DOVRCRAE0_A {
142 #[doc = "0: Disable recovery from Deep Software Standby mode by OVRCURA input"]
143 _0 = 0,
144 #[doc = "1: Enable recovery from Deep Software Standby mode by OVRCURA input"]
145 _1 = 1,
146}
147impl From<DOVRCRAE0_A> for bool {
148 #[inline(always)]
149 fn from(variant: DOVRCRAE0_A) -> Self {
150 variant as u8 != 0
151 }
152}
153impl DOVRCRAE0_R {
154 #[doc = "Get enumerated values variant"]
155 #[inline(always)]
156 pub fn variant(&self) -> DOVRCRAE0_A {
157 match self.bits {
158 false => DOVRCRAE0_A::_0,
159 true => DOVRCRAE0_A::_1,
160 }
161 }
162 #[doc = "Checks if the value of the field is `_0`"]
163 #[inline(always)]
164 pub fn is_0(&self) -> bool {
165 *self == DOVRCRAE0_A::_0
166 }
167 #[doc = "Checks if the value of the field is `_1`"]
168 #[inline(always)]
169 pub fn is_1(&self) -> bool {
170 *self == DOVRCRAE0_A::_1
171 }
172}
173#[doc = "Field `DOVRCRAE0` writer - USB OVRCURA Interrupt Enable/Clear"]
174pub type DOVRCRAE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, DPUSR1R_SPEC, DOVRCRAE0_A, O>;
175impl<'a, const O: u8> DOVRCRAE0_W<'a, O> {
176 #[doc = "Disable recovery from Deep Software Standby mode by OVRCURA input"]
177 #[inline(always)]
178 pub fn _0(self) -> &'a mut W {
179 self.variant(DOVRCRAE0_A::_0)
180 }
181 #[doc = "Enable recovery from Deep Software Standby mode by OVRCURA input"]
182 #[inline(always)]
183 pub fn _1(self) -> &'a mut W {
184 self.variant(DOVRCRAE0_A::_1)
185 }
186}
187#[doc = "Field `DVBSE0` reader - USB VBUS Interrupt Enable/Clear"]
188pub type DVBSE0_R = crate::BitReader<DVBSE0_A>;
189#[doc = "USB VBUS Interrupt Enable/Clear\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq, Eq)]
191pub enum DVBSE0_A {
192 #[doc = "0: Disable recovery from Deep Software Standby mode by VBUS input"]
193 _0 = 0,
194 #[doc = "1: Enable recovery from Deep Software Standby mode by VBUS input"]
195 _1 = 1,
196}
197impl From<DVBSE0_A> for bool {
198 #[inline(always)]
199 fn from(variant: DVBSE0_A) -> Self {
200 variant as u8 != 0
201 }
202}
203impl DVBSE0_R {
204 #[doc = "Get enumerated values variant"]
205 #[inline(always)]
206 pub fn variant(&self) -> DVBSE0_A {
207 match self.bits {
208 false => DVBSE0_A::_0,
209 true => DVBSE0_A::_1,
210 }
211 }
212 #[doc = "Checks if the value of the field is `_0`"]
213 #[inline(always)]
214 pub fn is_0(&self) -> bool {
215 *self == DVBSE0_A::_0
216 }
217 #[doc = "Checks if the value of the field is `_1`"]
218 #[inline(always)]
219 pub fn is_1(&self) -> bool {
220 *self == DVBSE0_A::_1
221 }
222}
223#[doc = "Field `DVBSE0` writer - USB VBUS Interrupt Enable/Clear"]
224pub type DVBSE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, DPUSR1R_SPEC, DVBSE0_A, O>;
225impl<'a, const O: u8> DVBSE0_W<'a, O> {
226 #[doc = "Disable recovery from Deep Software Standby mode by VBUS input"]
227 #[inline(always)]
228 pub fn _0(self) -> &'a mut W {
229 self.variant(DVBSE0_A::_0)
230 }
231 #[doc = "Enable recovery from Deep Software Standby mode by VBUS input"]
232 #[inline(always)]
233 pub fn _1(self) -> &'a mut W {
234 self.variant(DVBSE0_A::_1)
235 }
236}
237#[doc = "Field `DPINT0` reader - USB DP Interrupt Source Recovery"]
238pub type DPINT0_R = crate::BitReader<DPINT0_A>;
239#[doc = "USB DP Interrupt Source Recovery\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
241pub enum DPINT0_A {
242 #[doc = "0: System has not recovered from Deep Software Standby mode"]
243 _0 = 0,
244 #[doc = "1: System recovered from Deep Software Standby mode because of DP"]
245 _1 = 1,
246}
247impl From<DPINT0_A> for bool {
248 #[inline(always)]
249 fn from(variant: DPINT0_A) -> Self {
250 variant as u8 != 0
251 }
252}
253impl DPINT0_R {
254 #[doc = "Get enumerated values variant"]
255 #[inline(always)]
256 pub fn variant(&self) -> DPINT0_A {
257 match self.bits {
258 false => DPINT0_A::_0,
259 true => DPINT0_A::_1,
260 }
261 }
262 #[doc = "Checks if the value of the field is `_0`"]
263 #[inline(always)]
264 pub fn is_0(&self) -> bool {
265 *self == DPINT0_A::_0
266 }
267 #[doc = "Checks if the value of the field is `_1`"]
268 #[inline(always)]
269 pub fn is_1(&self) -> bool {
270 *self == DPINT0_A::_1
271 }
272}
273#[doc = "Field `DMINT0` reader - USB DM Interrupt Source Recovery"]
274pub type DMINT0_R = crate::BitReader<DMINT0_A>;
275#[doc = "USB DM Interrupt Source Recovery\n\nValue on reset: 0"]
276#[derive(Clone, Copy, Debug, PartialEq, Eq)]
277pub enum DMINT0_A {
278 #[doc = "0: System has not recovered from Deep Software Standby mode"]
279 _0 = 0,
280 #[doc = "1: System recovered from Deep Software Standby mode because of DM input"]
281 _1 = 1,
282}
283impl From<DMINT0_A> for bool {
284 #[inline(always)]
285 fn from(variant: DMINT0_A) -> Self {
286 variant as u8 != 0
287 }
288}
289impl DMINT0_R {
290 #[doc = "Get enumerated values variant"]
291 #[inline(always)]
292 pub fn variant(&self) -> DMINT0_A {
293 match self.bits {
294 false => DMINT0_A::_0,
295 true => DMINT0_A::_1,
296 }
297 }
298 #[doc = "Checks if the value of the field is `_0`"]
299 #[inline(always)]
300 pub fn is_0(&self) -> bool {
301 *self == DMINT0_A::_0
302 }
303 #[doc = "Checks if the value of the field is `_1`"]
304 #[inline(always)]
305 pub fn is_1(&self) -> bool {
306 *self == DMINT0_A::_1
307 }
308}
309#[doc = "Field `DOVRCRA0` reader - USB OVRCURA Interrupt Source Recovery"]
310pub type DOVRCRA0_R = crate::BitReader<DOVRCRA0_A>;
311#[doc = "USB OVRCURA Interrupt Source Recovery\n\nValue on reset: 0"]
312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
313pub enum DOVRCRA0_A {
314 #[doc = "0: System has not recovered from Deep Software Standby mode"]
315 _0 = 0,
316 #[doc = "1: System recovered from Deep Software Standby mode because of OVRCURA input"]
317 _1 = 1,
318}
319impl From<DOVRCRA0_A> for bool {
320 #[inline(always)]
321 fn from(variant: DOVRCRA0_A) -> Self {
322 variant as u8 != 0
323 }
324}
325impl DOVRCRA0_R {
326 #[doc = "Get enumerated values variant"]
327 #[inline(always)]
328 pub fn variant(&self) -> DOVRCRA0_A {
329 match self.bits {
330 false => DOVRCRA0_A::_0,
331 true => DOVRCRA0_A::_1,
332 }
333 }
334 #[doc = "Checks if the value of the field is `_0`"]
335 #[inline(always)]
336 pub fn is_0(&self) -> bool {
337 *self == DOVRCRA0_A::_0
338 }
339 #[doc = "Checks if the value of the field is `_1`"]
340 #[inline(always)]
341 pub fn is_1(&self) -> bool {
342 *self == DOVRCRA0_A::_1
343 }
344}
345#[doc = "Field `DVBINT0` reader - USB VBUS Interrupt Source Recovery"]
346pub type DVBINT0_R = crate::BitReader<DVBINT0_A>;
347#[doc = "USB VBUS Interrupt Source Recovery\n\nValue on reset: 0"]
348#[derive(Clone, Copy, Debug, PartialEq, Eq)]
349pub enum DVBINT0_A {
350 #[doc = "0: System has not recovered from Deep Software Standby mode"]
351 _0 = 0,
352 #[doc = "1: System recovered from Deep Software Standby mode because of VBUS input"]
353 _1 = 1,
354}
355impl From<DVBINT0_A> for bool {
356 #[inline(always)]
357 fn from(variant: DVBINT0_A) -> Self {
358 variant as u8 != 0
359 }
360}
361impl DVBINT0_R {
362 #[doc = "Get enumerated values variant"]
363 #[inline(always)]
364 pub fn variant(&self) -> DVBINT0_A {
365 match self.bits {
366 false => DVBINT0_A::_0,
367 true => DVBINT0_A::_1,
368 }
369 }
370 #[doc = "Checks if the value of the field is `_0`"]
371 #[inline(always)]
372 pub fn is_0(&self) -> bool {
373 *self == DVBINT0_A::_0
374 }
375 #[doc = "Checks if the value of the field is `_1`"]
376 #[inline(always)]
377 pub fn is_1(&self) -> bool {
378 *self == DVBINT0_A::_1
379 }
380}
381impl R {
382 #[doc = "Bit 0 - USB DP Interrupt Enable/Clear"]
383 #[inline(always)]
384 pub fn dpinte0(&self) -> DPINTE0_R {
385 DPINTE0_R::new((self.bits & 1) != 0)
386 }
387 #[doc = "Bit 1 - USB DM Interrupt Enable/Clear"]
388 #[inline(always)]
389 pub fn dminte0(&self) -> DMINTE0_R {
390 DMINTE0_R::new(((self.bits >> 1) & 1) != 0)
391 }
392 #[doc = "Bit 4 - USB OVRCURA Interrupt Enable/Clear"]
393 #[inline(always)]
394 pub fn dovrcrae0(&self) -> DOVRCRAE0_R {
395 DOVRCRAE0_R::new(((self.bits >> 4) & 1) != 0)
396 }
397 #[doc = "Bit 7 - USB VBUS Interrupt Enable/Clear"]
398 #[inline(always)]
399 pub fn dvbse0(&self) -> DVBSE0_R {
400 DVBSE0_R::new(((self.bits >> 7) & 1) != 0)
401 }
402 #[doc = "Bit 16 - USB DP Interrupt Source Recovery"]
403 #[inline(always)]
404 pub fn dpint0(&self) -> DPINT0_R {
405 DPINT0_R::new(((self.bits >> 16) & 1) != 0)
406 }
407 #[doc = "Bit 17 - USB DM Interrupt Source Recovery"]
408 #[inline(always)]
409 pub fn dmint0(&self) -> DMINT0_R {
410 DMINT0_R::new(((self.bits >> 17) & 1) != 0)
411 }
412 #[doc = "Bit 20 - USB OVRCURA Interrupt Source Recovery"]
413 #[inline(always)]
414 pub fn dovrcra0(&self) -> DOVRCRA0_R {
415 DOVRCRA0_R::new(((self.bits >> 20) & 1) != 0)
416 }
417 #[doc = "Bit 23 - USB VBUS Interrupt Source Recovery"]
418 #[inline(always)]
419 pub fn dvbint0(&self) -> DVBINT0_R {
420 DVBINT0_R::new(((self.bits >> 23) & 1) != 0)
421 }
422}
423impl W {
424 #[doc = "Bit 0 - USB DP Interrupt Enable/Clear"]
425 #[inline(always)]
426 #[must_use]
427 pub fn dpinte0(&mut self) -> DPINTE0_W<0> {
428 DPINTE0_W::new(self)
429 }
430 #[doc = "Bit 1 - USB DM Interrupt Enable/Clear"]
431 #[inline(always)]
432 #[must_use]
433 pub fn dminte0(&mut self) -> DMINTE0_W<1> {
434 DMINTE0_W::new(self)
435 }
436 #[doc = "Bit 4 - USB OVRCURA Interrupt Enable/Clear"]
437 #[inline(always)]
438 #[must_use]
439 pub fn dovrcrae0(&mut self) -> DOVRCRAE0_W<4> {
440 DOVRCRAE0_W::new(self)
441 }
442 #[doc = "Bit 7 - USB VBUS Interrupt Enable/Clear"]
443 #[inline(always)]
444 #[must_use]
445 pub fn dvbse0(&mut self) -> DVBSE0_W<7> {
446 DVBSE0_W::new(self)
447 }
448 #[doc = "Writes raw bits to the register."]
449 #[inline(always)]
450 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
451 self.0.bits(bits);
452 self
453 }
454}
455#[doc = "Deep Software Standby USB Suspend/Resume Interrupt Register\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 [dpusr1r](index.html) module"]
456pub struct DPUSR1R_SPEC;
457impl crate::RegisterSpec for DPUSR1R_SPEC {
458 type Ux = u32;
459}
460#[doc = "`read()` method returns [dpusr1r::R](R) reader structure"]
461impl crate::Readable for DPUSR1R_SPEC {
462 type Reader = R;
463}
464#[doc = "`write(|w| ..)` method takes [dpusr1r::W](W) writer structure"]
465impl crate::Writable for DPUSR1R_SPEC {
466 type Writer = W;
467 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
468 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
469}
470#[doc = "`reset()` method sets DPUSR1R to value 0"]
471impl crate::Resettable for DPUSR1R_SPEC {
472 const RESET_VALUE: Self::Ux = 0;
473}