1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"USB registers"]
28unsafe impl ::core::marker::Send for super::Usb {}
29unsafe impl ::core::marker::Sync for super::Usb {}
30impl super::Usb {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "Alternate Event Register"]
38 #[inline(always)]
39 pub const fn usb_altev_reg(
40 &self,
41 ) -> &'static crate::common::Reg<self::UsbAltevReg_SPEC, crate::common::RW> {
42 unsafe {
43 crate::common::Reg::<self::UsbAltevReg_SPEC, crate::common::RW>::from_ptr(
44 self._svd2pac_as_ptr().add(32usize),
45 )
46 }
47 }
48
49 #[doc = "Alternate Mask Register"]
50 #[inline(always)]
51 pub const fn usb_altmsk_reg(
52 &self,
53 ) -> &'static crate::common::Reg<self::UsbAltmskReg_SPEC, crate::common::RW> {
54 unsafe {
55 crate::common::Reg::<self::UsbAltmskReg_SPEC, crate::common::RW>::from_ptr(
56 self._svd2pac_as_ptr().add(36usize),
57 )
58 }
59 }
60
61 #[doc = "USB Charger Control Register"]
62 #[inline(always)]
63 pub const fn usb_charger_ctrl_reg(
64 &self,
65 ) -> &'static crate::common::Reg<self::UsbChargerCtrlReg_SPEC, crate::common::RW> {
66 unsafe {
67 crate::common::Reg::<self::UsbChargerCtrlReg_SPEC, crate::common::RW>::from_ptr(
68 self._svd2pac_as_ptr().add(424usize),
69 )
70 }
71 }
72
73 #[doc = "USB Charger Status Register"]
74 #[inline(always)]
75 pub const fn usb_charger_stat_reg(
76 &self,
77 ) -> &'static crate::common::Reg<self::UsbChargerStatReg_SPEC, crate::common::RW> {
78 unsafe {
79 crate::common::Reg::<self::UsbChargerStatReg_SPEC, crate::common::RW>::from_ptr(
80 self._svd2pac_as_ptr().add(428usize),
81 )
82 }
83 }
84
85 #[doc = "USB DMA control register"]
86 #[inline(always)]
87 pub const fn usb_dma_ctrl_reg(
88 &self,
89 ) -> &'static crate::common::Reg<self::UsbDmaCtrlReg_SPEC, crate::common::RW> {
90 unsafe {
91 crate::common::Reg::<self::UsbDmaCtrlReg_SPEC, crate::common::RW>::from_ptr(
92 self._svd2pac_as_ptr().add(416usize),
93 )
94 }
95 }
96
97 #[doc = "EP0 INNAK and OUTNAK Register"]
98 #[inline(always)]
99 pub const fn usb_ep0_nak_reg(
100 &self,
101 ) -> &'static crate::common::Reg<self::UsbEp0NakReg_SPEC, crate::common::RW> {
102 unsafe {
103 crate::common::Reg::<self::UsbEp0NakReg_SPEC, crate::common::RW>::from_ptr(
104 self._svd2pac_as_ptr().add(144usize),
105 )
106 }
107 }
108
109 #[doc = "Endpoint Control 0 Register"]
110 #[inline(always)]
111 pub const fn usb_epc0_reg(
112 &self,
113 ) -> &'static crate::common::Reg<self::UsbEpc0Reg_SPEC, crate::common::RW> {
114 unsafe {
115 crate::common::Reg::<self::UsbEpc0Reg_SPEC, crate::common::RW>::from_ptr(
116 self._svd2pac_as_ptr().add(128usize),
117 )
118 }
119 }
120
121 #[doc = "Endpoint Control Register 1"]
122 #[inline(always)]
123 pub const fn usb_epc1_reg(
124 &self,
125 ) -> &'static crate::common::Reg<self::UsbEpc1Reg_SPEC, crate::common::RW> {
126 unsafe {
127 crate::common::Reg::<self::UsbEpc1Reg_SPEC, crate::common::RW>::from_ptr(
128 self._svd2pac_as_ptr().add(160usize),
129 )
130 }
131 }
132
133 #[doc = "Endpoint Control Register 2"]
134 #[inline(always)]
135 pub const fn usb_epc2_reg(
136 &self,
137 ) -> &'static crate::common::Reg<self::UsbEpc2Reg_SPEC, crate::common::RW> {
138 unsafe {
139 crate::common::Reg::<self::UsbEpc2Reg_SPEC, crate::common::RW>::from_ptr(
140 self._svd2pac_as_ptr().add(176usize),
141 )
142 }
143 }
144
145 #[doc = "Endpoint Control Register 3"]
146 #[inline(always)]
147 pub const fn usb_epc3_reg(
148 &self,
149 ) -> &'static crate::common::Reg<self::UsbEpc3Reg_SPEC, crate::common::RW> {
150 unsafe {
151 crate::common::Reg::<self::UsbEpc3Reg_SPEC, crate::common::RW>::from_ptr(
152 self._svd2pac_as_ptr().add(192usize),
153 )
154 }
155 }
156
157 #[doc = "Endpoint Control Register 4"]
158 #[inline(always)]
159 pub const fn usb_epc4_reg(
160 &self,
161 ) -> &'static crate::common::Reg<self::UsbEpc4Reg_SPEC, crate::common::RW> {
162 unsafe {
163 crate::common::Reg::<self::UsbEpc4Reg_SPEC, crate::common::RW>::from_ptr(
164 self._svd2pac_as_ptr().add(208usize),
165 )
166 }
167 }
168
169 #[doc = "Endpoint Control Register 5"]
170 #[inline(always)]
171 pub const fn usb_epc5_reg(
172 &self,
173 ) -> &'static crate::common::Reg<self::UsbEpc5Reg_SPEC, crate::common::RW> {
174 unsafe {
175 crate::common::Reg::<self::UsbEpc5Reg_SPEC, crate::common::RW>::from_ptr(
176 self._svd2pac_as_ptr().add(224usize),
177 )
178 }
179 }
180
181 #[doc = "Endpoint Control Register 6"]
182 #[inline(always)]
183 pub const fn usb_epc6_reg(
184 &self,
185 ) -> &'static crate::common::Reg<self::UsbEpc6Reg_SPEC, crate::common::RW> {
186 unsafe {
187 crate::common::Reg::<self::UsbEpc6Reg_SPEC, crate::common::RW>::from_ptr(
188 self._svd2pac_as_ptr().add(240usize),
189 )
190 }
191 }
192
193 #[doc = "Function Address Register"]
194 #[inline(always)]
195 pub const fn usb_far_reg(
196 &self,
197 ) -> &'static crate::common::Reg<self::UsbFarReg_SPEC, crate::common::RW> {
198 unsafe {
199 crate::common::Reg::<self::UsbFarReg_SPEC, crate::common::RW>::from_ptr(
200 self._svd2pac_as_ptr().add(16usize),
201 )
202 }
203 }
204
205 #[doc = "Frame Number High Byte Register"]
206 #[inline(always)]
207 pub const fn usb_fnh_reg(
208 &self,
209 ) -> &'static crate::common::Reg<self::UsbFnhReg_SPEC, crate::common::RW> {
210 unsafe {
211 crate::common::Reg::<self::UsbFnhReg_SPEC, crate::common::RW>::from_ptr(
212 self._svd2pac_as_ptr().add(72usize),
213 )
214 }
215 }
216
217 #[doc = "Frame Number Low Byte Register"]
218 #[inline(always)]
219 pub const fn usb_fnl_reg(
220 &self,
221 ) -> &'static crate::common::Reg<self::UsbFnlReg_SPEC, crate::common::RW> {
222 unsafe {
223 crate::common::Reg::<self::UsbFnlReg_SPEC, crate::common::RW>::from_ptr(
224 self._svd2pac_as_ptr().add(76usize),
225 )
226 }
227 }
228
229 #[doc = "FIFO Warning Event Register"]
230 #[inline(always)]
231 pub const fn usb_fwev_reg(
232 &self,
233 ) -> &'static crate::common::Reg<self::UsbFwevReg_SPEC, crate::common::RW> {
234 unsafe {
235 crate::common::Reg::<self::UsbFwevReg_SPEC, crate::common::RW>::from_ptr(
236 self._svd2pac_as_ptr().add(64usize),
237 )
238 }
239 }
240
241 #[doc = "FIFO Warning Mask Register"]
242 #[inline(always)]
243 pub const fn usb_fwmsk_reg(
244 &self,
245 ) -> &'static crate::common::Reg<self::UsbFwmskReg_SPEC, crate::common::RW> {
246 unsafe {
247 crate::common::Reg::<self::UsbFwmskReg_SPEC, crate::common::RW>::from_ptr(
248 self._svd2pac_as_ptr().add(68usize),
249 )
250 }
251 }
252
253 #[doc = "Main Event Register"]
254 #[inline(always)]
255 pub const fn usb_maev_reg(
256 &self,
257 ) -> &'static crate::common::Reg<self::UsbMaevReg_SPEC, crate::common::RW> {
258 unsafe {
259 crate::common::Reg::<self::UsbMaevReg_SPEC, crate::common::RW>::from_ptr(
260 self._svd2pac_as_ptr().add(24usize),
261 )
262 }
263 }
264
265 #[doc = "Main Mask Register"]
266 #[inline(always)]
267 pub const fn usb_mamsk_reg(
268 &self,
269 ) -> &'static crate::common::Reg<self::UsbMamskReg_SPEC, crate::common::RW> {
270 unsafe {
271 crate::common::Reg::<self::UsbMamskReg_SPEC, crate::common::RW>::from_ptr(
272 self._svd2pac_as_ptr().add(28usize),
273 )
274 }
275 }
276
277 #[doc = "Main Control Register)"]
278 #[inline(always)]
279 pub const fn usb_mctrl_reg(
280 &self,
281 ) -> &'static crate::common::Reg<self::UsbMctrlReg_SPEC, crate::common::RW> {
282 unsafe {
283 crate::common::Reg::<self::UsbMctrlReg_SPEC, crate::common::RW>::from_ptr(
284 self._svd2pac_as_ptr().add(0usize),
285 )
286 }
287 }
288
289 #[doc = "NAK Event Register"]
290 #[inline(always)]
291 pub const fn usb_nakev_reg(
292 &self,
293 ) -> &'static crate::common::Reg<self::UsbNakevReg_SPEC, crate::common::RW> {
294 unsafe {
295 crate::common::Reg::<self::UsbNakevReg_SPEC, crate::common::RW>::from_ptr(
296 self._svd2pac_as_ptr().add(56usize),
297 )
298 }
299 }
300
301 #[doc = "NAK Mask Register"]
302 #[inline(always)]
303 pub const fn usb_nakmsk_reg(
304 &self,
305 ) -> &'static crate::common::Reg<self::UsbNakmskReg_SPEC, crate::common::RW> {
306 unsafe {
307 crate::common::Reg::<self::UsbNakmskReg_SPEC, crate::common::RW>::from_ptr(
308 self._svd2pac_as_ptr().add(60usize),
309 )
310 }
311 }
312
313 #[doc = "Node Functional State Register"]
314 #[inline(always)]
315 pub const fn usb_nfsr_reg(
316 &self,
317 ) -> &'static crate::common::Reg<self::UsbNfsrReg_SPEC, crate::common::RW> {
318 unsafe {
319 crate::common::Reg::<self::UsbNfsrReg_SPEC, crate::common::RW>::from_ptr(
320 self._svd2pac_as_ptr().add(20usize),
321 )
322 }
323 }
324
325 #[doc = "Receive Command 0 Register"]
326 #[inline(always)]
327 pub const fn usb_rxc0_reg(
328 &self,
329 ) -> &'static crate::common::Reg<self::UsbRxc0Reg_SPEC, crate::common::RW> {
330 unsafe {
331 crate::common::Reg::<self::UsbRxc0Reg_SPEC, crate::common::RW>::from_ptr(
332 self._svd2pac_as_ptr().add(156usize),
333 )
334 }
335 }
336
337 #[doc = "Receive Command Register 1"]
338 #[inline(always)]
339 pub const fn usb_rxc1_reg(
340 &self,
341 ) -> &'static crate::common::Reg<self::UsbRxc1Reg_SPEC, crate::common::RW> {
342 unsafe {
343 crate::common::Reg::<self::UsbRxc1Reg_SPEC, crate::common::RW>::from_ptr(
344 self._svd2pac_as_ptr().add(188usize),
345 )
346 }
347 }
348
349 #[doc = "Receive Command Register 2"]
350 #[inline(always)]
351 pub const fn usb_rxc2_reg(
352 &self,
353 ) -> &'static crate::common::Reg<self::UsbRxc2Reg_SPEC, crate::common::RW> {
354 unsafe {
355 crate::common::Reg::<self::UsbRxc2Reg_SPEC, crate::common::RW>::from_ptr(
356 self._svd2pac_as_ptr().add(220usize),
357 )
358 }
359 }
360
361 #[doc = "Receive Command Register 3"]
362 #[inline(always)]
363 pub const fn usb_rxc3_reg(
364 &self,
365 ) -> &'static crate::common::Reg<self::UsbRxc3Reg_SPEC, crate::common::RW> {
366 unsafe {
367 crate::common::Reg::<self::UsbRxc3Reg_SPEC, crate::common::RW>::from_ptr(
368 self._svd2pac_as_ptr().add(252usize),
369 )
370 }
371 }
372
373 #[doc = "Receive Data 0 Register"]
374 #[inline(always)]
375 pub const fn usb_rxd0_reg(
376 &self,
377 ) -> &'static crate::common::Reg<self::UsbRxd0Reg_SPEC, crate::common::RW> {
378 unsafe {
379 crate::common::Reg::<self::UsbRxd0Reg_SPEC, crate::common::RW>::from_ptr(
380 self._svd2pac_as_ptr().add(148usize),
381 )
382 }
383 }
384
385 #[doc = "Receive Data Register,1"]
386 #[inline(always)]
387 pub const fn usb_rxd1_reg(
388 &self,
389 ) -> &'static crate::common::Reg<self::UsbRxd1Reg_SPEC, crate::common::RW> {
390 unsafe {
391 crate::common::Reg::<self::UsbRxd1Reg_SPEC, crate::common::RW>::from_ptr(
392 self._svd2pac_as_ptr().add(180usize),
393 )
394 }
395 }
396
397 #[doc = "Receive Data Register 2"]
398 #[inline(always)]
399 pub const fn usb_rxd2_reg(
400 &self,
401 ) -> &'static crate::common::Reg<self::UsbRxd2Reg_SPEC, crate::common::RW> {
402 unsafe {
403 crate::common::Reg::<self::UsbRxd2Reg_SPEC, crate::common::RW>::from_ptr(
404 self._svd2pac_as_ptr().add(212usize),
405 )
406 }
407 }
408
409 #[doc = "Receive Data Register 3"]
410 #[inline(always)]
411 pub const fn usb_rxd3_reg(
412 &self,
413 ) -> &'static crate::common::Reg<self::UsbRxd3Reg_SPEC, crate::common::RW> {
414 unsafe {
415 crate::common::Reg::<self::UsbRxd3Reg_SPEC, crate::common::RW>::from_ptr(
416 self._svd2pac_as_ptr().add(244usize),
417 )
418 }
419 }
420
421 #[doc = "Receive Event Register"]
422 #[inline(always)]
423 pub const fn usb_rxev_reg(
424 &self,
425 ) -> &'static crate::common::Reg<self::UsbRxevReg_SPEC, crate::common::RW> {
426 unsafe {
427 crate::common::Reg::<self::UsbRxevReg_SPEC, crate::common::RW>::from_ptr(
428 self._svd2pac_as_ptr().add(48usize),
429 )
430 }
431 }
432
433 #[doc = "Receive Mask Register"]
434 #[inline(always)]
435 pub const fn usb_rxmsk_reg(
436 &self,
437 ) -> &'static crate::common::Reg<self::UsbRxmskReg_SPEC, crate::common::RW> {
438 unsafe {
439 crate::common::Reg::<self::UsbRxmskReg_SPEC, crate::common::RW>::from_ptr(
440 self._svd2pac_as_ptr().add(52usize),
441 )
442 }
443 }
444
445 #[doc = "Receive Status 0 Register"]
446 #[inline(always)]
447 pub const fn usb_rxs0_reg(
448 &self,
449 ) -> &'static crate::common::Reg<self::UsbRxs0Reg_SPEC, crate::common::RW> {
450 unsafe {
451 crate::common::Reg::<self::UsbRxs0Reg_SPEC, crate::common::RW>::from_ptr(
452 self._svd2pac_as_ptr().add(152usize),
453 )
454 }
455 }
456
457 #[doc = "Receive Status Register 1"]
458 #[inline(always)]
459 pub const fn usb_rxs1_reg(
460 &self,
461 ) -> &'static crate::common::Reg<self::UsbRxs1Reg_SPEC, crate::common::RW> {
462 unsafe {
463 crate::common::Reg::<self::UsbRxs1Reg_SPEC, crate::common::RW>::from_ptr(
464 self._svd2pac_as_ptr().add(184usize),
465 )
466 }
467 }
468
469 #[doc = "Receive Status Register 2"]
470 #[inline(always)]
471 pub const fn usb_rxs2_reg(
472 &self,
473 ) -> &'static crate::common::Reg<self::UsbRxs2Reg_SPEC, crate::common::RW> {
474 unsafe {
475 crate::common::Reg::<self::UsbRxs2Reg_SPEC, crate::common::RW>::from_ptr(
476 self._svd2pac_as_ptr().add(216usize),
477 )
478 }
479 }
480
481 #[doc = "Receive Status Register 3"]
482 #[inline(always)]
483 pub const fn usb_rxs3_reg(
484 &self,
485 ) -> &'static crate::common::Reg<self::UsbRxs3Reg_SPEC, crate::common::RW> {
486 unsafe {
487 crate::common::Reg::<self::UsbRxs3Reg_SPEC, crate::common::RW>::from_ptr(
488 self._svd2pac_as_ptr().add(248usize),
489 )
490 }
491 }
492
493 #[doc = "Transceiver configuration Register"]
494 #[inline(always)]
495 pub const fn usb_tcr_reg(
496 &self,
497 ) -> &'static crate::common::Reg<self::UsbTcrReg_SPEC, crate::common::RW> {
498 unsafe {
499 crate::common::Reg::<self::UsbTcrReg_SPEC, crate::common::RW>::from_ptr(
500 self._svd2pac_as_ptr().add(8usize),
501 )
502 }
503 }
504
505 #[doc = "Transmit command 0 Register"]
506 #[inline(always)]
507 pub const fn usb_txc0_reg(
508 &self,
509 ) -> &'static crate::common::Reg<self::UsbTxc0Reg_SPEC, crate::common::RW> {
510 unsafe {
511 crate::common::Reg::<self::UsbTxc0Reg_SPEC, crate::common::RW>::from_ptr(
512 self._svd2pac_as_ptr().add(140usize),
513 )
514 }
515 }
516
517 #[doc = "Transmit Command Register 1"]
518 #[inline(always)]
519 pub const fn usb_txc1_reg(
520 &self,
521 ) -> &'static crate::common::Reg<self::UsbTxc1Reg_SPEC, crate::common::RW> {
522 unsafe {
523 crate::common::Reg::<self::UsbTxc1Reg_SPEC, crate::common::RW>::from_ptr(
524 self._svd2pac_as_ptr().add(172usize),
525 )
526 }
527 }
528
529 #[doc = "Transmit Command Register 2"]
530 #[inline(always)]
531 pub const fn usb_txc2_reg(
532 &self,
533 ) -> &'static crate::common::Reg<self::UsbTxc2Reg_SPEC, crate::common::RW> {
534 unsafe {
535 crate::common::Reg::<self::UsbTxc2Reg_SPEC, crate::common::RW>::from_ptr(
536 self._svd2pac_as_ptr().add(204usize),
537 )
538 }
539 }
540
541 #[doc = "Transmit Command Register 3"]
542 #[inline(always)]
543 pub const fn usb_txc3_reg(
544 &self,
545 ) -> &'static crate::common::Reg<self::UsbTxc3Reg_SPEC, crate::common::RW> {
546 unsafe {
547 crate::common::Reg::<self::UsbTxc3Reg_SPEC, crate::common::RW>::from_ptr(
548 self._svd2pac_as_ptr().add(236usize),
549 )
550 }
551 }
552
553 #[doc = "Transmit Data 0 Register"]
554 #[inline(always)]
555 pub const fn usb_txd0_reg(
556 &self,
557 ) -> &'static crate::common::Reg<self::UsbTxd0Reg_SPEC, crate::common::RW> {
558 unsafe {
559 crate::common::Reg::<self::UsbTxd0Reg_SPEC, crate::common::RW>::from_ptr(
560 self._svd2pac_as_ptr().add(132usize),
561 )
562 }
563 }
564
565 #[doc = "Transmit Data Register 1"]
566 #[inline(always)]
567 pub const fn usb_txd1_reg(
568 &self,
569 ) -> &'static crate::common::Reg<self::UsbTxd1Reg_SPEC, crate::common::RW> {
570 unsafe {
571 crate::common::Reg::<self::UsbTxd1Reg_SPEC, crate::common::RW>::from_ptr(
572 self._svd2pac_as_ptr().add(164usize),
573 )
574 }
575 }
576
577 #[doc = "Transmit Data Register 2"]
578 #[inline(always)]
579 pub const fn usb_txd2_reg(
580 &self,
581 ) -> &'static crate::common::Reg<self::UsbTxd2Reg_SPEC, crate::common::RW> {
582 unsafe {
583 crate::common::Reg::<self::UsbTxd2Reg_SPEC, crate::common::RW>::from_ptr(
584 self._svd2pac_as_ptr().add(196usize),
585 )
586 }
587 }
588
589 #[doc = "Transmit Data Register 3"]
590 #[inline(always)]
591 pub const fn usb_txd3_reg(
592 &self,
593 ) -> &'static crate::common::Reg<self::UsbTxd3Reg_SPEC, crate::common::RW> {
594 unsafe {
595 crate::common::Reg::<self::UsbTxd3Reg_SPEC, crate::common::RW>::from_ptr(
596 self._svd2pac_as_ptr().add(228usize),
597 )
598 }
599 }
600
601 #[doc = "Transmit Event Register"]
602 #[inline(always)]
603 pub const fn usb_txev_reg(
604 &self,
605 ) -> &'static crate::common::Reg<self::UsbTxevReg_SPEC, crate::common::RW> {
606 unsafe {
607 crate::common::Reg::<self::UsbTxevReg_SPEC, crate::common::RW>::from_ptr(
608 self._svd2pac_as_ptr().add(40usize),
609 )
610 }
611 }
612
613 #[doc = "Transmit Mask Register"]
614 #[inline(always)]
615 pub const fn usb_txmsk_reg(
616 &self,
617 ) -> &'static crate::common::Reg<self::UsbTxmskReg_SPEC, crate::common::RW> {
618 unsafe {
619 crate::common::Reg::<self::UsbTxmskReg_SPEC, crate::common::RW>::from_ptr(
620 self._svd2pac_as_ptr().add(44usize),
621 )
622 }
623 }
624
625 #[doc = "Transmit Status 0 Register"]
626 #[inline(always)]
627 pub const fn usb_txs0_reg(
628 &self,
629 ) -> &'static crate::common::Reg<self::UsbTxs0Reg_SPEC, crate::common::RW> {
630 unsafe {
631 crate::common::Reg::<self::UsbTxs0Reg_SPEC, crate::common::RW>::from_ptr(
632 self._svd2pac_as_ptr().add(136usize),
633 )
634 }
635 }
636
637 #[doc = "Transmit Status Register 1"]
638 #[inline(always)]
639 pub const fn usb_txs1_reg(
640 &self,
641 ) -> &'static crate::common::Reg<self::UsbTxs1Reg_SPEC, crate::common::RW> {
642 unsafe {
643 crate::common::Reg::<self::UsbTxs1Reg_SPEC, crate::common::RW>::from_ptr(
644 self._svd2pac_as_ptr().add(168usize),
645 )
646 }
647 }
648
649 #[doc = "Transmit Status Register 2"]
650 #[inline(always)]
651 pub const fn usb_txs2_reg(
652 &self,
653 ) -> &'static crate::common::Reg<self::UsbTxs2Reg_SPEC, crate::common::RW> {
654 unsafe {
655 crate::common::Reg::<self::UsbTxs2Reg_SPEC, crate::common::RW>::from_ptr(
656 self._svd2pac_as_ptr().add(200usize),
657 )
658 }
659 }
660
661 #[doc = "Transmit Status Register 3"]
662 #[inline(always)]
663 pub const fn usb_txs3_reg(
664 &self,
665 ) -> &'static crate::common::Reg<self::UsbTxs3Reg_SPEC, crate::common::RW> {
666 unsafe {
667 crate::common::Reg::<self::UsbTxs3Reg_SPEC, crate::common::RW>::from_ptr(
668 self._svd2pac_as_ptr().add(232usize),
669 )
670 }
671 }
672
673 #[doc = "USB test Register (for test purpose only)"]
674 #[inline(always)]
675 pub const fn usb_utr_reg(
676 &self,
677 ) -> &'static crate::common::Reg<self::UsbUtrReg_SPEC, crate::common::RW> {
678 unsafe {
679 crate::common::Reg::<self::UsbUtrReg_SPEC, crate::common::RW>::from_ptr(
680 self._svd2pac_as_ptr().add(12usize),
681 )
682 }
683 }
684
685 #[doc = "Transceiver 2.0 Configuration and Diagnostics Register(for test purpose only)"]
686 #[inline(always)]
687 pub const fn usb_ux20cdr_reg(
688 &self,
689 ) -> &'static crate::common::Reg<self::UsbUx20CdrReg_SPEC, crate::common::RW> {
690 unsafe {
691 crate::common::Reg::<self::UsbUx20CdrReg_SPEC, crate::common::RW>::from_ptr(
692 self._svd2pac_as_ptr().add(124usize),
693 )
694 }
695 }
696
697 #[doc = "Transceiver diagnostic Register (for test purpose only)"]
698 #[inline(always)]
699 pub const fn usb_xcvdiag_reg(
700 &self,
701 ) -> &'static crate::common::Reg<self::UsbXcvdiagReg_SPEC, crate::common::RW> {
702 unsafe {
703 crate::common::Reg::<self::UsbXcvdiagReg_SPEC, crate::common::RW>::from_ptr(
704 self._svd2pac_as_ptr().add(4usize),
705 )
706 }
707 }
708}
709#[doc(hidden)]
710#[derive(Copy, Clone, Eq, PartialEq)]
711pub struct UsbAltevReg_SPEC;
712impl crate::sealed::RegSpec for UsbAltevReg_SPEC {
713 type DataType = u32;
714}
715
716#[doc = "Alternate Event Register"]
717pub type UsbAltevReg = crate::RegValueT<UsbAltevReg_SPEC>;
718
719impl UsbAltevReg {
720 #[doc = "Resume\nResume signalling is detected on the USB when the device is in Suspend state (NFS in the NFSR register is set to SUSPEND), and a non IDLE signal is present on the USB, indicating that this device should begin it\'s wake-up sequence and enter Operational state. This bit is cleared when the register is read."]
721 #[inline(always)]
722 pub fn usb_resume(
723 self,
724 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbAltevReg_SPEC, crate::common::RW> {
725 crate::common::RegisterFieldBool::<7,1,0,UsbAltevReg_SPEC,crate::common::RW>::from_register(self,0)
726 }
727
728 #[doc = "Reset\nThis bit is set to 1, when 2.5 us of SEO have been detected on the upstream port. In response, the functional state should be reset (NFS in the NFSR register is set to RESET), where it must remain for at least 100 us. The functional state can then return to Operational state. This bit is cleared when the register is read"]
729 #[inline(always)]
730 pub fn usb_reset(
731 self,
732 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbAltevReg_SPEC, crate::common::RW> {
733 crate::common::RegisterFieldBool::<6,1,0,UsbAltevReg_SPEC,crate::common::RW>::from_register(self,0)
734 }
735
736 #[doc = "Suspend Detect 5 ms\nThis bit is set to 1 after 5 ms of IDLE have been detected on the upstream port, indicating that this device is permitted to perform a remote wake-up operation. The resume may be initiated under firmware control by writing the resume value to the NFSR register. This bit is cleared when the register is read."]
737 #[inline(always)]
738 pub fn usb_sd5(
739 self,
740 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbAltevReg_SPEC, crate::common::RW> {
741 crate::common::RegisterFieldBool::<5,1,0,UsbAltevReg_SPEC,crate::common::RW>::from_register(self,0)
742 }
743
744 #[doc = "Suspend Detect 3 ms\nThis bit is set to 1 after 3 ms of IDLE have been detected on the upstream port, indicating that the device should be suspended. The suspend occurs under firmware control by writing the suspend value to the Node Functional State (NFSR) register. This bit is cleared when the register is read."]
745 #[inline(always)]
746 pub fn usb_sd3(
747 self,
748 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbAltevReg_SPEC, crate::common::RW> {
749 crate::common::RegisterFieldBool::<4,1,0,UsbAltevReg_SPEC,crate::common::RW>::from_register(self,0)
750 }
751
752 #[doc = "End of Packet\nA valid EOP sequence was been detected on the USB. It is used when this device has initiated a Remote wake-up sequence to indicate that the Resume sequence has been acknowledged and completed by the host. This bit is cleared when the register is read."]
753 #[inline(always)]
754 pub fn usb_eop(
755 self,
756 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbAltevReg_SPEC, crate::common::RW> {
757 crate::common::RegisterFieldBool::<3,1,0,UsbAltevReg_SPEC,crate::common::RW>::from_register(self,0)
758 }
759}
760impl ::core::default::Default for UsbAltevReg {
761 #[inline(always)]
762 fn default() -> UsbAltevReg {
763 <crate::RegValueT<UsbAltevReg_SPEC> as RegisterValue<_>>::new(0)
764 }
765}
766
767#[doc(hidden)]
768#[derive(Copy, Clone, Eq, PartialEq)]
769pub struct UsbAltmskReg_SPEC;
770impl crate::sealed::RegSpec for UsbAltmskReg_SPEC {
771 type DataType = u32;
772}
773
774#[doc = "Alternate Mask Register"]
775pub type UsbAltmskReg = crate::RegValueT<UsbAltmskReg_SPEC>;
776
777impl UsbAltmskReg {
778 #[doc = "A bit set to 1 in this register enables automatic setting of the ALT bit in the MAEV register when the respective event in the ALTEV register occurs. Otherwise, setting MAEV.ALT bit is disabled.\nSame Bit Definition as ALTEV Register"]
779 #[inline(always)]
780 pub fn usb_m_resume(
781 self,
782 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbAltmskReg_SPEC, crate::common::RW> {
783 crate::common::RegisterFieldBool::<7,1,0,UsbAltmskReg_SPEC,crate::common::RW>::from_register(self,0)
784 }
785
786 #[doc = "Same Bit Definition as ALTEV Register"]
787 #[inline(always)]
788 pub fn usb_m_reset(
789 self,
790 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbAltmskReg_SPEC, crate::common::RW> {
791 crate::common::RegisterFieldBool::<6,1,0,UsbAltmskReg_SPEC,crate::common::RW>::from_register(self,0)
792 }
793
794 #[doc = "Same Bit Definition as ALTEV Register"]
795 #[inline(always)]
796 pub fn usb_m_sd5(
797 self,
798 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbAltmskReg_SPEC, crate::common::RW> {
799 crate::common::RegisterFieldBool::<5,1,0,UsbAltmskReg_SPEC,crate::common::RW>::from_register(self,0)
800 }
801
802 #[doc = "Same Bit Definition as ALTEV Register"]
803 #[inline(always)]
804 pub fn usb_m_sd3(
805 self,
806 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbAltmskReg_SPEC, crate::common::RW> {
807 crate::common::RegisterFieldBool::<4,1,0,UsbAltmskReg_SPEC,crate::common::RW>::from_register(self,0)
808 }
809
810 #[doc = "Same Bit Definition as ALTEV Register"]
811 #[inline(always)]
812 pub fn usb_m_eop(
813 self,
814 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbAltmskReg_SPEC, crate::common::RW> {
815 crate::common::RegisterFieldBool::<3,1,0,UsbAltmskReg_SPEC,crate::common::RW>::from_register(self,0)
816 }
817}
818impl ::core::default::Default for UsbAltmskReg {
819 #[inline(always)]
820 fn default() -> UsbAltmskReg {
821 <crate::RegValueT<UsbAltmskReg_SPEC> as RegisterValue<_>>::new(0)
822 }
823}
824
825#[doc(hidden)]
826#[derive(Copy, Clone, Eq, PartialEq)]
827pub struct UsbChargerCtrlReg_SPEC;
828impl crate::sealed::RegSpec for UsbChargerCtrlReg_SPEC {
829 type DataType = u32;
830}
831
832#[doc = "USB Charger Control Register"]
833pub type UsbChargerCtrlReg = crate::RegValueT<UsbChargerCtrlReg_SPEC>;
834
835impl UsbChargerCtrlReg {
836 #[doc = "0 = Disable\n1 = Enable the Idm_sink to USBm"]
837 #[inline(always)]
838 pub fn idm_sink_on(
839 self,
840 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
841 crate::common::RegisterFieldBool::<5,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
842 }
843
844 #[doc = "0 = Disable\n1 = Enable the Idp_sink to USBp"]
845 #[inline(always)]
846 pub fn idp_sink_on(
847 self,
848 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
849 crate::common::RegisterFieldBool::<4,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
850 }
851
852 #[doc = "0 = Disable\n1 = Enable Vdm_src to USBm and USB_DCP_DET status bit."]
853 #[inline(always)]
854 pub fn vdm_src_on(
855 self,
856 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
857 crate::common::RegisterFieldBool::<3,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
858 }
859
860 #[doc = "0 = Disable\n1 = Enable the Vdp_src to USB_CHG_DET status bit."]
861 #[inline(always)]
862 pub fn vdp_src_on(
863 self,
864 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
865 crate::common::RegisterFieldBool::<2,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
866 }
867
868 #[doc = "0 = Disable\n1 = Enable the Idp_src and Rdm_dwn."]
869 #[inline(always)]
870 pub fn idp_src_on(
871 self,
872 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
873 crate::common::RegisterFieldBool::<1,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
874 }
875
876 #[doc = "0 = Disable USB charger detect circuit.\n1 = Enable USB charger detect circuit."]
877 #[inline(always)]
878 pub fn usb_charge_on(
879 self,
880 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbChargerCtrlReg_SPEC, crate::common::RW> {
881 crate::common::RegisterFieldBool::<0,1,0,UsbChargerCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
882 }
883}
884impl ::core::default::Default for UsbChargerCtrlReg {
885 #[inline(always)]
886 fn default() -> UsbChargerCtrlReg {
887 <crate::RegValueT<UsbChargerCtrlReg_SPEC> as RegisterValue<_>>::new(0)
888 }
889}
890
891#[doc(hidden)]
892#[derive(Copy, Clone, Eq, PartialEq)]
893pub struct UsbChargerStatReg_SPEC;
894impl crate::sealed::RegSpec for UsbChargerStatReg_SPEC {
895 type DataType = u32;
896}
897
898#[doc = "USB Charger Status Register"]
899pub type UsbChargerStatReg = crate::RegValueT<UsbChargerStatReg_SPEC>;
900
901impl UsbChargerStatReg {
902 #[doc = "0 = USBm <2.3V\n1 = USBm >2.5V"]
903 #[inline(always)]
904 pub fn usb_dm_val2(
905 self,
906 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
907 crate::common::RegisterFieldBool::<5,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
908 }
909
910 #[doc = "0: USBp < 2.3V\n1: USBp > 2.5V"]
911 #[inline(always)]
912 pub fn usb_dp_val2(
913 self,
914 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
915 crate::common::RegisterFieldBool::<4,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
916 }
917
918 #[doc = "0 = USBm < 0.8V\n1 = USBm > 1.5V (PS2 or Proprietary Charger)"]
919 #[inline(always)]
920 pub fn usb_dm_val(
921 self,
922 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
923 crate::common::RegisterFieldBool::<3,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
924 }
925
926 #[doc = "0 = USBp < 0.8V\n1 = USBp > 1.5V"]
927 #[inline(always)]
928 pub fn usb_dp_val(
929 self,
930 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
931 crate::common::RegisterFieldBool::<2,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
932 }
933
934 #[doc = "0 = Standard downstream or nothing connected.\n1 = Charging Downstream Port (CDP) or Dedicated Charging."]
935 #[inline(always)]
936 pub fn usb_chg_det(
937 self,
938 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
939 crate::common::RegisterFieldBool::<1,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
940 }
941
942 #[doc = "0 = Charging downstream port is detected.\n1 = Dedicated charger is detected.\nControl bit VDM_SRC_ON must be set to validate this status bit.\nNote: This register shows the actual status."]
943 #[inline(always)]
944 pub fn usb_dcp_det(
945 self,
946 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbChargerStatReg_SPEC, crate::common::R> {
947 crate::common::RegisterFieldBool::<0,1,0,UsbChargerStatReg_SPEC,crate::common::R>::from_register(self,0)
948 }
949}
950impl ::core::default::Default for UsbChargerStatReg {
951 #[inline(always)]
952 fn default() -> UsbChargerStatReg {
953 <crate::RegValueT<UsbChargerStatReg_SPEC> as RegisterValue<_>>::new(0)
954 }
955}
956
957#[doc(hidden)]
958#[derive(Copy, Clone, Eq, PartialEq)]
959pub struct UsbDmaCtrlReg_SPEC;
960impl crate::sealed::RegSpec for UsbDmaCtrlReg_SPEC {
961 type DataType = u32;
962}
963
964#[doc = "USB DMA control register"]
965pub type UsbDmaCtrlReg = crate::RegValueT<UsbDmaCtrlReg_SPEC>;
966
967impl UsbDmaCtrlReg {
968 #[doc = "0 = USB DMA control off. (Normal operation)\n1 = USB_DMA on. DMA channels 0 and 1 are connected by\nUSB Endpoint according bits USB_DMA_TX and USB_DMA_RX"]
969 #[inline(always)]
970 pub fn usb_dma_en(
971 self,
972 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbDmaCtrlReg_SPEC, crate::common::RW> {
973 crate::common::RegisterFieldBool::<6,1,0,UsbDmaCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
974 }
975
976 #[doc = "000 = DMA channels 1 is connected Tx USB Endpoint 1\n001 = DMA channels 1 is connected Tx USB Endpoint 3\n010 = DMA channels 1 is connected Tx USB Endpoint 5\n100, 1xx = Reserved"]
977 #[inline(always)]
978 pub fn usb_dma_tx(
979 self,
980 ) -> crate::common::RegisterField<3, 0x7, 1, 0, u8, u8, UsbDmaCtrlReg_SPEC, crate::common::RW>
981 {
982 crate::common::RegisterField::<3,0x7,1,0,u8,u8,UsbDmaCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
983 }
984
985 #[doc = "000 = DMA channels 0 is connected Rx USB Endpoint 2\n001 = DMA channels 0 is connected Rx USB Endpoint 4\n010 = DMA channels 0 is connected Rx USB Endpoint 6\n100, 1xx = Reserved"]
986 #[inline(always)]
987 pub fn usb_dma_rx(
988 self,
989 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbDmaCtrlReg_SPEC, crate::common::RW>
990 {
991 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbDmaCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
992 }
993}
994impl ::core::default::Default for UsbDmaCtrlReg {
995 #[inline(always)]
996 fn default() -> UsbDmaCtrlReg {
997 <crate::RegValueT<UsbDmaCtrlReg_SPEC> as RegisterValue<_>>::new(0)
998 }
999}
1000
1001#[doc(hidden)]
1002#[derive(Copy, Clone, Eq, PartialEq)]
1003pub struct UsbEp0NakReg_SPEC;
1004impl crate::sealed::RegSpec for UsbEp0NakReg_SPEC {
1005 type DataType = u32;
1006}
1007
1008#[doc = "EP0 INNAK and OUTNAK Register"]
1009pub type UsbEp0NakReg = crate::RegValueT<UsbEp0NakReg_SPEC>;
1010
1011impl UsbEp0NakReg {
1012 #[doc = "End point 0 OUT NAK\nThis bit n is set to 1 when a NAK handshake is generated for an enabled address/endpoint combination (AD_EN in the FAR register is set to 1) in response to an OUT token. This bit is not set if NAK is generated as result of an overrun condition. It is cleared when the register is read."]
1013 #[inline(always)]
1014 pub fn usb_ep0_outnak(
1015 self,
1016 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbEp0NakReg_SPEC, crate::common::R> {
1017 crate::common::RegisterFieldBool::<1,1,0,UsbEp0NakReg_SPEC,crate::common::R>::from_register(self,0)
1018 }
1019
1020 #[doc = "End point 0 IN NAK\nThis bit is set to 1 when a NAK handshake is generated for an enabled address/endpoint combination (AD_EN in the FAR register is set to 1) in response to an IN token. This bit is cleared when the register is read."]
1021 #[inline(always)]
1022 pub fn usb_ep0_innak(
1023 self,
1024 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbEp0NakReg_SPEC, crate::common::R> {
1025 crate::common::RegisterFieldBool::<0,1,0,UsbEp0NakReg_SPEC,crate::common::R>::from_register(self,0)
1026 }
1027}
1028impl ::core::default::Default for UsbEp0NakReg {
1029 #[inline(always)]
1030 fn default() -> UsbEp0NakReg {
1031 <crate::RegValueT<UsbEp0NakReg_SPEC> as RegisterValue<_>>::new(0)
1032 }
1033}
1034
1035#[doc(hidden)]
1036#[derive(Copy, Clone, Eq, PartialEq)]
1037pub struct UsbEpc0Reg_SPEC;
1038impl crate::sealed::RegSpec for UsbEpc0Reg_SPEC {
1039 type DataType = u32;
1040}
1041
1042#[doc = "Endpoint Control 0 Register"]
1043pub type UsbEpc0Reg = crate::RegValueT<UsbEpc0Reg_SPEC>;
1044
1045impl UsbEpc0Reg {
1046 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\n- The transmit FIFO is enabled and an IN token is received.\n- The receive FIFO is enabled and an OUT token is received.\nNote: A SETUP token does not cause a STALL handshake to be generated when this bit is set.\nUpon transmitting the STALL handshake, the RX_LAST and the TX_DONE bits in the respective Receive/Transmit Status registers are set to 1."]
1047 #[inline(always)]
1048 pub fn usb_stall(
1049 self,
1050 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc0Reg_SPEC, crate::common::RW> {
1051 crate::common::RegisterFieldBool::<7,1,0,UsbEpc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1052 }
1053
1054 #[doc = "Default Address\nWhen set to 1, the device responds to the default address regardless of the contents of FAR6-0/EP03-0 fields. When an IN packet is transmitted for the endpoint, the DEF bit is automatically cleared to 0.\nThis bit aids in the transition from default address to assigned address. The transition from the default address 00000000000b to an address assigned during bus enumeration may not occur in the middle of the SET_ADDRESS control sequence. This is necessary to complete the control sequence. However, the address must change immediately after this sequence finishes in order to avoid errors when another control sequence immediately follows the SET_ADDRESS command.\nOn USB reset, the firmware has 10 ms for set-up, and should write 8016 to the FAR register and 0016 to the EPC0 register. On receipt of a SET_ADDRESS command, the firmware must write 4016 to the EPC0 register and (8016 or <assigned_function_address>) to the FAR register. It must then queue a zero length IN packet to complete the status phase of the SET_ADDRESS control sequence."]
1055 #[inline(always)]
1056 pub fn usb_def(
1057 self,
1058 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbEpc0Reg_SPEC, crate::common::RW> {
1059 crate::common::RegisterFieldBool::<6,1,0,UsbEpc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1060 }
1061
1062 #[doc = "Endpoint Address\nThis field holds the 4-bit Endpoint address. For Endpoint 0, these bits are hardwired to 0000b. Writing a 1 to any of the EP bits is ignored."]
1063 #[inline(always)]
1064 pub fn usb_ep(
1065 self,
1066 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc0Reg_SPEC, crate::common::R> {
1067 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc0Reg_SPEC,crate::common::R>::from_register(self,0)
1068 }
1069}
1070impl ::core::default::Default for UsbEpc0Reg {
1071 #[inline(always)]
1072 fn default() -> UsbEpc0Reg {
1073 <crate::RegValueT<UsbEpc0Reg_SPEC> as RegisterValue<_>>::new(0)
1074 }
1075}
1076
1077#[doc(hidden)]
1078#[derive(Copy, Clone, Eq, PartialEq)]
1079pub struct UsbEpc1Reg_SPEC;
1080impl crate::sealed::RegSpec for UsbEpc1Reg_SPEC {
1081 type DataType = u32;
1082}
1083
1084#[doc = "Endpoint Control Register 1"]
1085pub type UsbEpc1Reg = crate::RegValueT<UsbEpc1Reg_SPEC>;
1086
1087impl UsbEpc1Reg {
1088 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1089 #[inline(always)]
1090 pub fn usb_stall(
1091 self,
1092 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc1Reg_SPEC, crate::common::RW> {
1093 crate::common::RegisterFieldBool::<7,1,0,UsbEpc1Reg_SPEC,crate::common::RW>::from_register(self,0)
1094 }
1095
1096 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1097 #[inline(always)]
1098 pub fn usb_iso(
1099 self,
1100 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc1Reg_SPEC, crate::common::RW> {
1101 crate::common::RegisterFieldBool::<5,1,0,UsbEpc1Reg_SPEC,crate::common::RW>::from_register(self,0)
1102 }
1103
1104 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1105 #[inline(always)]
1106 pub fn usb_ep_en(
1107 self,
1108 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc1Reg_SPEC, crate::common::RW> {
1109 crate::common::RegisterFieldBool::<4,1,0,UsbEpc1Reg_SPEC,crate::common::RW>::from_register(self,0)
1110 }
1111
1112 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1113 #[inline(always)]
1114 pub fn usb_ep(
1115 self,
1116 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc1Reg_SPEC, crate::common::RW>
1117 {
1118 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc1Reg_SPEC,crate::common::RW>::from_register(self,0)
1119 }
1120}
1121impl ::core::default::Default for UsbEpc1Reg {
1122 #[inline(always)]
1123 fn default() -> UsbEpc1Reg {
1124 <crate::RegValueT<UsbEpc1Reg_SPEC> as RegisterValue<_>>::new(0)
1125 }
1126}
1127
1128#[doc(hidden)]
1129#[derive(Copy, Clone, Eq, PartialEq)]
1130pub struct UsbEpc2Reg_SPEC;
1131impl crate::sealed::RegSpec for UsbEpc2Reg_SPEC {
1132 type DataType = u32;
1133}
1134
1135#[doc = "Endpoint Control Register 2"]
1136pub type UsbEpc2Reg = crate::RegValueT<UsbEpc2Reg_SPEC>;
1137
1138impl UsbEpc2Reg {
1139 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1140 #[inline(always)]
1141 pub fn usb_stall(
1142 self,
1143 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc2Reg_SPEC, crate::common::RW> {
1144 crate::common::RegisterFieldBool::<7,1,0,UsbEpc2Reg_SPEC,crate::common::RW>::from_register(self,0)
1145 }
1146
1147 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1148 #[inline(always)]
1149 pub fn usb_iso(
1150 self,
1151 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc2Reg_SPEC, crate::common::RW> {
1152 crate::common::RegisterFieldBool::<5,1,0,UsbEpc2Reg_SPEC,crate::common::RW>::from_register(self,0)
1153 }
1154
1155 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1156 #[inline(always)]
1157 pub fn usb_ep_en(
1158 self,
1159 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc2Reg_SPEC, crate::common::RW> {
1160 crate::common::RegisterFieldBool::<4,1,0,UsbEpc2Reg_SPEC,crate::common::RW>::from_register(self,0)
1161 }
1162
1163 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1164 #[inline(always)]
1165 pub fn usb_ep(
1166 self,
1167 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc2Reg_SPEC, crate::common::RW>
1168 {
1169 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc2Reg_SPEC,crate::common::RW>::from_register(self,0)
1170 }
1171}
1172impl ::core::default::Default for UsbEpc2Reg {
1173 #[inline(always)]
1174 fn default() -> UsbEpc2Reg {
1175 <crate::RegValueT<UsbEpc2Reg_SPEC> as RegisterValue<_>>::new(0)
1176 }
1177}
1178
1179#[doc(hidden)]
1180#[derive(Copy, Clone, Eq, PartialEq)]
1181pub struct UsbEpc3Reg_SPEC;
1182impl crate::sealed::RegSpec for UsbEpc3Reg_SPEC {
1183 type DataType = u32;
1184}
1185
1186#[doc = "Endpoint Control Register 3"]
1187pub type UsbEpc3Reg = crate::RegValueT<UsbEpc3Reg_SPEC>;
1188
1189impl UsbEpc3Reg {
1190 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1191 #[inline(always)]
1192 pub fn usb_stall(
1193 self,
1194 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc3Reg_SPEC, crate::common::RW> {
1195 crate::common::RegisterFieldBool::<7,1,0,UsbEpc3Reg_SPEC,crate::common::RW>::from_register(self,0)
1196 }
1197
1198 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1199 #[inline(always)]
1200 pub fn usb_iso(
1201 self,
1202 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc3Reg_SPEC, crate::common::RW> {
1203 crate::common::RegisterFieldBool::<5,1,0,UsbEpc3Reg_SPEC,crate::common::RW>::from_register(self,0)
1204 }
1205
1206 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1207 #[inline(always)]
1208 pub fn usb_ep_en(
1209 self,
1210 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc3Reg_SPEC, crate::common::RW> {
1211 crate::common::RegisterFieldBool::<4,1,0,UsbEpc3Reg_SPEC,crate::common::RW>::from_register(self,0)
1212 }
1213
1214 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1215 #[inline(always)]
1216 pub fn usb_ep(
1217 self,
1218 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc3Reg_SPEC, crate::common::RW>
1219 {
1220 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc3Reg_SPEC,crate::common::RW>::from_register(self,0)
1221 }
1222}
1223impl ::core::default::Default for UsbEpc3Reg {
1224 #[inline(always)]
1225 fn default() -> UsbEpc3Reg {
1226 <crate::RegValueT<UsbEpc3Reg_SPEC> as RegisterValue<_>>::new(0)
1227 }
1228}
1229
1230#[doc(hidden)]
1231#[derive(Copy, Clone, Eq, PartialEq)]
1232pub struct UsbEpc4Reg_SPEC;
1233impl crate::sealed::RegSpec for UsbEpc4Reg_SPEC {
1234 type DataType = u32;
1235}
1236
1237#[doc = "Endpoint Control Register 4"]
1238pub type UsbEpc4Reg = crate::RegValueT<UsbEpc4Reg_SPEC>;
1239
1240impl UsbEpc4Reg {
1241 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1242 #[inline(always)]
1243 pub fn usb_stall(
1244 self,
1245 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc4Reg_SPEC, crate::common::RW> {
1246 crate::common::RegisterFieldBool::<7,1,0,UsbEpc4Reg_SPEC,crate::common::RW>::from_register(self,0)
1247 }
1248
1249 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1250 #[inline(always)]
1251 pub fn usb_iso(
1252 self,
1253 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc4Reg_SPEC, crate::common::RW> {
1254 crate::common::RegisterFieldBool::<5,1,0,UsbEpc4Reg_SPEC,crate::common::RW>::from_register(self,0)
1255 }
1256
1257 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1258 #[inline(always)]
1259 pub fn usb_ep_en(
1260 self,
1261 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc4Reg_SPEC, crate::common::RW> {
1262 crate::common::RegisterFieldBool::<4,1,0,UsbEpc4Reg_SPEC,crate::common::RW>::from_register(self,0)
1263 }
1264
1265 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1266 #[inline(always)]
1267 pub fn usb_ep(
1268 self,
1269 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc4Reg_SPEC, crate::common::RW>
1270 {
1271 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc4Reg_SPEC,crate::common::RW>::from_register(self,0)
1272 }
1273}
1274impl ::core::default::Default for UsbEpc4Reg {
1275 #[inline(always)]
1276 fn default() -> UsbEpc4Reg {
1277 <crate::RegValueT<UsbEpc4Reg_SPEC> as RegisterValue<_>>::new(0)
1278 }
1279}
1280
1281#[doc(hidden)]
1282#[derive(Copy, Clone, Eq, PartialEq)]
1283pub struct UsbEpc5Reg_SPEC;
1284impl crate::sealed::RegSpec for UsbEpc5Reg_SPEC {
1285 type DataType = u32;
1286}
1287
1288#[doc = "Endpoint Control Register 5"]
1289pub type UsbEpc5Reg = crate::RegValueT<UsbEpc5Reg_SPEC>;
1290
1291impl UsbEpc5Reg {
1292 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1293 #[inline(always)]
1294 pub fn usb_stall(
1295 self,
1296 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc5Reg_SPEC, crate::common::RW> {
1297 crate::common::RegisterFieldBool::<7,1,0,UsbEpc5Reg_SPEC,crate::common::RW>::from_register(self,0)
1298 }
1299
1300 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1301 #[inline(always)]
1302 pub fn usb_iso(
1303 self,
1304 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc5Reg_SPEC, crate::common::RW> {
1305 crate::common::RegisterFieldBool::<5,1,0,UsbEpc5Reg_SPEC,crate::common::RW>::from_register(self,0)
1306 }
1307
1308 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1309 #[inline(always)]
1310 pub fn usb_ep_en(
1311 self,
1312 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc5Reg_SPEC, crate::common::RW> {
1313 crate::common::RegisterFieldBool::<4,1,0,UsbEpc5Reg_SPEC,crate::common::RW>::from_register(self,0)
1314 }
1315
1316 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1317 #[inline(always)]
1318 pub fn usb_ep(
1319 self,
1320 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc5Reg_SPEC, crate::common::RW>
1321 {
1322 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc5Reg_SPEC,crate::common::RW>::from_register(self,0)
1323 }
1324}
1325impl ::core::default::Default for UsbEpc5Reg {
1326 #[inline(always)]
1327 fn default() -> UsbEpc5Reg {
1328 <crate::RegValueT<UsbEpc5Reg_SPEC> as RegisterValue<_>>::new(0)
1329 }
1330}
1331
1332#[doc(hidden)]
1333#[derive(Copy, Clone, Eq, PartialEq)]
1334pub struct UsbEpc6Reg_SPEC;
1335impl crate::sealed::RegSpec for UsbEpc6Reg_SPEC {
1336 type DataType = u32;
1337}
1338
1339#[doc = "Endpoint Control Register 6"]
1340pub type UsbEpc6Reg = crate::RegValueT<UsbEpc6Reg_SPEC>;
1341
1342impl UsbEpc6Reg {
1343 #[doc = "Stall\nSetting this bit to 1 causes the chip to generate STALL handshakes under the following conditions:\nThe transmit FIFO is enabled and an IN token is received.\nThe receive FIFO is enabled and an OUT token is received.\nSetting this bit to 1 does not generate a STALL handshake in response to a SETUP token"]
1344 #[inline(always)]
1345 pub fn usb_stall(
1346 self,
1347 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbEpc6Reg_SPEC, crate::common::RW> {
1348 crate::common::RegisterFieldBool::<7,1,0,UsbEpc6Reg_SPEC,crate::common::RW>::from_register(self,0)
1349 }
1350
1351 #[doc = "Isochronous\nWhen this bit is set to 1, the endpoint is isochronous. This implies that no NAK is sent if the endpoint is not ready but enabled; i.e. If an IN token is received and no data is available in the FIFO to transmit, or if an OUT token is received and the FIFO is full since there is no USB handshake for isochronous transfers."]
1352 #[inline(always)]
1353 pub fn usb_iso(
1354 self,
1355 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbEpc6Reg_SPEC, crate::common::RW> {
1356 crate::common::RegisterFieldBool::<5,1,0,UsbEpc6Reg_SPEC,crate::common::RW>::from_register(self,0)
1357 }
1358
1359 #[doc = "Endpoint Enable\nWhen this bit is set to 1, the EP\\[3:0\\] field is used in address comparison, together with the AD\\[6:0\\] field in the FAR register. When cleared to 0, the endpoint does not respond to any token on the USB bus."]
1360 #[inline(always)]
1361 pub fn usb_ep_en(
1362 self,
1363 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbEpc6Reg_SPEC, crate::common::RW> {
1364 crate::common::RegisterFieldBool::<4,1,0,UsbEpc6Reg_SPEC,crate::common::RW>::from_register(self,0)
1365 }
1366
1367 #[doc = "Endpoint Address\nThis 4-bit field holds the endpoint address."]
1368 #[inline(always)]
1369 pub fn usb_ep(
1370 self,
1371 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbEpc6Reg_SPEC, crate::common::RW>
1372 {
1373 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbEpc6Reg_SPEC,crate::common::RW>::from_register(self,0)
1374 }
1375}
1376impl ::core::default::Default for UsbEpc6Reg {
1377 #[inline(always)]
1378 fn default() -> UsbEpc6Reg {
1379 <crate::RegValueT<UsbEpc6Reg_SPEC> as RegisterValue<_>>::new(0)
1380 }
1381}
1382
1383#[doc(hidden)]
1384#[derive(Copy, Clone, Eq, PartialEq)]
1385pub struct UsbFarReg_SPEC;
1386impl crate::sealed::RegSpec for UsbFarReg_SPEC {
1387 type DataType = u32;
1388}
1389
1390#[doc = "Function Address Register"]
1391pub type UsbFarReg = crate::RegValueT<UsbFarReg_SPEC>;
1392
1393impl UsbFarReg {
1394 #[doc = "Address Enable\nWhen set to 1, USB address field bits 6-0 are used in address comparison\nWhen cleared to 0, the device does not respond to any token on the USB bus.\nNote: If the DEF bit in the Endpoint Control 0 register is set, Endpoint 0 responds to the default address."]
1395 #[inline(always)]
1396 pub fn usb_ad_en(
1397 self,
1398 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbFarReg_SPEC, crate::common::RW> {
1399 crate::common::RegisterFieldBool::<7,1,0,UsbFarReg_SPEC,crate::common::RW>::from_register(self,0)
1400 }
1401
1402 #[doc = "Address\nThis field holds the 7-bit function address used to transmit and receive all tokens addressed to this device."]
1403 #[inline(always)]
1404 pub fn usb_ad(
1405 self,
1406 ) -> crate::common::RegisterField<0, 0x7f, 1, 0, u8, u8, UsbFarReg_SPEC, crate::common::RW>
1407 {
1408 crate::common::RegisterField::<0,0x7f,1,0,u8,u8,UsbFarReg_SPEC,crate::common::RW>::from_register(self,0)
1409 }
1410}
1411impl ::core::default::Default for UsbFarReg {
1412 #[inline(always)]
1413 fn default() -> UsbFarReg {
1414 <crate::RegValueT<UsbFarReg_SPEC> as RegisterValue<_>>::new(0)
1415 }
1416}
1417
1418#[doc(hidden)]
1419#[derive(Copy, Clone, Eq, PartialEq)]
1420pub struct UsbFnhReg_SPEC;
1421impl crate::sealed::RegSpec for UsbFnhReg_SPEC {
1422 type DataType = u32;
1423}
1424
1425#[doc = "Frame Number High Byte Register"]
1426pub type UsbFnhReg = crate::RegValueT<UsbFnhReg_SPEC>;
1427
1428impl UsbFnhReg {
1429 #[doc = "Missed SOF Flag\nThis flag is set to 1, when the frame number in a valid received SOF does not match the expected next value, or when an SOF is not received within 12060 bit times. This bit is set by the hardware and is cleared by reading the FNH register."]
1430 #[inline(always)]
1431 pub fn usb_mf(
1432 self,
1433 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbFnhReg_SPEC, crate::common::R> {
1434 crate::common::RegisterFieldBool::<7, 1, 0, UsbFnhReg_SPEC, crate::common::R>::from_register(
1435 self, 0,
1436 )
1437 }
1438
1439 #[doc = "Unlock Flag\nThis bit indicates that at least two frames were received without an expected frame number, or that no valid SOF was received within 12060 bit times. If this bit is set, the frame number from the next valid SOF packet is loaded in FN. This bit is set by the hardware and is cleared by reading the FNH register."]
1440 #[inline(always)]
1441 pub fn usb_ul(
1442 self,
1443 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbFnhReg_SPEC, crate::common::R> {
1444 crate::common::RegisterFieldBool::<6, 1, 0, UsbFnhReg_SPEC, crate::common::R>::from_register(
1445 self, 0,
1446 )
1447 }
1448
1449 #[doc = "Reset Frame Count\nWriting a 1 to this bit resets the frame number to 00016, after which this bit clears itself to 0 again. This bit always reads 0."]
1450 #[inline(always)]
1451 pub fn usb_rfc(
1452 self,
1453 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbFnhReg_SPEC, crate::common::R> {
1454 crate::common::RegisterFieldBool::<5, 1, 0, UsbFnhReg_SPEC, crate::common::R>::from_register(
1455 self, 0,
1456 )
1457 }
1458
1459 #[doc = "Frame Number\nThis 3-bit field contains the three most significant bits (MSB) of the current frame number, received in the last SOF packet. If a valid frame number is not received within 12060 bit times (Frame Length Maximum, FLMAX, with tolerance) of the previous change, the frame number is incremented artificially. If two successive frames are missed or are incorrect, the current FN is frozen and loaded with the next frame number from a valid SOF packet.\nIf the frame number low byte was read by firmware before reading the FNH register, the user actually reads the contents of a buffer register which holds the value of the three frame number bits of this register when the low byte was read. Therefore, the correct sequence to read the frame number is: FNL, FNH. Read operations to the FNH register, without first reading the Frame Number Low Byte (FNL) register directly, read the actual value of the three MSBs of the frame number."]
1460 #[inline(always)]
1461 pub fn usb_fn_10_8(
1462 self,
1463 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbFnhReg_SPEC, crate::common::R> {
1464 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbFnhReg_SPEC,crate::common::R>::from_register(self,0)
1465 }
1466}
1467impl ::core::default::Default for UsbFnhReg {
1468 #[inline(always)]
1469 fn default() -> UsbFnhReg {
1470 <crate::RegValueT<UsbFnhReg_SPEC> as RegisterValue<_>>::new(192)
1471 }
1472}
1473
1474#[doc(hidden)]
1475#[derive(Copy, Clone, Eq, PartialEq)]
1476pub struct UsbFnlReg_SPEC;
1477impl crate::sealed::RegSpec for UsbFnlReg_SPEC {
1478 type DataType = u32;
1479}
1480
1481#[doc = "Frame Number Low Byte Register"]
1482pub type UsbFnlReg = crate::RegValueT<UsbFnlReg_SPEC>;
1483
1484impl UsbFnlReg {
1485 #[doc = "The Frame Number Low Byte Register holds the low byte of the frame number. To ensure consistency, reading this low byte causes the three frame number bits in the FNH register to be locked until this register is read. The correct sequence to read the frame number is: FNL, FNH."]
1486 #[inline(always)]
1487 pub fn usb_fn(
1488 self,
1489 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbFnlReg_SPEC, crate::common::R> {
1490 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbFnlReg_SPEC,crate::common::R>::from_register(self,0)
1491 }
1492}
1493impl ::core::default::Default for UsbFnlReg {
1494 #[inline(always)]
1495 fn default() -> UsbFnlReg {
1496 <crate::RegValueT<UsbFnlReg_SPEC> as RegisterValue<_>>::new(0)
1497 }
1498}
1499
1500#[doc(hidden)]
1501#[derive(Copy, Clone, Eq, PartialEq)]
1502pub struct UsbFwevReg_SPEC;
1503impl crate::sealed::RegSpec for UsbFwevReg_SPEC {
1504 type DataType = u32;
1505}
1506
1507#[doc = "FIFO Warning Event Register"]
1508pub type UsbFwevReg = crate::RegValueT<UsbFwevReg_SPEC>;
1509
1510impl UsbFwevReg {
1511 #[doc = "Receive Warning n: 3:1\nThe bit n is set to 1 when the respective receive endpoint FIFO reaches the warning limit, as specified by the RFWL bits of the respective EPCx register. This bit is cleared when the warning condition is cleared by either reading data from the FIFO or when the FIFO is flushed."]
1512 #[inline(always)]
1513 pub fn usb_rxwarn31(
1514 self,
1515 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbFwevReg_SPEC, crate::common::R> {
1516 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbFwevReg_SPEC,crate::common::R>::from_register(self,0)
1517 }
1518
1519 #[doc = "Transmit Warning n: 3:1\nThe bit n is set to 1 when the respective transmit endpoint FIFO reaches the warning limit, as specified by the TFWL bits of the respective TXCn register, and transmission from the respective endpoint is enabled. This bit is cleared when the warning condition is cleared by either writing new data to the FIFO when the FIFO is flushed, or when transmission is done, as indicated by the TX_DONE bit in the TXSn register."]
1520 #[inline(always)]
1521 pub fn usb_txwarn31(
1522 self,
1523 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbFwevReg_SPEC, crate::common::R> {
1524 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbFwevReg_SPEC,crate::common::R>::from_register(self,0)
1525 }
1526}
1527impl ::core::default::Default for UsbFwevReg {
1528 #[inline(always)]
1529 fn default() -> UsbFwevReg {
1530 <crate::RegValueT<UsbFwevReg_SPEC> as RegisterValue<_>>::new(0)
1531 }
1532}
1533
1534#[doc(hidden)]
1535#[derive(Copy, Clone, Eq, PartialEq)]
1536pub struct UsbFwmskReg_SPEC;
1537impl crate::sealed::RegSpec for UsbFwmskReg_SPEC {
1538 type DataType = u32;
1539}
1540
1541#[doc = "FIFO Warning Mask Register"]
1542pub type UsbFwmskReg = crate::RegValueT<UsbFwmskReg_SPEC>;
1543
1544impl UsbFwmskReg {
1545 #[doc = "The FIFO Warning Mask Register selects, which FWEV bits are reported in the MAEV register. A bit set to 1 and the corresponding bit in the FWEV register is set 1, causes the WARN bit in the MAEV register to be set to 1. When cleared to 0, the corresponding bit in the FWEV register does not cause WARN to be set to 1. Same Bit Definition as FWEV Register"]
1546 #[inline(always)]
1547 pub fn usb_m_rxwarn31(
1548 self,
1549 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbFwmskReg_SPEC, crate::common::RW>
1550 {
1551 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbFwmskReg_SPEC,crate::common::RW>::from_register(self,0)
1552 }
1553
1554 #[doc = "The FIFO Warning Mask Register selects, which FWEV bits are reported in the MAEV register. A bit set to 1 and the corresponding bit in the FWEV register is set 1, causes the WARN bit in the MAEV register to be set to 1. When cleared to 0, the corresponding bit in the FWEV register does not cause WARN to be set to 1. Same Bit Definition as FWEV Register"]
1555 #[inline(always)]
1556 pub fn usb_m_txwarn31(
1557 self,
1558 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbFwmskReg_SPEC, crate::common::RW>
1559 {
1560 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbFwmskReg_SPEC,crate::common::RW>::from_register(self,0)
1561 }
1562}
1563impl ::core::default::Default for UsbFwmskReg {
1564 #[inline(always)]
1565 fn default() -> UsbFwmskReg {
1566 <crate::RegValueT<UsbFwmskReg_SPEC> as RegisterValue<_>>::new(0)
1567 }
1568}
1569
1570#[doc(hidden)]
1571#[derive(Copy, Clone, Eq, PartialEq)]
1572pub struct UsbMaevReg_SPEC;
1573impl crate::sealed::RegSpec for UsbMaevReg_SPEC {
1574 type DataType = u32;
1575}
1576
1577#[doc = "Main Event Register"]
1578pub type UsbMaevReg = crate::RegValueT<UsbMaevReg_SPEC>;
1579
1580impl UsbMaevReg {
1581 #[doc = "USB Charger event\nThis bit is set if one of the bits in USB_CHARGER_STAT_REG\\[2-0\\] change. This bit is cleared to 0 when if USB_CHARGER_STAT_REG is read."]
1582 #[inline(always)]
1583 pub fn usb_ch_ev(
1584 self,
1585 ) -> crate::common::RegisterFieldBool<11, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1586 crate::common::RegisterFieldBool::<11,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1587 }
1588
1589 #[doc = "Endpoint 0 NAK Event\nThis bit is an OR of EP0_NAK_REG\\[EP0_OUTNAK\\] and EP0_NAK_REG\\[EP0_INNAK\\] bits. USB_EP0_NAK is cleared to 0 when EP0_NAK_REG is read."]
1590 #[inline(always)]
1591 pub fn usb_ep0_nak(
1592 self,
1593 ) -> crate::common::RegisterFieldBool<10, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1594 crate::common::RegisterFieldBool::<10,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1595 }
1596
1597 #[doc = "Endpoint 0 Receive Event\nThis bit is a copy of the RXS0\\[RX_LAST\\] and is cleared to 0 when this RXS0 register is read.\nNote: Since Endpoint 0 implements a store and forward principle, an overrun condition for FIFO0 cannot occur"]
1598 #[inline(always)]
1599 pub fn usb_ep0_rx(
1600 self,
1601 ) -> crate::common::RegisterFieldBool<9, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1602 crate::common::RegisterFieldBool::<9,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1603 }
1604
1605 #[doc = "Endpoint 0 Transmit Event\nThis bit is a copy of the TXS0\\[TX_DONE\\] bit and is cleared to 0 when the TXS0 register is read.\nNote: Since Endpoint 0 implements a store and forward principle, an underrun condition for FIFO0 cannot occur."]
1606 #[inline(always)]
1607 pub fn usb_ep0_tx(
1608 self,
1609 ) -> crate::common::RegisterFieldBool<8, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1610 crate::common::RegisterFieldBool::<8,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1611 }
1612
1613 #[doc = "Master Interrupt Enable\nThis bit is hardwired to 0 in the Main Event (MAEV) register; bit 7 in the Main Mask (MAMSK) register is the Master Interrupt Enable."]
1614 #[inline(always)]
1615 pub fn usb_intr(
1616 self,
1617 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1618 crate::common::RegisterFieldBool::<7,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1619 }
1620
1621 #[doc = "Receive Event\nThis bit is set to 1 if any of the unmasked bits in the Receive Event (RXEV) register is set to 1. It indicates that a SETUP or OUT transaction has been completed. This bit is cleared to 0 when all of the RX_LAST bits in each Receive Status (RXSn) register and all RXOVRRN bits in the RXEV register are cleared to 0."]
1622 #[inline(always)]
1623 pub fn usb_rx_ev(
1624 self,
1625 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1626 crate::common::RegisterFieldBool::<6,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1627 }
1628
1629 #[doc = "Unlocked/Locked Detected\nThis bit is set to 1, when the frame timer has either entered unlocked condition from a locked condition, or has re-entered a locked condition from an unlocked condition as determined by the UL bit in the Frame Number (FNH or FNL) register. This bit is cleared to 0 when the register is read."]
1630 #[inline(always)]
1631 pub fn usb_uld(
1632 self,
1633 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1634 crate::common::RegisterFieldBool::<5,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1635 }
1636
1637 #[doc = "Negative Acknowledge Event\nThis bit indicates that one of the unmasked NAK Event (NAKEV) register bits has been set to 1. This bit is cleared to 0 when the NAKEV register is read."]
1638 #[inline(always)]
1639 pub fn usb_nak(
1640 self,
1641 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1642 crate::common::RegisterFieldBool::<4,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1643 }
1644
1645 #[doc = "Frame Event\nThis bit is set to 1, if the frame counter is updated with a new value. This can be due to the receipt of a valid SOF packet on the USB or to an artificial update if the frame counter was unlocked or a frame was missed. This bit is cleared to 0 when the register is read."]
1646 #[inline(always)]
1647 pub fn usb_frame(
1648 self,
1649 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1650 crate::common::RegisterFieldBool::<3,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1651 }
1652
1653 #[doc = "Transmit Event\nThis bit is set to 1, if any of the unmasked bits in the Transmit Event (TXEV) register (TXFIFOn or TXUNDRNn) is set to 1. Therefore, it indicates that an IN transaction has been completed. This bit is cleared to 0 when all the TX_DONE bits and the TXUNDRN bits in each Transmit Status (TXSn) register are cleared to 0."]
1654 #[inline(always)]
1655 pub fn usb_tx_ev(
1656 self,
1657 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1658 crate::common::RegisterFieldBool::<2,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1659 }
1660
1661 #[doc = "Alternate Event\nThis bit indicates that one of the unmasked ALTEV register bits has been set to 1. This bit is cleared to 0 by reading the ALTEV register."]
1662 #[inline(always)]
1663 pub fn usb_alt(
1664 self,
1665 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1666 crate::common::RegisterFieldBool::<1,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1667 }
1668
1669 #[doc = "Warning Event\nThis bit indicates that one of the unmasked bits in the FIFO Warning Event (FWEV) register has been set to 1. This bit is cleared to 0 by reading the FWEV register."]
1670 #[inline(always)]
1671 pub fn usb_warn(
1672 self,
1673 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbMaevReg_SPEC, crate::common::RW> {
1674 crate::common::RegisterFieldBool::<0,1,0,UsbMaevReg_SPEC,crate::common::RW>::from_register(self,0)
1675 }
1676}
1677impl ::core::default::Default for UsbMaevReg {
1678 #[inline(always)]
1679 fn default() -> UsbMaevReg {
1680 <crate::RegValueT<UsbMaevReg_SPEC> as RegisterValue<_>>::new(0)
1681 }
1682}
1683
1684#[doc(hidden)]
1685#[derive(Copy, Clone, Eq, PartialEq)]
1686pub struct UsbMamskReg_SPEC;
1687impl crate::sealed::RegSpec for UsbMamskReg_SPEC {
1688 type DataType = u32;
1689}
1690
1691#[doc = "Main Mask Register"]
1692pub type UsbMamskReg = crate::RegValueT<UsbMamskReg_SPEC>;
1693
1694impl UsbMamskReg {
1695 #[doc = "The Main Mask Register masks out events reported in the MAEV registers. A bit set to 1, enables the interrupts for the respective event in the MAEV register. If the corresponding bit is cleared to 0, interrupt generation for this event is disabled. Same Bit Definition as MAEV Register"]
1696 #[inline(always)]
1697 pub fn usb_m_ch_ev(
1698 self,
1699 ) -> crate::common::RegisterFieldBool<11, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1700 crate::common::RegisterFieldBool::<11,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1701 }
1702
1703 #[doc = "Same Bit Definition as MAEV Register"]
1704 #[inline(always)]
1705 pub fn usb_m_ep0_nak(
1706 self,
1707 ) -> crate::common::RegisterFieldBool<10, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1708 crate::common::RegisterFieldBool::<10,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1709 }
1710
1711 #[doc = "Same Bit Definition as MAEV Register"]
1712 #[inline(always)]
1713 pub fn usb_m_ep0_rx(
1714 self,
1715 ) -> crate::common::RegisterFieldBool<9, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1716 crate::common::RegisterFieldBool::<9,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1717 }
1718
1719 #[doc = "Same Bit Definition as MAEV Register"]
1720 #[inline(always)]
1721 pub fn usb_m_ep0_tx(
1722 self,
1723 ) -> crate::common::RegisterFieldBool<8, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1724 crate::common::RegisterFieldBool::<8,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1725 }
1726
1727 #[doc = "Same Bit Definition as MAEV Register"]
1728 #[inline(always)]
1729 pub fn usb_m_intr(
1730 self,
1731 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1732 crate::common::RegisterFieldBool::<7,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1733 }
1734
1735 #[doc = "Same Bit Definition as MAEV Register"]
1736 #[inline(always)]
1737 pub fn usb_m_rx_ev(
1738 self,
1739 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1740 crate::common::RegisterFieldBool::<6,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1741 }
1742
1743 #[doc = "Same Bit Definition as MAEV Register"]
1744 #[inline(always)]
1745 pub fn usb_m_uld(
1746 self,
1747 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1748 crate::common::RegisterFieldBool::<5,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1749 }
1750
1751 #[doc = "Same Bit Definition as MAEV Register"]
1752 #[inline(always)]
1753 pub fn usb_m_nak(
1754 self,
1755 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1756 crate::common::RegisterFieldBool::<4,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1757 }
1758
1759 #[doc = "Same Bit Definition as MAEV Register"]
1760 #[inline(always)]
1761 pub fn usb_m_frame(
1762 self,
1763 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1764 crate::common::RegisterFieldBool::<3,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1765 }
1766
1767 #[doc = "Same Bit Definition as MAEV Register"]
1768 #[inline(always)]
1769 pub fn usb_m_tx_ev(
1770 self,
1771 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1772 crate::common::RegisterFieldBool::<2,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1773 }
1774
1775 #[doc = "Same Bit Definition as MAEV Register"]
1776 #[inline(always)]
1777 pub fn usb_m_alt(
1778 self,
1779 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1780 crate::common::RegisterFieldBool::<1,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1781 }
1782
1783 #[doc = "Same Bit Definition as MAEV Register"]
1784 #[inline(always)]
1785 pub fn usb_m_warn(
1786 self,
1787 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbMamskReg_SPEC, crate::common::RW> {
1788 crate::common::RegisterFieldBool::<0,1,0,UsbMamskReg_SPEC,crate::common::RW>::from_register(self,0)
1789 }
1790}
1791impl ::core::default::Default for UsbMamskReg {
1792 #[inline(always)]
1793 fn default() -> UsbMamskReg {
1794 <crate::RegValueT<UsbMamskReg_SPEC> as RegisterValue<_>>::new(0)
1795 }
1796}
1797
1798#[doc(hidden)]
1799#[derive(Copy, Clone, Eq, PartialEq)]
1800pub struct UsbMctrlReg_SPEC;
1801impl crate::sealed::RegSpec for UsbMctrlReg_SPEC {
1802 type DataType = u32;
1803}
1804
1805#[doc = "Main Control Register)"]
1806pub type UsbMctrlReg = crate::RegValueT<UsbMctrlReg_SPEC>;
1807
1808impl UsbMctrlReg {
1809 #[doc = "Low Speed Mode\nThis bit enables USB 1.5 Mbit/s low speed and swaps D+ and D- pull-up resistors. Changing speed may only be done if USBEN is set to 0.\nAlso D+ and D- rise and fall times are adjusted according to the USB specification."]
1810 #[inline(always)]
1811 pub fn lsmode(
1812 self,
1813 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbMctrlReg_SPEC, crate::common::RW> {
1814 crate::common::RegisterFieldBool::<4,1,0,UsbMctrlReg_SPEC,crate::common::RW>::from_register(self,0)
1815 }
1816
1817 #[doc = "Node Attached\nThis bit indicates that this node is ready to be detected as attached to USB. When cleared to 0 the transceiver forces SE0 on the USB port to prevent the hub (to which this node is connected to) from detecting an attach event. After reset or when the USB node is disabled, this bit is cleared to 0 to give the device time before it must respond to commands. After this bit has been set to 1, the device no longer drives the USB and should be ready to receive Reset signalling from the hub.\nNote: This bit can only be set is USBEN is \'1\'"]
1818 #[inline(always)]
1819 pub fn usb_nat(
1820 self,
1821 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbMctrlReg_SPEC, crate::common::RW> {
1822 crate::common::RegisterFieldBool::<3,1,0,UsbMctrlReg_SPEC,crate::common::RW>::from_register(self,0)
1823 }
1824
1825 #[doc = "Debug Mode.\nWhen this bit is set, the following registers are writable: Main Event (MAEV), Alternate Event (ALTEV), NAK Event (NAKEV), Transmit Status and Receive Status. Setting the DBG bit forces the node into a locked state. The node states can be read out of the transceiver diagnostic register (XCVDIAG) at location 0xFF6802 by setting the DIAG bit in the Test Control register (UTR).\nNote: The operation of CoR bits is not effected by entering Debug mode) Note: This bit can only be set is USBEN is \'1\'"]
1826 #[inline(always)]
1827 pub fn usb_dbg(
1828 self,
1829 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbMctrlReg_SPEC, crate::common::RW> {
1830 crate::common::RegisterFieldBool::<1,1,0,UsbMctrlReg_SPEC,crate::common::RW>::from_register(self,0)
1831 }
1832
1833 #[doc = "USB EnableSetting this bit to 1 enables the Full/Low Speed USB node. If the USBEN bit is cleared to 0, the USB is disabled and the 48 MHz clock within the USB node is stopped. In addition, all USB registers are set to their reset state.\nNote that the transceiver forces SE0 on the bus to prevent the hub to detected the USB node, when it is disabled (not attached).\nThe USBEN bit is cleared to 0 after reset"]
1834 #[inline(always)]
1835 pub fn usben(
1836 self,
1837 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbMctrlReg_SPEC, crate::common::RW> {
1838 crate::common::RegisterFieldBool::<0,1,0,UsbMctrlReg_SPEC,crate::common::RW>::from_register(self,0)
1839 }
1840}
1841impl ::core::default::Default for UsbMctrlReg {
1842 #[inline(always)]
1843 fn default() -> UsbMctrlReg {
1844 <crate::RegValueT<UsbMctrlReg_SPEC> as RegisterValue<_>>::new(0)
1845 }
1846}
1847
1848#[doc(hidden)]
1849#[derive(Copy, Clone, Eq, PartialEq)]
1850pub struct UsbNakevReg_SPEC;
1851impl crate::sealed::RegSpec for UsbNakevReg_SPEC {
1852 type DataType = u32;
1853}
1854
1855#[doc = "NAK Event Register"]
1856pub type UsbNakevReg = crate::RegValueT<UsbNakevReg_SPEC>;
1857
1858impl UsbNakevReg {
1859 #[doc = "OUT n: 3:1\nThe bit n is set to 1 when a NAK handshake is generated for an enabled address/endpoint combination (AD_EN in the FAR register is set to 1 and EP_EN in the EPCx register is set to 1) in response to an OUT token. This bit is not set if NAK is generated as result of an overrun condition. It is cleared when the register is read."]
1860 #[inline(always)]
1861 pub fn usb_out31(
1862 self,
1863 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbNakevReg_SPEC, crate::common::R>
1864 {
1865 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbNakevReg_SPEC,crate::common::R>::from_register(self,0)
1866 }
1867
1868 #[doc = "IN n: 3:1\nThe bit n is set to 1 when a NAK handshake is generated for an enabled address/endpoint combination (AD_EN in the Function Address, FAR, register is set to 1 and EP_EN in the Endpoint Control, EPCx, register is set to 1) in response to an IN token. This bit is cleared when the register is read."]
1869 #[inline(always)]
1870 pub fn usb_in31(
1871 self,
1872 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbNakevReg_SPEC, crate::common::R>
1873 {
1874 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbNakevReg_SPEC,crate::common::R>::from_register(self,0)
1875 }
1876}
1877impl ::core::default::Default for UsbNakevReg {
1878 #[inline(always)]
1879 fn default() -> UsbNakevReg {
1880 <crate::RegValueT<UsbNakevReg_SPEC> as RegisterValue<_>>::new(0)
1881 }
1882}
1883
1884#[doc(hidden)]
1885#[derive(Copy, Clone, Eq, PartialEq)]
1886pub struct UsbNakmskReg_SPEC;
1887impl crate::sealed::RegSpec for UsbNakmskReg_SPEC {
1888 type DataType = u32;
1889}
1890
1891#[doc = "NAK Mask Register"]
1892pub type UsbNakmskReg = crate::RegValueT<UsbNakmskReg_SPEC>;
1893
1894impl UsbNakmskReg {
1895 #[doc = "When set and the corresponding bit in the NAKEV register is set, the NAK bit in the MAEV register is set. When cleared, the corresponding bit in the NAKEV register does not cause NAK to be set. Same Bit Definition as NAKEV Register"]
1896 #[inline(always)]
1897 pub fn usb_m_out31(
1898 self,
1899 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbNakmskReg_SPEC, crate::common::RW>
1900 {
1901 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbNakmskReg_SPEC,crate::common::RW>::from_register(self,0)
1902 }
1903
1904 #[doc = "Same Bit Definition as NAKEV Register"]
1905 #[inline(always)]
1906 pub fn usb_m_in31(
1907 self,
1908 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbNakmskReg_SPEC, crate::common::RW>
1909 {
1910 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbNakmskReg_SPEC,crate::common::RW>::from_register(self,0)
1911 }
1912}
1913impl ::core::default::Default for UsbNakmskReg {
1914 #[inline(always)]
1915 fn default() -> UsbNakmskReg {
1916 <crate::RegValueT<UsbNakmskReg_SPEC> as RegisterValue<_>>::new(0)
1917 }
1918}
1919
1920#[doc(hidden)]
1921#[derive(Copy, Clone, Eq, PartialEq)]
1922pub struct UsbNfsrReg_SPEC;
1923impl crate::sealed::RegSpec for UsbNfsrReg_SPEC {
1924 type DataType = u32;
1925}
1926
1927#[doc = "Node Functional State Register"]
1928pub type UsbNfsrReg = crate::RegValueT<UsbNfsrReg_SPEC>;
1929
1930impl UsbNfsrReg {
1931 #[doc = "The Node Functional State Register reports and controls the current functional state of the USB node.\n00: NodeReset.\nThis is the USB Reset state. This is entered upon a module reset or by software upon detection of a USB Reset. Upon entry, all endpoint pipes are disabled. DEF in the Endpoint Control 0 (EPC0) register and AD_EN in the Function Address (FAR) register should be cleared by software on entry to this state. On exit, DEF should be reset so the device responds to the default address.\n01: NodeResume\nIn this state, resume signalling is generated. This state should be entered by firmware to initiate a remote wake-up sequence by the device. The node must remain in this state for at least 1 ms and no more than 15 ms.\n10: NodeOperational\nThis is the normal operational state. In this state the node is configured for operation on the USB bus.\n11: NodeSuspend\nSuspend state should be entered by firmware on detection of a Suspend event while in Operational state. While in Suspend state, the transceivers operate in their low-power suspend mode. All endpoint controllers and the bits TX_EN, LAST and RX_EN are reset, while all other internal states are frozen. On detection of bus activity, the RESUME bit in the ALTEV register is set. In response, software can cause entry to NodeOperational state."]
1932 #[inline(always)]
1933 pub fn usb_nfs(
1934 self,
1935 ) -> crate::common::RegisterField<0, 0x3, 1, 0, u8, u8, UsbNfsrReg_SPEC, crate::common::RW>
1936 {
1937 crate::common::RegisterField::<0,0x3,1,0,u8,u8,UsbNfsrReg_SPEC,crate::common::RW>::from_register(self,0)
1938 }
1939}
1940impl ::core::default::Default for UsbNfsrReg {
1941 #[inline(always)]
1942 fn default() -> UsbNfsrReg {
1943 <crate::RegValueT<UsbNfsrReg_SPEC> as RegisterValue<_>>::new(0)
1944 }
1945}
1946
1947#[doc(hidden)]
1948#[derive(Copy, Clone, Eq, PartialEq)]
1949pub struct UsbRxc0Reg_SPEC;
1950impl crate::sealed::RegSpec for UsbRxc0Reg_SPEC {
1951 type DataType = u32;
1952}
1953
1954#[doc = "Receive Command 0 Register"]
1955pub type UsbRxc0Reg = crate::RegValueT<UsbRxc0Reg_SPEC>;
1956
1957impl UsbRxc0Reg {
1958 #[doc = "Flush\nWriting a 1 to this bit flushes all data from the control endpoint FIFOs, resets the endpoint to Idle state, clears the FIFO read and write pointer, and then clears itself. If the endpoint is currently using FIFO0 to transfer data on USB, flushing is delayed until after the transfer is done. This bit is cleared to 0 on reset. This bit is equivalent to FLUSH in the TXC0 register."]
1959 #[inline(always)]
1960 pub fn usb_flush(
1961 self,
1962 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbRxc0Reg_SPEC, crate::common::RW> {
1963 crate::common::RegisterFieldBool::<3,1,0,UsbRxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1964 }
1965
1966 #[doc = "Ignore SETUP Tokens\nWhen this bit is set to 1, the endpoint ignores any SETUP tokens directed to its configured address."]
1967 #[inline(always)]
1968 pub fn usb_ign_setup(
1969 self,
1970 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbRxc0Reg_SPEC, crate::common::RW> {
1971 crate::common::RegisterFieldBool::<2,1,0,UsbRxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1972 }
1973
1974 #[doc = "Ignore OUT Tokens\nWhen this bit is set to 1, the endpoint ignores any OUT tokens directed to its configured address."]
1975 #[inline(always)]
1976 pub fn usb_ign_out(
1977 self,
1978 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbRxc0Reg_SPEC, crate::common::RW> {
1979 crate::common::RegisterFieldBool::<1,1,0,UsbRxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1980 }
1981
1982 #[doc = "Receive Enable\nOUT packet reception is disabled after every data packet is received, or when a STALL handshake is returned in response to an OUT token. A 1 must be written to this bit to re-enable data reception. Reception of SETUP packets is always enabled. In the case of back-to-back SETUP packets (for a given endpoint) where a valid SETUP packet is received with no other intervening non-SETUP tokens, the Endpoint Controller discards the new SETUP packet and returns an ACK handshake. If any other reasons prevent the Endpoint Controller from accepting the SETUP packet, it must not generate a handshake. This allows recovery from a condition where the ACK of the first SETUP token was lost by the host."]
1983 #[inline(always)]
1984 pub fn usb_rx_en(
1985 self,
1986 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbRxc0Reg_SPEC, crate::common::RW> {
1987 crate::common::RegisterFieldBool::<0,1,0,UsbRxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
1988 }
1989}
1990impl ::core::default::Default for UsbRxc0Reg {
1991 #[inline(always)]
1992 fn default() -> UsbRxc0Reg {
1993 <crate::RegValueT<UsbRxc0Reg_SPEC> as RegisterValue<_>>::new(0)
1994 }
1995}
1996
1997#[doc(hidden)]
1998#[derive(Copy, Clone, Eq, PartialEq)]
1999pub struct UsbRxc1Reg_SPEC;
2000impl crate::sealed::RegSpec for UsbRxc1Reg_SPEC {
2001 type DataType = u32;
2002}
2003
2004#[doc = "Receive Command Register 1"]
2005pub type UsbRxc1Reg = crate::RegValueT<UsbRxc1Reg_SPEC>;
2006
2007impl UsbRxc1Reg {
2008 #[doc = "Receive FIFO Warning Limit\nThese bits specify how many more bytes can be received to the respective FIFO before an overrun condition occurs. If the number of empty bytes remaining in the FIFO is equal to or less than the selected warning limit, the RXWARN bit in the FWEV register is set to 1.RFWL\\[1:0\\] :\n00: RFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2009 #[inline(always)]
2010 pub fn usb_rfwl(
2011 self,
2012 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbRxc1Reg_SPEC, crate::common::RW>
2013 {
2014 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbRxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2015 }
2016
2017 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding receive FIFO, resets the endpoint to Idle state, and resets both the FIFO read and write pointers. If the MAC is currently using the FIFO to receive data, flushing is delayed until after receiving is completed."]
2018 #[inline(always)]
2019 pub fn usb_flush(
2020 self,
2021 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbRxc1Reg_SPEC, crate::common::RW> {
2022 crate::common::RegisterFieldBool::<3,1,0,UsbRxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2023 }
2024
2025 #[doc = "Ignore SETUP Tokens\nWhen this bit is set to 1, the endpoint ignores any SETUP tokens directed to its configured address."]
2026 #[inline(always)]
2027 pub fn usb_ign_setup(
2028 self,
2029 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbRxc1Reg_SPEC, crate::common::RW> {
2030 crate::common::RegisterFieldBool::<2,1,0,UsbRxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2031 }
2032
2033 #[doc = "Receive Enable\nOUT packet cannot be received after every data packet is received, or when a STALL handshake is returned in response to an OUT token. This bit must be written with a 1 to re-enable data reception. SETUP packets can always be received. In the case of back-to-back SETUP packets (for a given endpoint) where a valid SETUP packet has been received with no other intervening non-SETUP tokens, the receive state machine discards the new SETUP packet and returns an ACK handshake. If, for any other reason, the receive state machine cannot accept the SETUP packet, no HANDSHAKE should be generated."]
2034 #[inline(always)]
2035 pub fn usb_rx_en(
2036 self,
2037 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbRxc1Reg_SPEC, crate::common::RW> {
2038 crate::common::RegisterFieldBool::<0,1,0,UsbRxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2039 }
2040}
2041impl ::core::default::Default for UsbRxc1Reg {
2042 #[inline(always)]
2043 fn default() -> UsbRxc1Reg {
2044 <crate::RegValueT<UsbRxc1Reg_SPEC> as RegisterValue<_>>::new(0)
2045 }
2046}
2047
2048#[doc(hidden)]
2049#[derive(Copy, Clone, Eq, PartialEq)]
2050pub struct UsbRxc2Reg_SPEC;
2051impl crate::sealed::RegSpec for UsbRxc2Reg_SPEC {
2052 type DataType = u32;
2053}
2054
2055#[doc = "Receive Command Register 2"]
2056pub type UsbRxc2Reg = crate::RegValueT<UsbRxc2Reg_SPEC>;
2057
2058impl UsbRxc2Reg {
2059 #[doc = "Receive FIFO Warning Limit\nThese bits specify how many more bytes can be received to the respective FIFO before an overrun condition occurs. If the number of empty bytes remaining in the FIFO is equal to or less than the selected warning limit, the RXWARN bit in the FWEV register is set to 1.RFWL\\[1:0\\] :\n00: RFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2060 #[inline(always)]
2061 pub fn usb_rfwl(
2062 self,
2063 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbRxc2Reg_SPEC, crate::common::RW>
2064 {
2065 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbRxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2066 }
2067
2068 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding receive FIFO, resets the endpoint to Idle state, and resets both the FIFO read and write pointers. If the MAC is currently using the FIFO to receive data, flushing is delayed until after receiving is completed."]
2069 #[inline(always)]
2070 pub fn usb_flush(
2071 self,
2072 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbRxc2Reg_SPEC, crate::common::RW> {
2073 crate::common::RegisterFieldBool::<3,1,0,UsbRxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2074 }
2075
2076 #[doc = "Ignore SETUP Tokens\nWhen this bit is set to 1, the endpoint ignores any SETUP tokens directed to its configured address."]
2077 #[inline(always)]
2078 pub fn usb_ign_setup(
2079 self,
2080 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbRxc2Reg_SPEC, crate::common::RW> {
2081 crate::common::RegisterFieldBool::<2,1,0,UsbRxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2082 }
2083
2084 #[doc = "Receive Enable\nOUT packet cannot be received after every data packet is received, or when a STALL handshake is returned in response to an OUT token. This bit must be written with a 1 to re-enable data reception. SETUP packets can always be received. In the case of back-to-back SETUP packets (for a given endpoint) where a valid SETUP packet has been received with no other intervening non-SETUP tokens, the receive state machine discards the new SETUP packet and returns an ACK handshake. If, for any other reason, the receive state machine cannot accept the SETUP packet, no HANDSHAKE should be generated."]
2085 #[inline(always)]
2086 pub fn usb_rx_en(
2087 self,
2088 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbRxc2Reg_SPEC, crate::common::RW> {
2089 crate::common::RegisterFieldBool::<0,1,0,UsbRxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2090 }
2091}
2092impl ::core::default::Default for UsbRxc2Reg {
2093 #[inline(always)]
2094 fn default() -> UsbRxc2Reg {
2095 <crate::RegValueT<UsbRxc2Reg_SPEC> as RegisterValue<_>>::new(0)
2096 }
2097}
2098
2099#[doc(hidden)]
2100#[derive(Copy, Clone, Eq, PartialEq)]
2101pub struct UsbRxc3Reg_SPEC;
2102impl crate::sealed::RegSpec for UsbRxc3Reg_SPEC {
2103 type DataType = u32;
2104}
2105
2106#[doc = "Receive Command Register 3"]
2107pub type UsbRxc3Reg = crate::RegValueT<UsbRxc3Reg_SPEC>;
2108
2109impl UsbRxc3Reg {
2110 #[doc = "Receive FIFO Warning Limit\nThese bits specify how many more bytes can be received to the respective FIFO before an overrun condition occurs. If the number of empty bytes remaining in the FIFO is equal to or less than the selected warning limit, the RXWARN bit in the FWEV register is set to 1.RFWL\\[1:0\\] :\n00: RFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2111 #[inline(always)]
2112 pub fn usb_rfwl(
2113 self,
2114 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbRxc3Reg_SPEC, crate::common::RW>
2115 {
2116 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbRxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2117 }
2118
2119 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding receive FIFO, resets the endpoint to Idle state, and resets both the FIFO read and write pointers. If the MAC is currently using the FIFO to receive data, flushing is delayed until after receiving is completed."]
2120 #[inline(always)]
2121 pub fn usb_flush(
2122 self,
2123 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbRxc3Reg_SPEC, crate::common::RW> {
2124 crate::common::RegisterFieldBool::<3,1,0,UsbRxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2125 }
2126
2127 #[doc = "Ignore SETUP Tokens\nWhen this bit is set to 1, the endpoint ignores any SETUP tokens directed to its configured address."]
2128 #[inline(always)]
2129 pub fn usb_ign_setup(
2130 self,
2131 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbRxc3Reg_SPEC, crate::common::RW> {
2132 crate::common::RegisterFieldBool::<2,1,0,UsbRxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2133 }
2134
2135 #[doc = "Receive Enable\nOUT packet cannot be received after every data packet is received, or when a STALL handshake is returned in response to an OUT token. This bit must be written with a 1 to re-enable data reception. SETUP packets can always be received. In the case of back-to-back SETUP packets (for a given endpoint) where a valid SETUP packet has been received with no other intervening non-SETUP tokens, the receive state machine discards the new SETUP packet and returns an ACK handshake. If, for any other reason, the receive state machine cannot accept the SETUP packet, no HANDSHAKE should be generated."]
2136 #[inline(always)]
2137 pub fn usb_rx_en(
2138 self,
2139 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbRxc3Reg_SPEC, crate::common::RW> {
2140 crate::common::RegisterFieldBool::<0,1,0,UsbRxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2141 }
2142}
2143impl ::core::default::Default for UsbRxc3Reg {
2144 #[inline(always)]
2145 fn default() -> UsbRxc3Reg {
2146 <crate::RegValueT<UsbRxc3Reg_SPEC> as RegisterValue<_>>::new(0)
2147 }
2148}
2149
2150#[doc(hidden)]
2151#[derive(Copy, Clone, Eq, PartialEq)]
2152pub struct UsbRxd0Reg_SPEC;
2153impl crate::sealed::RegSpec for UsbRxd0Reg_SPEC {
2154 type DataType = u32;
2155}
2156
2157#[doc = "Receive Data 0 Register"]
2158pub type UsbRxd0Reg = crate::RegValueT<UsbRxd0Reg_SPEC>;
2159
2160impl UsbRxd0Reg {
2161 #[doc = "Receive FIFO Data Byte\nThe firmware should expect to read only the packet payload data. The PID and CRC16 are removed from the incoming data stream automatically.\nIn TEST mode this register allow read/write access."]
2162 #[inline(always)]
2163 pub fn usb_rxfd(
2164 self,
2165 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbRxd0Reg_SPEC, crate::common::R>
2166 {
2167 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbRxd0Reg_SPEC,crate::common::R>::from_register(self,0)
2168 }
2169}
2170impl ::core::default::Default for UsbRxd0Reg {
2171 #[inline(always)]
2172 fn default() -> UsbRxd0Reg {
2173 <crate::RegValueT<UsbRxd0Reg_SPEC> as RegisterValue<_>>::new(0)
2174 }
2175}
2176
2177#[doc(hidden)]
2178#[derive(Copy, Clone, Eq, PartialEq)]
2179pub struct UsbRxd1Reg_SPEC;
2180impl crate::sealed::RegSpec for UsbRxd1Reg_SPEC {
2181 type DataType = u32;
2182}
2183
2184#[doc = "Receive Data Register,1"]
2185pub type UsbRxd1Reg = crate::RegValueT<UsbRxd1Reg_SPEC>;
2186
2187impl UsbRxd1Reg {
2188 #[doc = "Receive FIFO Data Byte\nThe firmware should expect to read only the packet payload data. The PID and CRC16 are terminated by the receive state machine.\nIn TEST mode this register allow read/write access via the core bus."]
2189 #[inline(always)]
2190 pub fn usb_rxfd(
2191 self,
2192 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbRxd1Reg_SPEC, crate::common::R>
2193 {
2194 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbRxd1Reg_SPEC,crate::common::R>::from_register(self,0)
2195 }
2196}
2197impl ::core::default::Default for UsbRxd1Reg {
2198 #[inline(always)]
2199 fn default() -> UsbRxd1Reg {
2200 <crate::RegValueT<UsbRxd1Reg_SPEC> as RegisterValue<_>>::new(0)
2201 }
2202}
2203
2204#[doc(hidden)]
2205#[derive(Copy, Clone, Eq, PartialEq)]
2206pub struct UsbRxd2Reg_SPEC;
2207impl crate::sealed::RegSpec for UsbRxd2Reg_SPEC {
2208 type DataType = u32;
2209}
2210
2211#[doc = "Receive Data Register 2"]
2212pub type UsbRxd2Reg = crate::RegValueT<UsbRxd2Reg_SPEC>;
2213
2214impl UsbRxd2Reg {
2215 #[doc = "Receive FIFO Data Byte\nThe firmware should expect to read only the packet payload data. The PID and CRC16 are terminated by the receive state machine.\nIn TEST mode this register allow read/write access via the core bus."]
2216 #[inline(always)]
2217 pub fn usb_rxfd(
2218 self,
2219 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbRxd2Reg_SPEC, crate::common::R>
2220 {
2221 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbRxd2Reg_SPEC,crate::common::R>::from_register(self,0)
2222 }
2223}
2224impl ::core::default::Default for UsbRxd2Reg {
2225 #[inline(always)]
2226 fn default() -> UsbRxd2Reg {
2227 <crate::RegValueT<UsbRxd2Reg_SPEC> as RegisterValue<_>>::new(0)
2228 }
2229}
2230
2231#[doc(hidden)]
2232#[derive(Copy, Clone, Eq, PartialEq)]
2233pub struct UsbRxd3Reg_SPEC;
2234impl crate::sealed::RegSpec for UsbRxd3Reg_SPEC {
2235 type DataType = u32;
2236}
2237
2238#[doc = "Receive Data Register 3"]
2239pub type UsbRxd3Reg = crate::RegValueT<UsbRxd3Reg_SPEC>;
2240
2241impl UsbRxd3Reg {
2242 #[doc = "Receive FIFO Data Byte\nThe firmware should expect to read only the packet payload data. The PID and CRC16 are terminated by the receive state machine.\nIn TEST mode this register allow read/write access via the core bus."]
2243 #[inline(always)]
2244 pub fn usb_rxfd(
2245 self,
2246 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbRxd3Reg_SPEC, crate::common::R>
2247 {
2248 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbRxd3Reg_SPEC,crate::common::R>::from_register(self,0)
2249 }
2250}
2251impl ::core::default::Default for UsbRxd3Reg {
2252 #[inline(always)]
2253 fn default() -> UsbRxd3Reg {
2254 <crate::RegValueT<UsbRxd3Reg_SPEC> as RegisterValue<_>>::new(0)
2255 }
2256}
2257
2258#[doc(hidden)]
2259#[derive(Copy, Clone, Eq, PartialEq)]
2260pub struct UsbRxevReg_SPEC;
2261impl crate::sealed::RegSpec for UsbRxevReg_SPEC {
2262 type DataType = u32;
2263}
2264
2265#[doc = "Receive Event Register"]
2266pub type UsbRxevReg = crate::RegValueT<UsbRxevReg_SPEC>;
2267
2268impl UsbRxevReg {
2269 #[doc = "Receive Overrun n: 3:1\nThe bit n is set to 1 in the event of an overrun condition in the corresponding receive FIFO n. They are cleared to 0 when the register is read. The firmware must check the respective RX_ERR bits that packets received for the other receive endpoints (EP2, EP4 and EP6, ) are not corrupted by errors, as these endpoints support data streaming (packets which are longer than the actual FIFO depth)."]
2270 #[inline(always)]
2271 pub fn usb_rxovrrn31(
2272 self,
2273 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbRxevReg_SPEC, crate::common::R> {
2274 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbRxevReg_SPEC,crate::common::R>::from_register(self,0)
2275 }
2276
2277 #[doc = "Receive FIFO n: 3:1\nThe bit n is set to 1 whenever either RX_ERR or RX_LAST in the respective Receive Status register (RXSn) is set to 1. Reading the corresponding RXSn register automatically clears these bits.The CoR function is disabled, when the Freeze signal is asserted.The USB node discards all packets for Endpoint 0 received with errors. This is necessary in case of retransmission due to media errors, ensuring that a good copy of a SETUP packet is captured. Otherwise, the FIFO may potentially be tied up, holding corrupted data and unable to receive a retransmission of the same packet.\nIf data streaming is used for the receive endpoints (EP2, EP4 and EP6, EP8) the firmware must check the respective RX_ERR bits to ensure the packets received are not corrupted by errors."]
2278 #[inline(always)]
2279 pub fn usb_rxfifo31(
2280 self,
2281 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbRxevReg_SPEC, crate::common::R> {
2282 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbRxevReg_SPEC,crate::common::R>::from_register(self,0)
2283 }
2284}
2285impl ::core::default::Default for UsbRxevReg {
2286 #[inline(always)]
2287 fn default() -> UsbRxevReg {
2288 <crate::RegValueT<UsbRxevReg_SPEC> as RegisterValue<_>>::new(0)
2289 }
2290}
2291
2292#[doc(hidden)]
2293#[derive(Copy, Clone, Eq, PartialEq)]
2294pub struct UsbRxmskReg_SPEC;
2295impl crate::sealed::RegSpec for UsbRxmskReg_SPEC {
2296 type DataType = u32;
2297}
2298
2299#[doc = "Receive Mask Register"]
2300pub type UsbRxmskReg = crate::RegValueT<UsbRxmskReg_SPEC>;
2301
2302impl UsbRxmskReg {
2303 #[doc = "The Receive Mask Register is used to select the bits of the RXEV registers, which causes the RX_EV bit in the MAEV register to be set to 1. When set to 1 and the corresponding bit in the RXEV register is set to 1, RX_EV bit in the MAEV register is set to1. When cleared to 0, the corresponding bit in the RXEV register does not cause RX_EV to be set to1. Same Bit Definition as RXEV Register"]
2304 #[inline(always)]
2305 pub fn usb_m_rxovrrn31(
2306 self,
2307 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbRxmskReg_SPEC, crate::common::RW>
2308 {
2309 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbRxmskReg_SPEC,crate::common::RW>::from_register(self,0)
2310 }
2311
2312 #[doc = "Same Bit Definition as RXEV Register"]
2313 #[inline(always)]
2314 pub fn usb_m_rxfifo31(
2315 self,
2316 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbRxmskReg_SPEC, crate::common::RW>
2317 {
2318 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbRxmskReg_SPEC,crate::common::RW>::from_register(self,0)
2319 }
2320}
2321impl ::core::default::Default for UsbRxmskReg {
2322 #[inline(always)]
2323 fn default() -> UsbRxmskReg {
2324 <crate::RegValueT<UsbRxmskReg_SPEC> as RegisterValue<_>>::new(0)
2325 }
2326}
2327
2328#[doc(hidden)]
2329#[derive(Copy, Clone, Eq, PartialEq)]
2330pub struct UsbRxs0Reg_SPEC;
2331impl crate::sealed::RegSpec for UsbRxs0Reg_SPEC {
2332 type DataType = u32;
2333}
2334
2335#[doc = "Receive Status 0 Register"]
2336pub type UsbRxs0Reg = crate::RegValueT<UsbRxs0Reg_SPEC>;
2337
2338impl UsbRxs0Reg {
2339 #[doc = "Setup\nThis bit indicates that the setup packet has been received. This bit is unchanged for zero length packets. It is cleared to 0 when this register is read."]
2340 #[inline(always)]
2341 pub fn usb_setup(
2342 self,
2343 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs0Reg_SPEC, crate::common::R> {
2344 crate::common::RegisterFieldBool::<6,1,0,UsbRxs0Reg_SPEC,crate::common::R>::from_register(self,0)
2345 }
2346
2347 #[doc = "Toggle\nThis bit specified the PID used when receiving the packet. A value of 0 indicates that the last successfully received packet had a DATA0 PID, while a value of 1 indicates that this packet had a DATA1 PID. This bit is unchanged for zero length packets. It is cleared to 0 when this register is read."]
2348 #[inline(always)]
2349 pub fn usb_toggle_rx0(
2350 self,
2351 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs0Reg_SPEC, crate::common::R> {
2352 crate::common::RegisterFieldBool::<5,1,0,UsbRxs0Reg_SPEC,crate::common::R>::from_register(self,0)
2353 }
2354
2355 #[doc = "Receive Last Bytes\nThis bit indicates that an ACK was sent upon completion of a successful receive operation. This bit is unchanged for zero length packets. It is cleared to 0 when this register is read."]
2356 #[inline(always)]
2357 pub fn usb_rx_last(
2358 self,
2359 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs0Reg_SPEC, crate::common::R> {
2360 crate::common::RegisterFieldBool::<4,1,0,UsbRxs0Reg_SPEC,crate::common::R>::from_register(self,0)
2361 }
2362
2363 #[doc = "Receive Count\nThis 4-bit field contains the number of bytes presently in the RX FIFO. This number is never larger than 8 for Endpoint 0."]
2364 #[inline(always)]
2365 pub fn usb_rcount(
2366 self,
2367 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs0Reg_SPEC, crate::common::R> {
2368 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs0Reg_SPEC,crate::common::R>::from_register(self,0)
2369 }
2370}
2371impl ::core::default::Default for UsbRxs0Reg {
2372 #[inline(always)]
2373 fn default() -> UsbRxs0Reg {
2374 <crate::RegValueT<UsbRxs0Reg_SPEC> as RegisterValue<_>>::new(0)
2375 }
2376}
2377
2378#[doc(hidden)]
2379#[derive(Copy, Clone, Eq, PartialEq)]
2380pub struct UsbRxs1Reg_SPEC;
2381impl crate::sealed::RegSpec for UsbRxs1Reg_SPEC {
2382 type DataType = u32;
2383}
2384
2385#[doc = "Receive Status Register 1"]
2386pub type UsbRxs1Reg = crate::RegValueT<UsbRxs1Reg_SPEC>;
2387
2388impl UsbRxs1Reg {
2389 #[doc = "it contains the number of bytes presently in the endpoint receive FIFO (range 0..64)"]
2390 #[inline(always)]
2391 pub fn usb_rxcount(
2392 self,
2393 ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, UsbRxs1Reg_SPEC, crate::common::R>
2394 {
2395 crate::common::RegisterField::<8,0x7f,1,0,u8,u8,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2396 }
2397
2398 #[doc = "Receive Error\nWhen set to 1, this bit indicates a media error, such as bit-stuffing or CRC. If this bit is set to 1, the firmware must flush the respective FIFO."]
2399 #[inline(always)]
2400 pub fn usb_rx_err(
2401 self,
2402 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2403 crate::common::RegisterFieldBool::<7,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2404 }
2405
2406 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2407 #[inline(always)]
2408 pub fn usb_setup(
2409 self,
2410 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2411 crate::common::RegisterFieldBool::<6,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2412 }
2413
2414 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO in the EPCn register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, a value of 0 indicates that the last successfully received packet had a DATA0 PID, while a value of 1 indicates that this packet had a DATA1 PID.\nFor ISO operation, this bit reflects the LSB of the frame number (FNL0) after a packet was successfully received for this endpoint.\nThis bit is reset to 0 by reading the RXSn register."]
2415 #[inline(always)]
2416 pub fn usb_toggle_rx(
2417 self,
2418 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2419 crate::common::RegisterFieldBool::<5,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2420 }
2421
2422 #[doc = "Receive Last\nThis bit indicates that an ACK was sent upon completion of a successful receive operation. This bit is cleared to 0 when this register is read."]
2423 #[inline(always)]
2424 pub fn usb_rx_last(
2425 self,
2426 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2427 crate::common::RegisterFieldBool::<4,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2428 }
2429
2430 #[doc = "Receive Counter\nThis 4-bit field contains the number of bytes presently in the endpoint receive FIFO. If this number is greater than 15, a value of 15 is actually reported."]
2431 #[inline(always)]
2432 pub fn usb_rcount(
2433 self,
2434 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs1Reg_SPEC, crate::common::R> {
2435 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2436 }
2437}
2438impl ::core::default::Default for UsbRxs1Reg {
2439 #[inline(always)]
2440 fn default() -> UsbRxs1Reg {
2441 <crate::RegValueT<UsbRxs1Reg_SPEC> as RegisterValue<_>>::new(0)
2442 }
2443}
2444
2445#[doc(hidden)]
2446#[derive(Copy, Clone, Eq, PartialEq)]
2447pub struct UsbRxs2Reg_SPEC;
2448impl crate::sealed::RegSpec for UsbRxs2Reg_SPEC {
2449 type DataType = u32;
2450}
2451
2452#[doc = "Receive Status Register 2"]
2453pub type UsbRxs2Reg = crate::RegValueT<UsbRxs2Reg_SPEC>;
2454
2455impl UsbRxs2Reg {
2456 #[doc = "it contains the number of bytes presently in the endpoint receive FIFO (range 0..64)"]
2457 #[inline(always)]
2458 pub fn usb_rxcount(
2459 self,
2460 ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, UsbRxs2Reg_SPEC, crate::common::R>
2461 {
2462 crate::common::RegisterField::<8,0x7f,1,0,u8,u8,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2463 }
2464
2465 #[doc = "Receive Error\nWhen set to 1, this bit indicates a media error, such as bit-stuffing or CRC. If this bit is set to 1, the firmware must flush the respective FIFO."]
2466 #[inline(always)]
2467 pub fn usb_rx_err(
2468 self,
2469 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2470 crate::common::RegisterFieldBool::<7,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2471 }
2472
2473 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2474 #[inline(always)]
2475 pub fn usb_setup(
2476 self,
2477 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2478 crate::common::RegisterFieldBool::<6,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2479 }
2480
2481 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO in the EPCn register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, a value of 0 indicates that the last successfully received packet had a DATA0 PID, while a value of 1 indicates that this packet had a DATA1 PID.\nFor ISO operation, this bit reflects the LSB of the frame number (FNL0) after a packet was successfully received for this endpoint.\nThis bit is reset to 0 by reading the RXSn register."]
2482 #[inline(always)]
2483 pub fn usb_toggle_rx(
2484 self,
2485 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2486 crate::common::RegisterFieldBool::<5,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2487 }
2488
2489 #[doc = "Receive Last\nThis bit indicates that an ACK was sent upon completion of a successful receive operation. This bit is cleared to 0 when this register is read."]
2490 #[inline(always)]
2491 pub fn usb_rx_last(
2492 self,
2493 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2494 crate::common::RegisterFieldBool::<4,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2495 }
2496
2497 #[doc = "Receive Counter\nThis 4-bit field contains the number of bytes presently in the endpoint receive FIFO. If this number is greater than 15, a value of 15 is actually reported."]
2498 #[inline(always)]
2499 pub fn usb_rcount(
2500 self,
2501 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs2Reg_SPEC, crate::common::R> {
2502 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2503 }
2504}
2505impl ::core::default::Default for UsbRxs2Reg {
2506 #[inline(always)]
2507 fn default() -> UsbRxs2Reg {
2508 <crate::RegValueT<UsbRxs2Reg_SPEC> as RegisterValue<_>>::new(0)
2509 }
2510}
2511
2512#[doc(hidden)]
2513#[derive(Copy, Clone, Eq, PartialEq)]
2514pub struct UsbRxs3Reg_SPEC;
2515impl crate::sealed::RegSpec for UsbRxs3Reg_SPEC {
2516 type DataType = u32;
2517}
2518
2519#[doc = "Receive Status Register 3"]
2520pub type UsbRxs3Reg = crate::RegValueT<UsbRxs3Reg_SPEC>;
2521
2522impl UsbRxs3Reg {
2523 #[doc = "it contains the number of bytes presently in the endpoint receive FIFO (range 0..64)"]
2524 #[inline(always)]
2525 pub fn usb_rxcount(
2526 self,
2527 ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, UsbRxs3Reg_SPEC, crate::common::R>
2528 {
2529 crate::common::RegisterField::<8,0x7f,1,0,u8,u8,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2530 }
2531
2532 #[doc = "Receive Error\nWhen set to 1, this bit indicates a media error, such as bit-stuffing or CRC. If this bit is set to 1, the firmware must flush the respective FIFO."]
2533 #[inline(always)]
2534 pub fn usb_rx_err(
2535 self,
2536 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2537 crate::common::RegisterFieldBool::<7,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2538 }
2539
2540 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2541 #[inline(always)]
2542 pub fn usb_setup(
2543 self,
2544 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2545 crate::common::RegisterFieldBool::<6,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2546 }
2547
2548 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO in the EPCn register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, a value of 0 indicates that the last successfully received packet had a DATA0 PID, while a value of 1 indicates that this packet had a DATA1 PID.\nFor ISO operation, this bit reflects the LSB of the frame number (FNL0) after a packet was successfully received for this endpoint.\nThis bit is reset to 0 by reading the RXSn register."]
2549 #[inline(always)]
2550 pub fn usb_toggle_rx(
2551 self,
2552 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2553 crate::common::RegisterFieldBool::<5,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2554 }
2555
2556 #[doc = "Receive Last\nThis bit indicates that an ACK was sent upon completion of a successful receive operation. This bit is cleared to 0 when this register is read."]
2557 #[inline(always)]
2558 pub fn usb_rx_last(
2559 self,
2560 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2561 crate::common::RegisterFieldBool::<4,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2562 }
2563
2564 #[doc = "Receive Counter\nThis 4-bit field contains the number of bytes presently in the endpoint receive FIFO. If this number is greater than 15, a value of 15 is actually reported."]
2565 #[inline(always)]
2566 pub fn usb_rcount(
2567 self,
2568 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs3Reg_SPEC, crate::common::R> {
2569 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2570 }
2571}
2572impl ::core::default::Default for UsbRxs3Reg {
2573 #[inline(always)]
2574 fn default() -> UsbRxs3Reg {
2575 <crate::RegValueT<UsbRxs3Reg_SPEC> as RegisterValue<_>>::new(0)
2576 }
2577}
2578
2579#[doc(hidden)]
2580#[derive(Copy, Clone, Eq, PartialEq)]
2581pub struct UsbTcrReg_SPEC;
2582impl crate::sealed::RegSpec for UsbTcrReg_SPEC {
2583 type DataType = u32;
2584}
2585
2586#[doc = "Transceiver configuration Register"]
2587pub type UsbTcrReg = crate::RegValueT<UsbTcrReg_SPEC>;
2588
2589impl UsbTcrReg {
2590 #[doc = "Reference Voltage/ Threshold voltage AdjustControls the single-ended receiver threshold.\nShall not be modified unless instructed by Dialog Semiconductor\nOnly enabled if USB_UTR_REG\\[7\\] = 1"]
2591 #[inline(always)]
2592 pub fn usb_vadj(
2593 self,
2594 ) -> crate::common::RegisterField<5, 0x7, 1, 0, u8, u8, UsbTcrReg_SPEC, crate::common::RW> {
2595 crate::common::RegisterField::<5,0x7,1,0,u8,u8,UsbTcrReg_SPEC,crate::common::RW>::from_register(self,0)
2596 }
2597
2598 #[doc = "Transmitter Current Adjust\nControls the driver edge rate control current.\nShall not be modified unless instructed by Dialog Semiconductor\nOnly enabled if USB_UTR_REG\\[7\\] = 1"]
2599 #[inline(always)]
2600 pub fn usb_cadj(
2601 self,
2602 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTcrReg_SPEC, crate::common::RW>
2603 {
2604 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTcrReg_SPEC,crate::common::RW>::from_register(self,0)
2605 }
2606}
2607impl ::core::default::Default for UsbTcrReg {
2608 #[inline(always)]
2609 fn default() -> UsbTcrReg {
2610 <crate::RegValueT<UsbTcrReg_SPEC> as RegisterValue<_>>::new(144)
2611 }
2612}
2613
2614#[doc(hidden)]
2615#[derive(Copy, Clone, Eq, PartialEq)]
2616pub struct UsbTxc0Reg_SPEC;
2617impl crate::sealed::RegSpec for UsbTxc0Reg_SPEC {
2618 type DataType = u32;
2619}
2620
2621#[doc = "Transmit command 0 Register"]
2622pub type UsbTxc0Reg = crate::RegValueT<UsbTxc0Reg_SPEC>;
2623
2624impl UsbTxc0Reg {
2625 #[doc = "Ignore IN Tokens\nWhen this bit is set to 1, the endpoint will ignore any IN tokens directed to its configured address."]
2626 #[inline(always)]
2627 pub fn usb_ign_in(
2628 self,
2629 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2630 crate::common::RegisterFieldBool::<4,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2631 }
2632
2633 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the control endpoint FIFOs, resets the endpoint to Idle state, clears the FIFO read and write pointer, and then clears itself. If the endpoint is currently using the FIFO0 to transfer data on USB, flushing is delayed until after the transfer is done. It is equivalent to the FLUSH bit in the RXC0 register."]
2634 #[inline(always)]
2635 pub fn usb_flush(
2636 self,
2637 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2638 crate::common::RegisterFieldBool::<3,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2639 }
2640
2641 #[doc = "Toggle\nThis bit specifies the PID used when transmitting the packet. A value of 0 causes a DATA0 PID to be generated, while a value of 1 causes a DATA1 PID to be generated. This bit is not altered by the hardware."]
2642 #[inline(always)]
2643 pub fn usb_toggle_tx0(
2644 self,
2645 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2646 crate::common::RegisterFieldBool::<2,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2647 }
2648
2649 #[doc = "Transmission Enable\nThis bit enables data transmission from the FIFO. It is cleared to 0 by hardware after transmitting a single packet, or a STALL handshake, in response to an IN token. It must be set to 1 by firmware to start packet transmission. The RX_EN bit in the Receive Command 0 (RXC0) register takes precedence over this bit; i.e. if RX_EN is set, TX_EN bit is ignored until RX_EN is reset.\nZero length packets are indicated by setting this bit without writing any data to the FIFO."]
2650 #[inline(always)]
2651 pub fn usb_tx_en(
2652 self,
2653 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2654 crate::common::RegisterFieldBool::<0,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2655 }
2656}
2657impl ::core::default::Default for UsbTxc0Reg {
2658 #[inline(always)]
2659 fn default() -> UsbTxc0Reg {
2660 <crate::RegValueT<UsbTxc0Reg_SPEC> as RegisterValue<_>>::new(0)
2661 }
2662}
2663
2664#[doc(hidden)]
2665#[derive(Copy, Clone, Eq, PartialEq)]
2666pub struct UsbTxc1Reg_SPEC;
2667impl crate::sealed::RegSpec for UsbTxc1Reg_SPEC {
2668 type DataType = u32;
2669}
2670
2671#[doc = "Transmit Command Register 1"]
2672pub type UsbTxc1Reg = crate::RegValueT<UsbTxc1Reg_SPEC>;
2673
2674impl UsbTxc1Reg {
2675 #[doc = "Ignore ISO Mask\nThis bit has an effect only if the endpoint is set to be isochronous. If set to 1, this bit disables locking of specific frame numbers with the alternate function of the TOGGLE bit. Thus data is transmitted upon reception of the next IN token. If cleared to 0, data is only transmitted when FNL0 matches TOGGLE. This bit is cleared to 0 after reset."]
2676 #[inline(always)]
2677 pub fn usb_ign_isomsk(
2678 self,
2679 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2680 crate::common::RegisterFieldBool::<7,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2681 }
2682
2683 #[doc = "Transmit FIFO Warning Limit\nThese bits specify how many more bytes can be transmitted from the respective FIFO before an underrun condition occurs. If the number of bytes remaining in the FIFO is equal to or less than the selected warning limit, the TXWARN bit in the FWEV register is set. To avoid interrupts caused by setting this bit while the FIFO is being filled before a transmission begins, TXWARN is only set when transmission from the endpoint is enabled (TX_ENn in the TXCn register is set).\nTFWL\\[1:0\\] :\n00: TFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2684 #[inline(always)]
2685 pub fn usb_tfwl(
2686 self,
2687 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc1Reg_SPEC, crate::common::RW>
2688 {
2689 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2690 }
2691
2692 #[doc = "Refill FIFO\nSetting the LAST bit to 1 automatically saves the Transmit Read Pointer (TXRP) to a buffer. When the RFF bit is set to 1, the buffered TXRP is reloaded into the TXRP. This allows the user to repeat the last transaction if no ACK was received from the host. If the MAC is currently using the FIFO to transmit, TXRP is reloaded only after the transmission is complete. After reload, this bit is cleared to 0 by hardware."]
2693 #[inline(always)]
2694 pub fn usb_rff(
2695 self,
2696 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2697 crate::common::RegisterFieldBool::<4,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2698 }
2699
2700 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding transmit FIFO, resets the endpoint to Idle state, and clears both the FIFO read and write pointers. If the MAC is currently using the FIFO to transmit, data is flushed after the transmission is complete. After data flushing, this bit is cleared to 0 by hardware."]
2701 #[inline(always)]
2702 pub fn usb_flush(
2703 self,
2704 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2705 crate::common::RegisterFieldBool::<3,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2706 }
2707
2708 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO bit in the EPCn register is set to 1) or non-ISO operation (ISO bit is cleared to 0) is used.\nFor non-ISO operation, it specifies the PID used when transmitting the packet. A value of 0 causes a DATA0 PID to be generated, while a value of 1 causes a DATA1 PID to be generated.\nFor ISO operation, this bit and the LSB of the frame counter (FNL0) act as a mask for the TX_EN bit to allow pre-queuing of packets to specific frame numbers; I.e. transmission is enabled only if bit 0 in the FNL register is set to TOGGLE. If an IN token is not received while this condition is true, the contents of the FIFO are flushed with the next SOF. If the endpoint is set to ISO, data is always transferred with a DATA0 PID."]
2709 #[inline(always)]
2710 pub fn usb_toggle_tx(
2711 self,
2712 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2713 crate::common::RegisterFieldBool::<2,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2714 }
2715
2716 #[doc = "Last Byte\nSetting this bit to 1 indicates that the entire packet has been written into the FIFO. This is used especially for streaming data to the FIFO while the actual transmission occurs. If the LAST bit is not set to 1 and the transmit FIFO becomes empty during a transmission, a stuff error followed by an EOP is forced on the bus. Zero length packets are indicated by setting this bit without writing any data to the FIFO.\nThe transmit state machine transmits the payload data, CRC16 and the EOP signal before clearing this bit."]
2717 #[inline(always)]
2718 pub fn usb_last(
2719 self,
2720 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2721 crate::common::RegisterFieldBool::<1,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2722 }
2723
2724 #[doc = "Transmission Enable\nThis bit enables data transmission from the FIFO. It is cleared to 0 by hardware after transmitting a single packet or after a STALL handshake in response to an IN token. It must be set to 1 by firmware to start packet transmission."]
2725 #[inline(always)]
2726 pub fn usb_tx_en(
2727 self,
2728 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2729 crate::common::RegisterFieldBool::<0,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2730 }
2731}
2732impl ::core::default::Default for UsbTxc1Reg {
2733 #[inline(always)]
2734 fn default() -> UsbTxc1Reg {
2735 <crate::RegValueT<UsbTxc1Reg_SPEC> as RegisterValue<_>>::new(0)
2736 }
2737}
2738
2739#[doc(hidden)]
2740#[derive(Copy, Clone, Eq, PartialEq)]
2741pub struct UsbTxc2Reg_SPEC;
2742impl crate::sealed::RegSpec for UsbTxc2Reg_SPEC {
2743 type DataType = u32;
2744}
2745
2746#[doc = "Transmit Command Register 2"]
2747pub type UsbTxc2Reg = crate::RegValueT<UsbTxc2Reg_SPEC>;
2748
2749impl UsbTxc2Reg {
2750 #[doc = "Ignore ISO Mask\nThis bit has an effect only if the endpoint is set to be isochronous. If set to 1, this bit disables locking of specific frame numbers with the alternate function of the TOGGLE bit. Thus data is transmitted upon reception of the next IN token. If cleared to 0, data is only transmitted when FNL0 matches TOGGLE. This bit is cleared to 0 after reset."]
2751 #[inline(always)]
2752 pub fn usb_ign_isomsk(
2753 self,
2754 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2755 crate::common::RegisterFieldBool::<7,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2756 }
2757
2758 #[doc = "Transmit FIFO Warning Limit\nThese bits specify how many more bytes can be transmitted from the respective FIFO before an underrun condition occurs. If the number of bytes remaining in the FIFO is equal to or less than the selected warning limit, the TXWARN bit in the FWEV register is set. To avoid interrupts caused by setting this bit while the FIFO is being filled before a transmission begins, TXWARN is only set when transmission from the endpoint is enabled (TX_ENn in the TXCn register is set).\nTFWL\\[1:0\\] :\n00: TFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2759 #[inline(always)]
2760 pub fn usb_tfwl(
2761 self,
2762 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc2Reg_SPEC, crate::common::RW>
2763 {
2764 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2765 }
2766
2767 #[doc = "Refill FIFO\nSetting the LAST bit to 1 automatically saves the Transmit Read Pointer (TXRP) to a buffer. When the RFF bit is set to 1, the buffered TXRP is reloaded into the TXRP. This allows the user to repeat the last transaction if no ACK was received from the host. If the MAC is currently using the FIFO to transmit, TXRP is reloaded only after the transmission is complete. After reload, this bit is cleared to 0 by hardware."]
2768 #[inline(always)]
2769 pub fn usb_rff(
2770 self,
2771 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2772 crate::common::RegisterFieldBool::<4,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2773 }
2774
2775 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding transmit FIFO, resets the endpoint to Idle state, and clears both the FIFO read and write pointers. If the MAC is currently using the FIFO to transmit, data is flushed after the transmission is complete. After data flushing, this bit is cleared to 0 by hardware."]
2776 #[inline(always)]
2777 pub fn usb_flush(
2778 self,
2779 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2780 crate::common::RegisterFieldBool::<3,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2781 }
2782
2783 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO bit in the EPCn register is set to 1) or non-ISO operation (ISO bit is cleared to 0) is used.\nFor non-ISO operation, it specifies the PID used when transmitting the packet. A value of 0 causes a DATA0 PID to be generated, while a value of 1 causes a DATA1 PID to be generated.\nFor ISO operation, this bit and the LSB of the frame counter (FNL0) act as a mask for the TX_EN bit to allow pre-queuing of packets to specific frame numbers; I.e. transmission is enabled only if bit 0 in the FNL register is set to TOGGLE. If an IN token is not received while this condition is true, the contents of the FIFO are flushed with the next SOF. If the endpoint is set to ISO, data is always transferred with a DATA0 PID."]
2784 #[inline(always)]
2785 pub fn usb_toggle_tx(
2786 self,
2787 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2788 crate::common::RegisterFieldBool::<2,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2789 }
2790
2791 #[doc = "Last Byte\nSetting this bit to 1 indicates that the entire packet has been written into the FIFO. This is used especially for streaming data to the FIFO while the actual transmission occurs. If the LAST bit is not set to 1 and the transmit FIFO becomes empty during a transmission, a stuff error followed by an EOP is forced on the bus. Zero length packets are indicated by setting this bit without writing any data to the FIFO.\nThe transmit state machine transmits the payload data, CRC16 and the EOP signal before clearing this bit."]
2792 #[inline(always)]
2793 pub fn usb_last(
2794 self,
2795 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2796 crate::common::RegisterFieldBool::<1,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2797 }
2798
2799 #[doc = "Transmission Enable\nThis bit enables data transmission from the FIFO. It is cleared to 0 by hardware after transmitting a single packet or after a STALL handshake in response to an IN token. It must be set to 1 by firmware to start packet transmission."]
2800 #[inline(always)]
2801 pub fn usb_tx_en(
2802 self,
2803 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2804 crate::common::RegisterFieldBool::<0,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2805 }
2806}
2807impl ::core::default::Default for UsbTxc2Reg {
2808 #[inline(always)]
2809 fn default() -> UsbTxc2Reg {
2810 <crate::RegValueT<UsbTxc2Reg_SPEC> as RegisterValue<_>>::new(0)
2811 }
2812}
2813
2814#[doc(hidden)]
2815#[derive(Copy, Clone, Eq, PartialEq)]
2816pub struct UsbTxc3Reg_SPEC;
2817impl crate::sealed::RegSpec for UsbTxc3Reg_SPEC {
2818 type DataType = u32;
2819}
2820
2821#[doc = "Transmit Command Register 3"]
2822pub type UsbTxc3Reg = crate::RegValueT<UsbTxc3Reg_SPEC>;
2823
2824impl UsbTxc3Reg {
2825 #[doc = "Ignore ISO Mask\nThis bit has an effect only if the endpoint is set to be isochronous. If set to 1, this bit disables locking of specific frame numbers with the alternate function of the TOGGLE bit. Thus data is transmitted upon reception of the next IN token. If cleared to 0, data is only transmitted when FNL0 matches TOGGLE. This bit is cleared to 0 after reset."]
2826 #[inline(always)]
2827 pub fn usb_ign_isomsk(
2828 self,
2829 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2830 crate::common::RegisterFieldBool::<7,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2831 }
2832
2833 #[doc = "Transmit FIFO Warning Limit\nThese bits specify how many more bytes can be transmitted from the respective FIFO before an underrun condition occurs. If the number of bytes remaining in the FIFO is equal to or less than the selected warning limit, the TXWARN bit in the FWEV register is set. To avoid interrupts caused by setting this bit while the FIFO is being filled before a transmission begins, TXWARN is only set when transmission from the endpoint is enabled (TX_ENn in the TXCn register is set).\nTFWL\\[1:0\\] :\n00: TFWL disabled\n01: Less than 5 bytes remaining in FIFO\n10: Less than 9 bytes remaining in FIFO\n11: Less than 17 bytes remaining in FIFO"]
2834 #[inline(always)]
2835 pub fn usb_tfwl(
2836 self,
2837 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc3Reg_SPEC, crate::common::RW>
2838 {
2839 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2840 }
2841
2842 #[doc = "Refill FIFO\nSetting the LAST bit to 1 automatically saves the Transmit Read Pointer (TXRP) to a buffer. When the RFF bit is set to 1, the buffered TXRP is reloaded into the TXRP. This allows the user to repeat the last transaction if no ACK was received from the host. If the MAC is currently using the FIFO to transmit, TXRP is reloaded only after the transmission is complete. After reload, this bit is cleared to 0 by hardware."]
2843 #[inline(always)]
2844 pub fn usb_rff(
2845 self,
2846 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2847 crate::common::RegisterFieldBool::<4,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2848 }
2849
2850 #[doc = "Flush FIFO\nWriting a 1 to this bit flushes all data from the corresponding transmit FIFO, resets the endpoint to Idle state, and clears both the FIFO read and write pointers. If the MAC is currently using the FIFO to transmit, data is flushed after the transmission is complete. After data flushing, this bit is cleared to 0 by hardware."]
2851 #[inline(always)]
2852 pub fn usb_flush(
2853 self,
2854 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2855 crate::common::RegisterFieldBool::<3,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2856 }
2857
2858 #[doc = "Toggle\nThe function of this bit differs depending on whether ISO (ISO bit in the EPCn register is set to 1) or non-ISO operation (ISO bit is cleared to 0) is used.\nFor non-ISO operation, it specifies the PID used when transmitting the packet. A value of 0 causes a DATA0 PID to be generated, while a value of 1 causes a DATA1 PID to be generated.\nFor ISO operation, this bit and the LSB of the frame counter (FNL0) act as a mask for the TX_EN bit to allow pre-queuing of packets to specific frame numbers; I.e. transmission is enabled only if bit 0 in the FNL register is set to TOGGLE. If an IN token is not received while this condition is true, the contents of the FIFO are flushed with the next SOF. If the endpoint is set to ISO, data is always transferred with a DATA0 PID."]
2859 #[inline(always)]
2860 pub fn usb_toggle_tx(
2861 self,
2862 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2863 crate::common::RegisterFieldBool::<2,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2864 }
2865
2866 #[doc = "Last Byte\nSetting this bit to 1 indicates that the entire packet has been written into the FIFO. This is used especially for streaming data to the FIFO while the actual transmission occurs. If the LAST bit is not set to 1 and the transmit FIFO becomes empty during a transmission, a stuff error followed by an EOP is forced on the bus. Zero length packets are indicated by setting this bit without writing any data to the FIFO.\nThe transmit state machine transmits the payload data, CRC16 and the EOP signal before clearing this bit."]
2867 #[inline(always)]
2868 pub fn usb_last(
2869 self,
2870 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2871 crate::common::RegisterFieldBool::<1,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2872 }
2873
2874 #[doc = "Transmission Enable\nThis bit enables data transmission from the FIFO. It is cleared to 0 by hardware after transmitting a single packet or after a STALL handshake in response to an IN token. It must be set to 1 by firmware to start packet transmission."]
2875 #[inline(always)]
2876 pub fn usb_tx_en(
2877 self,
2878 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2879 crate::common::RegisterFieldBool::<0,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2880 }
2881}
2882impl ::core::default::Default for UsbTxc3Reg {
2883 #[inline(always)]
2884 fn default() -> UsbTxc3Reg {
2885 <crate::RegValueT<UsbTxc3Reg_SPEC> as RegisterValue<_>>::new(0)
2886 }
2887}
2888
2889#[doc(hidden)]
2890#[derive(Copy, Clone, Eq, PartialEq)]
2891pub struct UsbTxd0Reg_SPEC;
2892impl crate::sealed::RegSpec for UsbTxd0Reg_SPEC {
2893 type DataType = u32;
2894}
2895
2896#[doc = "Transmit Data 0 Register"]
2897pub type UsbTxd0Reg = crate::RegValueT<UsbTxd0Reg_SPEC>;
2898
2899impl UsbTxd0Reg {
2900 #[doc = "Transmit FIFO Data Byte\nThe firmware is expected to write only the packet payload data. The PID and CRC16 are created automatically."]
2901 #[inline(always)]
2902 pub fn usb_txfd(
2903 self,
2904 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd0Reg_SPEC, crate::common::W>
2905 {
2906 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd0Reg_SPEC,crate::common::W>::from_register(self,0)
2907 }
2908}
2909impl ::core::default::Default for UsbTxd0Reg {
2910 #[inline(always)]
2911 fn default() -> UsbTxd0Reg {
2912 <crate::RegValueT<UsbTxd0Reg_SPEC> as RegisterValue<_>>::new(0)
2913 }
2914}
2915
2916#[doc(hidden)]
2917#[derive(Copy, Clone, Eq, PartialEq)]
2918pub struct UsbTxd1Reg_SPEC;
2919impl crate::sealed::RegSpec for UsbTxd1Reg_SPEC {
2920 type DataType = u32;
2921}
2922
2923#[doc = "Transmit Data Register 1"]
2924pub type UsbTxd1Reg = crate::RegValueT<UsbTxd1Reg_SPEC>;
2925
2926impl UsbTxd1Reg {
2927 #[doc = "Transmit FIFO Data Byte\nThe firmware is expected to write only the packet payload data. PID and CRC16 are inserted automatically in the transmit data stream.\nIn TEST mode this register allow read/write access via the core bus."]
2928 #[inline(always)]
2929 pub fn usb_txfd(
2930 self,
2931 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd1Reg_SPEC, crate::common::W>
2932 {
2933 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd1Reg_SPEC,crate::common::W>::from_register(self,0)
2934 }
2935}
2936impl ::core::default::Default for UsbTxd1Reg {
2937 #[inline(always)]
2938 fn default() -> UsbTxd1Reg {
2939 <crate::RegValueT<UsbTxd1Reg_SPEC> as RegisterValue<_>>::new(0)
2940 }
2941}
2942
2943#[doc(hidden)]
2944#[derive(Copy, Clone, Eq, PartialEq)]
2945pub struct UsbTxd2Reg_SPEC;
2946impl crate::sealed::RegSpec for UsbTxd2Reg_SPEC {
2947 type DataType = u32;
2948}
2949
2950#[doc = "Transmit Data Register 2"]
2951pub type UsbTxd2Reg = crate::RegValueT<UsbTxd2Reg_SPEC>;
2952
2953impl UsbTxd2Reg {
2954 #[doc = "Transmit FIFO Data Byte\nThe firmware is expected to write only the packet payload data. PID and CRC16 are inserted automatically in the transmit data stream.\nIn TEST mode this register allow read/write access via the core bus."]
2955 #[inline(always)]
2956 pub fn usb_txfd(
2957 self,
2958 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd2Reg_SPEC, crate::common::W>
2959 {
2960 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd2Reg_SPEC,crate::common::W>::from_register(self,0)
2961 }
2962}
2963impl ::core::default::Default for UsbTxd2Reg {
2964 #[inline(always)]
2965 fn default() -> UsbTxd2Reg {
2966 <crate::RegValueT<UsbTxd2Reg_SPEC> as RegisterValue<_>>::new(0)
2967 }
2968}
2969
2970#[doc(hidden)]
2971#[derive(Copy, Clone, Eq, PartialEq)]
2972pub struct UsbTxd3Reg_SPEC;
2973impl crate::sealed::RegSpec for UsbTxd3Reg_SPEC {
2974 type DataType = u32;
2975}
2976
2977#[doc = "Transmit Data Register 3"]
2978pub type UsbTxd3Reg = crate::RegValueT<UsbTxd3Reg_SPEC>;
2979
2980impl UsbTxd3Reg {
2981 #[doc = "Transmit FIFO Data Byte\nThe firmware is expected to write only the packet payload data. PID and CRC16 are inserted automatically in the transmit data stream.\nIn TEST mode this register allow read/write access via the core bus."]
2982 #[inline(always)]
2983 pub fn usb_txfd(
2984 self,
2985 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd3Reg_SPEC, crate::common::W>
2986 {
2987 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd3Reg_SPEC,crate::common::W>::from_register(self,0)
2988 }
2989}
2990impl ::core::default::Default for UsbTxd3Reg {
2991 #[inline(always)]
2992 fn default() -> UsbTxd3Reg {
2993 <crate::RegValueT<UsbTxd3Reg_SPEC> as RegisterValue<_>>::new(0)
2994 }
2995}
2996
2997#[doc(hidden)]
2998#[derive(Copy, Clone, Eq, PartialEq)]
2999pub struct UsbTxevReg_SPEC;
3000impl crate::sealed::RegSpec for UsbTxevReg_SPEC {
3001 type DataType = u32;
3002}
3003
3004#[doc = "Transmit Event Register"]
3005pub type UsbTxevReg = crate::RegValueT<UsbTxevReg_SPEC>;
3006
3007impl UsbTxevReg {
3008 #[doc = "Transmit Underrun n: 3:1\nThe bit n is a copy of the respective TX_URUN bit from the corresponding Transmit Status register (TXSn). Whenever any of the Transmit FIFOs underflows, the respective TXUDRRN bit is set to 1. These bits are cleared to 0 when the corresponding Transmit Status register is read"]
3009 #[inline(always)]
3010 pub fn usb_txudrrn31(
3011 self,
3012 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbTxevReg_SPEC, crate::common::R> {
3013 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbTxevReg_SPEC,crate::common::R>::from_register(self,0)
3014 }
3015
3016 #[doc = "Transmit FIFO n: 3:1\nThe bit n is a copy of the TX_DONE bit from the corresponding Transmit Status register (TXSn). A bit is set to 1 when the IN transaction for the corresponding transmit endpoint n has been completed. These bits are cleared to 0 when the corresponding TXSn register is read."]
3017 #[inline(always)]
3018 pub fn usb_txfifo31(
3019 self,
3020 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbTxevReg_SPEC, crate::common::R> {
3021 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbTxevReg_SPEC,crate::common::R>::from_register(self,0)
3022 }
3023}
3024impl ::core::default::Default for UsbTxevReg {
3025 #[inline(always)]
3026 fn default() -> UsbTxevReg {
3027 <crate::RegValueT<UsbTxevReg_SPEC> as RegisterValue<_>>::new(0)
3028 }
3029}
3030
3031#[doc(hidden)]
3032#[derive(Copy, Clone, Eq, PartialEq)]
3033pub struct UsbTxmskReg_SPEC;
3034impl crate::sealed::RegSpec for UsbTxmskReg_SPEC {
3035 type DataType = u32;
3036}
3037
3038#[doc = "Transmit Mask Register"]
3039pub type UsbTxmskReg = crate::RegValueT<UsbTxmskReg_SPEC>;
3040
3041impl UsbTxmskReg {
3042 #[doc = "The Transmit Mask Register is used to select the bits of the TXEV registers, which causes the TX_EV bit in the MAEV register to be set to 1. When a bit is set to 1 and the corresponding bit in the TXEV register is set to 1, the TX_EV bit in the MAEV register is set to1. When cleared to 0, the corresponding bit in the TXEV register does not cause TX_EV to be set to 1. Same Bit Definition as TXEV Register"]
3043 #[inline(always)]
3044 pub fn usb_m_txudrrn31(
3045 self,
3046 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbTxmskReg_SPEC, crate::common::RW>
3047 {
3048 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbTxmskReg_SPEC,crate::common::RW>::from_register(self,0)
3049 }
3050
3051 #[doc = "Same Bit Definition as TXEV Register"]
3052 #[inline(always)]
3053 pub fn usb_m_txfifo31(
3054 self,
3055 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbTxmskReg_SPEC, crate::common::RW>
3056 {
3057 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbTxmskReg_SPEC,crate::common::RW>::from_register(self,0)
3058 }
3059}
3060impl ::core::default::Default for UsbTxmskReg {
3061 #[inline(always)]
3062 fn default() -> UsbTxmskReg {
3063 <crate::RegValueT<UsbTxmskReg_SPEC> as RegisterValue<_>>::new(0)
3064 }
3065}
3066
3067#[doc(hidden)]
3068#[derive(Copy, Clone, Eq, PartialEq)]
3069pub struct UsbTxs0Reg_SPEC;
3070impl crate::sealed::RegSpec for UsbTxs0Reg_SPEC {
3071 type DataType = u32;
3072}
3073
3074#[doc = "Transmit Status 0 Register"]
3075pub type UsbTxs0Reg = crate::RegValueT<UsbTxs0Reg_SPEC>;
3076
3077impl UsbTxs0Reg {
3078 #[doc = "Acknowledge Status\nThis bit indicates the status, as received from the host, of the ACK for the packet previously sent. This bit is to be interpreted when TX_DONE is set to 1. It is set to 1, when an ACK is received; otherwise, it remains cleared. This bit is also cleared to 0, when this register is read."]
3079 #[inline(always)]
3080 pub fn usb_ack_stat(
3081 self,
3082 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs0Reg_SPEC, crate::common::R> {
3083 crate::common::RegisterFieldBool::<6,1,0,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3084 }
3085
3086 #[doc = "Transmission Done\nWhen set to 1, this bit indicates that a packet has completed transmission. It is cleared to 0, when this register is read."]
3087 #[inline(always)]
3088 pub fn usb_tx_done(
3089 self,
3090 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs0Reg_SPEC, crate::common::R> {
3091 crate::common::RegisterFieldBool::<5,1,0,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3092 }
3093
3094 #[doc = "Transmission Count\nThis 5-bit field indicates the number of empty bytes available in the FIFO. This field is never larger than 8 for Endpoint 0."]
3095 #[inline(always)]
3096 pub fn usb_tcount(
3097 self,
3098 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs0Reg_SPEC, crate::common::R>
3099 {
3100 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3101 }
3102}
3103impl ::core::default::Default for UsbTxs0Reg {
3104 #[inline(always)]
3105 fn default() -> UsbTxs0Reg {
3106 <crate::RegValueT<UsbTxs0Reg_SPEC> as RegisterValue<_>>::new(8)
3107 }
3108}
3109
3110#[doc(hidden)]
3111#[derive(Copy, Clone, Eq, PartialEq)]
3112pub struct UsbTxs1Reg_SPEC;
3113impl crate::sealed::RegSpec for UsbTxs1Reg_SPEC {
3114 type DataType = u32;
3115}
3116
3117#[doc = "Transmit Status Register 1"]
3118pub type UsbTxs1Reg = crate::RegValueT<UsbTxs1Reg_SPEC>;
3119
3120impl UsbTxs1Reg {
3121 #[doc = "Transmit FIFO Underrun\nThis bit is set to 1, if the transmit FIFO becomes empty during a transmission, and no new data is written to the FIFO. If so, the Media Access Controller (MAC) forces a bit stuff error followed by an EOP. This bit is cleared to 0, when this register is read."]
3122 #[inline(always)]
3123 pub fn usb_tx_urun(
3124 self,
3125 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3126 crate::common::RegisterFieldBool::<7,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3127 }
3128
3129 #[doc = "Acknowledge Status\nThis bit is interpreted when TX_DONE is set. It\'s function differs depending on whether ISO (ISO in the EPCx register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, this bit indicates the acknowledge status (from the host) about the ACK for the previously sent packet. This bit itself is set to 1, when an ACK is received; otherwise, it is cleared to 0.\nFor ISO operation, this bit is set if a frame number LSB match (see IGN_ISOMSK bit in the USB_TXCx_REG) occurs, and data was sent in response to an IN token. Otherwise, this bit is cleared to 0, the FIFO is flushed and TX_DONE is set.\nThis bit is also cleared to 0, when this register is read."]
3130 #[inline(always)]
3131 pub fn usb_ack_stat(
3132 self,
3133 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3134 crate::common::RegisterFieldBool::<6,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3135 }
3136
3137 #[doc = "Transmission Done\nWhen set to 1, this bit indicates that the endpoint responded to a USB packet. Three conditions can cause this bit to be set:\nA data packet completed transmission in response to an IN token with non-ISO operation.\nThe endpoint sent a STALL handshake in response to an IN token\nA scheduled ISO frame was transmitted or discarded.\nThis bit is cleared to 0 when this register is read."]
3138 #[inline(always)]
3139 pub fn usb_tx_done(
3140 self,
3141 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3142 crate::common::RegisterFieldBool::<5,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3143 }
3144
3145 #[doc = "Transmission Count\nThis 5-bit field holds the number of empty bytes available in the FIFO. If this number is greater than 31, a value of 31 is actually reported."]
3146 #[inline(always)]
3147 pub fn usb_tcount(
3148 self,
3149 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs1Reg_SPEC, crate::common::R>
3150 {
3151 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3152 }
3153}
3154impl ::core::default::Default for UsbTxs1Reg {
3155 #[inline(always)]
3156 fn default() -> UsbTxs1Reg {
3157 <crate::RegValueT<UsbTxs1Reg_SPEC> as RegisterValue<_>>::new(31)
3158 }
3159}
3160
3161#[doc(hidden)]
3162#[derive(Copy, Clone, Eq, PartialEq)]
3163pub struct UsbTxs2Reg_SPEC;
3164impl crate::sealed::RegSpec for UsbTxs2Reg_SPEC {
3165 type DataType = u32;
3166}
3167
3168#[doc = "Transmit Status Register 2"]
3169pub type UsbTxs2Reg = crate::RegValueT<UsbTxs2Reg_SPEC>;
3170
3171impl UsbTxs2Reg {
3172 #[doc = "Transmit FIFO Underrun\nThis bit is set to 1, if the transmit FIFO becomes empty during a transmission, and no new data is written to the FIFO. If so, the Media Access Controller (MAC) forces a bit stuff error followed by an EOP. This bit is cleared to 0, when this register is read."]
3173 #[inline(always)]
3174 pub fn usb_tx_urun(
3175 self,
3176 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3177 crate::common::RegisterFieldBool::<7,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3178 }
3179
3180 #[doc = "Acknowledge Status\nThis bit is interpreted when TX_DONE is set. It\'s function differs depending on whether ISO (ISO in the EPCx register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, this bit indicates the acknowledge status (from the host) about the ACK for the previously sent packet. This bit itself is set to 1, when an ACK is received; otherwise, it is cleared to 0.\nFor ISO operation, this bit is set if a frame number LSB match (see IGN_ISOMSK bit in the USB_TXCx_REG) occurs, and data was sent in response to an IN token. Otherwise, this bit is cleared to 0, the FIFO is flushed and TX_DONE is set.\nThis bit is also cleared to 0, when this register is read."]
3181 #[inline(always)]
3182 pub fn usb_ack_stat(
3183 self,
3184 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3185 crate::common::RegisterFieldBool::<6,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3186 }
3187
3188 #[doc = "Transmission Done\nWhen set to 1, this bit indicates that the endpoint responded to a USB packet. Three conditions can cause this bit to be set:\nA data packet completed transmission in response to an IN token with non-ISO operation.\nThe endpoint sent a STALL handshake in response to an IN token\nA scheduled ISO frame was transmitted or discarded.\nThis bit is cleared to 0 when this register is read."]
3189 #[inline(always)]
3190 pub fn usb_tx_done(
3191 self,
3192 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3193 crate::common::RegisterFieldBool::<5,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3194 }
3195
3196 #[doc = "Transmission Count\nThis 5-bit field holds the number of empty bytes available in the FIFO. If this number is greater than 31, a value of 31 is actually reported."]
3197 #[inline(always)]
3198 pub fn usb_tcount(
3199 self,
3200 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs2Reg_SPEC, crate::common::R>
3201 {
3202 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3203 }
3204}
3205impl ::core::default::Default for UsbTxs2Reg {
3206 #[inline(always)]
3207 fn default() -> UsbTxs2Reg {
3208 <crate::RegValueT<UsbTxs2Reg_SPEC> as RegisterValue<_>>::new(31)
3209 }
3210}
3211
3212#[doc(hidden)]
3213#[derive(Copy, Clone, Eq, PartialEq)]
3214pub struct UsbTxs3Reg_SPEC;
3215impl crate::sealed::RegSpec for UsbTxs3Reg_SPEC {
3216 type DataType = u32;
3217}
3218
3219#[doc = "Transmit Status Register 3"]
3220pub type UsbTxs3Reg = crate::RegValueT<UsbTxs3Reg_SPEC>;
3221
3222impl UsbTxs3Reg {
3223 #[doc = "Transmit FIFO Underrun\nThis bit is set to 1, if the transmit FIFO becomes empty during a transmission, and no new data is written to the FIFO. If so, the Media Access Controller (MAC) forces a bit stuff error followed by an EOP. This bit is cleared to 0, when this register is read."]
3224 #[inline(always)]
3225 pub fn usb_tx_urun(
3226 self,
3227 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3228 crate::common::RegisterFieldBool::<7,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3229 }
3230
3231 #[doc = "Acknowledge Status\nThis bit is interpreted when TX_DONE is set. It\'s function differs depending on whether ISO (ISO in the EPCx register is set) or non-ISO operation (ISO is reset) is used.\nFor non-ISO operation, this bit indicates the acknowledge status (from the host) about the ACK for the previously sent packet. This bit itself is set to 1, when an ACK is received; otherwise, it is cleared to 0.\nFor ISO operation, this bit is set if a frame number LSB match (see IGN_ISOMSK bit in the USB_TXCx_REG) occurs, and data was sent in response to an IN token. Otherwise, this bit is cleared to 0, the FIFO is flushed and TX_DONE is set.\nThis bit is also cleared to 0, when this register is read."]
3232 #[inline(always)]
3233 pub fn usb_ack_stat(
3234 self,
3235 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3236 crate::common::RegisterFieldBool::<6,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3237 }
3238
3239 #[doc = "Transmission Done\nWhen set to 1, this bit indicates that the endpoint responded to a USB packet. Three conditions can cause this bit to be set:\nA data packet completed transmission in response to an IN token with non-ISO operation.\nThe endpoint sent a STALL handshake in response to an IN token\nA scheduled ISO frame was transmitted or discarded.\nThis bit is cleared to 0 when this register is read."]
3240 #[inline(always)]
3241 pub fn usb_tx_done(
3242 self,
3243 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3244 crate::common::RegisterFieldBool::<5,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3245 }
3246
3247 #[doc = "Transmission Count\nThis 5-bit field holds the number of empty bytes available in the FIFO. If this number is greater than 31, a value of 31 is actually reported."]
3248 #[inline(always)]
3249 pub fn usb_tcount(
3250 self,
3251 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs3Reg_SPEC, crate::common::R>
3252 {
3253 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3254 }
3255}
3256impl ::core::default::Default for UsbTxs3Reg {
3257 #[inline(always)]
3258 fn default() -> UsbTxs3Reg {
3259 <crate::RegValueT<UsbTxs3Reg_SPEC> as RegisterValue<_>>::new(31)
3260 }
3261}
3262
3263#[doc(hidden)]
3264#[derive(Copy, Clone, Eq, PartialEq)]
3265pub struct UsbUtrReg_SPEC;
3266impl crate::sealed::RegSpec for UsbUtrReg_SPEC {
3267 type DataType = u32;
3268}
3269
3270#[doc = "USB test Register (for test purpose only)"]
3271pub type UsbUtrReg = crate::RegValueT<UsbUtrReg_SPEC>;
3272
3273impl UsbUtrReg {
3274 #[doc = "Diagnostic enable\n\'0\': Normal operational.\n\'1\': Access to the USB_XCVDIAG_REG and USB_TCR_REG enabled. For diagnostic purposes only"]
3275 #[inline(always)]
3276 pub fn usb_diag(
3277 self,
3278 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3279 crate::common::RegisterFieldBool::<7,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3280 }
3281
3282 #[doc = "No CRC16\nWhen this bit is set to 1, all packets transmitted by the Full/Low Speed USB node are sent without a trailing CRC16. Receive operations are unaffected. This mode is used to check that CRC errors can be detected by other nodes. For diagnostic purposes only"]
3283 #[inline(always)]
3284 pub fn usb_ncrc(
3285 self,
3286 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3287 crate::common::RegisterFieldBool::<6,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3288 }
3289
3290 #[doc = "Short Frame\nEnables the Frame timer to lock and track, short, non-compliant USB frame sizes. The Short Frame bit should not be set during normal operation. For test purposes only"]
3291 #[inline(always)]
3292 pub fn usb_sf(
3293 self,
3294 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3295 crate::common::RegisterFieldBool::<5,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3296 }
3297
3298 #[doc = "Reserved. Must be kept to \'0\'"]
3299 #[inline(always)]
3300 pub fn usb_utr_res(
3301 self,
3302 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbUtrReg_SPEC, crate::common::RW>
3303 {
3304 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3305 }
3306}
3307impl ::core::default::Default for UsbUtrReg {
3308 #[inline(always)]
3309 fn default() -> UsbUtrReg {
3310 <crate::RegValueT<UsbUtrReg_SPEC> as RegisterValue<_>>::new(0)
3311 }
3312}
3313
3314#[doc(hidden)]
3315#[derive(Copy, Clone, Eq, PartialEq)]
3316pub struct UsbUx20CdrReg_SPEC;
3317impl crate::sealed::RegSpec for UsbUx20CdrReg_SPEC {
3318 type DataType = u32;
3319}
3320
3321#[doc = "Transceiver 2.0 Configuration and Diagnostics Register(for test purpose only)"]
3322pub type UsbUx20CdrReg = crate::RegValueT<UsbUx20CdrReg_SPEC>;
3323
3324impl UsbUx20CdrReg {
3325 #[doc = "Test bit"]
3326 #[inline(always)]
3327 pub fn rpu_test7(
3328 self,
3329 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbUx20CdrReg_SPEC, crate::common::R> {
3330 crate::common::RegisterFieldBool::<7,1,0,UsbUx20CdrReg_SPEC,crate::common::R>::from_register(self,0)
3331 }
3332
3333 #[doc = "0: Closes SW2 switch to reduced pull-up resistor connected to the USB_Dp and USB_Dm.\n1: Opens SW2 switch resistor connected to the USB_Dp and USB_Dm (independent of the VBus state)."]
3334 #[inline(always)]
3335 pub fn rpu_test_sw2(
3336 self,
3337 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3338 crate::common::RegisterFieldBool::<6,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3339 }
3340
3341 #[doc = "0: Enable the pull-up resistor on USB_Dp (SW1 closed)\n1: Disable the pull-up resistor on USB_Dp (SW1 open) (Independent of the VBus state)."]
3342 #[inline(always)]
3343 pub fn rpu_test_sw1(
3344 self,
3345 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3346 crate::common::RegisterFieldBool::<5,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3347 }
3348
3349 #[doc = "Pull-Up Resistor Test Enable\n0: Normal operation\n1: Enables the test features controlled by RPU_TEST_SW1, RPU_TEST_SW1DM and RPU_TEST_SW2"]
3350 #[inline(always)]
3351 pub fn rpu_test_en(
3352 self,
3353 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3354 crate::common::RegisterFieldBool::<4,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3355 }
3356
3357 #[doc = "0: Enable the pull-up resistor on USB_Dm (SW1DM closed)\n1: Disable the pull-up resistor on USB_Dm (SW1DM open) (Independent of the VBus state)."]
3358 #[inline(always)]
3359 pub fn rpu_test_sw1dm(
3360 self,
3361 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3362 crate::common::RegisterFieldBool::<2,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3363 }
3364
3365 #[doc = "Test bit, must be kept 0"]
3366 #[inline(always)]
3367 pub fn rpu_rcdelay(
3368 self,
3369 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3370 crate::common::RegisterFieldBool::<1,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3371 }
3372
3373 #[doc = "Test bit, must be kept 0"]
3374 #[inline(always)]
3375 pub fn rpu_ssproten(
3376 self,
3377 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3378 crate::common::RegisterFieldBool::<0,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3379 }
3380}
3381impl ::core::default::Default for UsbUx20CdrReg {
3382 #[inline(always)]
3383 fn default() -> UsbUx20CdrReg {
3384 <crate::RegValueT<UsbUx20CdrReg_SPEC> as RegisterValue<_>>::new(0)
3385 }
3386}
3387
3388#[doc(hidden)]
3389#[derive(Copy, Clone, Eq, PartialEq)]
3390pub struct UsbXcvdiagReg_SPEC;
3391impl crate::sealed::RegSpec for UsbXcvdiagReg_SPEC {
3392 type DataType = u32;
3393}
3394
3395#[doc = "Transceiver diagnostic Register (for test purpose only)"]
3396pub type UsbXcvdiagReg = crate::RegValueT<UsbXcvdiagReg_SPEC>;
3397
3398impl UsbXcvdiagReg {
3399 #[doc = "With Bit0 = 1 this bit shows the level of the USB_Dp receive data from transceiver; i.e. D+ <= VSE."]
3400 #[inline(always)]
3401 pub fn usb_vpin(
3402 self,
3403 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3404 crate::common::RegisterFieldBool::<7,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3405 }
3406
3407 #[doc = "With Bit0 = 1 this bit shows the level USB_Dm receive data from transceiver; i.e. D- <= VSE."]
3408 #[inline(always)]
3409 pub fn usb_vmin(
3410 self,
3411 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3412 crate::common::RegisterFieldBool::<6,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3413 }
3414
3415 #[doc = "With Bit0 = 1 this bit shows the differential level of the receive comparator."]
3416 #[inline(always)]
3417 pub fn usb_rcv(
3418 self,
3419 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3420 crate::common::RegisterFieldBool::<5,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3421 }
3422
3423 #[doc = "With Bit0 = 1, this bit enables test Bits 2,1. Must be kept to \'0\' for normal operation"]
3424 #[inline(always)]
3425 pub fn usb_xcv_txen(
3426 self,
3427 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3428 crate::common::RegisterFieldBool::<3,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3429 }
3430
3431 #[doc = "With Bit3,0 = 1, this bit sets USB_Dm to a high level, independent of LSMODE selection"]
3432 #[inline(always)]
3433 pub fn usb_xcv_txn(
3434 self,
3435 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3436 crate::common::RegisterFieldBool::<2,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3437 }
3438
3439 #[doc = "With Bit3,0 = 1, this bit sets USB_Dp to a high level, independent of LSMODE selection"]
3440 #[inline(always)]
3441 pub fn usb_xcv_txp(
3442 self,
3443 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3444 crate::common::RegisterFieldBool::<1,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3445 }
3446
3447 #[doc = "Enable USB_XCVDIAG_REG\n0: Normal operation, test bits disabled\n1: Enable test bits 7,6,5,3,2,1"]
3448 #[inline(always)]
3449 pub fn usb_xcv_test(
3450 self,
3451 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3452 crate::common::RegisterFieldBool::<0,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3453 }
3454}
3455impl ::core::default::Default for UsbXcvdiagReg {
3456 #[inline(always)]
3457 fn default() -> UsbXcvdiagReg {
3458 <crate::RegValueT<UsbXcvdiagReg_SPEC> as RegisterValue<_>>::new(0)
3459 }
3460}