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 ESOFR {
52 NotExpectedStartOfFrame = 0,
54 ExpectedStartOfFrame = 1,
56}
57impl From<ESOFR> for bool {
58 #[inline(always)]
59 fn from(variant: ESOFR) -> Self {
60 variant as u8 != 0
61 }
62}
63pub type ESOF_R = crate::BitReader<ESOFR>;
65impl ESOF_R {
66 #[inline(always)]
68 pub const fn variant(&self) -> ESOFR {
69 match self.bits {
70 false => ESOFR::NotExpectedStartOfFrame,
71 true => ESOFR::ExpectedStartOfFrame,
72 }
73 }
74 #[inline(always)]
76 pub fn is_not_expected_start_of_frame(&self) -> bool {
77 *self == ESOFR::NotExpectedStartOfFrame
78 }
79 #[inline(always)]
81 pub fn is_expected_start_of_frame(&self) -> bool {
82 *self == ESOFR::ExpectedStartOfFrame
83 }
84}
85#[cfg_attr(feature = "defmt", derive(defmt::Format))]
89#[derive(Clone, Copy, Debug, PartialEq, Eq)]
90pub enum ESOFW {
91 Clear = 0,
93}
94impl From<ESOFW> for bool {
95 #[inline(always)]
96 fn from(variant: ESOFW) -> Self {
97 variant as u8 != 0
98 }
99}
100pub type ESOF_W<'a, REG> = crate::BitWriter0C<'a, REG, ESOFW>;
102impl<'a, REG> ESOF_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(ESOFW::Clear)
110 }
111}
112#[cfg_attr(feature = "defmt", derive(defmt::Format))]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum SOFR {
118 NotStartOfFrame = 0,
120 StartOfFrame = 1,
122}
123impl From<SOFR> for bool {
124 #[inline(always)]
125 fn from(variant: SOFR) -> Self {
126 variant as u8 != 0
127 }
128}
129pub type SOF_R = crate::BitReader<SOFR>;
131impl SOF_R {
132 #[inline(always)]
134 pub const fn variant(&self) -> SOFR {
135 match self.bits {
136 false => SOFR::NotStartOfFrame,
137 true => SOFR::StartOfFrame,
138 }
139 }
140 #[inline(always)]
142 pub fn is_not_start_of_frame(&self) -> bool {
143 *self == SOFR::NotStartOfFrame
144 }
145 #[inline(always)]
147 pub fn is_start_of_frame(&self) -> bool {
148 *self == SOFR::StartOfFrame
149 }
150}
151#[cfg_attr(feature = "defmt", derive(defmt::Format))]
155#[derive(Clone, Copy, Debug, PartialEq, Eq)]
156pub enum SOFW {
157 Clear = 0,
159}
160impl From<SOFW> for bool {
161 #[inline(always)]
162 fn from(variant: SOFW) -> Self {
163 variant as u8 != 0
164 }
165}
166pub type SOF_W<'a, REG> = crate::BitWriter0C<'a, REG, SOFW>;
168impl<'a, REG> SOF_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(SOFW::Clear)
176 }
177}
178#[cfg_attr(feature = "defmt", derive(defmt::Format))]
182#[derive(Clone, Copy, Debug, PartialEq, Eq)]
183pub enum RESETR {
184 NotReset = 0,
186 Reset = 1,
188}
189impl From<RESETR> for bool {
190 #[inline(always)]
191 fn from(variant: RESETR) -> Self {
192 variant as u8 != 0
193 }
194}
195pub type RESET_R = crate::BitReader<RESETR>;
197impl RESET_R {
198 #[inline(always)]
200 pub const fn variant(&self) -> RESETR {
201 match self.bits {
202 false => RESETR::NotReset,
203 true => RESETR::Reset,
204 }
205 }
206 #[inline(always)]
208 pub fn is_not_reset(&self) -> bool {
209 *self == RESETR::NotReset
210 }
211 #[inline(always)]
213 pub fn is_reset(&self) -> bool {
214 *self == RESETR::Reset
215 }
216}
217#[cfg_attr(feature = "defmt", derive(defmt::Format))]
221#[derive(Clone, Copy, Debug, PartialEq, Eq)]
222pub enum RESETW {
223 Clear = 0,
225}
226impl From<RESETW> for bool {
227 #[inline(always)]
228 fn from(variant: RESETW) -> Self {
229 variant as u8 != 0
230 }
231}
232pub type RESET_W<'a, REG> = crate::BitWriter0C<'a, REG, RESETW>;
234impl<'a, REG> RESET_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(RESETW::Clear)
242 }
243}
244#[cfg_attr(feature = "defmt", derive(defmt::Format))]
248#[derive(Clone, Copy, Debug, PartialEq, Eq)]
249pub enum SUSPR {
250 NotSuspend = 0,
252 Suspend = 1,
254}
255impl From<SUSPR> for bool {
256 #[inline(always)]
257 fn from(variant: SUSPR) -> Self {
258 variant as u8 != 0
259 }
260}
261pub type SUSP_R = crate::BitReader<SUSPR>;
263impl SUSP_R {
264 #[inline(always)]
266 pub const fn variant(&self) -> SUSPR {
267 match self.bits {
268 false => SUSPR::NotSuspend,
269 true => SUSPR::Suspend,
270 }
271 }
272 #[inline(always)]
274 pub fn is_not_suspend(&self) -> bool {
275 *self == SUSPR::NotSuspend
276 }
277 #[inline(always)]
279 pub fn is_suspend(&self) -> bool {
280 *self == SUSPR::Suspend
281 }
282}
283#[cfg_attr(feature = "defmt", derive(defmt::Format))]
287#[derive(Clone, Copy, Debug, PartialEq, Eq)]
288pub enum SUSPW {
289 Clear = 0,
291}
292impl From<SUSPW> for bool {
293 #[inline(always)]
294 fn from(variant: SUSPW) -> Self {
295 variant as u8 != 0
296 }
297}
298pub type SUSP_W<'a, REG> = crate::BitWriter0C<'a, REG, SUSPW>;
300impl<'a, REG> SUSP_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(SUSPW::Clear)
308 }
309}
310#[cfg_attr(feature = "defmt", derive(defmt::Format))]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315pub enum WKUPR {
316 NotWakeup = 0,
318 Wakeup = 1,
320}
321impl From<WKUPR> for bool {
322 #[inline(always)]
323 fn from(variant: WKUPR) -> Self {
324 variant as u8 != 0
325 }
326}
327pub type WKUP_R = crate::BitReader<WKUPR>;
329impl WKUP_R {
330 #[inline(always)]
332 pub const fn variant(&self) -> WKUPR {
333 match self.bits {
334 false => WKUPR::NotWakeup,
335 true => WKUPR::Wakeup,
336 }
337 }
338 #[inline(always)]
340 pub fn is_not_wakeup(&self) -> bool {
341 *self == WKUPR::NotWakeup
342 }
343 #[inline(always)]
345 pub fn is_wakeup(&self) -> bool {
346 *self == WKUPR::Wakeup
347 }
348}
349#[cfg_attr(feature = "defmt", derive(defmt::Format))]
353#[derive(Clone, Copy, Debug, PartialEq, Eq)]
354pub enum WKUPW {
355 Clear = 0,
357}
358impl From<WKUPW> for bool {
359 #[inline(always)]
360 fn from(variant: WKUPW) -> Self {
361 variant as u8 != 0
362 }
363}
364pub type WKUP_W<'a, REG> = crate::BitWriter0C<'a, REG, WKUPW>;
366impl<'a, REG> WKUP_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(WKUPW::Clear)
374 }
375}
376#[cfg_attr(feature = "defmt", derive(defmt::Format))]
380#[derive(Clone, Copy, Debug, PartialEq, Eq)]
381pub enum ERRR {
382 NotOverrun = 0,
384 Error = 1,
386}
387impl From<ERRR> for bool {
388 #[inline(always)]
389 fn from(variant: ERRR) -> Self {
390 variant as u8 != 0
391 }
392}
393pub type ERR_R = crate::BitReader<ERRR>;
395impl ERR_R {
396 #[inline(always)]
398 pub const fn variant(&self) -> ERRR {
399 match self.bits {
400 false => ERRR::NotOverrun,
401 true => ERRR::Error,
402 }
403 }
404 #[inline(always)]
406 pub fn is_not_overrun(&self) -> bool {
407 *self == ERRR::NotOverrun
408 }
409 #[inline(always)]
411 pub fn is_error(&self) -> bool {
412 *self == ERRR::Error
413 }
414}
415#[cfg_attr(feature = "defmt", derive(defmt::Format))]
419#[derive(Clone, Copy, Debug, PartialEq, Eq)]
420pub enum ERRW {
421 Clear = 0,
423}
424impl From<ERRW> for bool {
425 #[inline(always)]
426 fn from(variant: ERRW) -> Self {
427 variant as u8 != 0
428 }
429}
430pub type ERR_W<'a, REG> = crate::BitWriter0C<'a, REG, ERRW>;
432impl<'a, REG> ERR_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(ERRW::Clear)
440 }
441}
442#[cfg_attr(feature = "defmt", derive(defmt::Format))]
446#[derive(Clone, Copy, Debug, PartialEq, Eq)]
447pub enum PMAOVRR {
448 NotOverrun = 0,
450 Overrun = 1,
452}
453impl From<PMAOVRR> for bool {
454 #[inline(always)]
455 fn from(variant: PMAOVRR) -> Self {
456 variant as u8 != 0
457 }
458}
459pub type PMAOVR_R = crate::BitReader<PMAOVRR>;
461impl PMAOVR_R {
462 #[inline(always)]
464 pub const fn variant(&self) -> PMAOVRR {
465 match self.bits {
466 false => PMAOVRR::NotOverrun,
467 true => PMAOVRR::Overrun,
468 }
469 }
470 #[inline(always)]
472 pub fn is_not_overrun(&self) -> bool {
473 *self == PMAOVRR::NotOverrun
474 }
475 #[inline(always)]
477 pub fn is_overrun(&self) -> bool {
478 *self == PMAOVRR::Overrun
479 }
480}
481#[cfg_attr(feature = "defmt", derive(defmt::Format))]
485#[derive(Clone, Copy, Debug, PartialEq, Eq)]
486pub enum PMAOVRW {
487 Clear = 0,
489}
490impl From<PMAOVRW> for bool {
491 #[inline(always)]
492 fn from(variant: PMAOVRW) -> Self {
493 variant as u8 != 0
494 }
495}
496pub type PMAOVR_W<'a, REG> = crate::BitWriter0C<'a, REG, PMAOVRW>;
498impl<'a, REG> PMAOVR_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(PMAOVRW::Clear)
506 }
507}
508#[cfg_attr(feature = "defmt", derive(defmt::Format))]
512#[derive(Clone, Copy, Debug, PartialEq, Eq)]
513pub enum CTR {
514 Completed = 1,
516}
517impl From<CTR> for bool {
518 #[inline(always)]
519 fn from(variant: CTR) -> Self {
520 variant as u8 != 0
521 }
522}
523pub type CTR_R = crate::BitReader<CTR>;
525impl CTR_R {
526 #[inline(always)]
528 pub const fn variant(&self) -> Option<CTR> {
529 match self.bits {
530 true => Some(CTR::Completed),
531 _ => None,
532 }
533 }
534 #[inline(always)]
536 pub fn is_completed(&self) -> bool {
537 *self == CTR::Completed
538 }
539}
540impl R {
541 #[inline(always)]
543 pub fn ep_id(&self) -> EP_ID_R {
544 EP_ID_R::new((self.bits & 0x0f) as u8)
545 }
546 #[inline(always)]
548 pub fn dir(&self) -> DIR_R {
549 DIR_R::new(((self.bits >> 4) & 1) != 0)
550 }
551 #[inline(always)]
553 pub fn esof(&self) -> ESOF_R {
554 ESOF_R::new(((self.bits >> 8) & 1) != 0)
555 }
556 #[inline(always)]
558 pub fn sof(&self) -> SOF_R {
559 SOF_R::new(((self.bits >> 9) & 1) != 0)
560 }
561 #[inline(always)]
563 pub fn reset(&self) -> RESET_R {
564 RESET_R::new(((self.bits >> 10) & 1) != 0)
565 }
566 #[inline(always)]
568 pub fn susp(&self) -> SUSP_R {
569 SUSP_R::new(((self.bits >> 11) & 1) != 0)
570 }
571 #[inline(always)]
573 pub fn wkup(&self) -> WKUP_R {
574 WKUP_R::new(((self.bits >> 12) & 1) != 0)
575 }
576 #[inline(always)]
578 pub fn err(&self) -> ERR_R {
579 ERR_R::new(((self.bits >> 13) & 1) != 0)
580 }
581 #[inline(always)]
583 pub fn pmaovr(&self) -> PMAOVR_R {
584 PMAOVR_R::new(((self.bits >> 14) & 1) != 0)
585 }
586 #[inline(always)]
588 pub fn ctr(&self) -> CTR_R {
589 CTR_R::new(((self.bits >> 15) & 1) != 0)
590 }
591}
592impl core::fmt::Debug for R {
593 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
594 f.debug_struct("ISTR")
595 .field("ep_id", &self.ep_id())
596 .field("dir", &self.dir())
597 .field("esof", &self.esof())
598 .field("sof", &self.sof())
599 .field("reset", &self.reset())
600 .field("susp", &self.susp())
601 .field("wkup", &self.wkup())
602 .field("err", &self.err())
603 .field("pmaovr", &self.pmaovr())
604 .field("ctr", &self.ctr())
605 .finish()
606 }
607}
608impl W {
609 #[inline(always)]
611 pub fn esof(&mut self) -> ESOF_W<ISTRrs> {
612 ESOF_W::new(self, 8)
613 }
614 #[inline(always)]
616 pub fn sof(&mut self) -> SOF_W<ISTRrs> {
617 SOF_W::new(self, 9)
618 }
619 #[inline(always)]
621 pub fn reset(&mut self) -> RESET_W<ISTRrs> {
622 RESET_W::new(self, 10)
623 }
624 #[inline(always)]
626 pub fn susp(&mut self) -> SUSP_W<ISTRrs> {
627 SUSP_W::new(self, 11)
628 }
629 #[inline(always)]
631 pub fn wkup(&mut self) -> WKUP_W<ISTRrs> {
632 WKUP_W::new(self, 12)
633 }
634 #[inline(always)]
636 pub fn err(&mut self) -> ERR_W<ISTRrs> {
637 ERR_W::new(self, 13)
638 }
639 #[inline(always)]
641 pub fn pmaovr(&mut self) -> PMAOVR_W<ISTRrs> {
642 PMAOVR_W::new(self, 14)
643 }
644}
645pub struct ISTRrs;
651impl crate::RegisterSpec for ISTRrs {
652 type Ux = u32;
653}
654impl crate::Readable for ISTRrs {}
656impl crate::Writable for ISTRrs {
658 type Safety = crate::Unsafe;
659 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x7f00;
660 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
661}
662impl crate::Resettable for ISTRrs {
664 const RESET_VALUE: u32 = 0;
665}