ra6m1/usbfs/
syssts0.rs

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, LNST_A>;
18#[doc = "USB Data Line Status Monitor\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20#[repr(u8)]
21pub enum LNST_A {
22    #[doc = "0: SE0"]
23    _00 = 0,
24    #[doc = "1: J-State"]
25    _01 = 1,
26    #[doc = "2: K-State"]
27    _10 = 2,
28    #[doc = "3: SE1"]
29    _11 = 3,
30}
31impl From<LNST_A> for u8 {
32    #[inline(always)]
33    fn from(variant: LNST_A) -> Self {
34        variant as _
35    }
36}
37impl LNST_R {
38    #[doc = "Get enumerated values variant"]
39    #[inline(always)]
40    pub fn variant(&self) -> LNST_A {
41        match self.bits {
42            0 => LNST_A::_00,
43            1 => LNST_A::_01,
44            2 => LNST_A::_10,
45            3 => LNST_A::_11,
46            _ => unreachable!(),
47        }
48    }
49    #[doc = "Checks if the value of the field is `_00`"]
50    #[inline(always)]
51    pub fn is_00(&self) -> bool {
52        *self == LNST_A::_00
53    }
54    #[doc = "Checks if the value of the field is `_01`"]
55    #[inline(always)]
56    pub fn is_01(&self) -> bool {
57        *self == LNST_A::_01
58    }
59    #[doc = "Checks if the value of the field is `_10`"]
60    #[inline(always)]
61    pub fn is_10(&self) -> bool {
62        *self == LNST_A::_10
63    }
64    #[doc = "Checks if the value of the field is `_11`"]
65    #[inline(always)]
66    pub fn is_11(&self) -> bool {
67        *self == LNST_A::_11
68    }
69}
70#[doc = "Field `IDMON` reader - External ID0 Input Pin Monitor"]
71pub type IDMON_R = crate::BitReader<IDMON_A>;
72#[doc = "External ID0 Input Pin Monitor\n\nValue on reset: 0"]
73#[derive(Clone, Copy, Debug, PartialEq, Eq)]
74pub enum IDMON_A {
75    #[doc = "0: USB0_ID pin is low"]
76    _0 = 0,
77    #[doc = "1: USB0_ID pin is high"]
78    _1 = 1,
79}
80impl From<IDMON_A> for bool {
81    #[inline(always)]
82    fn from(variant: IDMON_A) -> Self {
83        variant as u8 != 0
84    }
85}
86impl IDMON_R {
87    #[doc = "Get enumerated values variant"]
88    #[inline(always)]
89    pub fn variant(&self) -> IDMON_A {
90        match self.bits {
91            false => IDMON_A::_0,
92            true => IDMON_A::_1,
93        }
94    }
95    #[doc = "Checks if the value of the field is `_0`"]
96    #[inline(always)]
97    pub fn is_0(&self) -> bool {
98        *self == IDMON_A::_0
99    }
100    #[doc = "Checks if the value of the field is `_1`"]
101    #[inline(always)]
102    pub fn is_1(&self) -> bool {
103        *self == IDMON_A::_1
104    }
105}
106#[doc = "Field `SOFEA` reader - Active Monitor When the Host Controller is Selected."]
107pub type SOFEA_R = crate::BitReader<SOFEA_A>;
108#[doc = "Active Monitor When the Host Controller is Selected.\n\nValue on reset: 0"]
109#[derive(Clone, Copy, Debug, PartialEq, Eq)]
110pub enum SOFEA_A {
111    #[doc = "0: SOF output is stopped."]
112    _0 = 0,
113    #[doc = "1: SOF output is operating."]
114    _1 = 1,
115}
116impl From<SOFEA_A> for bool {
117    #[inline(always)]
118    fn from(variant: SOFEA_A) -> Self {
119        variant as u8 != 0
120    }
121}
122impl SOFEA_R {
123    #[doc = "Get enumerated values variant"]
124    #[inline(always)]
125    pub fn variant(&self) -> SOFEA_A {
126        match self.bits {
127            false => SOFEA_A::_0,
128            true => SOFEA_A::_1,
129        }
130    }
131    #[doc = "Checks if the value of the field is `_0`"]
132    #[inline(always)]
133    pub fn is_0(&self) -> bool {
134        *self == SOFEA_A::_0
135    }
136    #[doc = "Checks if the value of the field is `_1`"]
137    #[inline(always)]
138    pub fn is_1(&self) -> bool {
139        *self == SOFEA_A::_1
140    }
141}
142#[doc = "Field `HTACT` reader - USB Host Sequencer Status Monitor"]
143pub type HTACT_R = crate::BitReader<HTACT_A>;
144#[doc = "USB Host Sequencer Status Monitor\n\nValue on reset: 0"]
145#[derive(Clone, Copy, Debug, PartialEq, Eq)]
146pub enum HTACT_A {
147    #[doc = "0: Host sequencer of the USB is completely stopped."]
148    _0 = 0,
149    #[doc = "1: Host sequencer of the USB is not completely stopped."]
150    _1 = 1,
151}
152impl From<HTACT_A> for bool {
153    #[inline(always)]
154    fn from(variant: HTACT_A) -> Self {
155        variant as u8 != 0
156    }
157}
158impl HTACT_R {
159    #[doc = "Get enumerated values variant"]
160    #[inline(always)]
161    pub fn variant(&self) -> HTACT_A {
162        match self.bits {
163            false => HTACT_A::_0,
164            true => HTACT_A::_1,
165        }
166    }
167    #[doc = "Checks if the value of the field is `_0`"]
168    #[inline(always)]
169    pub fn is_0(&self) -> bool {
170        *self == HTACT_A::_0
171    }
172    #[doc = "Checks if the value of the field is `_1`"]
173    #[inline(always)]
174    pub fn is_1(&self) -> bool {
175        *self == HTACT_A::_1
176    }
177}
178#[doc = "Field `OVCMON` reader - External USB0_OVRCURA/ USB0_OVRCURB Input Pin MonitorThe OCVMON\\[1\\]
179bit indicates the status of the USBHS_OVRCURA pin. The OCVMON\\[0\\]
180bit indicates the status of the USBHS_OVRCURB pin."]
181pub type OVCMON_R = crate::FieldReader<u8, u8>;
182impl R {
183    #[doc = "Bits 0:1 - USB Data Line Status Monitor"]
184    #[inline(always)]
185    pub fn lnst(&self) -> LNST_R {
186        LNST_R::new((self.bits & 3) as u8)
187    }
188    #[doc = "Bit 2 - External ID0 Input Pin Monitor"]
189    #[inline(always)]
190    pub fn idmon(&self) -> IDMON_R {
191        IDMON_R::new(((self.bits >> 2) & 1) != 0)
192    }
193    #[doc = "Bit 5 - Active Monitor When the Host Controller is Selected."]
194    #[inline(always)]
195    pub fn sofea(&self) -> SOFEA_R {
196        SOFEA_R::new(((self.bits >> 5) & 1) != 0)
197    }
198    #[doc = "Bit 6 - USB Host Sequencer Status Monitor"]
199    #[inline(always)]
200    pub fn htact(&self) -> HTACT_R {
201        HTACT_R::new(((self.bits >> 6) & 1) != 0)
202    }
203    #[doc = "Bits 14:15 - External USB0_OVRCURA/ USB0_OVRCURB Input Pin MonitorThe OCVMON\\[1\\]
204bit indicates the status of the USBHS_OVRCURA pin. The OCVMON\\[0\\]
205bit indicates the status of the USBHS_OVRCURB pin."]
206    #[inline(always)]
207    pub fn ovcmon(&self) -> OVCMON_R {
208        OVCMON_R::new(((self.bits >> 14) & 3) as u8)
209    }
210}
211#[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"]
212pub struct SYSSTS0_SPEC;
213impl crate::RegisterSpec for SYSSTS0_SPEC {
214    type Ux = u16;
215}
216#[doc = "`read()` method returns [syssts0::R](R) reader structure"]
217impl crate::Readable for SYSSTS0_SPEC {
218    type Reader = R;
219}
220#[doc = "`reset()` method sets SYSSTS0 to value 0"]
221impl crate::Resettable for SYSSTS0_SPEC {
222    const RESET_VALUE: Self::Ux = 0;
223}