r528_pac/usb1/ohci_control_status_partition/
hc_interrupt_status.rs1#[doc = "Register `HC_INTERRUPT_STATUS` reader"]
2pub struct R(crate::R<HC_INTERRUPT_STATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HC_INTERRUPT_STATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HC_INTERRUPT_STATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HC_INTERRUPT_STATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HC_INTERRUPT_STATUS` writer"]
17pub struct W(crate::W<HC_INTERRUPT_STATUS_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HC_INTERRUPT_STATUS_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<HC_INTERRUPT_STATUS_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HC_INTERRUPT_STATUS_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ROOT_HUB_STATUS_CHANGE` reader - RootHubStatusChange\n\nThis bit is set when the content of or the content of any of \\[ NumberofDownstreamPort \\]
38has changed."]
39pub type ROOT_HUB_STATUS_CHANGE_R = crate::BitReader<bool>;
40#[doc = "Field `ROOT_HUB_STATUS_CHANGE` writer - RootHubStatusChange\n\nThis bit is set when the content of or the content of any of \\[ NumberofDownstreamPort \\]
41has changed."]
42pub type ROOT_HUB_STATUS_CHANGE_W<'a> =
43 crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 6>;
44#[doc = "Field `FRAME_NUMBER_OVERFLOW` reader - FrameNumberOverflow\n\nThis bit is set when the MSb of (bit 15) changes value, from 0 to 1 or from 1 to 0, and after has been updated."]
45pub type FRAME_NUMBER_OVERFLOW_R = crate::BitReader<bool>;
46#[doc = "Field `FRAME_NUMBER_OVERFLOW` writer - FrameNumberOverflow\n\nThis bit is set when the MSb of (bit 15) changes value, from 0 to 1 or from 1 to 0, and after has been updated."]
47pub type FRAME_NUMBER_OVERFLOW_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 5>;
48#[doc = "Field `UNRECOVERABLE_ERROR` reader - UnrecoverableError\n\nThis bit is set when HC detects a system error not related to USB. HC should not proceed with any processing nor signaling before the system error has been corrected. HCD clears this bit after HC has been reset."]
49pub type UNRECOVERABLE_ERROR_R = crate::BitReader<bool>;
50#[doc = "Field `UNRECOVERABLE_ERROR` writer - UnrecoverableError\n\nThis bit is set when HC detects a system error not related to USB. HC should not proceed with any processing nor signaling before the system error has been corrected. HCD clears this bit after HC has been reset."]
51pub type UNRECOVERABLE_ERROR_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 4>;
52#[doc = "Field `RESUME_DETECTED` reader - ResumeDetected\n\nThis bit is set when HC detects that a device on the USB is asserting resume signaling. It is the transition from no resume signaling to resume signaling causing this bit to be set. This bit is not set when HCD sets the USBRseume state."]
53pub type RESUME_DETECTED_R = crate::BitReader<bool>;
54#[doc = "Field `RESUME_DETECTED` writer - ResumeDetected\n\nThis bit is set when HC detects that a device on the USB is asserting resume signaling. It is the transition from no resume signaling to resume signaling causing this bit to be set. This bit is not set when HCD sets the USBRseume state."]
55pub type RESUME_DETECTED_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 3>;
56#[doc = "Field `START_OF_FRAME` reader - StartofFrame\n\nThis bit is set by HC at each start of frame and after the update of HccaFrameNumber. HC also generates a SOF token at the same time."]
57pub type START_OF_FRAME_R = crate::BitReader<bool>;
58#[doc = "Field `START_OF_FRAME` writer - StartofFrame\n\nThis bit is set by HC at each start of frame and after the update of HccaFrameNumber. HC also generates a SOF token at the same time."]
59pub type START_OF_FRAME_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 2>;
60#[doc = "Field `WRITEBACK_DONE_HEAD` reader - WritebackDoneHead\n\nThis bit is set immediately after HC has written to. Further updates of the will not occur until this bit has been cleared. HCD should only clear this bit after it has saved the content of HccaDoneHead."]
61pub type WRITEBACK_DONE_HEAD_R = crate::BitReader<bool>;
62#[doc = "Field `WRITEBACK_DONE_HEAD` writer - WritebackDoneHead\n\nThis bit is set immediately after HC has written to. Further updates of the will not occur until this bit has been cleared. HCD should only clear this bit after it has saved the content of HccaDoneHead."]
63pub type WRITEBACK_DONE_HEAD_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 1>;
64#[doc = "Field `SCHEDULING_OVERRUN` reader - SchedulingOverrun\n\nThis bit is set when the USB schedule for the current Frame overruns and after the update of. A scheduling overrun will also cause the SchedulingOverrunCount of to be incremented."]
65pub type SCHEDULING_OVERRUN_R = crate::BitReader<bool>;
66#[doc = "Field `SCHEDULING_OVERRUN` writer - SchedulingOverrun\n\nThis bit is set when the USB schedule for the current Frame overruns and after the update of. A scheduling overrun will also cause the SchedulingOverrunCount of to be incremented."]
67pub type SCHEDULING_OVERRUN_W<'a> = crate::BitWriter<'a, u32, HC_INTERRUPT_STATUS_SPEC, bool, 0>;
68impl R {
69 #[doc = "Bit 6 - RootHubStatusChange\n\nThis bit is set when the content of or the content of any of \\[ NumberofDownstreamPort \\]
70has changed."]
71 #[inline(always)]
72 pub fn root_hub_status_change(&self) -> ROOT_HUB_STATUS_CHANGE_R {
73 ROOT_HUB_STATUS_CHANGE_R::new(((self.bits >> 6) & 1) != 0)
74 }
75 #[doc = "Bit 5 - FrameNumberOverflow\n\nThis bit is set when the MSb of (bit 15) changes value, from 0 to 1 or from 1 to 0, and after has been updated."]
76 #[inline(always)]
77 pub fn frame_number_overflow(&self) -> FRAME_NUMBER_OVERFLOW_R {
78 FRAME_NUMBER_OVERFLOW_R::new(((self.bits >> 5) & 1) != 0)
79 }
80 #[doc = "Bit 4 - UnrecoverableError\n\nThis bit is set when HC detects a system error not related to USB. HC should not proceed with any processing nor signaling before the system error has been corrected. HCD clears this bit after HC has been reset."]
81 #[inline(always)]
82 pub fn unrecoverable_error(&self) -> UNRECOVERABLE_ERROR_R {
83 UNRECOVERABLE_ERROR_R::new(((self.bits >> 4) & 1) != 0)
84 }
85 #[doc = "Bit 3 - ResumeDetected\n\nThis bit is set when HC detects that a device on the USB is asserting resume signaling. It is the transition from no resume signaling to resume signaling causing this bit to be set. This bit is not set when HCD sets the USBRseume state."]
86 #[inline(always)]
87 pub fn resume_detected(&self) -> RESUME_DETECTED_R {
88 RESUME_DETECTED_R::new(((self.bits >> 3) & 1) != 0)
89 }
90 #[doc = "Bit 2 - StartofFrame\n\nThis bit is set by HC at each start of frame and after the update of HccaFrameNumber. HC also generates a SOF token at the same time."]
91 #[inline(always)]
92 pub fn start_of_frame(&self) -> START_OF_FRAME_R {
93 START_OF_FRAME_R::new(((self.bits >> 2) & 1) != 0)
94 }
95 #[doc = "Bit 1 - WritebackDoneHead\n\nThis bit is set immediately after HC has written to. Further updates of the will not occur until this bit has been cleared. HCD should only clear this bit after it has saved the content of HccaDoneHead."]
96 #[inline(always)]
97 pub fn writeback_done_head(&self) -> WRITEBACK_DONE_HEAD_R {
98 WRITEBACK_DONE_HEAD_R::new(((self.bits >> 1) & 1) != 0)
99 }
100 #[doc = "Bit 0 - SchedulingOverrun\n\nThis bit is set when the USB schedule for the current Frame overruns and after the update of. A scheduling overrun will also cause the SchedulingOverrunCount of to be incremented."]
101 #[inline(always)]
102 pub fn scheduling_overrun(&self) -> SCHEDULING_OVERRUN_R {
103 SCHEDULING_OVERRUN_R::new((self.bits & 1) != 0)
104 }
105}
106impl W {
107 #[doc = "Bit 6 - RootHubStatusChange\n\nThis bit is set when the content of or the content of any of \\[ NumberofDownstreamPort \\]
108has changed."]
109 #[inline(always)]
110 pub fn root_hub_status_change(&mut self) -> ROOT_HUB_STATUS_CHANGE_W {
111 ROOT_HUB_STATUS_CHANGE_W::new(self)
112 }
113 #[doc = "Bit 5 - FrameNumberOverflow\n\nThis bit is set when the MSb of (bit 15) changes value, from 0 to 1 or from 1 to 0, and after has been updated."]
114 #[inline(always)]
115 pub fn frame_number_overflow(&mut self) -> FRAME_NUMBER_OVERFLOW_W {
116 FRAME_NUMBER_OVERFLOW_W::new(self)
117 }
118 #[doc = "Bit 4 - UnrecoverableError\n\nThis bit is set when HC detects a system error not related to USB. HC should not proceed with any processing nor signaling before the system error has been corrected. HCD clears this bit after HC has been reset."]
119 #[inline(always)]
120 pub fn unrecoverable_error(&mut self) -> UNRECOVERABLE_ERROR_W {
121 UNRECOVERABLE_ERROR_W::new(self)
122 }
123 #[doc = "Bit 3 - ResumeDetected\n\nThis bit is set when HC detects that a device on the USB is asserting resume signaling. It is the transition from no resume signaling to resume signaling causing this bit to be set. This bit is not set when HCD sets the USBRseume state."]
124 #[inline(always)]
125 pub fn resume_detected(&mut self) -> RESUME_DETECTED_W {
126 RESUME_DETECTED_W::new(self)
127 }
128 #[doc = "Bit 2 - StartofFrame\n\nThis bit is set by HC at each start of frame and after the update of HccaFrameNumber. HC also generates a SOF token at the same time."]
129 #[inline(always)]
130 pub fn start_of_frame(&mut self) -> START_OF_FRAME_W {
131 START_OF_FRAME_W::new(self)
132 }
133 #[doc = "Bit 1 - WritebackDoneHead\n\nThis bit is set immediately after HC has written to. Further updates of the will not occur until this bit has been cleared. HCD should only clear this bit after it has saved the content of HccaDoneHead."]
134 #[inline(always)]
135 pub fn writeback_done_head(&mut self) -> WRITEBACK_DONE_HEAD_W {
136 WRITEBACK_DONE_HEAD_W::new(self)
137 }
138 #[doc = "Bit 0 - SchedulingOverrun\n\nThis bit is set when the USB schedule for the current Frame overruns and after the update of. A scheduling overrun will also cause the SchedulingOverrunCount of to be incremented."]
139 #[inline(always)]
140 pub fn scheduling_overrun(&mut self) -> SCHEDULING_OVERRUN_W {
141 SCHEDULING_OVERRUN_W::new(self)
142 }
143 #[doc = "Writes raw bits to the register."]
144 #[inline(always)]
145 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
146 self.0.bits(bits);
147 self
148 }
149}
150#[doc = "OHCI Interrupt Status 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_interrupt_status](index.html) module"]
151pub struct HC_INTERRUPT_STATUS_SPEC;
152impl crate::RegisterSpec for HC_INTERRUPT_STATUS_SPEC {
153 type Ux = u32;
154}
155#[doc = "`read()` method returns [hc_interrupt_status::R](R) reader structure"]
156impl crate::Readable for HC_INTERRUPT_STATUS_SPEC {
157 type Reader = R;
158}
159#[doc = "`write(|w| ..)` method takes [hc_interrupt_status::W](W) writer structure"]
160impl crate::Writable for HC_INTERRUPT_STATUS_SPEC {
161 type Writer = W;
162}
163#[doc = "`reset()` method sets HC_INTERRUPT_STATUS to value 0"]
164impl crate::Resettable for HC_INTERRUPT_STATUS_SPEC {
165 #[inline(always)]
166 fn reset_value() -> Self::Ux {
167 0
168 }
169}