1#[doc = "Register `SYSSTS0` reader"]
2pub struct R(crate::R<SYSSTS0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SYSSTS0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SYSSTS0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SYSSTS0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `LNST` reader - USB Data Line Status Monitor"]
17pub type LNST_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `IDMON` reader - External ID0 Input Pin Monitor"]
19pub type IDMON_R = crate::BitReader<IDMON_A>;
20#[doc = "External ID0 Input Pin Monitor\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum IDMON_A {
23 #[doc = "0: USB_ID pin is low"]
24 _0 = 0,
25 #[doc = "1: USB_ID pin is high"]
26 _1 = 1,
27}
28impl From<IDMON_A> for bool {
29 #[inline(always)]
30 fn from(variant: IDMON_A) -> Self {
31 variant as u8 != 0
32 }
33}
34impl IDMON_R {
35 #[doc = "Get enumerated values variant"]
36 #[inline(always)]
37 pub fn variant(&self) -> IDMON_A {
38 match self.bits {
39 false => IDMON_A::_0,
40 true => IDMON_A::_1,
41 }
42 }
43 #[doc = "Checks if the value of the field is `_0`"]
44 #[inline(always)]
45 pub fn is_0(&self) -> bool {
46 *self == IDMON_A::_0
47 }
48 #[doc = "Checks if the value of the field is `_1`"]
49 #[inline(always)]
50 pub fn is_1(&self) -> bool {
51 *self == IDMON_A::_1
52 }
53}
54#[doc = "Field `SOFEA` reader - Active Monitor When the Host Controller Is Selected"]
55pub type SOFEA_R = crate::BitReader<SOFEA_A>;
56#[doc = "Active Monitor When the Host Controller Is Selected\n\nValue on reset: 0"]
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub enum SOFEA_A {
59 #[doc = "0: SOF output stopped"]
60 _0 = 0,
61 #[doc = "1: SOF output operating"]
62 _1 = 1,
63}
64impl From<SOFEA_A> for bool {
65 #[inline(always)]
66 fn from(variant: SOFEA_A) -> Self {
67 variant as u8 != 0
68 }
69}
70impl SOFEA_R {
71 #[doc = "Get enumerated values variant"]
72 #[inline(always)]
73 pub fn variant(&self) -> SOFEA_A {
74 match self.bits {
75 false => SOFEA_A::_0,
76 true => SOFEA_A::_1,
77 }
78 }
79 #[doc = "Checks if the value of the field is `_0`"]
80 #[inline(always)]
81 pub fn is_0(&self) -> bool {
82 *self == SOFEA_A::_0
83 }
84 #[doc = "Checks if the value of the field is `_1`"]
85 #[inline(always)]
86 pub fn is_1(&self) -> bool {
87 *self == SOFEA_A::_1
88 }
89}
90#[doc = "Field `HTACT` reader - USB Host Sequencer Status Monitor"]
91pub type HTACT_R = crate::BitReader<HTACT_A>;
92#[doc = "USB Host Sequencer Status Monitor\n\nValue on reset: 0"]
93#[derive(Clone, Copy, Debug, PartialEq, Eq)]
94pub enum HTACT_A {
95 #[doc = "0: Host sequencer completely stopped"]
96 _0 = 0,
97 #[doc = "1: Host sequencer not completely stopped"]
98 _1 = 1,
99}
100impl From<HTACT_A> for bool {
101 #[inline(always)]
102 fn from(variant: HTACT_A) -> Self {
103 variant as u8 != 0
104 }
105}
106impl HTACT_R {
107 #[doc = "Get enumerated values variant"]
108 #[inline(always)]
109 pub fn variant(&self) -> HTACT_A {
110 match self.bits {
111 false => HTACT_A::_0,
112 true => HTACT_A::_1,
113 }
114 }
115 #[doc = "Checks if the value of the field is `_0`"]
116 #[inline(always)]
117 pub fn is_0(&self) -> bool {
118 *self == HTACT_A::_0
119 }
120 #[doc = "Checks if the value of the field is `_1`"]
121 #[inline(always)]
122 pub fn is_1(&self) -> bool {
123 *self == HTACT_A::_1
124 }
125}
126#[doc = "Field `OVCMON` reader - External USB_OVRCURA/ USB_OVRCURB Input Pin Monitor"]
127pub type OVCMON_R = crate::FieldReader<u8, u8>;
128impl R {
129 #[doc = "Bits 0:1 - USB Data Line Status Monitor"]
130 #[inline(always)]
131 pub fn lnst(&self) -> LNST_R {
132 LNST_R::new((self.bits & 3) as u8)
133 }
134 #[doc = "Bit 2 - External ID0 Input Pin Monitor"]
135 #[inline(always)]
136 pub fn idmon(&self) -> IDMON_R {
137 IDMON_R::new(((self.bits >> 2) & 1) != 0)
138 }
139 #[doc = "Bit 5 - Active Monitor When the Host Controller Is Selected"]
140 #[inline(always)]
141 pub fn sofea(&self) -> SOFEA_R {
142 SOFEA_R::new(((self.bits >> 5) & 1) != 0)
143 }
144 #[doc = "Bit 6 - USB Host Sequencer Status Monitor"]
145 #[inline(always)]
146 pub fn htact(&self) -> HTACT_R {
147 HTACT_R::new(((self.bits >> 6) & 1) != 0)
148 }
149 #[doc = "Bits 14:15 - External USB_OVRCURA/ USB_OVRCURB Input Pin Monitor"]
150 #[inline(always)]
151 pub fn ovcmon(&self) -> OVCMON_R {
152 OVCMON_R::new(((self.bits >> 14) & 3) as u8)
153 }
154}
155#[doc = "System Configuration Status Register 0\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 [syssts0](index.html) module"]
156pub struct SYSSTS0_SPEC;
157impl crate::RegisterSpec for SYSSTS0_SPEC {
158 type Ux = u16;
159}
160#[doc = "`read()` method returns [syssts0::R](R) reader structure"]
161impl crate::Readable for SYSSTS0_SPEC {
162 type Reader = R;
163}
164#[doc = "`reset()` method sets SYSSTS0 to value 0"]
165impl crate::Resettable for SYSSTS0_SPEC {
166 const RESET_VALUE: Self::Ux = 0;
167}