1pub type R = crate::R<ISTRrs>;
3pub type W = crate::W<ISTRrs>;
5pub type EP_ID_R = crate::FieldReader;
7#[cfg_attr(feature = "defmt", derive(defmt::Format))]
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12pub enum DIR {
13 To = 0,
15 From = 1,
17}
18impl From<DIR> for bool {
19 #[inline(always)]
20 fn from(variant: DIR) -> Self {
21 variant as u8 != 0
22 }
23}
24pub type DIR_R = crate::BitReader<DIR>;
26impl DIR_R {
27 #[inline(always)]
29 pub const fn variant(&self) -> DIR {
30 match self.bits {
31 false => DIR::To,
32 true => DIR::From,
33 }
34 }
35 #[inline(always)]
37 pub fn is_to(&self) -> bool {
38 *self == DIR::To
39 }
40 #[inline(always)]
42 pub fn is_from(&self) -> bool {
43 *self == DIR::From
44 }
45}
46#[cfg_attr(feature = "defmt", derive(defmt::Format))]
50#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum L1REQR {
52 NotReceived = 0,
54 Received = 1,
56}
57impl From<L1REQR> for bool {
58 #[inline(always)]
59 fn from(variant: L1REQR) -> Self {
60 variant as u8 != 0
61 }
62}
63pub type L1REQ_R = crate::BitReader<L1REQR>;
65impl L1REQ_R {
66 #[inline(always)]
68 pub const fn variant(&self) -> L1REQR {
69 match self.bits {
70 false => L1REQR::NotReceived,
71 true => L1REQR::Received,
72 }
73 }
74 #[inline(always)]
76 pub fn is_not_received(&self) -> bool {
77 *self == L1REQR::NotReceived
78 }
79 #[inline(always)]
81 pub fn is_received(&self) -> bool {
82 *self == L1REQR::Received
83 }
84}
85#[cfg_attr(feature = "defmt", derive(defmt::Format))]
89#[derive(Clone, Copy, Debug, PartialEq, Eq)]
90pub enum L1REQW {
91 Clear = 0,
93}
94impl From<L1REQW> for bool {
95 #[inline(always)]
96 fn from(variant: L1REQW) -> Self {
97 variant as u8 != 0
98 }
99}
100pub type L1REQ_W<'a, REG> = crate::BitWriter0C<'a, REG, L1REQW>;
102impl<'a, REG> L1REQ_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn clear(self) -> &'a mut crate::W<REG> {
109 self.variant(L1REQW::Clear)
110 }
111}
112#[cfg_attr(feature = "defmt", derive(defmt::Format))]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum ESOFR {
118 NotExpectedStartOfFrame = 0,
120 ExpectedStartOfFrame = 1,
122}
123impl From<ESOFR> for bool {
124 #[inline(always)]
125 fn from(variant: ESOFR) -> Self {
126 variant as u8 != 0
127 }
128}
129pub type ESOF_R = crate::BitReader<ESOFR>;
131impl ESOF_R {
132 #[inline(always)]
134 pub const fn variant(&self) -> ESOFR {
135 match self.bits {
136 false => ESOFR::NotExpectedStartOfFrame,
137 true => ESOFR::ExpectedStartOfFrame,
138 }
139 }
140 #[inline(always)]
142 pub fn is_not_expected_start_of_frame(&self) -> bool {
143 *self == ESOFR::NotExpectedStartOfFrame
144 }
145 #[inline(always)]
147 pub fn is_expected_start_of_frame(&self) -> bool {
148 *self == ESOFR::ExpectedStartOfFrame
149 }
150}
151#[cfg_attr(feature = "defmt", derive(defmt::Format))]
155#[derive(Clone, Copy, Debug, PartialEq, Eq)]
156pub enum ESOFW {
157 Clear = 0,
159}
160impl From<ESOFW> for bool {
161 #[inline(always)]
162 fn from(variant: ESOFW) -> Self {
163 variant as u8 != 0
164 }
165}
166pub type ESOF_W<'a, REG> = crate::BitWriter0C<'a, REG, ESOFW>;
168impl<'a, REG> ESOF_W<'a, REG>
169where
170 REG: crate::Writable + crate::RegisterSpec,
171{
172 #[inline(always)]
174 pub fn clear(self) -> &'a mut crate::W<REG> {
175 self.variant(ESOFW::Clear)
176 }
177}
178#[cfg_attr(feature = "defmt", derive(defmt::Format))]
182#[derive(Clone, Copy, Debug, PartialEq, Eq)]
183pub enum SOFR {
184 NotStartOfFrame = 0,
186 StartOfFrame = 1,
188}
189impl From<SOFR> for bool {
190 #[inline(always)]
191 fn from(variant: SOFR) -> Self {
192 variant as u8 != 0
193 }
194}
195pub type SOF_R = crate::BitReader<SOFR>;
197impl SOF_R {
198 #[inline(always)]
200 pub const fn variant(&self) -> SOFR {
201 match self.bits {
202 false => SOFR::NotStartOfFrame,
203 true => SOFR::StartOfFrame,
204 }
205 }
206 #[inline(always)]
208 pub fn is_not_start_of_frame(&self) -> bool {
209 *self == SOFR::NotStartOfFrame
210 }
211 #[inline(always)]
213 pub fn is_start_of_frame(&self) -> bool {
214 *self == SOFR::StartOfFrame
215 }
216}
217#[cfg_attr(feature = "defmt", derive(defmt::Format))]
221#[derive(Clone, Copy, Debug, PartialEq, Eq)]
222pub enum SOFW {
223 Clear = 0,
225}
226impl From<SOFW> for bool {
227 #[inline(always)]
228 fn from(variant: SOFW) -> Self {
229 variant as u8 != 0
230 }
231}
232pub type SOF_W<'a, REG> = crate::BitWriter0C<'a, REG, SOFW>;
234impl<'a, REG> SOF_W<'a, REG>
235where
236 REG: crate::Writable + crate::RegisterSpec,
237{
238 #[inline(always)]
240 pub fn clear(self) -> &'a mut crate::W<REG> {
241 self.variant(SOFW::Clear)
242 }
243}
244#[cfg_attr(feature = "defmt", derive(defmt::Format))]
248#[derive(Clone, Copy, Debug, PartialEq, Eq)]
249pub enum RESETR {
250 NotReset = 0,
252 Reset = 1,
254}
255impl From<RESETR> for bool {
256 #[inline(always)]
257 fn from(variant: RESETR) -> Self {
258 variant as u8 != 0
259 }
260}
261pub type RESET_R = crate::BitReader<RESETR>;
263impl RESET_R {
264 #[inline(always)]
266 pub const fn variant(&self) -> RESETR {
267 match self.bits {
268 false => RESETR::NotReset,
269 true => RESETR::Reset,
270 }
271 }
272 #[inline(always)]
274 pub fn is_not_reset(&self) -> bool {
275 *self == RESETR::NotReset
276 }
277 #[inline(always)]
279 pub fn is_reset(&self) -> bool {
280 *self == RESETR::Reset
281 }
282}
283#[cfg_attr(feature = "defmt", derive(defmt::Format))]
287#[derive(Clone, Copy, Debug, PartialEq, Eq)]
288pub enum RESETW {
289 Clear = 0,
291}
292impl From<RESETW> for bool {
293 #[inline(always)]
294 fn from(variant: RESETW) -> Self {
295 variant as u8 != 0
296 }
297}
298pub type RESET_W<'a, REG> = crate::BitWriter0C<'a, REG, RESETW>;
300impl<'a, REG> RESET_W<'a, REG>
301where
302 REG: crate::Writable + crate::RegisterSpec,
303{
304 #[inline(always)]
306 pub fn clear(self) -> &'a mut crate::W<REG> {
307 self.variant(RESETW::Clear)
308 }
309}
310#[cfg_attr(feature = "defmt", derive(defmt::Format))]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315pub enum SUSPR {
316 NotSuspend = 0,
318 Suspend = 1,
320}
321impl From<SUSPR> for bool {
322 #[inline(always)]
323 fn from(variant: SUSPR) -> Self {
324 variant as u8 != 0
325 }
326}
327pub type SUSP_R = crate::BitReader<SUSPR>;
329impl SUSP_R {
330 #[inline(always)]
332 pub const fn variant(&self) -> SUSPR {
333 match self.bits {
334 false => SUSPR::NotSuspend,
335 true => SUSPR::Suspend,
336 }
337 }
338 #[inline(always)]
340 pub fn is_not_suspend(&self) -> bool {
341 *self == SUSPR::NotSuspend
342 }
343 #[inline(always)]
345 pub fn is_suspend(&self) -> bool {
346 *self == SUSPR::Suspend
347 }
348}
349#[cfg_attr(feature = "defmt", derive(defmt::Format))]
353#[derive(Clone, Copy, Debug, PartialEq, Eq)]
354pub enum SUSPW {
355 Clear = 0,
357}
358impl From<SUSPW> for bool {
359 #[inline(always)]
360 fn from(variant: SUSPW) -> Self {
361 variant as u8 != 0
362 }
363}
364pub type SUSP_W<'a, REG> = crate::BitWriter0C<'a, REG, SUSPW>;
366impl<'a, REG> SUSP_W<'a, REG>
367where
368 REG: crate::Writable + crate::RegisterSpec,
369{
370 #[inline(always)]
372 pub fn clear(self) -> &'a mut crate::W<REG> {
373 self.variant(SUSPW::Clear)
374 }
375}
376#[cfg_attr(feature = "defmt", derive(defmt::Format))]
380#[derive(Clone, Copy, Debug, PartialEq, Eq)]
381pub enum WKUPR {
382 NotWakeup = 0,
384 Wakeup = 1,
386}
387impl From<WKUPR> for bool {
388 #[inline(always)]
389 fn from(variant: WKUPR) -> Self {
390 variant as u8 != 0
391 }
392}
393pub type WKUP_R = crate::BitReader<WKUPR>;
395impl WKUP_R {
396 #[inline(always)]
398 pub const fn variant(&self) -> WKUPR {
399 match self.bits {
400 false => WKUPR::NotWakeup,
401 true => WKUPR::Wakeup,
402 }
403 }
404 #[inline(always)]
406 pub fn is_not_wakeup(&self) -> bool {
407 *self == WKUPR::NotWakeup
408 }
409 #[inline(always)]
411 pub fn is_wakeup(&self) -> bool {
412 *self == WKUPR::Wakeup
413 }
414}
415#[cfg_attr(feature = "defmt", derive(defmt::Format))]
419#[derive(Clone, Copy, Debug, PartialEq, Eq)]
420pub enum WKUPW {
421 Clear = 0,
423}
424impl From<WKUPW> for bool {
425 #[inline(always)]
426 fn from(variant: WKUPW) -> Self {
427 variant as u8 != 0
428 }
429}
430pub type WKUP_W<'a, REG> = crate::BitWriter0C<'a, REG, WKUPW>;
432impl<'a, REG> WKUP_W<'a, REG>
433where
434 REG: crate::Writable + crate::RegisterSpec,
435{
436 #[inline(always)]
438 pub fn clear(self) -> &'a mut crate::W<REG> {
439 self.variant(WKUPW::Clear)
440 }
441}
442#[cfg_attr(feature = "defmt", derive(defmt::Format))]
446#[derive(Clone, Copy, Debug, PartialEq, Eq)]
447pub enum ERRR {
448 NotOverrun = 0,
450 Error = 1,
452}
453impl From<ERRR> for bool {
454 #[inline(always)]
455 fn from(variant: ERRR) -> Self {
456 variant as u8 != 0
457 }
458}
459pub type ERR_R = crate::BitReader<ERRR>;
461impl ERR_R {
462 #[inline(always)]
464 pub const fn variant(&self) -> ERRR {
465 match self.bits {
466 false => ERRR::NotOverrun,
467 true => ERRR::Error,
468 }
469 }
470 #[inline(always)]
472 pub fn is_not_overrun(&self) -> bool {
473 *self == ERRR::NotOverrun
474 }
475 #[inline(always)]
477 pub fn is_error(&self) -> bool {
478 *self == ERRR::Error
479 }
480}
481#[cfg_attr(feature = "defmt", derive(defmt::Format))]
485#[derive(Clone, Copy, Debug, PartialEq, Eq)]
486pub enum ERRW {
487 Clear = 0,
489}
490impl From<ERRW> for bool {
491 #[inline(always)]
492 fn from(variant: ERRW) -> Self {
493 variant as u8 != 0
494 }
495}
496pub type ERR_W<'a, REG> = crate::BitWriter0C<'a, REG, ERRW>;
498impl<'a, REG> ERR_W<'a, REG>
499where
500 REG: crate::Writable + crate::RegisterSpec,
501{
502 #[inline(always)]
504 pub fn clear(self) -> &'a mut crate::W<REG> {
505 self.variant(ERRW::Clear)
506 }
507}
508#[cfg_attr(feature = "defmt", derive(defmt::Format))]
512#[derive(Clone, Copy, Debug, PartialEq, Eq)]
513pub enum PMAOVRR {
514 NotOverrun = 0,
516 Overrun = 1,
518}
519impl From<PMAOVRR> for bool {
520 #[inline(always)]
521 fn from(variant: PMAOVRR) -> Self {
522 variant as u8 != 0
523 }
524}
525pub type PMAOVR_R = crate::BitReader<PMAOVRR>;
527impl PMAOVR_R {
528 #[inline(always)]
530 pub const fn variant(&self) -> PMAOVRR {
531 match self.bits {
532 false => PMAOVRR::NotOverrun,
533 true => PMAOVRR::Overrun,
534 }
535 }
536 #[inline(always)]
538 pub fn is_not_overrun(&self) -> bool {
539 *self == PMAOVRR::NotOverrun
540 }
541 #[inline(always)]
543 pub fn is_overrun(&self) -> bool {
544 *self == PMAOVRR::Overrun
545 }
546}
547#[cfg_attr(feature = "defmt", derive(defmt::Format))]
551#[derive(Clone, Copy, Debug, PartialEq, Eq)]
552pub enum PMAOVRW {
553 Clear = 0,
555}
556impl From<PMAOVRW> for bool {
557 #[inline(always)]
558 fn from(variant: PMAOVRW) -> Self {
559 variant as u8 != 0
560 }
561}
562pub type PMAOVR_W<'a, REG> = crate::BitWriter0C<'a, REG, PMAOVRW>;
564impl<'a, REG> PMAOVR_W<'a, REG>
565where
566 REG: crate::Writable + crate::RegisterSpec,
567{
568 #[inline(always)]
570 pub fn clear(self) -> &'a mut crate::W<REG> {
571 self.variant(PMAOVRW::Clear)
572 }
573}
574#[cfg_attr(feature = "defmt", derive(defmt::Format))]
578#[derive(Clone, Copy, Debug, PartialEq, Eq)]
579pub enum CTR {
580 Completed = 1,
582}
583impl From<CTR> for bool {
584 #[inline(always)]
585 fn from(variant: CTR) -> Self {
586 variant as u8 != 0
587 }
588}
589pub type CTR_R = crate::BitReader<CTR>;
591impl CTR_R {
592 #[inline(always)]
594 pub const fn variant(&self) -> Option<CTR> {
595 match self.bits {
596 true => Some(CTR::Completed),
597 _ => None,
598 }
599 }
600 #[inline(always)]
602 pub fn is_completed(&self) -> bool {
603 *self == CTR::Completed
604 }
605}
606impl R {
607 #[inline(always)]
609 pub fn ep_id(&self) -> EP_ID_R {
610 EP_ID_R::new((self.bits & 0x0f) as u8)
611 }
612 #[inline(always)]
614 pub fn dir(&self) -> DIR_R {
615 DIR_R::new(((self.bits >> 4) & 1) != 0)
616 }
617 #[inline(always)]
619 pub fn l1req(&self) -> L1REQ_R {
620 L1REQ_R::new(((self.bits >> 7) & 1) != 0)
621 }
622 #[inline(always)]
624 pub fn esof(&self) -> ESOF_R {
625 ESOF_R::new(((self.bits >> 8) & 1) != 0)
626 }
627 #[inline(always)]
629 pub fn sof(&self) -> SOF_R {
630 SOF_R::new(((self.bits >> 9) & 1) != 0)
631 }
632 #[inline(always)]
634 pub fn reset(&self) -> RESET_R {
635 RESET_R::new(((self.bits >> 10) & 1) != 0)
636 }
637 #[inline(always)]
639 pub fn susp(&self) -> SUSP_R {
640 SUSP_R::new(((self.bits >> 11) & 1) != 0)
641 }
642 #[inline(always)]
644 pub fn wkup(&self) -> WKUP_R {
645 WKUP_R::new(((self.bits >> 12) & 1) != 0)
646 }
647 #[inline(always)]
649 pub fn err(&self) -> ERR_R {
650 ERR_R::new(((self.bits >> 13) & 1) != 0)
651 }
652 #[inline(always)]
654 pub fn pmaovr(&self) -> PMAOVR_R {
655 PMAOVR_R::new(((self.bits >> 14) & 1) != 0)
656 }
657 #[inline(always)]
659 pub fn ctr(&self) -> CTR_R {
660 CTR_R::new(((self.bits >> 15) & 1) != 0)
661 }
662}
663impl core::fmt::Debug for R {
664 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
665 f.debug_struct("ISTR")
666 .field("ep_id", &self.ep_id())
667 .field("dir", &self.dir())
668 .field("l1req", &self.l1req())
669 .field("esof", &self.esof())
670 .field("sof", &self.sof())
671 .field("reset", &self.reset())
672 .field("susp", &self.susp())
673 .field("wkup", &self.wkup())
674 .field("err", &self.err())
675 .field("pmaovr", &self.pmaovr())
676 .field("ctr", &self.ctr())
677 .finish()
678 }
679}
680impl W {
681 #[inline(always)]
683 pub fn l1req(&mut self) -> L1REQ_W<ISTRrs> {
684 L1REQ_W::new(self, 7)
685 }
686 #[inline(always)]
688 pub fn esof(&mut self) -> ESOF_W<ISTRrs> {
689 ESOF_W::new(self, 8)
690 }
691 #[inline(always)]
693 pub fn sof(&mut self) -> SOF_W<ISTRrs> {
694 SOF_W::new(self, 9)
695 }
696 #[inline(always)]
698 pub fn reset(&mut self) -> RESET_W<ISTRrs> {
699 RESET_W::new(self, 10)
700 }
701 #[inline(always)]
703 pub fn susp(&mut self) -> SUSP_W<ISTRrs> {
704 SUSP_W::new(self, 11)
705 }
706 #[inline(always)]
708 pub fn wkup(&mut self) -> WKUP_W<ISTRrs> {
709 WKUP_W::new(self, 12)
710 }
711 #[inline(always)]
713 pub fn err(&mut self) -> ERR_W<ISTRrs> {
714 ERR_W::new(self, 13)
715 }
716 #[inline(always)]
718 pub fn pmaovr(&mut self) -> PMAOVR_W<ISTRrs> {
719 PMAOVR_W::new(self, 14)
720 }
721}
722pub struct ISTRrs;
728impl crate::RegisterSpec for ISTRrs {
729 type Ux = u32;
730}
731impl crate::Readable for ISTRrs {}
733impl crate::Writable for ISTRrs {
735 type Safety = crate::Unsafe;
736 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x7f80;
737}
738impl crate::Resettable for ISTRrs {}