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(16usize),
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(18usize),
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(212usize),
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(214usize),
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(208usize),
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(72usize),
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(64usize),
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(80usize),
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(88usize),
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(96usize),
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(104usize),
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(112usize),
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(120usize),
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(8usize),
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(36usize),
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(38usize),
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(32usize),
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(34usize),
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(12usize),
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(14usize),
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(28usize),
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(30usize),
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(10usize),
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(78usize),
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(94usize),
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(110usize),
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(126usize),
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(74usize),
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(90usize),
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(106usize),
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(122usize),
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(24usize),
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(26usize),
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(76usize),
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(92usize),
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(108usize),
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(124usize),
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(4usize),
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(70usize),
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(86usize),
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(102usize),
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(118usize),
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(66usize),
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(82usize),
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(98usize),
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(114usize),
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(20usize),
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(22usize),
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(68usize),
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(84usize),
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(100usize),
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(116usize),
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(6usize),
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(62usize),
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(2usize),
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
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 = u16;
2383}
2384
2385#[doc = "Receive Status Register 1"]
2386pub type UsbRxs1Reg = crate::RegValueT<UsbRxs1Reg_SPEC>;
2387
2388impl UsbRxs1Reg {
2389 #[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."]
2390 #[inline(always)]
2391 pub fn usb_rx_err(
2392 self,
2393 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2394 crate::common::RegisterFieldBool::<7,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2395 }
2396
2397 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2398 #[inline(always)]
2399 pub fn usb_setup(
2400 self,
2401 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2402 crate::common::RegisterFieldBool::<6,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2403 }
2404
2405 #[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."]
2406 #[inline(always)]
2407 pub fn usb_toggle_rx(
2408 self,
2409 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2410 crate::common::RegisterFieldBool::<5,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2411 }
2412
2413 #[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."]
2414 #[inline(always)]
2415 pub fn usb_rx_last(
2416 self,
2417 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs1Reg_SPEC, crate::common::R> {
2418 crate::common::RegisterFieldBool::<4,1,0,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2419 }
2420
2421 #[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."]
2422 #[inline(always)]
2423 pub fn usb_rcount(
2424 self,
2425 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs1Reg_SPEC, crate::common::R> {
2426 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs1Reg_SPEC,crate::common::R>::from_register(self,0)
2427 }
2428}
2429impl ::core::default::Default for UsbRxs1Reg {
2430 #[inline(always)]
2431 fn default() -> UsbRxs1Reg {
2432 <crate::RegValueT<UsbRxs1Reg_SPEC> as RegisterValue<_>>::new(0)
2433 }
2434}
2435
2436#[doc(hidden)]
2437#[derive(Copy, Clone, Eq, PartialEq)]
2438pub struct UsbRxs2Reg_SPEC;
2439impl crate::sealed::RegSpec for UsbRxs2Reg_SPEC {
2440 type DataType = u16;
2441}
2442
2443#[doc = "Receive Status Register 2"]
2444pub type UsbRxs2Reg = crate::RegValueT<UsbRxs2Reg_SPEC>;
2445
2446impl UsbRxs2Reg {
2447 #[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."]
2448 #[inline(always)]
2449 pub fn usb_rx_err(
2450 self,
2451 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2452 crate::common::RegisterFieldBool::<7,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2453 }
2454
2455 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2456 #[inline(always)]
2457 pub fn usb_setup(
2458 self,
2459 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2460 crate::common::RegisterFieldBool::<6,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2461 }
2462
2463 #[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."]
2464 #[inline(always)]
2465 pub fn usb_toggle_rx(
2466 self,
2467 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2468 crate::common::RegisterFieldBool::<5,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2469 }
2470
2471 #[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."]
2472 #[inline(always)]
2473 pub fn usb_rx_last(
2474 self,
2475 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs2Reg_SPEC, crate::common::R> {
2476 crate::common::RegisterFieldBool::<4,1,0,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2477 }
2478
2479 #[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."]
2480 #[inline(always)]
2481 pub fn usb_rcount(
2482 self,
2483 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs2Reg_SPEC, crate::common::R> {
2484 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs2Reg_SPEC,crate::common::R>::from_register(self,0)
2485 }
2486}
2487impl ::core::default::Default for UsbRxs2Reg {
2488 #[inline(always)]
2489 fn default() -> UsbRxs2Reg {
2490 <crate::RegValueT<UsbRxs2Reg_SPEC> as RegisterValue<_>>::new(0)
2491 }
2492}
2493
2494#[doc(hidden)]
2495#[derive(Copy, Clone, Eq, PartialEq)]
2496pub struct UsbRxs3Reg_SPEC;
2497impl crate::sealed::RegSpec for UsbRxs3Reg_SPEC {
2498 type DataType = u16;
2499}
2500
2501#[doc = "Receive Status Register 3"]
2502pub type UsbRxs3Reg = crate::RegValueT<UsbRxs3Reg_SPEC>;
2503
2504impl UsbRxs3Reg {
2505 #[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."]
2506 #[inline(always)]
2507 pub fn usb_rx_err(
2508 self,
2509 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2510 crate::common::RegisterFieldBool::<7,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2511 }
2512
2513 #[doc = "Setup\nThis bit indicates that the setup packet has been received. It is cleared when this register is read."]
2514 #[inline(always)]
2515 pub fn usb_setup(
2516 self,
2517 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2518 crate::common::RegisterFieldBool::<6,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2519 }
2520
2521 #[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."]
2522 #[inline(always)]
2523 pub fn usb_toggle_rx(
2524 self,
2525 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2526 crate::common::RegisterFieldBool::<5,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2527 }
2528
2529 #[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."]
2530 #[inline(always)]
2531 pub fn usb_rx_last(
2532 self,
2533 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbRxs3Reg_SPEC, crate::common::R> {
2534 crate::common::RegisterFieldBool::<4,1,0,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2535 }
2536
2537 #[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."]
2538 #[inline(always)]
2539 pub fn usb_rcount(
2540 self,
2541 ) -> crate::common::RegisterField<0, 0xf, 1, 0, u8, u8, UsbRxs3Reg_SPEC, crate::common::R> {
2542 crate::common::RegisterField::<0,0xf,1,0,u8,u8,UsbRxs3Reg_SPEC,crate::common::R>::from_register(self,0)
2543 }
2544}
2545impl ::core::default::Default for UsbRxs3Reg {
2546 #[inline(always)]
2547 fn default() -> UsbRxs3Reg {
2548 <crate::RegValueT<UsbRxs3Reg_SPEC> as RegisterValue<_>>::new(0)
2549 }
2550}
2551
2552#[doc(hidden)]
2553#[derive(Copy, Clone, Eq, PartialEq)]
2554pub struct UsbTcrReg_SPEC;
2555impl crate::sealed::RegSpec for UsbTcrReg_SPEC {
2556 type DataType = u16;
2557}
2558
2559#[doc = "Transceiver configuration Register"]
2560pub type UsbTcrReg = crate::RegValueT<UsbTcrReg_SPEC>;
2561
2562impl UsbTcrReg {
2563 #[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"]
2564 #[inline(always)]
2565 pub fn usb_vadj(
2566 self,
2567 ) -> crate::common::RegisterField<5, 0x7, 1, 0, u8, u8, UsbTcrReg_SPEC, crate::common::RW> {
2568 crate::common::RegisterField::<5,0x7,1,0,u8,u8,UsbTcrReg_SPEC,crate::common::RW>::from_register(self,0)
2569 }
2570
2571 #[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"]
2572 #[inline(always)]
2573 pub fn usb_cadj(
2574 self,
2575 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTcrReg_SPEC, crate::common::RW>
2576 {
2577 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTcrReg_SPEC,crate::common::RW>::from_register(self,0)
2578 }
2579}
2580impl ::core::default::Default for UsbTcrReg {
2581 #[inline(always)]
2582 fn default() -> UsbTcrReg {
2583 <crate::RegValueT<UsbTcrReg_SPEC> as RegisterValue<_>>::new(144)
2584 }
2585}
2586
2587#[doc(hidden)]
2588#[derive(Copy, Clone, Eq, PartialEq)]
2589pub struct UsbTxc0Reg_SPEC;
2590impl crate::sealed::RegSpec for UsbTxc0Reg_SPEC {
2591 type DataType = u16;
2592}
2593
2594#[doc = "Transmit command 0 Register"]
2595pub type UsbTxc0Reg = crate::RegValueT<UsbTxc0Reg_SPEC>;
2596
2597impl UsbTxc0Reg {
2598 #[doc = "Ignore IN Tokens\nWhen this bit is set to 1, the endpoint will ignore any IN tokens directed to its configured address."]
2599 #[inline(always)]
2600 pub fn usb_ign_in(
2601 self,
2602 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2603 crate::common::RegisterFieldBool::<4,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2604 }
2605
2606 #[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."]
2607 #[inline(always)]
2608 pub fn usb_flush(
2609 self,
2610 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2611 crate::common::RegisterFieldBool::<3,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2612 }
2613
2614 #[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."]
2615 #[inline(always)]
2616 pub fn usb_toggle_tx0(
2617 self,
2618 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2619 crate::common::RegisterFieldBool::<2,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2620 }
2621
2622 #[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."]
2623 #[inline(always)]
2624 pub fn usb_tx_en(
2625 self,
2626 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc0Reg_SPEC, crate::common::RW> {
2627 crate::common::RegisterFieldBool::<0,1,0,UsbTxc0Reg_SPEC,crate::common::RW>::from_register(self,0)
2628 }
2629}
2630impl ::core::default::Default for UsbTxc0Reg {
2631 #[inline(always)]
2632 fn default() -> UsbTxc0Reg {
2633 <crate::RegValueT<UsbTxc0Reg_SPEC> as RegisterValue<_>>::new(0)
2634 }
2635}
2636
2637#[doc(hidden)]
2638#[derive(Copy, Clone, Eq, PartialEq)]
2639pub struct UsbTxc1Reg_SPEC;
2640impl crate::sealed::RegSpec for UsbTxc1Reg_SPEC {
2641 type DataType = u16;
2642}
2643
2644#[doc = "Transmit Command Register 1"]
2645pub type UsbTxc1Reg = crate::RegValueT<UsbTxc1Reg_SPEC>;
2646
2647impl UsbTxc1Reg {
2648 #[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."]
2649 #[inline(always)]
2650 pub fn usb_ign_isomsk(
2651 self,
2652 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2653 crate::common::RegisterFieldBool::<7,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2654 }
2655
2656 #[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"]
2657 #[inline(always)]
2658 pub fn usb_tfwl(
2659 self,
2660 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc1Reg_SPEC, crate::common::RW>
2661 {
2662 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2663 }
2664
2665 #[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."]
2666 #[inline(always)]
2667 pub fn usb_rff(
2668 self,
2669 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2670 crate::common::RegisterFieldBool::<4,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2671 }
2672
2673 #[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."]
2674 #[inline(always)]
2675 pub fn usb_flush(
2676 self,
2677 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2678 crate::common::RegisterFieldBool::<3,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2679 }
2680
2681 #[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."]
2682 #[inline(always)]
2683 pub fn usb_toggle_tx(
2684 self,
2685 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2686 crate::common::RegisterFieldBool::<2,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2687 }
2688
2689 #[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."]
2690 #[inline(always)]
2691 pub fn usb_last(
2692 self,
2693 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2694 crate::common::RegisterFieldBool::<1,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2695 }
2696
2697 #[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."]
2698 #[inline(always)]
2699 pub fn usb_tx_en(
2700 self,
2701 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc1Reg_SPEC, crate::common::RW> {
2702 crate::common::RegisterFieldBool::<0,1,0,UsbTxc1Reg_SPEC,crate::common::RW>::from_register(self,0)
2703 }
2704}
2705impl ::core::default::Default for UsbTxc1Reg {
2706 #[inline(always)]
2707 fn default() -> UsbTxc1Reg {
2708 <crate::RegValueT<UsbTxc1Reg_SPEC> as RegisterValue<_>>::new(0)
2709 }
2710}
2711
2712#[doc(hidden)]
2713#[derive(Copy, Clone, Eq, PartialEq)]
2714pub struct UsbTxc2Reg_SPEC;
2715impl crate::sealed::RegSpec for UsbTxc2Reg_SPEC {
2716 type DataType = u16;
2717}
2718
2719#[doc = "Transmit Command Register 2"]
2720pub type UsbTxc2Reg = crate::RegValueT<UsbTxc2Reg_SPEC>;
2721
2722impl UsbTxc2Reg {
2723 #[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."]
2724 #[inline(always)]
2725 pub fn usb_ign_isomsk(
2726 self,
2727 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2728 crate::common::RegisterFieldBool::<7,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2729 }
2730
2731 #[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"]
2732 #[inline(always)]
2733 pub fn usb_tfwl(
2734 self,
2735 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc2Reg_SPEC, crate::common::RW>
2736 {
2737 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2738 }
2739
2740 #[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."]
2741 #[inline(always)]
2742 pub fn usb_rff(
2743 self,
2744 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2745 crate::common::RegisterFieldBool::<4,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2746 }
2747
2748 #[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."]
2749 #[inline(always)]
2750 pub fn usb_flush(
2751 self,
2752 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2753 crate::common::RegisterFieldBool::<3,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2754 }
2755
2756 #[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."]
2757 #[inline(always)]
2758 pub fn usb_toggle_tx(
2759 self,
2760 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2761 crate::common::RegisterFieldBool::<2,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2762 }
2763
2764 #[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."]
2765 #[inline(always)]
2766 pub fn usb_last(
2767 self,
2768 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2769 crate::common::RegisterFieldBool::<1,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2770 }
2771
2772 #[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."]
2773 #[inline(always)]
2774 pub fn usb_tx_en(
2775 self,
2776 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc2Reg_SPEC, crate::common::RW> {
2777 crate::common::RegisterFieldBool::<0,1,0,UsbTxc2Reg_SPEC,crate::common::RW>::from_register(self,0)
2778 }
2779}
2780impl ::core::default::Default for UsbTxc2Reg {
2781 #[inline(always)]
2782 fn default() -> UsbTxc2Reg {
2783 <crate::RegValueT<UsbTxc2Reg_SPEC> as RegisterValue<_>>::new(0)
2784 }
2785}
2786
2787#[doc(hidden)]
2788#[derive(Copy, Clone, Eq, PartialEq)]
2789pub struct UsbTxc3Reg_SPEC;
2790impl crate::sealed::RegSpec for UsbTxc3Reg_SPEC {
2791 type DataType = u16;
2792}
2793
2794#[doc = "Transmit Command Register 3"]
2795pub type UsbTxc3Reg = crate::RegValueT<UsbTxc3Reg_SPEC>;
2796
2797impl UsbTxc3Reg {
2798 #[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."]
2799 #[inline(always)]
2800 pub fn usb_ign_isomsk(
2801 self,
2802 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2803 crate::common::RegisterFieldBool::<7,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2804 }
2805
2806 #[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"]
2807 #[inline(always)]
2808 pub fn usb_tfwl(
2809 self,
2810 ) -> crate::common::RegisterField<5, 0x3, 1, 0, u8, u8, UsbTxc3Reg_SPEC, crate::common::RW>
2811 {
2812 crate::common::RegisterField::<5,0x3,1,0,u8,u8,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2813 }
2814
2815 #[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."]
2816 #[inline(always)]
2817 pub fn usb_rff(
2818 self,
2819 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2820 crate::common::RegisterFieldBool::<4,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2821 }
2822
2823 #[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."]
2824 #[inline(always)]
2825 pub fn usb_flush(
2826 self,
2827 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2828 crate::common::RegisterFieldBool::<3,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2829 }
2830
2831 #[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."]
2832 #[inline(always)]
2833 pub fn usb_toggle_tx(
2834 self,
2835 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2836 crate::common::RegisterFieldBool::<2,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2837 }
2838
2839 #[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."]
2840 #[inline(always)]
2841 pub fn usb_last(
2842 self,
2843 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2844 crate::common::RegisterFieldBool::<1,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2845 }
2846
2847 #[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."]
2848 #[inline(always)]
2849 pub fn usb_tx_en(
2850 self,
2851 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbTxc3Reg_SPEC, crate::common::RW> {
2852 crate::common::RegisterFieldBool::<0,1,0,UsbTxc3Reg_SPEC,crate::common::RW>::from_register(self,0)
2853 }
2854}
2855impl ::core::default::Default for UsbTxc3Reg {
2856 #[inline(always)]
2857 fn default() -> UsbTxc3Reg {
2858 <crate::RegValueT<UsbTxc3Reg_SPEC> as RegisterValue<_>>::new(0)
2859 }
2860}
2861
2862#[doc(hidden)]
2863#[derive(Copy, Clone, Eq, PartialEq)]
2864pub struct UsbTxd0Reg_SPEC;
2865impl crate::sealed::RegSpec for UsbTxd0Reg_SPEC {
2866 type DataType = u16;
2867}
2868
2869#[doc = "Transmit Data 0 Register"]
2870pub type UsbTxd0Reg = crate::RegValueT<UsbTxd0Reg_SPEC>;
2871
2872impl UsbTxd0Reg {
2873 #[doc = "Transmit FIFO Data Byte\nThe firmware is expected to write only the packet payload data. The PID and CRC16 are created automatically."]
2874 #[inline(always)]
2875 pub fn usb_txfd(
2876 self,
2877 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd0Reg_SPEC, crate::common::W>
2878 {
2879 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd0Reg_SPEC,crate::common::W>::from_register(self,0)
2880 }
2881}
2882impl ::core::default::Default for UsbTxd0Reg {
2883 #[inline(always)]
2884 fn default() -> UsbTxd0Reg {
2885 <crate::RegValueT<UsbTxd0Reg_SPEC> as RegisterValue<_>>::new(0)
2886 }
2887}
2888
2889#[doc(hidden)]
2890#[derive(Copy, Clone, Eq, PartialEq)]
2891pub struct UsbTxd1Reg_SPEC;
2892impl crate::sealed::RegSpec for UsbTxd1Reg_SPEC {
2893 type DataType = u16;
2894}
2895
2896#[doc = "Transmit Data Register 1"]
2897pub type UsbTxd1Reg = crate::RegValueT<UsbTxd1Reg_SPEC>;
2898
2899impl UsbTxd1Reg {
2900 #[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."]
2901 #[inline(always)]
2902 pub fn usb_txfd(
2903 self,
2904 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, UsbTxd1Reg_SPEC, crate::common::W>
2905 {
2906 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd1Reg_SPEC,crate::common::W>::from_register(self,0)
2907 }
2908}
2909impl ::core::default::Default for UsbTxd1Reg {
2910 #[inline(always)]
2911 fn default() -> UsbTxd1Reg {
2912 <crate::RegValueT<UsbTxd1Reg_SPEC> as RegisterValue<_>>::new(0)
2913 }
2914}
2915
2916#[doc(hidden)]
2917#[derive(Copy, Clone, Eq, PartialEq)]
2918pub struct UsbTxd2Reg_SPEC;
2919impl crate::sealed::RegSpec for UsbTxd2Reg_SPEC {
2920 type DataType = u16;
2921}
2922
2923#[doc = "Transmit Data Register 2"]
2924pub type UsbTxd2Reg = crate::RegValueT<UsbTxd2Reg_SPEC>;
2925
2926impl UsbTxd2Reg {
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, UsbTxd2Reg_SPEC, crate::common::W>
2932 {
2933 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd2Reg_SPEC,crate::common::W>::from_register(self,0)
2934 }
2935}
2936impl ::core::default::Default for UsbTxd2Reg {
2937 #[inline(always)]
2938 fn default() -> UsbTxd2Reg {
2939 <crate::RegValueT<UsbTxd2Reg_SPEC> as RegisterValue<_>>::new(0)
2940 }
2941}
2942
2943#[doc(hidden)]
2944#[derive(Copy, Clone, Eq, PartialEq)]
2945pub struct UsbTxd3Reg_SPEC;
2946impl crate::sealed::RegSpec for UsbTxd3Reg_SPEC {
2947 type DataType = u16;
2948}
2949
2950#[doc = "Transmit Data Register 3"]
2951pub type UsbTxd3Reg = crate::RegValueT<UsbTxd3Reg_SPEC>;
2952
2953impl UsbTxd3Reg {
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, UsbTxd3Reg_SPEC, crate::common::W>
2959 {
2960 crate::common::RegisterField::<0,0xff,1,0,u8,u8,UsbTxd3Reg_SPEC,crate::common::W>::from_register(self,0)
2961 }
2962}
2963impl ::core::default::Default for UsbTxd3Reg {
2964 #[inline(always)]
2965 fn default() -> UsbTxd3Reg {
2966 <crate::RegValueT<UsbTxd3Reg_SPEC> as RegisterValue<_>>::new(0)
2967 }
2968}
2969
2970#[doc(hidden)]
2971#[derive(Copy, Clone, Eq, PartialEq)]
2972pub struct UsbTxevReg_SPEC;
2973impl crate::sealed::RegSpec for UsbTxevReg_SPEC {
2974 type DataType = u16;
2975}
2976
2977#[doc = "Transmit Event Register"]
2978pub type UsbTxevReg = crate::RegValueT<UsbTxevReg_SPEC>;
2979
2980impl UsbTxevReg {
2981 #[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"]
2982 #[inline(always)]
2983 pub fn usb_txudrrn31(
2984 self,
2985 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbTxevReg_SPEC, crate::common::R> {
2986 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbTxevReg_SPEC,crate::common::R>::from_register(self,0)
2987 }
2988
2989 #[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."]
2990 #[inline(always)]
2991 pub fn usb_txfifo31(
2992 self,
2993 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbTxevReg_SPEC, crate::common::R> {
2994 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbTxevReg_SPEC,crate::common::R>::from_register(self,0)
2995 }
2996}
2997impl ::core::default::Default for UsbTxevReg {
2998 #[inline(always)]
2999 fn default() -> UsbTxevReg {
3000 <crate::RegValueT<UsbTxevReg_SPEC> as RegisterValue<_>>::new(0)
3001 }
3002}
3003
3004#[doc(hidden)]
3005#[derive(Copy, Clone, Eq, PartialEq)]
3006pub struct UsbTxmskReg_SPEC;
3007impl crate::sealed::RegSpec for UsbTxmskReg_SPEC {
3008 type DataType = u16;
3009}
3010
3011#[doc = "Transmit Mask Register"]
3012pub type UsbTxmskReg = crate::RegValueT<UsbTxmskReg_SPEC>;
3013
3014impl UsbTxmskReg {
3015 #[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"]
3016 #[inline(always)]
3017 pub fn usb_m_txudrrn31(
3018 self,
3019 ) -> crate::common::RegisterField<4, 0x7, 1, 0, u8, u8, UsbTxmskReg_SPEC, crate::common::RW>
3020 {
3021 crate::common::RegisterField::<4,0x7,1,0,u8,u8,UsbTxmskReg_SPEC,crate::common::RW>::from_register(self,0)
3022 }
3023
3024 #[doc = "Same Bit Definition as TXEV Register"]
3025 #[inline(always)]
3026 pub fn usb_m_txfifo31(
3027 self,
3028 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, UsbTxmskReg_SPEC, crate::common::RW>
3029 {
3030 crate::common::RegisterField::<0,0x7,1,0,u8,u8,UsbTxmskReg_SPEC,crate::common::RW>::from_register(self,0)
3031 }
3032}
3033impl ::core::default::Default for UsbTxmskReg {
3034 #[inline(always)]
3035 fn default() -> UsbTxmskReg {
3036 <crate::RegValueT<UsbTxmskReg_SPEC> as RegisterValue<_>>::new(0)
3037 }
3038}
3039
3040#[doc(hidden)]
3041#[derive(Copy, Clone, Eq, PartialEq)]
3042pub struct UsbTxs0Reg_SPEC;
3043impl crate::sealed::RegSpec for UsbTxs0Reg_SPEC {
3044 type DataType = u16;
3045}
3046
3047#[doc = "Transmit Status 0 Register"]
3048pub type UsbTxs0Reg = crate::RegValueT<UsbTxs0Reg_SPEC>;
3049
3050impl UsbTxs0Reg {
3051 #[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."]
3052 #[inline(always)]
3053 pub fn usb_ack_stat(
3054 self,
3055 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs0Reg_SPEC, crate::common::R> {
3056 crate::common::RegisterFieldBool::<6,1,0,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3057 }
3058
3059 #[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."]
3060 #[inline(always)]
3061 pub fn usb_tx_done(
3062 self,
3063 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs0Reg_SPEC, crate::common::R> {
3064 crate::common::RegisterFieldBool::<5,1,0,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3065 }
3066
3067 #[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."]
3068 #[inline(always)]
3069 pub fn usb_tcount(
3070 self,
3071 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs0Reg_SPEC, crate::common::R>
3072 {
3073 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs0Reg_SPEC,crate::common::R>::from_register(self,0)
3074 }
3075}
3076impl ::core::default::Default for UsbTxs0Reg {
3077 #[inline(always)]
3078 fn default() -> UsbTxs0Reg {
3079 <crate::RegValueT<UsbTxs0Reg_SPEC> as RegisterValue<_>>::new(8)
3080 }
3081}
3082
3083#[doc(hidden)]
3084#[derive(Copy, Clone, Eq, PartialEq)]
3085pub struct UsbTxs1Reg_SPEC;
3086impl crate::sealed::RegSpec for UsbTxs1Reg_SPEC {
3087 type DataType = u16;
3088}
3089
3090#[doc = "Transmit Status Register 1"]
3091pub type UsbTxs1Reg = crate::RegValueT<UsbTxs1Reg_SPEC>;
3092
3093impl UsbTxs1Reg {
3094 #[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."]
3095 #[inline(always)]
3096 pub fn usb_tx_urun(
3097 self,
3098 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3099 crate::common::RegisterFieldBool::<7,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3100 }
3101
3102 #[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."]
3103 #[inline(always)]
3104 pub fn usb_ack_stat(
3105 self,
3106 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3107 crate::common::RegisterFieldBool::<6,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3108 }
3109
3110 #[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."]
3111 #[inline(always)]
3112 pub fn usb_tx_done(
3113 self,
3114 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs1Reg_SPEC, crate::common::R> {
3115 crate::common::RegisterFieldBool::<5,1,0,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3116 }
3117
3118 #[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."]
3119 #[inline(always)]
3120 pub fn usb_tcount(
3121 self,
3122 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs1Reg_SPEC, crate::common::R>
3123 {
3124 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs1Reg_SPEC,crate::common::R>::from_register(self,0)
3125 }
3126}
3127impl ::core::default::Default for UsbTxs1Reg {
3128 #[inline(always)]
3129 fn default() -> UsbTxs1Reg {
3130 <crate::RegValueT<UsbTxs1Reg_SPEC> as RegisterValue<_>>::new(31)
3131 }
3132}
3133
3134#[doc(hidden)]
3135#[derive(Copy, Clone, Eq, PartialEq)]
3136pub struct UsbTxs2Reg_SPEC;
3137impl crate::sealed::RegSpec for UsbTxs2Reg_SPEC {
3138 type DataType = u16;
3139}
3140
3141#[doc = "Transmit Status Register 2"]
3142pub type UsbTxs2Reg = crate::RegValueT<UsbTxs2Reg_SPEC>;
3143
3144impl UsbTxs2Reg {
3145 #[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."]
3146 #[inline(always)]
3147 pub fn usb_tx_urun(
3148 self,
3149 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3150 crate::common::RegisterFieldBool::<7,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3151 }
3152
3153 #[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."]
3154 #[inline(always)]
3155 pub fn usb_ack_stat(
3156 self,
3157 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3158 crate::common::RegisterFieldBool::<6,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3159 }
3160
3161 #[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."]
3162 #[inline(always)]
3163 pub fn usb_tx_done(
3164 self,
3165 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs2Reg_SPEC, crate::common::R> {
3166 crate::common::RegisterFieldBool::<5,1,0,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3167 }
3168
3169 #[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."]
3170 #[inline(always)]
3171 pub fn usb_tcount(
3172 self,
3173 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs2Reg_SPEC, crate::common::R>
3174 {
3175 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs2Reg_SPEC,crate::common::R>::from_register(self,0)
3176 }
3177}
3178impl ::core::default::Default for UsbTxs2Reg {
3179 #[inline(always)]
3180 fn default() -> UsbTxs2Reg {
3181 <crate::RegValueT<UsbTxs2Reg_SPEC> as RegisterValue<_>>::new(31)
3182 }
3183}
3184
3185#[doc(hidden)]
3186#[derive(Copy, Clone, Eq, PartialEq)]
3187pub struct UsbTxs3Reg_SPEC;
3188impl crate::sealed::RegSpec for UsbTxs3Reg_SPEC {
3189 type DataType = u16;
3190}
3191
3192#[doc = "Transmit Status Register 3"]
3193pub type UsbTxs3Reg = crate::RegValueT<UsbTxs3Reg_SPEC>;
3194
3195impl UsbTxs3Reg {
3196 #[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."]
3197 #[inline(always)]
3198 pub fn usb_tx_urun(
3199 self,
3200 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3201 crate::common::RegisterFieldBool::<7,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3202 }
3203
3204 #[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."]
3205 #[inline(always)]
3206 pub fn usb_ack_stat(
3207 self,
3208 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3209 crate::common::RegisterFieldBool::<6,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3210 }
3211
3212 #[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."]
3213 #[inline(always)]
3214 pub fn usb_tx_done(
3215 self,
3216 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbTxs3Reg_SPEC, crate::common::R> {
3217 crate::common::RegisterFieldBool::<5,1,0,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3218 }
3219
3220 #[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."]
3221 #[inline(always)]
3222 pub fn usb_tcount(
3223 self,
3224 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbTxs3Reg_SPEC, crate::common::R>
3225 {
3226 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbTxs3Reg_SPEC,crate::common::R>::from_register(self,0)
3227 }
3228}
3229impl ::core::default::Default for UsbTxs3Reg {
3230 #[inline(always)]
3231 fn default() -> UsbTxs3Reg {
3232 <crate::RegValueT<UsbTxs3Reg_SPEC> as RegisterValue<_>>::new(31)
3233 }
3234}
3235
3236#[doc(hidden)]
3237#[derive(Copy, Clone, Eq, PartialEq)]
3238pub struct UsbUtrReg_SPEC;
3239impl crate::sealed::RegSpec for UsbUtrReg_SPEC {
3240 type DataType = u16;
3241}
3242
3243#[doc = "USB test Register (for test purpose only)"]
3244pub type UsbUtrReg = crate::RegValueT<UsbUtrReg_SPEC>;
3245
3246impl UsbUtrReg {
3247 #[doc = "Diagnostic enable\n\'0\': Normal operational.\n\'1\': Access to the USB_XCVDIAG_REG and USB_TCR_REG enabled. For diagnostic purposes only"]
3248 #[inline(always)]
3249 pub fn usb_diag(
3250 self,
3251 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3252 crate::common::RegisterFieldBool::<7,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3253 }
3254
3255 #[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"]
3256 #[inline(always)]
3257 pub fn usb_ncrc(
3258 self,
3259 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3260 crate::common::RegisterFieldBool::<6,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3261 }
3262
3263 #[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"]
3264 #[inline(always)]
3265 pub fn usb_sf(
3266 self,
3267 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbUtrReg_SPEC, crate::common::RW> {
3268 crate::common::RegisterFieldBool::<5,1,0,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3269 }
3270
3271 #[doc = "Reserved. Must be kept to \'0\'"]
3272 #[inline(always)]
3273 pub fn usb_utr_res(
3274 self,
3275 ) -> crate::common::RegisterField<0, 0x1f, 1, 0, u8, u8, UsbUtrReg_SPEC, crate::common::RW>
3276 {
3277 crate::common::RegisterField::<0,0x1f,1,0,u8,u8,UsbUtrReg_SPEC,crate::common::RW>::from_register(self,0)
3278 }
3279}
3280impl ::core::default::Default for UsbUtrReg {
3281 #[inline(always)]
3282 fn default() -> UsbUtrReg {
3283 <crate::RegValueT<UsbUtrReg_SPEC> as RegisterValue<_>>::new(0)
3284 }
3285}
3286
3287#[doc(hidden)]
3288#[derive(Copy, Clone, Eq, PartialEq)]
3289pub struct UsbUx20CdrReg_SPEC;
3290impl crate::sealed::RegSpec for UsbUx20CdrReg_SPEC {
3291 type DataType = u16;
3292}
3293
3294#[doc = "Transceiver 2.0 Configuration and Diagnostics Register(for test purpose only)"]
3295pub type UsbUx20CdrReg = crate::RegValueT<UsbUx20CdrReg_SPEC>;
3296
3297impl UsbUx20CdrReg {
3298 #[doc = "Test bit"]
3299 #[inline(always)]
3300 pub fn rpu_test7(
3301 self,
3302 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbUx20CdrReg_SPEC, crate::common::R> {
3303 crate::common::RegisterFieldBool::<7,1,0,UsbUx20CdrReg_SPEC,crate::common::R>::from_register(self,0)
3304 }
3305
3306 #[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)."]
3307 #[inline(always)]
3308 pub fn rpu_test_sw2(
3309 self,
3310 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3311 crate::common::RegisterFieldBool::<6,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3312 }
3313
3314 #[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)."]
3315 #[inline(always)]
3316 pub fn rpu_test_sw1(
3317 self,
3318 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3319 crate::common::RegisterFieldBool::<5,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3320 }
3321
3322 #[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"]
3323 #[inline(always)]
3324 pub fn rpu_test_en(
3325 self,
3326 ) -> crate::common::RegisterFieldBool<4, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3327 crate::common::RegisterFieldBool::<4,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3328 }
3329
3330 #[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)."]
3331 #[inline(always)]
3332 pub fn rpu_test_sw1dm(
3333 self,
3334 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3335 crate::common::RegisterFieldBool::<2,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3336 }
3337
3338 #[doc = "Test bit, must be kept 0"]
3339 #[inline(always)]
3340 pub fn rpu_rcdelay(
3341 self,
3342 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3343 crate::common::RegisterFieldBool::<1,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3344 }
3345
3346 #[doc = "Test bit, must be kept 0"]
3347 #[inline(always)]
3348 pub fn rpu_ssproten(
3349 self,
3350 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbUx20CdrReg_SPEC, crate::common::RW> {
3351 crate::common::RegisterFieldBool::<0,1,0,UsbUx20CdrReg_SPEC,crate::common::RW>::from_register(self,0)
3352 }
3353}
3354impl ::core::default::Default for UsbUx20CdrReg {
3355 #[inline(always)]
3356 fn default() -> UsbUx20CdrReg {
3357 <crate::RegValueT<UsbUx20CdrReg_SPEC> as RegisterValue<_>>::new(0)
3358 }
3359}
3360
3361#[doc(hidden)]
3362#[derive(Copy, Clone, Eq, PartialEq)]
3363pub struct UsbXcvdiagReg_SPEC;
3364impl crate::sealed::RegSpec for UsbXcvdiagReg_SPEC {
3365 type DataType = u16;
3366}
3367
3368#[doc = "Transceiver diagnostic Register (for test purpose only)"]
3369pub type UsbXcvdiagReg = crate::RegValueT<UsbXcvdiagReg_SPEC>;
3370
3371impl UsbXcvdiagReg {
3372 #[doc = "With Bit0 = 1 this bit shows the level of the USB_Dp receive data from transceiver; i.e. D+ <= VSE."]
3373 #[inline(always)]
3374 pub fn usb_vpin(
3375 self,
3376 ) -> crate::common::RegisterFieldBool<7, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3377 crate::common::RegisterFieldBool::<7,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3378 }
3379
3380 #[doc = "With Bit0 = 1 this bit shows the level USB_Dm receive data from transceiver; i.e. D- <= VSE."]
3381 #[inline(always)]
3382 pub fn usb_vmin(
3383 self,
3384 ) -> crate::common::RegisterFieldBool<6, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3385 crate::common::RegisterFieldBool::<6,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3386 }
3387
3388 #[doc = "With Bit0 = 1 this bit shows the differential level of the receive comparator."]
3389 #[inline(always)]
3390 pub fn usb_rcv(
3391 self,
3392 ) -> crate::common::RegisterFieldBool<5, 1, 0, UsbXcvdiagReg_SPEC, crate::common::R> {
3393 crate::common::RegisterFieldBool::<5,1,0,UsbXcvdiagReg_SPEC,crate::common::R>::from_register(self,0)
3394 }
3395
3396 #[doc = "With Bit0 = 1, this bit enables test Bits 2,1. Must be kept to \'0\' for normal operation"]
3397 #[inline(always)]
3398 pub fn usb_xcv_txen(
3399 self,
3400 ) -> crate::common::RegisterFieldBool<3, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3401 crate::common::RegisterFieldBool::<3,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3402 }
3403
3404 #[doc = "With Bit3,0 = 1, this bit sets USB_Dm to a high level, independent of LSMODE selection"]
3405 #[inline(always)]
3406 pub fn usb_xcv_txn(
3407 self,
3408 ) -> crate::common::RegisterFieldBool<2, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3409 crate::common::RegisterFieldBool::<2,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3410 }
3411
3412 #[doc = "With Bit3,0 = 1, this bit sets USB_Dp to a high level, independent of LSMODE selection"]
3413 #[inline(always)]
3414 pub fn usb_xcv_txp(
3415 self,
3416 ) -> crate::common::RegisterFieldBool<1, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3417 crate::common::RegisterFieldBool::<1,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3418 }
3419
3420 #[doc = "Enable USB_XCVDIAG_REG\n0: Normal operation, test bits disabled\n1: Enable test bits 7,6,5,3,2,1"]
3421 #[inline(always)]
3422 pub fn usb_xcv_test(
3423 self,
3424 ) -> crate::common::RegisterFieldBool<0, 1, 0, UsbXcvdiagReg_SPEC, crate::common::RW> {
3425 crate::common::RegisterFieldBool::<0,1,0,UsbXcvdiagReg_SPEC,crate::common::RW>::from_register(self,0)
3426 }
3427}
3428impl ::core::default::Default for UsbXcvdiagReg {
3429 #[inline(always)]
3430 fn default() -> UsbXcvdiagReg {
3431 <crate::RegValueT<UsbXcvdiagReg_SPEC> as RegisterValue<_>>::new(0)
3432 }
3433}