stm32f0/stm32f0x1/usb/
fnr.rs1pub type R = crate::R<FNRrs>;
3pub type FN_R = crate::FieldReader<u16>;
5pub type LSOF_R = crate::FieldReader;
7#[cfg_attr(feature = "defmt", derive(defmt::Format))]
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12pub enum LCK {
13 Locked = 1,
15}
16impl From<LCK> for bool {
17 #[inline(always)]
18 fn from(variant: LCK) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type LCK_R = crate::BitReader<LCK>;
24impl LCK_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> Option<LCK> {
28 match self.bits {
29 true => Some(LCK::Locked),
30 _ => None,
31 }
32 }
33 #[inline(always)]
35 pub fn is_locked(&self) -> bool {
36 *self == LCK::Locked
37 }
38}
39#[cfg_attr(feature = "defmt", derive(defmt::Format))]
43#[derive(Clone, Copy, Debug, PartialEq, Eq)]
44pub enum RXDM {
45 Received = 1,
47}
48impl From<RXDM> for bool {
49 #[inline(always)]
50 fn from(variant: RXDM) -> Self {
51 variant as u8 != 0
52 }
53}
54pub type RXDM_R = crate::BitReader<RXDM>;
56impl RXDM_R {
57 #[inline(always)]
59 pub const fn variant(&self) -> Option<RXDM> {
60 match self.bits {
61 true => Some(RXDM::Received),
62 _ => None,
63 }
64 }
65 #[inline(always)]
67 pub fn is_received(&self) -> bool {
68 *self == RXDM::Received
69 }
70}
71#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum RXDP {
77 Received = 1,
79}
80impl From<RXDP> for bool {
81 #[inline(always)]
82 fn from(variant: RXDP) -> Self {
83 variant as u8 != 0
84 }
85}
86pub type RXDP_R = crate::BitReader<RXDP>;
88impl RXDP_R {
89 #[inline(always)]
91 pub const fn variant(&self) -> Option<RXDP> {
92 match self.bits {
93 true => Some(RXDP::Received),
94 _ => None,
95 }
96 }
97 #[inline(always)]
99 pub fn is_received(&self) -> bool {
100 *self == RXDP::Received
101 }
102}
103impl R {
104 #[inline(always)]
106 pub fn fn_(&self) -> FN_R {
107 FN_R::new((self.bits & 0x07ff) as u16)
108 }
109 #[inline(always)]
111 pub fn lsof(&self) -> LSOF_R {
112 LSOF_R::new(((self.bits >> 11) & 3) as u8)
113 }
114 #[inline(always)]
116 pub fn lck(&self) -> LCK_R {
117 LCK_R::new(((self.bits >> 13) & 1) != 0)
118 }
119 #[inline(always)]
121 pub fn rxdm(&self) -> RXDM_R {
122 RXDM_R::new(((self.bits >> 14) & 1) != 0)
123 }
124 #[inline(always)]
126 pub fn rxdp(&self) -> RXDP_R {
127 RXDP_R::new(((self.bits >> 15) & 1) != 0)
128 }
129}
130impl core::fmt::Debug for R {
131 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
132 f.debug_struct("FNR")
133 .field("fn_", &self.fn_())
134 .field("lsof", &self.lsof())
135 .field("lck", &self.lck())
136 .field("rxdm", &self.rxdm())
137 .field("rxdp", &self.rxdp())
138 .finish()
139 }
140}
141pub struct FNRrs;
147impl crate::RegisterSpec for FNRrs {
148 type Ux = u32;
149}
150impl crate::Readable for FNRrs {}
152impl crate::Resettable for FNRrs {}