1#[doc = "Register `usb_xcvr` reader"]
2pub struct R(crate::R<USB_XCVR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<USB_XCVR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<USB_XCVR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<USB_XCVR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `usb_xcvr` writer"]
17pub struct W(crate::W<USB_XCVR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<USB_XCVR_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<USB_XCVR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<USB_XCVR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `usb_ldo_vfb` reader - "]
38pub type USB_LDO_VFB_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `usb_ldo_vfb` writer - "]
40pub type USB_LDO_VFB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, USB_XCVR_SPEC, u8, u8, 3, O>;
41#[doc = "Field `pu_usb_ldo` reader - "]
42pub type PU_USB_LDO_R = crate::BitReader<bool>;
43#[doc = "Field `pu_usb_ldo` writer - "]
44pub type PU_USB_LDO_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
45#[doc = "Field `usb_rout_nmos` reader - "]
46pub type USB_ROUT_NMOS_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `usb_rout_nmos` writer - "]
48pub type USB_ROUT_NMOS_W<'a, const O: u8> =
49 crate::FieldWriter<'a, u32, USB_XCVR_SPEC, u8, u8, 3, O>;
50#[doc = "Field `usb_rout_pmos` reader - "]
51pub type USB_ROUT_PMOS_R = crate::FieldReader<u8, u8>;
52#[doc = "Field `usb_rout_pmos` writer - "]
53pub type USB_ROUT_PMOS_W<'a, const O: u8> =
54 crate::FieldWriter<'a, u32, USB_XCVR_SPEC, u8, u8, 3, O>;
55#[doc = "Field `usb_oeb_sel` reader - "]
56pub type USB_OEB_SEL_R = crate::BitReader<bool>;
57#[doc = "Field `usb_oeb_sel` writer - "]
58pub type USB_OEB_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
59#[doc = "Field `usb_oeb_reg` reader - "]
60pub type USB_OEB_REG_R = crate::BitReader<bool>;
61#[doc = "Field `usb_oeb_reg` writer - "]
62pub type USB_OEB_REG_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
63#[doc = "Field `usb_oeb` reader - "]
64pub type USB_OEB_R = crate::BitReader<bool>;
65#[doc = "Field `usb_oeb` writer - "]
66pub type USB_OEB_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
67#[doc = "Field `usb_data_convert` reader - "]
68pub type USB_DATA_CONVERT_R = crate::BitReader<bool>;
69#[doc = "Field `usb_data_convert` writer - "]
70pub type USB_DATA_CONVERT_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
71#[doc = "Field `usb_enum` reader - "]
72pub type USB_ENUM_R = crate::BitReader<bool>;
73#[doc = "Field `usb_enum` writer - "]
74pub type USB_ENUM_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
75#[doc = "Field `usb_spd` reader - "]
76pub type USB_SPD_R = crate::BitReader<bool>;
77#[doc = "Field `usb_spd` writer - "]
78pub type USB_SPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
79#[doc = "Field `usb_sus` reader - "]
80pub type USB_SUS_R = crate::BitReader<bool>;
81#[doc = "Field `usb_sus` writer - "]
82pub type USB_SUS_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
83#[doc = "Field `pu_usb` reader - "]
84pub type PU_USB_R = crate::BitReader<bool>;
85#[doc = "Field `pu_usb` writer - "]
86pub type PU_USB_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
87#[doc = "Field `usb_bd` reader - "]
88pub type USB_BD_R = crate::BitReader<bool>;
89#[doc = "Field `usb_bd` writer - "]
90pub type USB_BD_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
91#[doc = "Field `usb_vim` reader - "]
92pub type USB_VIM_R = crate::BitReader<bool>;
93#[doc = "Field `usb_vim` writer - "]
94pub type USB_VIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
95#[doc = "Field `usb_vip` reader - "]
96pub type USB_VIP_R = crate::BitReader<bool>;
97#[doc = "Field `usb_vip` writer - "]
98pub type USB_VIP_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
99#[doc = "Field `usb_rcv` reader - "]
100pub type USB_RCV_R = crate::BitReader<bool>;
101#[doc = "Field `usb_rcv` writer - "]
102pub type USB_RCV_W<'a, const O: u8> = crate::BitWriter<'a, u32, USB_XCVR_SPEC, bool, O>;
103impl R {
104 #[doc = "Bits 0:2"]
105 #[inline(always)]
106 pub fn usb_ldo_vfb(&self) -> USB_LDO_VFB_R {
107 USB_LDO_VFB_R::new((self.bits & 7) as u8)
108 }
109 #[doc = "Bit 3"]
110 #[inline(always)]
111 pub fn pu_usb_ldo(&self) -> PU_USB_LDO_R {
112 PU_USB_LDO_R::new(((self.bits >> 3) & 1) != 0)
113 }
114 #[doc = "Bits 4:6"]
115 #[inline(always)]
116 pub fn usb_rout_nmos(&self) -> USB_ROUT_NMOS_R {
117 USB_ROUT_NMOS_R::new(((self.bits >> 4) & 7) as u8)
118 }
119 #[doc = "Bits 8:10"]
120 #[inline(always)]
121 pub fn usb_rout_pmos(&self) -> USB_ROUT_PMOS_R {
122 USB_ROUT_PMOS_R::new(((self.bits >> 8) & 7) as u8)
123 }
124 #[doc = "Bit 12"]
125 #[inline(always)]
126 pub fn usb_oeb_sel(&self) -> USB_OEB_SEL_R {
127 USB_OEB_SEL_R::new(((self.bits >> 12) & 1) != 0)
128 }
129 #[doc = "Bit 13"]
130 #[inline(always)]
131 pub fn usb_oeb_reg(&self) -> USB_OEB_REG_R {
132 USB_OEB_REG_R::new(((self.bits >> 13) & 1) != 0)
133 }
134 #[doc = "Bit 14"]
135 #[inline(always)]
136 pub fn usb_oeb(&self) -> USB_OEB_R {
137 USB_OEB_R::new(((self.bits >> 14) & 1) != 0)
138 }
139 #[doc = "Bit 16"]
140 #[inline(always)]
141 pub fn usb_data_convert(&self) -> USB_DATA_CONVERT_R {
142 USB_DATA_CONVERT_R::new(((self.bits >> 16) & 1) != 0)
143 }
144 #[doc = "Bit 20"]
145 #[inline(always)]
146 pub fn usb_enum(&self) -> USB_ENUM_R {
147 USB_ENUM_R::new(((self.bits >> 20) & 1) != 0)
148 }
149 #[doc = "Bit 21"]
150 #[inline(always)]
151 pub fn usb_spd(&self) -> USB_SPD_R {
152 USB_SPD_R::new(((self.bits >> 21) & 1) != 0)
153 }
154 #[doc = "Bit 22"]
155 #[inline(always)]
156 pub fn usb_sus(&self) -> USB_SUS_R {
157 USB_SUS_R::new(((self.bits >> 22) & 1) != 0)
158 }
159 #[doc = "Bit 23"]
160 #[inline(always)]
161 pub fn pu_usb(&self) -> PU_USB_R {
162 PU_USB_R::new(((self.bits >> 23) & 1) != 0)
163 }
164 #[doc = "Bit 24"]
165 #[inline(always)]
166 pub fn usb_bd(&self) -> USB_BD_R {
167 USB_BD_R::new(((self.bits >> 24) & 1) != 0)
168 }
169 #[doc = "Bit 25"]
170 #[inline(always)]
171 pub fn usb_vim(&self) -> USB_VIM_R {
172 USB_VIM_R::new(((self.bits >> 25) & 1) != 0)
173 }
174 #[doc = "Bit 26"]
175 #[inline(always)]
176 pub fn usb_vip(&self) -> USB_VIP_R {
177 USB_VIP_R::new(((self.bits >> 26) & 1) != 0)
178 }
179 #[doc = "Bit 27"]
180 #[inline(always)]
181 pub fn usb_rcv(&self) -> USB_RCV_R {
182 USB_RCV_R::new(((self.bits >> 27) & 1) != 0)
183 }
184}
185impl W {
186 #[doc = "Bits 0:2"]
187 #[inline(always)]
188 #[must_use]
189 pub fn usb_ldo_vfb(&mut self) -> USB_LDO_VFB_W<0> {
190 USB_LDO_VFB_W::new(self)
191 }
192 #[doc = "Bit 3"]
193 #[inline(always)]
194 #[must_use]
195 pub fn pu_usb_ldo(&mut self) -> PU_USB_LDO_W<3> {
196 PU_USB_LDO_W::new(self)
197 }
198 #[doc = "Bits 4:6"]
199 #[inline(always)]
200 #[must_use]
201 pub fn usb_rout_nmos(&mut self) -> USB_ROUT_NMOS_W<4> {
202 USB_ROUT_NMOS_W::new(self)
203 }
204 #[doc = "Bits 8:10"]
205 #[inline(always)]
206 #[must_use]
207 pub fn usb_rout_pmos(&mut self) -> USB_ROUT_PMOS_W<8> {
208 USB_ROUT_PMOS_W::new(self)
209 }
210 #[doc = "Bit 12"]
211 #[inline(always)]
212 #[must_use]
213 pub fn usb_oeb_sel(&mut self) -> USB_OEB_SEL_W<12> {
214 USB_OEB_SEL_W::new(self)
215 }
216 #[doc = "Bit 13"]
217 #[inline(always)]
218 #[must_use]
219 pub fn usb_oeb_reg(&mut self) -> USB_OEB_REG_W<13> {
220 USB_OEB_REG_W::new(self)
221 }
222 #[doc = "Bit 14"]
223 #[inline(always)]
224 #[must_use]
225 pub fn usb_oeb(&mut self) -> USB_OEB_W<14> {
226 USB_OEB_W::new(self)
227 }
228 #[doc = "Bit 16"]
229 #[inline(always)]
230 #[must_use]
231 pub fn usb_data_convert(&mut self) -> USB_DATA_CONVERT_W<16> {
232 USB_DATA_CONVERT_W::new(self)
233 }
234 #[doc = "Bit 20"]
235 #[inline(always)]
236 #[must_use]
237 pub fn usb_enum(&mut self) -> USB_ENUM_W<20> {
238 USB_ENUM_W::new(self)
239 }
240 #[doc = "Bit 21"]
241 #[inline(always)]
242 #[must_use]
243 pub fn usb_spd(&mut self) -> USB_SPD_W<21> {
244 USB_SPD_W::new(self)
245 }
246 #[doc = "Bit 22"]
247 #[inline(always)]
248 #[must_use]
249 pub fn usb_sus(&mut self) -> USB_SUS_W<22> {
250 USB_SUS_W::new(self)
251 }
252 #[doc = "Bit 23"]
253 #[inline(always)]
254 #[must_use]
255 pub fn pu_usb(&mut self) -> PU_USB_W<23> {
256 PU_USB_W::new(self)
257 }
258 #[doc = "Bit 24"]
259 #[inline(always)]
260 #[must_use]
261 pub fn usb_bd(&mut self) -> USB_BD_W<24> {
262 USB_BD_W::new(self)
263 }
264 #[doc = "Bit 25"]
265 #[inline(always)]
266 #[must_use]
267 pub fn usb_vim(&mut self) -> USB_VIM_W<25> {
268 USB_VIM_W::new(self)
269 }
270 #[doc = "Bit 26"]
271 #[inline(always)]
272 #[must_use]
273 pub fn usb_vip(&mut self) -> USB_VIP_W<26> {
274 USB_VIP_W::new(self)
275 }
276 #[doc = "Bit 27"]
277 #[inline(always)]
278 #[must_use]
279 pub fn usb_rcv(&mut self) -> USB_RCV_W<27> {
280 USB_RCV_W::new(self)
281 }
282 #[doc = "Writes raw bits to the register."]
283 #[inline(always)]
284 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
285 self.0.bits(bits);
286 self
287 }
288}
289#[doc = "usb_xcvr.\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 [usb_xcvr](index.html) module"]
290pub struct USB_XCVR_SPEC;
291impl crate::RegisterSpec for USB_XCVR_SPEC {
292 type Ux = u32;
293}
294#[doc = "`read()` method returns [usb_xcvr::R](R) reader structure"]
295impl crate::Readable for USB_XCVR_SPEC {
296 type Reader = R;
297}
298#[doc = "`write(|w| ..)` method takes [usb_xcvr::W](W) writer structure"]
299impl crate::Writable for USB_XCVR_SPEC {
300 type Writer = W;
301 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
302 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
303}
304#[doc = "`reset()` method sets usb_xcvr to value 0"]
305impl crate::Resettable for USB_XCVR_SPEC {
306 const RESET_VALUE: Self::Ux = 0;
307}