bl702_pac/usb/
usb_frame_no.rs

1#[doc = "Register `usb_frame_no` reader"]
2pub struct R(crate::R<USB_FRAME_NO_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<USB_FRAME_NO_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<USB_FRAME_NO_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<USB_FRAME_NO_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `usb_frame_no` writer"]
17pub struct W(crate::W<USB_FRAME_NO_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<USB_FRAME_NO_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<USB_FRAME_NO_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<USB_FRAME_NO_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `sts_frame_no` reader - "]
38pub type STS_FRAME_NO_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `sts_frame_no` writer - "]
40pub type STS_FRAME_NO_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, USB_FRAME_NO_SPEC, u16, u16, 11, O>;
42#[doc = "Field `sts_pid` reader - "]
43pub type STS_PID_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `sts_pid` writer - "]
45pub type STS_PID_W<'a, const O: u8> = crate::FieldWriter<'a, u32, USB_FRAME_NO_SPEC, u8, u8, 4, O>;
46#[doc = "Field `sts_ep_no` reader - "]
47pub type STS_EP_NO_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `sts_ep_no` writer - "]
49pub type STS_EP_NO_W<'a, const O: u8> =
50    crate::FieldWriter<'a, u32, USB_FRAME_NO_SPEC, u8, u8, 4, O>;
51impl R {
52    #[doc = "Bits 0:10"]
53    #[inline(always)]
54    pub fn sts_frame_no(&self) -> STS_FRAME_NO_R {
55        STS_FRAME_NO_R::new((self.bits & 0x07ff) as u16)
56    }
57    #[doc = "Bits 12:15"]
58    #[inline(always)]
59    pub fn sts_pid(&self) -> STS_PID_R {
60        STS_PID_R::new(((self.bits >> 12) & 0x0f) as u8)
61    }
62    #[doc = "Bits 16:19"]
63    #[inline(always)]
64    pub fn sts_ep_no(&self) -> STS_EP_NO_R {
65        STS_EP_NO_R::new(((self.bits >> 16) & 0x0f) as u8)
66    }
67}
68impl W {
69    #[doc = "Bits 0:10"]
70    #[inline(always)]
71    #[must_use]
72    pub fn sts_frame_no(&mut self) -> STS_FRAME_NO_W<0> {
73        STS_FRAME_NO_W::new(self)
74    }
75    #[doc = "Bits 12:15"]
76    #[inline(always)]
77    #[must_use]
78    pub fn sts_pid(&mut self) -> STS_PID_W<12> {
79        STS_PID_W::new(self)
80    }
81    #[doc = "Bits 16:19"]
82    #[inline(always)]
83    #[must_use]
84    pub fn sts_ep_no(&mut self) -> STS_EP_NO_W<16> {
85        STS_EP_NO_W::new(self)
86    }
87    #[doc = "Writes raw bits to the register."]
88    #[inline(always)]
89    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
90        self.0.bits(bits);
91        self
92    }
93}
94#[doc = "usb_frame_no.\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 [usb_frame_no](index.html) module"]
95pub struct USB_FRAME_NO_SPEC;
96impl crate::RegisterSpec for USB_FRAME_NO_SPEC {
97    type Ux = u32;
98}
99#[doc = "`read()` method returns [usb_frame_no::R](R) reader structure"]
100impl crate::Readable for USB_FRAME_NO_SPEC {
101    type Reader = R;
102}
103#[doc = "`write(|w| ..)` method takes [usb_frame_no::W](W) writer structure"]
104impl crate::Writable for USB_FRAME_NO_SPEC {
105    type Writer = W;
106    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
107    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
108}
109#[doc = "`reset()` method sets usb_frame_no to value 0"]
110impl crate::Resettable for USB_FRAME_NO_SPEC {
111    const RESET_VALUE: Self::Ux = 0;
112}