esp32s3/apb_ctrl/
retention_ctrl3.rs

1#[doc = "Register `RETENTION_CTRL3` reader"]
2pub type R = crate::R<RETENTION_CTRL3_SPEC>;
3#[doc = "Register `RETENTION_CTRL3` writer"]
4pub type W = crate::W<RETENTION_CTRL3_SPEC>;
5#[doc = "Field `RET_DCACHE_SIZE` reader - ******* Description ***********"]
6pub type RET_DCACHE_SIZE_R = crate::FieldReader<u16>;
7#[doc = "Field `RET_DCACHE_SIZE` writer - ******* Description ***********"]
8pub type RET_DCACHE_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
9#[doc = "Field `RET_DCACHE_VLD_SIZE` reader - ******* Description ***********"]
10pub type RET_DCACHE_VLD_SIZE_R = crate::FieldReader<u16>;
11#[doc = "Field `RET_DCACHE_VLD_SIZE` writer - ******* Description ***********"]
12pub type RET_DCACHE_VLD_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
13#[doc = "Field `RET_DCACHE_START_POINT` reader - ******* Description ***********"]
14pub type RET_DCACHE_START_POINT_R = crate::FieldReader<u16>;
15#[doc = "Field `RET_DCACHE_START_POINT` writer - ******* Description ***********"]
16pub type RET_DCACHE_START_POINT_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
17#[doc = "Field `RET_DCACHE_ENABLE` reader - ******* Description ***********"]
18pub type RET_DCACHE_ENABLE_R = crate::BitReader;
19#[doc = "Field `RET_DCACHE_ENABLE` writer - ******* Description ***********"]
20pub type RET_DCACHE_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 4:12 - ******* Description ***********"]
23    #[inline(always)]
24    pub fn ret_dcache_size(&self) -> RET_DCACHE_SIZE_R {
25        RET_DCACHE_SIZE_R::new(((self.bits >> 4) & 0x01ff) as u16)
26    }
27    #[doc = "Bits 13:21 - ******* Description ***********"]
28    #[inline(always)]
29    pub fn ret_dcache_vld_size(&self) -> RET_DCACHE_VLD_SIZE_R {
30        RET_DCACHE_VLD_SIZE_R::new(((self.bits >> 13) & 0x01ff) as u16)
31    }
32    #[doc = "Bits 22:30 - ******* Description ***********"]
33    #[inline(always)]
34    pub fn ret_dcache_start_point(&self) -> RET_DCACHE_START_POINT_R {
35        RET_DCACHE_START_POINT_R::new(((self.bits >> 22) & 0x01ff) as u16)
36    }
37    #[doc = "Bit 31 - ******* Description ***********"]
38    #[inline(always)]
39    pub fn ret_dcache_enable(&self) -> RET_DCACHE_ENABLE_R {
40        RET_DCACHE_ENABLE_R::new(((self.bits >> 31) & 1) != 0)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("RETENTION_CTRL3")
47            .field("ret_dcache_size", &self.ret_dcache_size())
48            .field("ret_dcache_vld_size", &self.ret_dcache_vld_size())
49            .field("ret_dcache_start_point", &self.ret_dcache_start_point())
50            .field("ret_dcache_enable", &self.ret_dcache_enable())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bits 4:12 - ******* Description ***********"]
56    #[inline(always)]
57    pub fn ret_dcache_size(&mut self) -> RET_DCACHE_SIZE_W<RETENTION_CTRL3_SPEC> {
58        RET_DCACHE_SIZE_W::new(self, 4)
59    }
60    #[doc = "Bits 13:21 - ******* Description ***********"]
61    #[inline(always)]
62    pub fn ret_dcache_vld_size(&mut self) -> RET_DCACHE_VLD_SIZE_W<RETENTION_CTRL3_SPEC> {
63        RET_DCACHE_VLD_SIZE_W::new(self, 13)
64    }
65    #[doc = "Bits 22:30 - ******* Description ***********"]
66    #[inline(always)]
67    pub fn ret_dcache_start_point(&mut self) -> RET_DCACHE_START_POINT_W<RETENTION_CTRL3_SPEC> {
68        RET_DCACHE_START_POINT_W::new(self, 22)
69    }
70    #[doc = "Bit 31 - ******* Description ***********"]
71    #[inline(always)]
72    pub fn ret_dcache_enable(&mut self) -> RET_DCACHE_ENABLE_W<RETENTION_CTRL3_SPEC> {
73        RET_DCACHE_ENABLE_W::new(self, 31)
74    }
75}
76#[doc = "******* Description ***********\n\nYou can [`read`](crate::Reg::read) this register and get [`retention_ctrl3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`retention_ctrl3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct RETENTION_CTRL3_SPEC;
78impl crate::RegisterSpec for RETENTION_CTRL3_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`retention_ctrl3::R`](R) reader structure"]
82impl crate::Readable for RETENTION_CTRL3_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`retention_ctrl3::W`](W) writer structure"]
84impl crate::Writable for RETENTION_CTRL3_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets RETENTION_CTRL3 to value 0x003f_fff0"]
90impl crate::Resettable for RETENTION_CTRL3_SPEC {
91    const RESET_VALUE: u32 = 0x003f_fff0;
92}