esp32s3/usb0/
grxstsr.rs

1#[doc = "Register `GRXSTSR` reader"]
2pub type R = crate::R<GRXSTSR_SPEC>;
3#[doc = "Field `G_CHNUM` reader - "]
4pub type G_CHNUM_R = crate::FieldReader;
5#[doc = "Field `G_BCNT` reader - "]
6pub type G_BCNT_R = crate::FieldReader<u16>;
7#[doc = "Field `G_DPID` reader - "]
8pub type G_DPID_R = crate::FieldReader;
9#[doc = "Field `G_PKTSTS` reader - "]
10pub type G_PKTSTS_R = crate::FieldReader;
11#[doc = "Field `G_FN` reader - "]
12pub type G_FN_R = crate::FieldReader;
13impl R {
14    #[doc = "Bits 0:3"]
15    #[inline(always)]
16    pub fn g_chnum(&self) -> G_CHNUM_R {
17        G_CHNUM_R::new((self.bits & 0x0f) as u8)
18    }
19    #[doc = "Bits 4:14"]
20    #[inline(always)]
21    pub fn g_bcnt(&self) -> G_BCNT_R {
22        G_BCNT_R::new(((self.bits >> 4) & 0x07ff) as u16)
23    }
24    #[doc = "Bits 15:16"]
25    #[inline(always)]
26    pub fn g_dpid(&self) -> G_DPID_R {
27        G_DPID_R::new(((self.bits >> 15) & 3) as u8)
28    }
29    #[doc = "Bits 17:20"]
30    #[inline(always)]
31    pub fn g_pktsts(&self) -> G_PKTSTS_R {
32        G_PKTSTS_R::new(((self.bits >> 17) & 0x0f) as u8)
33    }
34    #[doc = "Bits 21:24"]
35    #[inline(always)]
36    pub fn g_fn(&self) -> G_FN_R {
37        G_FN_R::new(((self.bits >> 21) & 0x0f) as u8)
38    }
39}
40#[cfg(feature = "impl-register-debug")]
41impl core::fmt::Debug for R {
42    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
43        f.debug_struct("GRXSTSR")
44            .field("g_chnum", &self.g_chnum())
45            .field("g_bcnt", &self.g_bcnt())
46            .field("g_dpid", &self.g_dpid())
47            .field("g_pktsts", &self.g_pktsts())
48            .field("g_fn", &self.g_fn())
49            .finish()
50    }
51}
52#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`grxstsr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
53pub struct GRXSTSR_SPEC;
54impl crate::RegisterSpec for GRXSTSR_SPEC {
55    type Ux = u32;
56}
57#[doc = "`read()` method returns [`grxstsr::R`](R) reader structure"]
58impl crate::Readable for GRXSTSR_SPEC {}
59#[doc = "`reset()` method sets GRXSTSR to value 0"]
60impl crate::Resettable for GRXSTSR_SPEC {
61    const RESET_VALUE: u32 = 0;
62}