esp32/dport/
rom_pd_ctrl.rs

1#[doc = "Register `ROM_PD_CTRL` reader"]
2pub type R = crate::R<ROM_PD_CTRL_SPEC>;
3#[doc = "Register `ROM_PD_CTRL` writer"]
4pub type W = crate::W<ROM_PD_CTRL_SPEC>;
5#[doc = "Field `PRO_ROM_PD` reader - "]
6pub type PRO_ROM_PD_R = crate::BitReader;
7#[doc = "Field `PRO_ROM_PD` writer - "]
8pub type PRO_ROM_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `APP_ROM_PD` reader - "]
10pub type APP_ROM_PD_R = crate::BitReader;
11#[doc = "Field `APP_ROM_PD` writer - "]
12pub type APP_ROM_PD_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SHARE_ROM_PD` reader - "]
14pub type SHARE_ROM_PD_R = crate::FieldReader;
15#[doc = "Field `SHARE_ROM_PD` writer - "]
16pub type SHARE_ROM_PD_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
17impl R {
18    #[doc = "Bit 0"]
19    #[inline(always)]
20    pub fn pro_rom_pd(&self) -> PRO_ROM_PD_R {
21        PRO_ROM_PD_R::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1"]
24    #[inline(always)]
25    pub fn app_rom_pd(&self) -> APP_ROM_PD_R {
26        APP_ROM_PD_R::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bits 2:7"]
29    #[inline(always)]
30    pub fn share_rom_pd(&self) -> SHARE_ROM_PD_R {
31        SHARE_ROM_PD_R::new(((self.bits >> 2) & 0x3f) as u8)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("ROM_PD_CTRL")
38            .field("pro_rom_pd", &self.pro_rom_pd())
39            .field("app_rom_pd", &self.app_rom_pd())
40            .field("share_rom_pd", &self.share_rom_pd())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bit 0"]
46    #[inline(always)]
47    pub fn pro_rom_pd(&mut self) -> PRO_ROM_PD_W<ROM_PD_CTRL_SPEC> {
48        PRO_ROM_PD_W::new(self, 0)
49    }
50    #[doc = "Bit 1"]
51    #[inline(always)]
52    pub fn app_rom_pd(&mut self) -> APP_ROM_PD_W<ROM_PD_CTRL_SPEC> {
53        APP_ROM_PD_W::new(self, 1)
54    }
55    #[doc = "Bits 2:7"]
56    #[inline(always)]
57    pub fn share_rom_pd(&mut self) -> SHARE_ROM_PD_W<ROM_PD_CTRL_SPEC> {
58        SHARE_ROM_PD_W::new(self, 2)
59    }
60}
61#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`rom_pd_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rom_pd_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct ROM_PD_CTRL_SPEC;
63impl crate::RegisterSpec for ROM_PD_CTRL_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`rom_pd_ctrl::R`](R) reader structure"]
67impl crate::Readable for ROM_PD_CTRL_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`rom_pd_ctrl::W`](W) writer structure"]
69impl crate::Writable for ROM_PD_CTRL_SPEC {
70    type Safety = crate::Unsafe;
71}
72#[doc = "`reset()` method sets ROM_PD_CTRL to value 0"]
73impl crate::Resettable for ROM_PD_CTRL_SPEC {}