d1_pac/usb1/hci_controller_phy_interface/
hci_ctrl3.rs1#[doc = "Register `hci_ctrl3` reader"]
2pub type R = crate::R<HCI_CTRL3_SPEC>;
3#[doc = "Register `hci_ctrl3` writer"]
4pub type W = crate::W<HCI_CTRL3_SPEC>;
5#[doc = "Field `linestate_change_detect_enable` reader - Linestate Change Detect Enable"]
6pub type LINESTATE_CHANGE_DETECT_ENABLE_R = crate::BitReader<LINESTATE_CHANGE_DETECT_ENABLE_A>;
7#[doc = "Linestate Change Detect Enable\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum LINESTATE_CHANGE_DETECT_ENABLE_A {
10 #[doc = "1: Enable"]
11 ENABLE = 1,
12 #[doc = "0: Disable"]
13 DISABLE = 0,
14}
15impl From<LINESTATE_CHANGE_DETECT_ENABLE_A> for bool {
16 #[inline(always)]
17 fn from(variant: LINESTATE_CHANGE_DETECT_ENABLE_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl LINESTATE_CHANGE_DETECT_ENABLE_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> LINESTATE_CHANGE_DETECT_ENABLE_A {
25 match self.bits {
26 true => LINESTATE_CHANGE_DETECT_ENABLE_A::ENABLE,
27 false => LINESTATE_CHANGE_DETECT_ENABLE_A::DISABLE,
28 }
29 }
30 #[doc = "Enable"]
31 #[inline(always)]
32 pub fn is_enable(&self) -> bool {
33 *self == LINESTATE_CHANGE_DETECT_ENABLE_A::ENABLE
34 }
35 #[doc = "Disable"]
36 #[inline(always)]
37 pub fn is_disable(&self) -> bool {
38 *self == LINESTATE_CHANGE_DETECT_ENABLE_A::DISABLE
39 }
40}
41#[doc = "Field `linestate_change_detect_enable` writer - Linestate Change Detect Enable"]
42pub type LINESTATE_CHANGE_DETECT_ENABLE_W<'a, REG> =
43 crate::BitWriter<'a, REG, LINESTATE_CHANGE_DETECT_ENABLE_A>;
44impl<'a, REG> LINESTATE_CHANGE_DETECT_ENABLE_W<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "Enable"]
49 #[inline(always)]
50 pub fn enable(self) -> &'a mut crate::W<REG> {
51 self.variant(LINESTATE_CHANGE_DETECT_ENABLE_A::ENABLE)
52 }
53 #[doc = "Disable"]
54 #[inline(always)]
55 pub fn disable(self) -> &'a mut crate::W<REG> {
56 self.variant(LINESTATE_CHANGE_DETECT_ENABLE_A::DISABLE)
57 }
58}
59#[doc = "Field `linestate_change_interrupt_enable` reader - Linestate Change Interrupt Enable"]
60pub type LINESTATE_CHANGE_INTERRUPT_ENABLE_R =
61 crate::BitReader<LINESTATE_CHANGE_INTERRUPT_ENABLE_A>;
62#[doc = "Linestate Change Interrupt Enable\n\nValue on reset: 0"]
63#[derive(Clone, Copy, Debug, PartialEq, Eq)]
64pub enum LINESTATE_CHANGE_INTERRUPT_ENABLE_A {
65 #[doc = "1: Enable"]
66 ENABLE = 1,
67 #[doc = "0: Disable"]
68 DISABLE = 0,
69}
70impl From<LINESTATE_CHANGE_INTERRUPT_ENABLE_A> for bool {
71 #[inline(always)]
72 fn from(variant: LINESTATE_CHANGE_INTERRUPT_ENABLE_A) -> Self {
73 variant as u8 != 0
74 }
75}
76impl LINESTATE_CHANGE_INTERRUPT_ENABLE_R {
77 #[doc = "Get enumerated values variant"]
78 #[inline(always)]
79 pub const fn variant(&self) -> LINESTATE_CHANGE_INTERRUPT_ENABLE_A {
80 match self.bits {
81 true => LINESTATE_CHANGE_INTERRUPT_ENABLE_A::ENABLE,
82 false => LINESTATE_CHANGE_INTERRUPT_ENABLE_A::DISABLE,
83 }
84 }
85 #[doc = "Enable"]
86 #[inline(always)]
87 pub fn is_enable(&self) -> bool {
88 *self == LINESTATE_CHANGE_INTERRUPT_ENABLE_A::ENABLE
89 }
90 #[doc = "Disable"]
91 #[inline(always)]
92 pub fn is_disable(&self) -> bool {
93 *self == LINESTATE_CHANGE_INTERRUPT_ENABLE_A::DISABLE
94 }
95}
96#[doc = "Field `linestate_change_interrupt_enable` writer - Linestate Change Interrupt Enable"]
97pub type LINESTATE_CHANGE_INTERRUPT_ENABLE_W<'a, REG> =
98 crate::BitWriter<'a, REG, LINESTATE_CHANGE_INTERRUPT_ENABLE_A>;
99impl<'a, REG> LINESTATE_CHANGE_INTERRUPT_ENABLE_W<'a, REG>
100where
101 REG: crate::Writable + crate::RegisterSpec,
102{
103 #[doc = "Enable"]
104 #[inline(always)]
105 pub fn enable(self) -> &'a mut crate::W<REG> {
106 self.variant(LINESTATE_CHANGE_INTERRUPT_ENABLE_A::ENABLE)
107 }
108 #[doc = "Disable"]
109 #[inline(always)]
110 pub fn disable(self) -> &'a mut crate::W<REG> {
111 self.variant(LINESTATE_CHANGE_INTERRUPT_ENABLE_A::DISABLE)
112 }
113}
114#[doc = "Field `remote_wakeup_enable` reader - Remote Wakeup Enable"]
115pub type REMOTE_WAKEUP_ENABLE_R = crate::BitReader<REMOTE_WAKEUP_ENABLE_A>;
116#[doc = "Remote Wakeup Enable\n\nValue on reset: 0"]
117#[derive(Clone, Copy, Debug, PartialEq, Eq)]
118pub enum REMOTE_WAKEUP_ENABLE_A {
119 #[doc = "1: Enable"]
120 ENABLE = 1,
121 #[doc = "0: Disable"]
122 DISABLE = 0,
123}
124impl From<REMOTE_WAKEUP_ENABLE_A> for bool {
125 #[inline(always)]
126 fn from(variant: REMOTE_WAKEUP_ENABLE_A) -> Self {
127 variant as u8 != 0
128 }
129}
130impl REMOTE_WAKEUP_ENABLE_R {
131 #[doc = "Get enumerated values variant"]
132 #[inline(always)]
133 pub const fn variant(&self) -> REMOTE_WAKEUP_ENABLE_A {
134 match self.bits {
135 true => REMOTE_WAKEUP_ENABLE_A::ENABLE,
136 false => REMOTE_WAKEUP_ENABLE_A::DISABLE,
137 }
138 }
139 #[doc = "Enable"]
140 #[inline(always)]
141 pub fn is_enable(&self) -> bool {
142 *self == REMOTE_WAKEUP_ENABLE_A::ENABLE
143 }
144 #[doc = "Disable"]
145 #[inline(always)]
146 pub fn is_disable(&self) -> bool {
147 *self == REMOTE_WAKEUP_ENABLE_A::DISABLE
148 }
149}
150#[doc = "Field `remote_wakeup_enable` writer - Remote Wakeup Enable"]
151pub type REMOTE_WAKEUP_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, REMOTE_WAKEUP_ENABLE_A>;
152impl<'a, REG> REMOTE_WAKEUP_ENABLE_W<'a, REG>
153where
154 REG: crate::Writable + crate::RegisterSpec,
155{
156 #[doc = "Enable"]
157 #[inline(always)]
158 pub fn enable(self) -> &'a mut crate::W<REG> {
159 self.variant(REMOTE_WAKEUP_ENABLE_A::ENABLE)
160 }
161 #[doc = "Disable"]
162 #[inline(always)]
163 pub fn disable(self) -> &'a mut crate::W<REG> {
164 self.variant(REMOTE_WAKEUP_ENABLE_A::DISABLE)
165 }
166}
167#[doc = "Field `linestate_change_detect` reader - Linestate Change Detect"]
168pub type LINESTATE_CHANGE_DETECT_R = crate::BitReader<LINESTATE_CHANGE_DETECT_A>;
169#[doc = "Linestate Change Detect\n\nValue on reset: 1"]
170#[derive(Clone, Copy, Debug, PartialEq, Eq)]
171pub enum LINESTATE_CHANGE_DETECT_A {
172 #[doc = "0: Linestate change not dected"]
173 NOT_DECTED = 0,
174 #[doc = "1: Linestate change dected Write '1' to clear."]
175 DECTED = 1,
176}
177impl From<LINESTATE_CHANGE_DETECT_A> for bool {
178 #[inline(always)]
179 fn from(variant: LINESTATE_CHANGE_DETECT_A) -> Self {
180 variant as u8 != 0
181 }
182}
183impl LINESTATE_CHANGE_DETECT_R {
184 #[doc = "Get enumerated values variant"]
185 #[inline(always)]
186 pub const fn variant(&self) -> LINESTATE_CHANGE_DETECT_A {
187 match self.bits {
188 false => LINESTATE_CHANGE_DETECT_A::NOT_DECTED,
189 true => LINESTATE_CHANGE_DETECT_A::DECTED,
190 }
191 }
192 #[doc = "Linestate change not dected"]
193 #[inline(always)]
194 pub fn is_not_dected(&self) -> bool {
195 *self == LINESTATE_CHANGE_DETECT_A::NOT_DECTED
196 }
197 #[doc = "Linestate change dected Write '1' to clear."]
198 #[inline(always)]
199 pub fn is_dected(&self) -> bool {
200 *self == LINESTATE_CHANGE_DETECT_A::DECTED
201 }
202}
203#[doc = "Field `linestate_change_detect` writer - Linestate Change Detect"]
204pub type LINESTATE_CHANGE_DETECT_W<'a, REG> =
205 crate::BitWriter1C<'a, REG, LINESTATE_CHANGE_DETECT_A>;
206impl<'a, REG> LINESTATE_CHANGE_DETECT_W<'a, REG>
207where
208 REG: crate::Writable + crate::RegisterSpec,
209{
210 #[doc = "Linestate change not dected"]
211 #[inline(always)]
212 pub fn not_dected(self) -> &'a mut crate::W<REG> {
213 self.variant(LINESTATE_CHANGE_DETECT_A::NOT_DECTED)
214 }
215 #[doc = "Linestate change dected Write '1' to clear."]
216 #[inline(always)]
217 pub fn dected(self) -> &'a mut crate::W<REG> {
218 self.variant(LINESTATE_CHANGE_DETECT_A::DECTED)
219 }
220}
221impl R {
222 #[doc = "Bit 0 - Linestate Change Detect Enable"]
223 #[inline(always)]
224 pub fn linestate_change_detect_enable(&self) -> LINESTATE_CHANGE_DETECT_ENABLE_R {
225 LINESTATE_CHANGE_DETECT_ENABLE_R::new((self.bits & 1) != 0)
226 }
227 #[doc = "Bit 1 - Linestate Change Interrupt Enable"]
228 #[inline(always)]
229 pub fn linestate_change_interrupt_enable(&self) -> LINESTATE_CHANGE_INTERRUPT_ENABLE_R {
230 LINESTATE_CHANGE_INTERRUPT_ENABLE_R::new(((self.bits >> 1) & 1) != 0)
231 }
232 #[doc = "Bit 3 - Remote Wakeup Enable"]
233 #[inline(always)]
234 pub fn remote_wakeup_enable(&self) -> REMOTE_WAKEUP_ENABLE_R {
235 REMOTE_WAKEUP_ENABLE_R::new(((self.bits >> 3) & 1) != 0)
236 }
237 #[doc = "Bit 16 - Linestate Change Detect"]
238 #[inline(always)]
239 pub fn linestate_change_detect(&self) -> LINESTATE_CHANGE_DETECT_R {
240 LINESTATE_CHANGE_DETECT_R::new(((self.bits >> 16) & 1) != 0)
241 }
242}
243impl W {
244 #[doc = "Bit 0 - Linestate Change Detect Enable"]
245 #[inline(always)]
246 #[must_use]
247 pub fn linestate_change_detect_enable(
248 &mut self,
249 ) -> LINESTATE_CHANGE_DETECT_ENABLE_W<HCI_CTRL3_SPEC> {
250 LINESTATE_CHANGE_DETECT_ENABLE_W::new(self, 0)
251 }
252 #[doc = "Bit 1 - Linestate Change Interrupt Enable"]
253 #[inline(always)]
254 #[must_use]
255 pub fn linestate_change_interrupt_enable(
256 &mut self,
257 ) -> LINESTATE_CHANGE_INTERRUPT_ENABLE_W<HCI_CTRL3_SPEC> {
258 LINESTATE_CHANGE_INTERRUPT_ENABLE_W::new(self, 1)
259 }
260 #[doc = "Bit 3 - Remote Wakeup Enable"]
261 #[inline(always)]
262 #[must_use]
263 pub fn remote_wakeup_enable(&mut self) -> REMOTE_WAKEUP_ENABLE_W<HCI_CTRL3_SPEC> {
264 REMOTE_WAKEUP_ENABLE_W::new(self, 3)
265 }
266 #[doc = "Bit 16 - Linestate Change Detect"]
267 #[inline(always)]
268 #[must_use]
269 pub fn linestate_change_detect(&mut self) -> LINESTATE_CHANGE_DETECT_W<HCI_CTRL3_SPEC> {
270 LINESTATE_CHANGE_DETECT_W::new(self, 16)
271 }
272 #[doc = r" Writes raw bits to the register."]
273 #[doc = r""]
274 #[doc = r" # Safety"]
275 #[doc = r""]
276 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
277 #[inline(always)]
278 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
279 self.bits = bits;
280 self
281 }
282}
283#[doc = "HCI Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hci_ctrl3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hci_ctrl3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
284pub struct HCI_CTRL3_SPEC;
285impl crate::RegisterSpec for HCI_CTRL3_SPEC {
286 type Ux = u32;
287}
288#[doc = "`read()` method returns [`hci_ctrl3::R`](R) reader structure"]
289impl crate::Readable for HCI_CTRL3_SPEC {}
290#[doc = "`write(|w| ..)` method takes [`hci_ctrl3::W`](W) writer structure"]
291impl crate::Writable for HCI_CTRL3_SPEC {
292 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
293 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x0001_0000;
294}
295#[doc = "`reset()` method sets hci_ctrl3 to value 0x0001_0000"]
296impl crate::Resettable for HCI_CTRL3_SPEC {
297 const RESET_VALUE: Self::Ux = 0x0001_0000;
298}