ra4e1/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, u8>;
18#[doc = "Field `SOFEA` reader - Active Monitor When the Host Controller Is Selected"]
19pub type SOFEA_R = crate::BitReader<SOFEA_A>;
20#[doc = "Active Monitor When the Host Controller Is Selected\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum SOFEA_A {
23    #[doc = "0: SOF output stopped"]
24    _0 = 0,
25    #[doc = "1: SOF output operating"]
26    _1 = 1,
27}
28impl From<SOFEA_A> for bool {
29    #[inline(always)]
30    fn from(variant: SOFEA_A) -> Self {
31        variant as u8 != 0
32    }
33}
34impl SOFEA_R {
35    #[doc = "Get enumerated values variant"]
36    #[inline(always)]
37    pub fn variant(&self) -> SOFEA_A {
38        match self.bits {
39            false => SOFEA_A::_0,
40            true => SOFEA_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 == SOFEA_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 == SOFEA_A::_1
52    }
53}
54#[doc = "Field `HTACT` reader - USB Host Sequencer Status Monitor"]
55pub type HTACT_R = crate::BitReader<HTACT_A>;
56#[doc = "USB Host Sequencer Status Monitor\n\nValue on reset: 0"]
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub enum HTACT_A {
59    #[doc = "0: Host sequencer completely stopped"]
60    _0 = 0,
61    #[doc = "1: Host sequencer not completely stopped"]
62    _1 = 1,
63}
64impl From<HTACT_A> for bool {
65    #[inline(always)]
66    fn from(variant: HTACT_A) -> Self {
67        variant as u8 != 0
68    }
69}
70impl HTACT_R {
71    #[doc = "Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> HTACT_A {
74        match self.bits {
75            false => HTACT_A::_0,
76            true => HTACT_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 == HTACT_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 == HTACT_A::_1
88    }
89}
90#[doc = "Field `OVCMON` reader - External USB_OVRCURA Input Pin Monitor"]
91pub type OVCMON_R = crate::BitReader<bool>;
92impl R {
93    #[doc = "Bits 0:1 - USB Data Line Status Monitor"]
94    #[inline(always)]
95    pub fn lnst(&self) -> LNST_R {
96        LNST_R::new((self.bits & 3) as u8)
97    }
98    #[doc = "Bit 5 - Active Monitor When the Host Controller Is Selected"]
99    #[inline(always)]
100    pub fn sofea(&self) -> SOFEA_R {
101        SOFEA_R::new(((self.bits >> 5) & 1) != 0)
102    }
103    #[doc = "Bit 6 - USB Host Sequencer Status Monitor"]
104    #[inline(always)]
105    pub fn htact(&self) -> HTACT_R {
106        HTACT_R::new(((self.bits >> 6) & 1) != 0)
107    }
108    #[doc = "Bit 15 - External USB_OVRCURA Input Pin Monitor"]
109    #[inline(always)]
110    pub fn ovcmon(&self) -> OVCMON_R {
111        OVCMON_R::new(((self.bits >> 15) & 1) != 0)
112    }
113}
114#[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"]
115pub struct SYSSTS0_SPEC;
116impl crate::RegisterSpec for SYSSTS0_SPEC {
117    type Ux = u16;
118}
119#[doc = "`read()` method returns [syssts0::R](R) reader structure"]
120impl crate::Readable for SYSSTS0_SPEC {
121    type Reader = R;
122}
123#[doc = "`reset()` method sets SYSSTS0 to value 0"]
124impl crate::Resettable for SYSSTS0_SPEC {
125    const RESET_VALUE: Self::Ux = 0;
126}