1#[doc = "Register `INFO` reader"]
2pub struct R(crate::R<INFO_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<INFO_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<INFO_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<INFO_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `FRAME_NR` reader - Frame number."]
17pub struct FRAME_NR_R(crate::FieldReader<u16, u16>);
18impl FRAME_NR_R {
19 #[inline(always)]
20 pub(crate) fn new(bits: u16) -> Self {
21 FRAME_NR_R(crate::FieldReader::new(bits))
22 }
23}
24impl core::ops::Deref for FRAME_NR_R {
25 type Target = crate::FieldReader<u16, u16>;
26 #[inline(always)]
27 fn deref(&self) -> &Self::Target {
28 &self.0
29 }
30}
31#[doc = "Field `ERR_CODE` reader - The error code which last occurred:."]
32pub struct ERR_CODE_R(crate::FieldReader<u8, u8>);
33impl ERR_CODE_R {
34 #[inline(always)]
35 pub(crate) fn new(bits: u8) -> Self {
36 ERR_CODE_R(crate::FieldReader::new(bits))
37 }
38}
39impl core::ops::Deref for ERR_CODE_R {
40 type Target = crate::FieldReader<u8, u8>;
41 #[inline(always)]
42 fn deref(&self) -> &Self::Target {
43 &self.0
44 }
45}
46#[doc = "Field `MINREV` reader - Minor revision."]
47pub struct MINREV_R(crate::FieldReader<u8, u8>);
48impl MINREV_R {
49 #[inline(always)]
50 pub(crate) fn new(bits: u8) -> Self {
51 MINREV_R(crate::FieldReader::new(bits))
52 }
53}
54impl core::ops::Deref for MINREV_R {
55 type Target = crate::FieldReader<u8, u8>;
56 #[inline(always)]
57 fn deref(&self) -> &Self::Target {
58 &self.0
59 }
60}
61#[doc = "Field `MAJREV` reader - Major revision."]
62pub struct MAJREV_R(crate::FieldReader<u8, u8>);
63impl MAJREV_R {
64 #[inline(always)]
65 pub(crate) fn new(bits: u8) -> Self {
66 MAJREV_R(crate::FieldReader::new(bits))
67 }
68}
69impl core::ops::Deref for MAJREV_R {
70 type Target = crate::FieldReader<u8, u8>;
71 #[inline(always)]
72 fn deref(&self) -> &Self::Target {
73 &self.0
74 }
75}
76impl R {
77 #[doc = "Bits 0:10 - Frame number."]
78 #[inline(always)]
79 pub fn frame_nr(&self) -> FRAME_NR_R {
80 FRAME_NR_R::new((self.bits & 0x07ff) as u16)
81 }
82 #[doc = "Bits 11:14 - The error code which last occurred:."]
83 #[inline(always)]
84 pub fn err_code(&self) -> ERR_CODE_R {
85 ERR_CODE_R::new(((self.bits >> 11) & 0x0f) as u8)
86 }
87 #[doc = "Bits 16:23 - Minor revision."]
88 #[inline(always)]
89 pub fn minrev(&self) -> MINREV_R {
90 MINREV_R::new(((self.bits >> 16) & 0xff) as u8)
91 }
92 #[doc = "Bits 24:31 - Major revision."]
93 #[inline(always)]
94 pub fn majrev(&self) -> MAJREV_R {
95 MAJREV_R::new(((self.bits >> 24) & 0xff) as u8)
96 }
97}
98#[doc = "USB Info register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [info](index.html) module"]
99pub struct INFO_SPEC;
100impl crate::RegisterSpec for INFO_SPEC {
101 type Ux = u32;
102}
103#[doc = "`read()` method returns [info::R](R) reader structure"]
104impl crate::Readable for INFO_SPEC {
105 type Reader = R;
106}
107#[doc = "`reset()` method sets INFO to value 0x0200_0000"]
108impl crate::Resettable for INFO_SPEC {
109 #[inline(always)]
110 fn reset_value() -> Self::Ux {
111 0x0200_0000
112 }
113}