1#[doc = "Register `USBHS_DEVEPTCFG[%s]` reader"]
2pub struct R(crate::R<USBHS_DEVEPTCFG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<USBHS_DEVEPTCFG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<USBHS_DEVEPTCFG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<USBHS_DEVEPTCFG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `USBHS_DEVEPTCFG[%s]` writer"]
17pub struct W(crate::W<USBHS_DEVEPTCFG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<USBHS_DEVEPTCFG_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<USBHS_DEVEPTCFG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<USBHS_DEVEPTCFG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ALLOC` reader - Endpoint Memory Allocate"]
38pub struct ALLOC_R(crate::FieldReader<bool, bool>);
39impl ALLOC_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: bool) -> Self {
42 ALLOC_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for ALLOC_R {
46 type Target = crate::FieldReader<bool, bool>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `ALLOC` writer - Endpoint Memory Allocate"]
53pub struct ALLOC_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> ALLOC_W<'a> {
57 #[doc = r"Sets the field bit"]
58 #[inline(always)]
59 pub fn set_bit(self) -> &'a mut W {
60 self.bit(true)
61 }
62 #[doc = r"Clears the field bit"]
63 #[inline(always)]
64 pub fn clear_bit(self) -> &'a mut W {
65 self.bit(false)
66 }
67 #[doc = r"Writes raw bits to the field"]
68 #[inline(always)]
69 pub fn bit(self, value: bool) -> &'a mut W {
70 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
71 self.w
72 }
73}
74#[doc = "Endpoint Banks\n\nValue on reset: 0"]
75#[derive(Clone, Copy, Debug, PartialEq)]
76#[repr(u8)]
77pub enum EPBK_A {
78 #[doc = "0: Single-bank endpoint"]
79 _1_BANK = 0,
80 #[doc = "1: Double-bank endpoint"]
81 _2_BANK = 1,
82 #[doc = "2: Triple-bank endpoint"]
83 _3_BANK = 2,
84}
85impl From<EPBK_A> for u8 {
86 #[inline(always)]
87 fn from(variant: EPBK_A) -> Self {
88 variant as _
89 }
90}
91#[doc = "Field `EPBK` reader - Endpoint Banks"]
92pub struct EPBK_R(crate::FieldReader<u8, EPBK_A>);
93impl EPBK_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: u8) -> Self {
96 EPBK_R(crate::FieldReader::new(bits))
97 }
98 #[doc = r"Get enumerated values variant"]
99 #[inline(always)]
100 pub fn variant(&self) -> Option<EPBK_A> {
101 match self.bits {
102 0 => Some(EPBK_A::_1_BANK),
103 1 => Some(EPBK_A::_2_BANK),
104 2 => Some(EPBK_A::_3_BANK),
105 _ => None,
106 }
107 }
108 #[doc = "Checks if the value of the field is `_1_BANK`"]
109 #[inline(always)]
110 pub fn is_1_bank(&self) -> bool {
111 **self == EPBK_A::_1_BANK
112 }
113 #[doc = "Checks if the value of the field is `_2_BANK`"]
114 #[inline(always)]
115 pub fn is_2_bank(&self) -> bool {
116 **self == EPBK_A::_2_BANK
117 }
118 #[doc = "Checks if the value of the field is `_3_BANK`"]
119 #[inline(always)]
120 pub fn is_3_bank(&self) -> bool {
121 **self == EPBK_A::_3_BANK
122 }
123}
124impl core::ops::Deref for EPBK_R {
125 type Target = crate::FieldReader<u8, EPBK_A>;
126 #[inline(always)]
127 fn deref(&self) -> &Self::Target {
128 &self.0
129 }
130}
131#[doc = "Field `EPBK` writer - Endpoint Banks"]
132pub struct EPBK_W<'a> {
133 w: &'a mut W,
134}
135impl<'a> EPBK_W<'a> {
136 #[doc = r"Writes `variant` to the field"]
137 #[inline(always)]
138 pub fn variant(self, variant: EPBK_A) -> &'a mut W {
139 unsafe { self.bits(variant.into()) }
140 }
141 #[doc = "Single-bank endpoint"]
142 #[inline(always)]
143 pub fn _1_bank(self) -> &'a mut W {
144 self.variant(EPBK_A::_1_BANK)
145 }
146 #[doc = "Double-bank endpoint"]
147 #[inline(always)]
148 pub fn _2_bank(self) -> &'a mut W {
149 self.variant(EPBK_A::_2_BANK)
150 }
151 #[doc = "Triple-bank endpoint"]
152 #[inline(always)]
153 pub fn _3_bank(self) -> &'a mut W {
154 self.variant(EPBK_A::_3_BANK)
155 }
156 #[doc = r"Writes raw bits to the field"]
157 #[inline(always)]
158 pub unsafe fn bits(self, value: u8) -> &'a mut W {
159 self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2);
160 self.w
161 }
162}
163#[doc = "Endpoint Size\n\nValue on reset: 0"]
164#[derive(Clone, Copy, Debug, PartialEq)]
165#[repr(u8)]
166pub enum EPSIZE_A {
167 #[doc = "0: 8 bytes"]
168 _8_BYTE = 0,
169 #[doc = "1: 16 bytes"]
170 _16_BYTE = 1,
171 #[doc = "2: 32 bytes"]
172 _32_BYTE = 2,
173 #[doc = "3: 64 bytes"]
174 _64_BYTE = 3,
175 #[doc = "4: 128 bytes"]
176 _128_BYTE = 4,
177 #[doc = "5: 256 bytes"]
178 _256_BYTE = 5,
179 #[doc = "6: 512 bytes"]
180 _512_BYTE = 6,
181 #[doc = "7: 1024 bytes"]
182 _1024_BYTE = 7,
183}
184impl From<EPSIZE_A> for u8 {
185 #[inline(always)]
186 fn from(variant: EPSIZE_A) -> Self {
187 variant as _
188 }
189}
190#[doc = "Field `EPSIZE` reader - Endpoint Size"]
191pub struct EPSIZE_R(crate::FieldReader<u8, EPSIZE_A>);
192impl EPSIZE_R {
193 #[inline(always)]
194 pub(crate) fn new(bits: u8) -> Self {
195 EPSIZE_R(crate::FieldReader::new(bits))
196 }
197 #[doc = r"Get enumerated values variant"]
198 #[inline(always)]
199 pub fn variant(&self) -> EPSIZE_A {
200 match self.bits {
201 0 => EPSIZE_A::_8_BYTE,
202 1 => EPSIZE_A::_16_BYTE,
203 2 => EPSIZE_A::_32_BYTE,
204 3 => EPSIZE_A::_64_BYTE,
205 4 => EPSIZE_A::_128_BYTE,
206 5 => EPSIZE_A::_256_BYTE,
207 6 => EPSIZE_A::_512_BYTE,
208 7 => EPSIZE_A::_1024_BYTE,
209 _ => unreachable!(),
210 }
211 }
212 #[doc = "Checks if the value of the field is `_8_BYTE`"]
213 #[inline(always)]
214 pub fn is_8_byte(&self) -> bool {
215 **self == EPSIZE_A::_8_BYTE
216 }
217 #[doc = "Checks if the value of the field is `_16_BYTE`"]
218 #[inline(always)]
219 pub fn is_16_byte(&self) -> bool {
220 **self == EPSIZE_A::_16_BYTE
221 }
222 #[doc = "Checks if the value of the field is `_32_BYTE`"]
223 #[inline(always)]
224 pub fn is_32_byte(&self) -> bool {
225 **self == EPSIZE_A::_32_BYTE
226 }
227 #[doc = "Checks if the value of the field is `_64_BYTE`"]
228 #[inline(always)]
229 pub fn is_64_byte(&self) -> bool {
230 **self == EPSIZE_A::_64_BYTE
231 }
232 #[doc = "Checks if the value of the field is `_128_BYTE`"]
233 #[inline(always)]
234 pub fn is_128_byte(&self) -> bool {
235 **self == EPSIZE_A::_128_BYTE
236 }
237 #[doc = "Checks if the value of the field is `_256_BYTE`"]
238 #[inline(always)]
239 pub fn is_256_byte(&self) -> bool {
240 **self == EPSIZE_A::_256_BYTE
241 }
242 #[doc = "Checks if the value of the field is `_512_BYTE`"]
243 #[inline(always)]
244 pub fn is_512_byte(&self) -> bool {
245 **self == EPSIZE_A::_512_BYTE
246 }
247 #[doc = "Checks if the value of the field is `_1024_BYTE`"]
248 #[inline(always)]
249 pub fn is_1024_byte(&self) -> bool {
250 **self == EPSIZE_A::_1024_BYTE
251 }
252}
253impl core::ops::Deref for EPSIZE_R {
254 type Target = crate::FieldReader<u8, EPSIZE_A>;
255 #[inline(always)]
256 fn deref(&self) -> &Self::Target {
257 &self.0
258 }
259}
260#[doc = "Field `EPSIZE` writer - Endpoint Size"]
261pub struct EPSIZE_W<'a> {
262 w: &'a mut W,
263}
264impl<'a> EPSIZE_W<'a> {
265 #[doc = r"Writes `variant` to the field"]
266 #[inline(always)]
267 pub fn variant(self, variant: EPSIZE_A) -> &'a mut W {
268 self.bits(variant.into())
269 }
270 #[doc = "8 bytes"]
271 #[inline(always)]
272 pub fn _8_byte(self) -> &'a mut W {
273 self.variant(EPSIZE_A::_8_BYTE)
274 }
275 #[doc = "16 bytes"]
276 #[inline(always)]
277 pub fn _16_byte(self) -> &'a mut W {
278 self.variant(EPSIZE_A::_16_BYTE)
279 }
280 #[doc = "32 bytes"]
281 #[inline(always)]
282 pub fn _32_byte(self) -> &'a mut W {
283 self.variant(EPSIZE_A::_32_BYTE)
284 }
285 #[doc = "64 bytes"]
286 #[inline(always)]
287 pub fn _64_byte(self) -> &'a mut W {
288 self.variant(EPSIZE_A::_64_BYTE)
289 }
290 #[doc = "128 bytes"]
291 #[inline(always)]
292 pub fn _128_byte(self) -> &'a mut W {
293 self.variant(EPSIZE_A::_128_BYTE)
294 }
295 #[doc = "256 bytes"]
296 #[inline(always)]
297 pub fn _256_byte(self) -> &'a mut W {
298 self.variant(EPSIZE_A::_256_BYTE)
299 }
300 #[doc = "512 bytes"]
301 #[inline(always)]
302 pub fn _512_byte(self) -> &'a mut W {
303 self.variant(EPSIZE_A::_512_BYTE)
304 }
305 #[doc = "1024 bytes"]
306 #[inline(always)]
307 pub fn _1024_byte(self) -> &'a mut W {
308 self.variant(EPSIZE_A::_1024_BYTE)
309 }
310 #[doc = r"Writes raw bits to the field"]
311 #[inline(always)]
312 pub fn bits(self, value: u8) -> &'a mut W {
313 self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u32 & 0x07) << 4);
314 self.w
315 }
316}
317#[doc = "Endpoint Direction\n\nValue on reset: 0"]
318#[derive(Clone, Copy, Debug, PartialEq)]
319pub enum EPDIR_A {
320 #[doc = "0: The endpoint direction is OUT."]
321 OUT = 0,
322 #[doc = "1: The endpoint direction is IN (nor for control endpoints)."]
323 IN = 1,
324}
325impl From<EPDIR_A> for bool {
326 #[inline(always)]
327 fn from(variant: EPDIR_A) -> Self {
328 variant as u8 != 0
329 }
330}
331#[doc = "Field `EPDIR` reader - Endpoint Direction"]
332pub struct EPDIR_R(crate::FieldReader<bool, EPDIR_A>);
333impl EPDIR_R {
334 #[inline(always)]
335 pub(crate) fn new(bits: bool) -> Self {
336 EPDIR_R(crate::FieldReader::new(bits))
337 }
338 #[doc = r"Get enumerated values variant"]
339 #[inline(always)]
340 pub fn variant(&self) -> EPDIR_A {
341 match self.bits {
342 false => EPDIR_A::OUT,
343 true => EPDIR_A::IN,
344 }
345 }
346 #[doc = "Checks if the value of the field is `OUT`"]
347 #[inline(always)]
348 pub fn is_out(&self) -> bool {
349 **self == EPDIR_A::OUT
350 }
351 #[doc = "Checks if the value of the field is `IN`"]
352 #[inline(always)]
353 pub fn is_in(&self) -> bool {
354 **self == EPDIR_A::IN
355 }
356}
357impl core::ops::Deref for EPDIR_R {
358 type Target = crate::FieldReader<bool, EPDIR_A>;
359 #[inline(always)]
360 fn deref(&self) -> &Self::Target {
361 &self.0
362 }
363}
364#[doc = "Field `EPDIR` writer - Endpoint Direction"]
365pub struct EPDIR_W<'a> {
366 w: &'a mut W,
367}
368impl<'a> EPDIR_W<'a> {
369 #[doc = r"Writes `variant` to the field"]
370 #[inline(always)]
371 pub fn variant(self, variant: EPDIR_A) -> &'a mut W {
372 self.bit(variant.into())
373 }
374 #[doc = "The endpoint direction is OUT."]
375 #[inline(always)]
376 pub fn out(self) -> &'a mut W {
377 self.variant(EPDIR_A::OUT)
378 }
379 #[doc = "The endpoint direction is IN (nor for control endpoints)."]
380 #[inline(always)]
381 pub fn in_(self) -> &'a mut W {
382 self.variant(EPDIR_A::IN)
383 }
384 #[doc = r"Sets the field bit"]
385 #[inline(always)]
386 pub fn set_bit(self) -> &'a mut W {
387 self.bit(true)
388 }
389 #[doc = r"Clears the field bit"]
390 #[inline(always)]
391 pub fn clear_bit(self) -> &'a mut W {
392 self.bit(false)
393 }
394 #[doc = r"Writes raw bits to the field"]
395 #[inline(always)]
396 pub fn bit(self, value: bool) -> &'a mut W {
397 self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
398 self.w
399 }
400}
401#[doc = "Field `AUTOSW` reader - Automatic Switch"]
402pub struct AUTOSW_R(crate::FieldReader<bool, bool>);
403impl AUTOSW_R {
404 #[inline(always)]
405 pub(crate) fn new(bits: bool) -> Self {
406 AUTOSW_R(crate::FieldReader::new(bits))
407 }
408}
409impl core::ops::Deref for AUTOSW_R {
410 type Target = crate::FieldReader<bool, bool>;
411 #[inline(always)]
412 fn deref(&self) -> &Self::Target {
413 &self.0
414 }
415}
416#[doc = "Field `AUTOSW` writer - Automatic Switch"]
417pub struct AUTOSW_W<'a> {
418 w: &'a mut W,
419}
420impl<'a> AUTOSW_W<'a> {
421 #[doc = r"Sets the field bit"]
422 #[inline(always)]
423 pub fn set_bit(self) -> &'a mut W {
424 self.bit(true)
425 }
426 #[doc = r"Clears the field bit"]
427 #[inline(always)]
428 pub fn clear_bit(self) -> &'a mut W {
429 self.bit(false)
430 }
431 #[doc = r"Writes raw bits to the field"]
432 #[inline(always)]
433 pub fn bit(self, value: bool) -> &'a mut W {
434 self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
435 self.w
436 }
437}
438#[doc = "Endpoint Type\n\nValue on reset: 0"]
439#[derive(Clone, Copy, Debug, PartialEq)]
440#[repr(u8)]
441pub enum EPTYPE_A {
442 #[doc = "0: Control"]
443 CTRL = 0,
444 #[doc = "1: Isochronous"]
445 ISO = 1,
446 #[doc = "2: Bulk"]
447 BLK = 2,
448 #[doc = "3: Interrupt"]
449 INTRPT = 3,
450}
451impl From<EPTYPE_A> for u8 {
452 #[inline(always)]
453 fn from(variant: EPTYPE_A) -> Self {
454 variant as _
455 }
456}
457#[doc = "Field `EPTYPE` reader - Endpoint Type"]
458pub struct EPTYPE_R(crate::FieldReader<u8, EPTYPE_A>);
459impl EPTYPE_R {
460 #[inline(always)]
461 pub(crate) fn new(bits: u8) -> Self {
462 EPTYPE_R(crate::FieldReader::new(bits))
463 }
464 #[doc = r"Get enumerated values variant"]
465 #[inline(always)]
466 pub fn variant(&self) -> EPTYPE_A {
467 match self.bits {
468 0 => EPTYPE_A::CTRL,
469 1 => EPTYPE_A::ISO,
470 2 => EPTYPE_A::BLK,
471 3 => EPTYPE_A::INTRPT,
472 _ => unreachable!(),
473 }
474 }
475 #[doc = "Checks if the value of the field is `CTRL`"]
476 #[inline(always)]
477 pub fn is_ctrl(&self) -> bool {
478 **self == EPTYPE_A::CTRL
479 }
480 #[doc = "Checks if the value of the field is `ISO`"]
481 #[inline(always)]
482 pub fn is_iso(&self) -> bool {
483 **self == EPTYPE_A::ISO
484 }
485 #[doc = "Checks if the value of the field is `BLK`"]
486 #[inline(always)]
487 pub fn is_blk(&self) -> bool {
488 **self == EPTYPE_A::BLK
489 }
490 #[doc = "Checks if the value of the field is `INTRPT`"]
491 #[inline(always)]
492 pub fn is_intrpt(&self) -> bool {
493 **self == EPTYPE_A::INTRPT
494 }
495}
496impl core::ops::Deref for EPTYPE_R {
497 type Target = crate::FieldReader<u8, EPTYPE_A>;
498 #[inline(always)]
499 fn deref(&self) -> &Self::Target {
500 &self.0
501 }
502}
503#[doc = "Field `EPTYPE` writer - Endpoint Type"]
504pub struct EPTYPE_W<'a> {
505 w: &'a mut W,
506}
507impl<'a> EPTYPE_W<'a> {
508 #[doc = r"Writes `variant` to the field"]
509 #[inline(always)]
510 pub fn variant(self, variant: EPTYPE_A) -> &'a mut W {
511 self.bits(variant.into())
512 }
513 #[doc = "Control"]
514 #[inline(always)]
515 pub fn ctrl(self) -> &'a mut W {
516 self.variant(EPTYPE_A::CTRL)
517 }
518 #[doc = "Isochronous"]
519 #[inline(always)]
520 pub fn iso(self) -> &'a mut W {
521 self.variant(EPTYPE_A::ISO)
522 }
523 #[doc = "Bulk"]
524 #[inline(always)]
525 pub fn blk(self) -> &'a mut W {
526 self.variant(EPTYPE_A::BLK)
527 }
528 #[doc = "Interrupt"]
529 #[inline(always)]
530 pub fn intrpt(self) -> &'a mut W {
531 self.variant(EPTYPE_A::INTRPT)
532 }
533 #[doc = r"Writes raw bits to the field"]
534 #[inline(always)]
535 pub fn bits(self, value: u8) -> &'a mut W {
536 self.w.bits = (self.w.bits & !(0x03 << 11)) | ((value as u32 & 0x03) << 11);
537 self.w
538 }
539}
540#[doc = "Number of transactions per microframe for isochronous endpoint\n\nValue on reset: 0"]
541#[derive(Clone, Copy, Debug, PartialEq)]
542#[repr(u8)]
543pub enum NBTRANS_A {
544 #[doc = "0: Reserved to endpoint that does not have the high-bandwidth isochronous capability."]
545 _0_TRANS = 0,
546 #[doc = "1: Default value: one transaction per microframe."]
547 _1_TRANS = 1,
548 #[doc = "2: Two transactions per microframe. This endpoint should be configured as double-bank."]
549 _2_TRANS = 2,
550 #[doc = "3: Three transactions per microframe. This endpoint should be configured as triple-bank."]
551 _3_TRANS = 3,
552}
553impl From<NBTRANS_A> for u8 {
554 #[inline(always)]
555 fn from(variant: NBTRANS_A) -> Self {
556 variant as _
557 }
558}
559#[doc = "Field `NBTRANS` reader - Number of transactions per microframe for isochronous endpoint"]
560pub struct NBTRANS_R(crate::FieldReader<u8, NBTRANS_A>);
561impl NBTRANS_R {
562 #[inline(always)]
563 pub(crate) fn new(bits: u8) -> Self {
564 NBTRANS_R(crate::FieldReader::new(bits))
565 }
566 #[doc = r"Get enumerated values variant"]
567 #[inline(always)]
568 pub fn variant(&self) -> NBTRANS_A {
569 match self.bits {
570 0 => NBTRANS_A::_0_TRANS,
571 1 => NBTRANS_A::_1_TRANS,
572 2 => NBTRANS_A::_2_TRANS,
573 3 => NBTRANS_A::_3_TRANS,
574 _ => unreachable!(),
575 }
576 }
577 #[doc = "Checks if the value of the field is `_0_TRANS`"]
578 #[inline(always)]
579 pub fn is_0_trans(&self) -> bool {
580 **self == NBTRANS_A::_0_TRANS
581 }
582 #[doc = "Checks if the value of the field is `_1_TRANS`"]
583 #[inline(always)]
584 pub fn is_1_trans(&self) -> bool {
585 **self == NBTRANS_A::_1_TRANS
586 }
587 #[doc = "Checks if the value of the field is `_2_TRANS`"]
588 #[inline(always)]
589 pub fn is_2_trans(&self) -> bool {
590 **self == NBTRANS_A::_2_TRANS
591 }
592 #[doc = "Checks if the value of the field is `_3_TRANS`"]
593 #[inline(always)]
594 pub fn is_3_trans(&self) -> bool {
595 **self == NBTRANS_A::_3_TRANS
596 }
597}
598impl core::ops::Deref for NBTRANS_R {
599 type Target = crate::FieldReader<u8, NBTRANS_A>;
600 #[inline(always)]
601 fn deref(&self) -> &Self::Target {
602 &self.0
603 }
604}
605#[doc = "Field `NBTRANS` writer - Number of transactions per microframe for isochronous endpoint"]
606pub struct NBTRANS_W<'a> {
607 w: &'a mut W,
608}
609impl<'a> NBTRANS_W<'a> {
610 #[doc = r"Writes `variant` to the field"]
611 #[inline(always)]
612 pub fn variant(self, variant: NBTRANS_A) -> &'a mut W {
613 self.bits(variant.into())
614 }
615 #[doc = "Reserved to endpoint that does not have the high-bandwidth isochronous capability."]
616 #[inline(always)]
617 pub fn _0_trans(self) -> &'a mut W {
618 self.variant(NBTRANS_A::_0_TRANS)
619 }
620 #[doc = "Default value: one transaction per microframe."]
621 #[inline(always)]
622 pub fn _1_trans(self) -> &'a mut W {
623 self.variant(NBTRANS_A::_1_TRANS)
624 }
625 #[doc = "Two transactions per microframe. This endpoint should be configured as double-bank."]
626 #[inline(always)]
627 pub fn _2_trans(self) -> &'a mut W {
628 self.variant(NBTRANS_A::_2_TRANS)
629 }
630 #[doc = "Three transactions per microframe. This endpoint should be configured as triple-bank."]
631 #[inline(always)]
632 pub fn _3_trans(self) -> &'a mut W {
633 self.variant(NBTRANS_A::_3_TRANS)
634 }
635 #[doc = r"Writes raw bits to the field"]
636 #[inline(always)]
637 pub fn bits(self, value: u8) -> &'a mut W {
638 self.w.bits = (self.w.bits & !(0x03 << 13)) | ((value as u32 & 0x03) << 13);
639 self.w
640 }
641}
642impl R {
643 #[doc = "Bit 1 - Endpoint Memory Allocate"]
644 #[inline(always)]
645 pub fn alloc(&self) -> ALLOC_R {
646 ALLOC_R::new(((self.bits >> 1) & 0x01) != 0)
647 }
648 #[doc = "Bits 2:3 - Endpoint Banks"]
649 #[inline(always)]
650 pub fn epbk(&self) -> EPBK_R {
651 EPBK_R::new(((self.bits >> 2) & 0x03) as u8)
652 }
653 #[doc = "Bits 4:6 - Endpoint Size"]
654 #[inline(always)]
655 pub fn epsize(&self) -> EPSIZE_R {
656 EPSIZE_R::new(((self.bits >> 4) & 0x07) as u8)
657 }
658 #[doc = "Bit 8 - Endpoint Direction"]
659 #[inline(always)]
660 pub fn epdir(&self) -> EPDIR_R {
661 EPDIR_R::new(((self.bits >> 8) & 0x01) != 0)
662 }
663 #[doc = "Bit 9 - Automatic Switch"]
664 #[inline(always)]
665 pub fn autosw(&self) -> AUTOSW_R {
666 AUTOSW_R::new(((self.bits >> 9) & 0x01) != 0)
667 }
668 #[doc = "Bits 11:12 - Endpoint Type"]
669 #[inline(always)]
670 pub fn eptype(&self) -> EPTYPE_R {
671 EPTYPE_R::new(((self.bits >> 11) & 0x03) as u8)
672 }
673 #[doc = "Bits 13:14 - Number of transactions per microframe for isochronous endpoint"]
674 #[inline(always)]
675 pub fn nbtrans(&self) -> NBTRANS_R {
676 NBTRANS_R::new(((self.bits >> 13) & 0x03) as u8)
677 }
678}
679impl W {
680 #[doc = "Bit 1 - Endpoint Memory Allocate"]
681 #[inline(always)]
682 pub fn alloc(&mut self) -> ALLOC_W {
683 ALLOC_W { w: self }
684 }
685 #[doc = "Bits 2:3 - Endpoint Banks"]
686 #[inline(always)]
687 pub fn epbk(&mut self) -> EPBK_W {
688 EPBK_W { w: self }
689 }
690 #[doc = "Bits 4:6 - Endpoint Size"]
691 #[inline(always)]
692 pub fn epsize(&mut self) -> EPSIZE_W {
693 EPSIZE_W { w: self }
694 }
695 #[doc = "Bit 8 - Endpoint Direction"]
696 #[inline(always)]
697 pub fn epdir(&mut self) -> EPDIR_W {
698 EPDIR_W { w: self }
699 }
700 #[doc = "Bit 9 - Automatic Switch"]
701 #[inline(always)]
702 pub fn autosw(&mut self) -> AUTOSW_W {
703 AUTOSW_W { w: self }
704 }
705 #[doc = "Bits 11:12 - Endpoint Type"]
706 #[inline(always)]
707 pub fn eptype(&mut self) -> EPTYPE_W {
708 EPTYPE_W { w: self }
709 }
710 #[doc = "Bits 13:14 - Number of transactions per microframe for isochronous endpoint"]
711 #[inline(always)]
712 pub fn nbtrans(&mut self) -> NBTRANS_W {
713 NBTRANS_W { w: self }
714 }
715 #[doc = "Writes raw bits to the register."]
716 #[inline(always)]
717 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
718 self.0.bits(bits);
719 self
720 }
721}
722#[doc = "Device Endpoint Configuration Register (n = 0) 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbhs_deveptcfg](index.html) module"]
723pub struct USBHS_DEVEPTCFG_SPEC;
724impl crate::RegisterSpec for USBHS_DEVEPTCFG_SPEC {
725 type Ux = u32;
726}
727#[doc = "`read()` method returns [usbhs_deveptcfg::R](R) reader structure"]
728impl crate::Readable for USBHS_DEVEPTCFG_SPEC {
729 type Reader = R;
730}
731#[doc = "`write(|w| ..)` method takes [usbhs_deveptcfg::W](W) writer structure"]
732impl crate::Writable for USBHS_DEVEPTCFG_SPEC {
733 type Writer = W;
734}
735#[doc = "`reset()` method sets USBHS_DEVEPTCFG[%s]
736to value 0"]
737impl crate::Resettable for USBHS_DEVEPTCFG_SPEC {
738 #[inline(always)]
739 fn reset_value() -> Self::Ux {
740 0
741 }
742}