esp32s2/usb0/
hptxsts.rs

1#[doc = "Register `HPTXSTS` reader"]
2pub type R = crate::R<HPTXSTS_SPEC>;
3#[doc = "Field `PTXFSPCAVAIL` reader - "]
4pub type PTXFSPCAVAIL_R = crate::FieldReader<u16>;
5#[doc = "Field `PTXQSPCAVAIL` reader - "]
6pub type PTXQSPCAVAIL_R = crate::FieldReader;
7#[doc = "Field `PTXQTOP` reader - "]
8pub type PTXQTOP_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:15"]
11    #[inline(always)]
12    pub fn ptxfspcavail(&self) -> PTXFSPCAVAIL_R {
13        PTXFSPCAVAIL_R::new((self.bits & 0xffff) as u16)
14    }
15    #[doc = "Bits 16:20"]
16    #[inline(always)]
17    pub fn ptxqspcavail(&self) -> PTXQSPCAVAIL_R {
18        PTXQSPCAVAIL_R::new(((self.bits >> 16) & 0x1f) as u8)
19    }
20    #[doc = "Bits 24:31"]
21    #[inline(always)]
22    pub fn ptxqtop(&self) -> PTXQTOP_R {
23        PTXQTOP_R::new(((self.bits >> 24) & 0xff) as u8)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("HPTXSTS")
30            .field("ptxfspcavail", &self.ptxfspcavail())
31            .field("ptxqspcavail", &self.ptxqspcavail())
32            .field("ptxqtop", &self.ptxqtop())
33            .finish()
34    }
35}
36#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`hptxsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct HPTXSTS_SPEC;
38impl crate::RegisterSpec for HPTXSTS_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`hptxsts::R`](R) reader structure"]
42impl crate::Readable for HPTXSTS_SPEC {}
43#[doc = "`reset()` method sets HPTXSTS to value 0x0008_0100"]
44impl crate::Resettable for HPTXSTS_SPEC {
45    const RESET_VALUE: u32 = 0x0008_0100;
46}