1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
#[doc = "Register `hc_control` reader"]
pub struct R(crate::R<HC_CONTROL_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<HC_CONTROL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<HC_CONTROL_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<HC_CONTROL_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `hc_control` writer"]
pub struct W(crate::W<HC_CONTROL_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<HC_CONTROL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<HC_CONTROL_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<HC_CONTROL_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `control_bulk_service_ratio` reader - This specifies the service ratio between Control and Bulk EDs. Before processing any of the nonperiodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs. The internal count will be retained when crossing the frame boundary. In case of reset, HCD is responsible for restoring this value."]
pub type CONTROL_BULK_SERVICE_RATIO_R = crate::FieldReader<u8, CONTROL_BULK_SERVICE_RATIO_A>;
#[doc = "This specifies the service ratio between Control and Bulk EDs. Before processing any of the nonperiodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs. The internal count will be retained when crossing the frame boundary. In case of reset, HCD is responsible for restoring this value.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CONTROL_BULK_SERVICE_RATIO_A {
    #[doc = "0: 1:1"]
    R1 = 0,
    #[doc = "1: 2:1"]
    R2 = 1,
    #[doc = "2: 3:1"]
    R3 = 2,
    #[doc = "3: 4:1"]
    R4 = 3,
}
impl From<CONTROL_BULK_SERVICE_RATIO_A> for u8 {
    #[inline(always)]
    fn from(variant: CONTROL_BULK_SERVICE_RATIO_A) -> Self {
        variant as _
    }
}
impl CONTROL_BULK_SERVICE_RATIO_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CONTROL_BULK_SERVICE_RATIO_A {
        match self.bits {
            0 => CONTROL_BULK_SERVICE_RATIO_A::R1,
            1 => CONTROL_BULK_SERVICE_RATIO_A::R2,
            2 => CONTROL_BULK_SERVICE_RATIO_A::R3,
            3 => CONTROL_BULK_SERVICE_RATIO_A::R4,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `R1`"]
    #[inline(always)]
    pub fn is_r1(&self) -> bool {
        *self == CONTROL_BULK_SERVICE_RATIO_A::R1
    }
    #[doc = "Checks if the value of the field is `R2`"]
    #[inline(always)]
    pub fn is_r2(&self) -> bool {
        *self == CONTROL_BULK_SERVICE_RATIO_A::R2
    }
    #[doc = "Checks if the value of the field is `R3`"]
    #[inline(always)]
    pub fn is_r3(&self) -> bool {
        *self == CONTROL_BULK_SERVICE_RATIO_A::R3
    }
    #[doc = "Checks if the value of the field is `R4`"]
    #[inline(always)]
    pub fn is_r4(&self) -> bool {
        *self == CONTROL_BULK_SERVICE_RATIO_A::R4
    }
}
#[doc = "Field `control_bulk_service_ratio` writer - This specifies the service ratio between Control and Bulk EDs. Before processing any of the nonperiodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs. The internal count will be retained when crossing the frame boundary. In case of reset, HCD is responsible for restoring this value."]
pub type CONTROL_BULK_SERVICE_RATIO_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, HC_CONTROL_SPEC, u8, CONTROL_BULK_SERVICE_RATIO_A, 2, O>;
impl<'a, const O: u8> CONTROL_BULK_SERVICE_RATIO_W<'a, O> {
    #[doc = "1:1"]
    #[inline(always)]
    pub fn r1(self) -> &'a mut W {
        self.variant(CONTROL_BULK_SERVICE_RATIO_A::R1)
    }
    #[doc = "2:1"]
    #[inline(always)]
    pub fn r2(self) -> &'a mut W {
        self.variant(CONTROL_BULK_SERVICE_RATIO_A::R2)
    }
    #[doc = "3:1"]
    #[inline(always)]
    pub fn r3(self) -> &'a mut W {
        self.variant(CONTROL_BULK_SERVICE_RATIO_A::R3)
    }
    #[doc = "4:1"]
    #[inline(always)]
    pub fn r4(self) -> &'a mut W {
        self.variant(CONTROL_BULK_SERVICE_RATIO_A::R4)
    }
}
#[doc = "Field `periodic_list_enable` reader - This bit is set to enable the processing of periodic list in the next Frame. If cleared by HCD, processing of the periodic list does not occur after the next SOF. HC must check this bit before it starts processing the list."]
pub type PERIODIC_LIST_ENABLE_R = crate::BitReader<bool>;
#[doc = "Field `periodic_list_enable` writer - This bit is set to enable the processing of periodic list in the next Frame. If cleared by HCD, processing of the periodic list does not occur after the next SOF. HC must check this bit before it starts processing the list."]
pub type PERIODIC_LIST_ENABLE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `control_list_enable` reader - This bit is set to enable the processing of the Control list in the next Frame. If cleared by HCD, the processing of the Control list does not occur after the next SOF. HC must check this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcControlCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcControlCurrentED before re-enabling processing of the list."]
pub type CONTROL_LIST_ENABLE_R = crate::BitReader<bool>;
#[doc = "Field `control_list_enable` writer - This bit is set to enable the processing of the Control list in the next Frame. If cleared by HCD, the processing of the Control list does not occur after the next SOF. HC must check this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcControlCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcControlCurrentED before re-enabling processing of the list."]
pub type CONTROL_LIST_ENABLE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `isochronous_enable` reader - This bit is used by HCD to enable/disable processing of isochronous EDs. While processing the periodic list in a Frame, HC checks the status of this bit when it finds an Isochronous ED (F=1). If set (enabled), HC continues processing the EDs. If cleared (disabled), HC halts processing of the periodic list (which now contains only isochronous EDs) and begins processing the Bulk/Control lists. Setting this bit is guaranteed to take effect in the next Frame (not the current Frame)."]
pub type ISOCHRONOUS_ENABLE_R = crate::BitReader<bool>;
#[doc = "Field `isochronous_enable` writer - This bit is used by HCD to enable/disable processing of isochronous EDs. While processing the periodic list in a Frame, HC checks the status of this bit when it finds an Isochronous ED (F=1). If set (enabled), HC continues processing the EDs. If cleared (disabled), HC halts processing of the periodic list (which now contains only isochronous EDs) and begins processing the Bulk/Control lists. Setting this bit is guaranteed to take effect in the next Frame (not the current Frame)."]
pub type ISOCHRONOUS_ENABLE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `bulk_list_enable` reader - This bit is set to enable the processing of the Bulk list in the next Frame. If cleared by HCD, the processing of the Bulk list does not occur after the next SOF. HC checks this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcBulkCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcBulkCurrentED before re-enabling processing of the list."]
pub type BULK_LIST_ENABLE_R = crate::BitReader<bool>;
#[doc = "Field `bulk_list_enable` writer - This bit is set to enable the processing of the Bulk list in the next Frame. If cleared by HCD, the processing of the Bulk list does not occur after the next SOF. HC checks this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcBulkCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcBulkCurrentED before re-enabling processing of the list."]
pub type BULK_LIST_ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `host_controller_functional_state_for_usb` reader - A transition to USBOperational from another state causes SOF generation to begin 1 ms later. HCD may determine whether HC has begun sending SOFs by reading the StartoFrame field of HcInterruptStatus.\n\nThis field may be changed by HC only when in the USBSUSPEND state. HC may move from the USBSUSPEND state to the USBRESUME state after detecting the resume signaling from a downstream port.\n\nHC enters USBSUSPEND after a software reset, whereas it enters USBRESET after a hardware reset. The latter also resets the Root Hub and asserts subsequent reset signaling to downstream ports."]
pub type HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_R =
    crate::FieldReader<u8, HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A>;
#[doc = "A transition to USBOperational from another state causes SOF generation to begin 1 ms later. HCD may determine whether HC has begun sending SOFs by reading the StartoFrame field of HcInterruptStatus.\n\nThis field may be changed by HC only when in the USBSUSPEND state. HC may move from the USBSUSPEND state to the USBRESUME state after detecting the resume signaling from a downstream port.\n\nHC enters USBSUSPEND after a software reset, whereas it enters USBRESET after a hardware reset. The latter also resets the Root Hub and asserts subsequent reset signaling to downstream ports.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A {
    #[doc = "0: USB Reset"]
    USB_RESET = 0,
    #[doc = "1: USB Resume"]
    USB_RESUME = 1,
    #[doc = "2: USB Operational"]
    USB_OPERATIONAL = 2,
    #[doc = "3: USB Suspend"]
    USB_SUSPEND = 3,
}
impl From<HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A> for u8 {
    #[inline(always)]
    fn from(variant: HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A) -> Self {
        variant as _
    }
}
impl HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A {
        match self.bits {
            0 => HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESET,
            1 => HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESUME,
            2 => HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_OPERATIONAL,
            3 => HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_SUSPEND,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `USB_RESET`"]
    #[inline(always)]
    pub fn is_usb_reset(&self) -> bool {
        *self == HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESET
    }
    #[doc = "Checks if the value of the field is `USB_RESUME`"]
    #[inline(always)]
    pub fn is_usb_resume(&self) -> bool {
        *self == HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESUME
    }
    #[doc = "Checks if the value of the field is `USB_OPERATIONAL`"]
    #[inline(always)]
    pub fn is_usb_operational(&self) -> bool {
        *self == HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_OPERATIONAL
    }
    #[doc = "Checks if the value of the field is `USB_SUSPEND`"]
    #[inline(always)]
    pub fn is_usb_suspend(&self) -> bool {
        *self == HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_SUSPEND
    }
}
#[doc = "Field `host_controller_functional_state_for_usb` writer - A transition to USBOperational from another state causes SOF generation to begin 1 ms later. HCD may determine whether HC has begun sending SOFs by reading the StartoFrame field of HcInterruptStatus.\n\nThis field may be changed by HC only when in the USBSUSPEND state. HC may move from the USBSUSPEND state to the USBRESUME state after detecting the resume signaling from a downstream port.\n\nHC enters USBSUSPEND after a software reset, whereas it enters USBRESET after a hardware reset. The latter also resets the Root Hub and asserts subsequent reset signaling to downstream ports."]
pub type HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_W<'a, const O: u8> = crate::FieldWriterSafe<
    'a,
    u32,
    HC_CONTROL_SPEC,
    u8,
    HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A,
    2,
    O,
>;
impl<'a, const O: u8> HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_W<'a, O> {
    #[doc = "USB Reset"]
    #[inline(always)]
    pub fn usb_reset(self) -> &'a mut W {
        self.variant(HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESET)
    }
    #[doc = "USB Resume"]
    #[inline(always)]
    pub fn usb_resume(self) -> &'a mut W {
        self.variant(HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_RESUME)
    }
    #[doc = "USB Operational"]
    #[inline(always)]
    pub fn usb_operational(self) -> &'a mut W {
        self.variant(HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_OPERATIONAL)
    }
    #[doc = "USB Suspend"]
    #[inline(always)]
    pub fn usb_suspend(self) -> &'a mut W {
        self.variant(HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_A::USB_SUSPEND)
    }
}
#[doc = "Field `interrupt_routing` reader - InterruptRouting This bit determines the routing of interrupts generated by events registered in HcInterruptStatus. If clear, all interrupt are routed to the normal host bus interrupt mechanism. If set interrupts are routed to the System Management Interrupt. HCD clears this bit upon a hardware reset, but it does not alter this bit upon a software reset. HCD uses this bit as a tag to indicate the ownership of HC."]
pub type INTERRUPT_ROUTING_R = crate::BitReader<bool>;
#[doc = "Field `interrupt_routing` writer - InterruptRouting This bit determines the routing of interrupts generated by events registered in HcInterruptStatus. If clear, all interrupt are routed to the normal host bus interrupt mechanism. If set interrupts are routed to the System Management Interrupt. HCD clears this bit upon a hardware reset, but it does not alter this bit upon a software reset. HCD uses this bit as a tag to indicate the ownership of HC."]
pub type INTERRUPT_ROUTING_W<'a, const O: u8> = crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `remote_wakeup_connected` reader - This bit indicates whether HC supports remote wakeup signaling. If remote wakeup is supported and used by the system, it is the responsibility of system firmware to set this bit during POST. HC clear the bit upon a hardware reset but does not alter it upon a software reset. Remote wakeup signaling of the host system is host-bus-specific and is not described in this specification."]
pub type REMOTE_WAKEUP_CONNECTED_R = crate::BitReader<bool>;
#[doc = "Field `remote_wakeup_connected` writer - This bit indicates whether HC supports remote wakeup signaling. If remote wakeup is supported and used by the system, it is the responsibility of system firmware to set this bit during POST. HC clear the bit upon a hardware reset but does not alter it upon a software reset. Remote wakeup signaling of the host system is host-bus-specific and is not described in this specification."]
pub type REMOTE_WAKEUP_CONNECTED_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
#[doc = "Field `remote_wakeup_enable` reader - This bit is used by HCD to enable or disable the remote wakeup feature upon the detection of upstream resume signaling. When this bit is set and the ResumeDetected bit in HcInterruptStatus is set, a remote wakeup is signaled to the host system. Setting this bit has no impact on the generation of hardware interrupt."]
pub type REMOTE_WAKEUP_ENABLE_R = crate::BitReader<bool>;
#[doc = "Field `remote_wakeup_enable` writer - This bit is used by HCD to enable or disable the remote wakeup feature upon the detection of upstream resume signaling. When this bit is set and the ResumeDetected bit in HcInterruptStatus is set, a remote wakeup is signaled to the host system. Setting this bit has no impact on the generation of hardware interrupt."]
pub type REMOTE_WAKEUP_ENABLE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, HC_CONTROL_SPEC, bool, O>;
impl R {
    #[doc = "Bits 0:1 - This specifies the service ratio between Control and Bulk EDs. Before processing any of the nonperiodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs. The internal count will be retained when crossing the frame boundary. In case of reset, HCD is responsible for restoring this value."]
    #[inline(always)]
    pub fn control_bulk_service_ratio(&self) -> CONTROL_BULK_SERVICE_RATIO_R {
        CONTROL_BULK_SERVICE_RATIO_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bit 2 - This bit is set to enable the processing of periodic list in the next Frame. If cleared by HCD, processing of the periodic list does not occur after the next SOF. HC must check this bit before it starts processing the list."]
    #[inline(always)]
    pub fn periodic_list_enable(&self) -> PERIODIC_LIST_ENABLE_R {
        PERIODIC_LIST_ENABLE_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - This bit is set to enable the processing of the Control list in the next Frame. If cleared by HCD, the processing of the Control list does not occur after the next SOF. HC must check this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcControlCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcControlCurrentED before re-enabling processing of the list."]
    #[inline(always)]
    pub fn control_list_enable(&self) -> CONTROL_LIST_ENABLE_R {
        CONTROL_LIST_ENABLE_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 3 - This bit is used by HCD to enable/disable processing of isochronous EDs. While processing the periodic list in a Frame, HC checks the status of this bit when it finds an Isochronous ED (F=1). If set (enabled), HC continues processing the EDs. If cleared (disabled), HC halts processing of the periodic list (which now contains only isochronous EDs) and begins processing the Bulk/Control lists. Setting this bit is guaranteed to take effect in the next Frame (not the current Frame)."]
    #[inline(always)]
    pub fn isochronous_enable(&self) -> ISOCHRONOUS_ENABLE_R {
        ISOCHRONOUS_ENABLE_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 5 - This bit is set to enable the processing of the Bulk list in the next Frame. If cleared by HCD, the processing of the Bulk list does not occur after the next SOF. HC checks this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcBulkCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcBulkCurrentED before re-enabling processing of the list."]
    #[inline(always)]
    pub fn bulk_list_enable(&self) -> BULK_LIST_ENABLE_R {
        BULK_LIST_ENABLE_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:7 - A transition to USBOperational from another state causes SOF generation to begin 1 ms later. HCD may determine whether HC has begun sending SOFs by reading the StartoFrame field of HcInterruptStatus.\n\nThis field may be changed by HC only when in the USBSUSPEND state. HC may move from the USBSUSPEND state to the USBRESUME state after detecting the resume signaling from a downstream port.\n\nHC enters USBSUSPEND after a software reset, whereas it enters USBRESET after a hardware reset. The latter also resets the Root Hub and asserts subsequent reset signaling to downstream ports."]
    #[inline(always)]
    pub fn host_controller_functional_state_for_usb(
        &self,
    ) -> HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_R {
        HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_R::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bit 8 - InterruptRouting This bit determines the routing of interrupts generated by events registered in HcInterruptStatus. If clear, all interrupt are routed to the normal host bus interrupt mechanism. If set interrupts are routed to the System Management Interrupt. HCD clears this bit upon a hardware reset, but it does not alter this bit upon a software reset. HCD uses this bit as a tag to indicate the ownership of HC."]
    #[inline(always)]
    pub fn interrupt_routing(&self) -> INTERRUPT_ROUTING_R {
        INTERRUPT_ROUTING_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - This bit indicates whether HC supports remote wakeup signaling. If remote wakeup is supported and used by the system, it is the responsibility of system firmware to set this bit during POST. HC clear the bit upon a hardware reset but does not alter it upon a software reset. Remote wakeup signaling of the host system is host-bus-specific and is not described in this specification."]
    #[inline(always)]
    pub fn remote_wakeup_connected(&self) -> REMOTE_WAKEUP_CONNECTED_R {
        REMOTE_WAKEUP_CONNECTED_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - This bit is used by HCD to enable or disable the remote wakeup feature upon the detection of upstream resume signaling. When this bit is set and the ResumeDetected bit in HcInterruptStatus is set, a remote wakeup is signaled to the host system. Setting this bit has no impact on the generation of hardware interrupt."]
    #[inline(always)]
    pub fn remote_wakeup_enable(&self) -> REMOTE_WAKEUP_ENABLE_R {
        REMOTE_WAKEUP_ENABLE_R::new(((self.bits >> 10) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - This specifies the service ratio between Control and Bulk EDs. Before processing any of the nonperiodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs. The internal count will be retained when crossing the frame boundary. In case of reset, HCD is responsible for restoring this value."]
    #[inline(always)]
    #[must_use]
    pub fn control_bulk_service_ratio(&mut self) -> CONTROL_BULK_SERVICE_RATIO_W<0> {
        CONTROL_BULK_SERVICE_RATIO_W::new(self)
    }
    #[doc = "Bit 2 - This bit is set to enable the processing of periodic list in the next Frame. If cleared by HCD, processing of the periodic list does not occur after the next SOF. HC must check this bit before it starts processing the list."]
    #[inline(always)]
    #[must_use]
    pub fn periodic_list_enable(&mut self) -> PERIODIC_LIST_ENABLE_W<2> {
        PERIODIC_LIST_ENABLE_W::new(self)
    }
    #[doc = "Bit 3 - This bit is set to enable the processing of the Control list in the next Frame. If cleared by HCD, the processing of the Control list does not occur after the next SOF. HC must check this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcControlCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcControlCurrentED before re-enabling processing of the list."]
    #[inline(always)]
    #[must_use]
    pub fn control_list_enable(&mut self) -> CONTROL_LIST_ENABLE_W<3> {
        CONTROL_LIST_ENABLE_W::new(self)
    }
    #[doc = "Bit 3 - This bit is used by HCD to enable/disable processing of isochronous EDs. While processing the periodic list in a Frame, HC checks the status of this bit when it finds an Isochronous ED (F=1). If set (enabled), HC continues processing the EDs. If cleared (disabled), HC halts processing of the periodic list (which now contains only isochronous EDs) and begins processing the Bulk/Control lists. Setting this bit is guaranteed to take effect in the next Frame (not the current Frame)."]
    #[inline(always)]
    #[must_use]
    pub fn isochronous_enable(&mut self) -> ISOCHRONOUS_ENABLE_W<3> {
        ISOCHRONOUS_ENABLE_W::new(self)
    }
    #[doc = "Bit 5 - This bit is set to enable the processing of the Bulk list in the next Frame. If cleared by HCD, the processing of the Bulk list does not occur after the next SOF. HC checks this bit whenever it determines to process the list. When disabled, HCD may modify the list. If HcBulkCurrentED is pointing to an ED to be removed, HCD must advance the pointer by updating HcBulkCurrentED before re-enabling processing of the list."]
    #[inline(always)]
    #[must_use]
    pub fn bulk_list_enable(&mut self) -> BULK_LIST_ENABLE_W<5> {
        BULK_LIST_ENABLE_W::new(self)
    }
    #[doc = "Bits 6:7 - A transition to USBOperational from another state causes SOF generation to begin 1 ms later. HCD may determine whether HC has begun sending SOFs by reading the StartoFrame field of HcInterruptStatus.\n\nThis field may be changed by HC only when in the USBSUSPEND state. HC may move from the USBSUSPEND state to the USBRESUME state after detecting the resume signaling from a downstream port.\n\nHC enters USBSUSPEND after a software reset, whereas it enters USBRESET after a hardware reset. The latter also resets the Root Hub and asserts subsequent reset signaling to downstream ports."]
    #[inline(always)]
    #[must_use]
    pub fn host_controller_functional_state_for_usb(
        &mut self,
    ) -> HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_W<6> {
        HOST_CONTROLLER_FUNCTIONAL_STATE_FOR_USB_W::new(self)
    }
    #[doc = "Bit 8 - InterruptRouting This bit determines the routing of interrupts generated by events registered in HcInterruptStatus. If clear, all interrupt are routed to the normal host bus interrupt mechanism. If set interrupts are routed to the System Management Interrupt. HCD clears this bit upon a hardware reset, but it does not alter this bit upon a software reset. HCD uses this bit as a tag to indicate the ownership of HC."]
    #[inline(always)]
    #[must_use]
    pub fn interrupt_routing(&mut self) -> INTERRUPT_ROUTING_W<8> {
        INTERRUPT_ROUTING_W::new(self)
    }
    #[doc = "Bit 9 - This bit indicates whether HC supports remote wakeup signaling. If remote wakeup is supported and used by the system, it is the responsibility of system firmware to set this bit during POST. HC clear the bit upon a hardware reset but does not alter it upon a software reset. Remote wakeup signaling of the host system is host-bus-specific and is not described in this specification."]
    #[inline(always)]
    #[must_use]
    pub fn remote_wakeup_connected(&mut self) -> REMOTE_WAKEUP_CONNECTED_W<9> {
        REMOTE_WAKEUP_CONNECTED_W::new(self)
    }
    #[doc = "Bit 10 - This bit is used by HCD to enable or disable the remote wakeup feature upon the detection of upstream resume signaling. When this bit is set and the ResumeDetected bit in HcInterruptStatus is set, a remote wakeup is signaled to the host system. Setting this bit has no impact on the generation of hardware interrupt."]
    #[inline(always)]
    #[must_use]
    pub fn remote_wakeup_enable(&mut self) -> REMOTE_WAKEUP_ENABLE_W<10> {
        REMOTE_WAKEUP_ENABLE_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "OHCI Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hc_control](index.html) module"]
pub struct HC_CONTROL_SPEC;
impl crate::RegisterSpec for HC_CONTROL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [hc_control::R](R) reader structure"]
impl crate::Readable for HC_CONTROL_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [hc_control::W](W) writer structure"]
impl crate::Writable for HC_CONTROL_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets hc_control to value 0"]
impl crate::Resettable for HC_CONTROL_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}