esp32s3/usb0/
gahbcfg.rs

1#[doc = "Register `GAHBCFG` reader"]
2pub type R = crate::R<GAHBCFG_SPEC>;
3#[doc = "Register `GAHBCFG` writer"]
4pub type W = crate::W<GAHBCFG_SPEC>;
5#[doc = "Field `GLBLLNTRMSK` reader - "]
6pub type GLBLLNTRMSK_R = crate::BitReader;
7#[doc = "Field `GLBLLNTRMSK` writer - "]
8pub type GLBLLNTRMSK_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `HBSTLEN` reader - "]
10pub type HBSTLEN_R = crate::FieldReader;
11#[doc = "Field `HBSTLEN` writer - "]
12pub type HBSTLEN_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `DMAEN` reader - "]
14pub type DMAEN_R = crate::BitReader;
15#[doc = "Field `DMAEN` writer - "]
16pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `NPTXFEMPLVL` reader - "]
18pub type NPTXFEMPLVL_R = crate::BitReader;
19#[doc = "Field `NPTXFEMPLVL` writer - "]
20pub type NPTXFEMPLVL_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `PTXFEMPLVL` reader - "]
22pub type PTXFEMPLVL_R = crate::BitReader;
23#[doc = "Field `PTXFEMPLVL` writer - "]
24pub type PTXFEMPLVL_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `REMMEMSUPP` reader - "]
26pub type REMMEMSUPP_R = crate::BitReader;
27#[doc = "Field `REMMEMSUPP` writer - "]
28pub type REMMEMSUPP_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `NOTIALLDMAWRIT` reader - "]
30pub type NOTIALLDMAWRIT_R = crate::BitReader;
31#[doc = "Field `NOTIALLDMAWRIT` writer - "]
32pub type NOTIALLDMAWRIT_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `AHBSINGLE` reader - "]
34pub type AHBSINGLE_R = crate::BitReader;
35#[doc = "Field `AHBSINGLE` writer - "]
36pub type AHBSINGLE_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `INVDESCENDIANESS` reader - "]
38pub type INVDESCENDIANESS_R = crate::BitReader;
39#[doc = "Field `INVDESCENDIANESS` writer - "]
40pub type INVDESCENDIANESS_W<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42    #[doc = "Bit 0"]
43    #[inline(always)]
44    pub fn glbllntrmsk(&self) -> GLBLLNTRMSK_R {
45        GLBLLNTRMSK_R::new((self.bits & 1) != 0)
46    }
47    #[doc = "Bits 1:4"]
48    #[inline(always)]
49    pub fn hbstlen(&self) -> HBSTLEN_R {
50        HBSTLEN_R::new(((self.bits >> 1) & 0x0f) as u8)
51    }
52    #[doc = "Bit 5"]
53    #[inline(always)]
54    pub fn dmaen(&self) -> DMAEN_R {
55        DMAEN_R::new(((self.bits >> 5) & 1) != 0)
56    }
57    #[doc = "Bit 7"]
58    #[inline(always)]
59    pub fn nptxfemplvl(&self) -> NPTXFEMPLVL_R {
60        NPTXFEMPLVL_R::new(((self.bits >> 7) & 1) != 0)
61    }
62    #[doc = "Bit 8"]
63    #[inline(always)]
64    pub fn ptxfemplvl(&self) -> PTXFEMPLVL_R {
65        PTXFEMPLVL_R::new(((self.bits >> 8) & 1) != 0)
66    }
67    #[doc = "Bit 21"]
68    #[inline(always)]
69    pub fn remmemsupp(&self) -> REMMEMSUPP_R {
70        REMMEMSUPP_R::new(((self.bits >> 21) & 1) != 0)
71    }
72    #[doc = "Bit 22"]
73    #[inline(always)]
74    pub fn notialldmawrit(&self) -> NOTIALLDMAWRIT_R {
75        NOTIALLDMAWRIT_R::new(((self.bits >> 22) & 1) != 0)
76    }
77    #[doc = "Bit 23"]
78    #[inline(always)]
79    pub fn ahbsingle(&self) -> AHBSINGLE_R {
80        AHBSINGLE_R::new(((self.bits >> 23) & 1) != 0)
81    }
82    #[doc = "Bit 24"]
83    #[inline(always)]
84    pub fn invdescendianess(&self) -> INVDESCENDIANESS_R {
85        INVDESCENDIANESS_R::new(((self.bits >> 24) & 1) != 0)
86    }
87}
88#[cfg(feature = "impl-register-debug")]
89impl core::fmt::Debug for R {
90    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
91        f.debug_struct("GAHBCFG")
92            .field("glbllntrmsk", &self.glbllntrmsk())
93            .field("hbstlen", &self.hbstlen())
94            .field("dmaen", &self.dmaen())
95            .field("nptxfemplvl", &self.nptxfemplvl())
96            .field("ptxfemplvl", &self.ptxfemplvl())
97            .field("remmemsupp", &self.remmemsupp())
98            .field("notialldmawrit", &self.notialldmawrit())
99            .field("ahbsingle", &self.ahbsingle())
100            .field("invdescendianess", &self.invdescendianess())
101            .finish()
102    }
103}
104impl W {
105    #[doc = "Bit 0"]
106    #[inline(always)]
107    pub fn glbllntrmsk(&mut self) -> GLBLLNTRMSK_W<GAHBCFG_SPEC> {
108        GLBLLNTRMSK_W::new(self, 0)
109    }
110    #[doc = "Bits 1:4"]
111    #[inline(always)]
112    pub fn hbstlen(&mut self) -> HBSTLEN_W<GAHBCFG_SPEC> {
113        HBSTLEN_W::new(self, 1)
114    }
115    #[doc = "Bit 5"]
116    #[inline(always)]
117    pub fn dmaen(&mut self) -> DMAEN_W<GAHBCFG_SPEC> {
118        DMAEN_W::new(self, 5)
119    }
120    #[doc = "Bit 7"]
121    #[inline(always)]
122    pub fn nptxfemplvl(&mut self) -> NPTXFEMPLVL_W<GAHBCFG_SPEC> {
123        NPTXFEMPLVL_W::new(self, 7)
124    }
125    #[doc = "Bit 8"]
126    #[inline(always)]
127    pub fn ptxfemplvl(&mut self) -> PTXFEMPLVL_W<GAHBCFG_SPEC> {
128        PTXFEMPLVL_W::new(self, 8)
129    }
130    #[doc = "Bit 21"]
131    #[inline(always)]
132    pub fn remmemsupp(&mut self) -> REMMEMSUPP_W<GAHBCFG_SPEC> {
133        REMMEMSUPP_W::new(self, 21)
134    }
135    #[doc = "Bit 22"]
136    #[inline(always)]
137    pub fn notialldmawrit(&mut self) -> NOTIALLDMAWRIT_W<GAHBCFG_SPEC> {
138        NOTIALLDMAWRIT_W::new(self, 22)
139    }
140    #[doc = "Bit 23"]
141    #[inline(always)]
142    pub fn ahbsingle(&mut self) -> AHBSINGLE_W<GAHBCFG_SPEC> {
143        AHBSINGLE_W::new(self, 23)
144    }
145    #[doc = "Bit 24"]
146    #[inline(always)]
147    pub fn invdescendianess(&mut self) -> INVDESCENDIANESS_W<GAHBCFG_SPEC> {
148        INVDESCENDIANESS_W::new(self, 24)
149    }
150}
151#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`gahbcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gahbcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
152pub struct GAHBCFG_SPEC;
153impl crate::RegisterSpec for GAHBCFG_SPEC {
154    type Ux = u32;
155}
156#[doc = "`read()` method returns [`gahbcfg::R`](R) reader structure"]
157impl crate::Readable for GAHBCFG_SPEC {}
158#[doc = "`write(|w| ..)` method takes [`gahbcfg::W`](W) writer structure"]
159impl crate::Writable for GAHBCFG_SPEC {
160    type Safety = crate::Unsafe;
161    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
162    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
163}
164#[doc = "`reset()` method sets GAHBCFG to value 0"]
165impl crate::Resettable for GAHBCFG_SPEC {
166    const RESET_VALUE: u32 = 0;
167}