esp32s3/extmem/
cache_wrap_around_ctrl.rs

1#[doc = "Register `CACHE_WRAP_AROUND_CTRL` reader"]
2pub type R = crate::R<CACHE_WRAP_AROUND_CTRL_SPEC>;
3#[doc = "Register `CACHE_WRAP_AROUND_CTRL` writer"]
4pub type W = crate::W<CACHE_WRAP_AROUND_CTRL_SPEC>;
5#[doc = "Field `CACHE_FLASH_WRAP_AROUND` reader - The bit is used to enable wrap around mode when read data from flash."]
6pub type CACHE_FLASH_WRAP_AROUND_R = crate::BitReader;
7#[doc = "Field `CACHE_FLASH_WRAP_AROUND` writer - The bit is used to enable wrap around mode when read data from flash."]
8pub type CACHE_FLASH_WRAP_AROUND_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CACHE_SRAM_RD_WRAP_AROUND` reader - The bit is used to enable wrap around mode when read data from spiram."]
10pub type CACHE_SRAM_RD_WRAP_AROUND_R = crate::BitReader;
11#[doc = "Field `CACHE_SRAM_RD_WRAP_AROUND` writer - The bit is used to enable wrap around mode when read data from spiram."]
12pub type CACHE_SRAM_RD_WRAP_AROUND_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - The bit is used to enable wrap around mode when read data from flash."]
15    #[inline(always)]
16    pub fn cache_flash_wrap_around(&self) -> CACHE_FLASH_WRAP_AROUND_R {
17        CACHE_FLASH_WRAP_AROUND_R::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - The bit is used to enable wrap around mode when read data from spiram."]
20    #[inline(always)]
21    pub fn cache_sram_rd_wrap_around(&self) -> CACHE_SRAM_RD_WRAP_AROUND_R {
22        CACHE_SRAM_RD_WRAP_AROUND_R::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("CACHE_WRAP_AROUND_CTRL")
29            .field("cache_flash_wrap_around", &self.cache_flash_wrap_around())
30            .field(
31                "cache_sram_rd_wrap_around",
32                &self.cache_sram_rd_wrap_around(),
33            )
34            .finish()
35    }
36}
37impl W {
38    #[doc = "Bit 0 - The bit is used to enable wrap around mode when read data from flash."]
39    #[inline(always)]
40    pub fn cache_flash_wrap_around(
41        &mut self,
42    ) -> CACHE_FLASH_WRAP_AROUND_W<CACHE_WRAP_AROUND_CTRL_SPEC> {
43        CACHE_FLASH_WRAP_AROUND_W::new(self, 0)
44    }
45    #[doc = "Bit 1 - The bit is used to enable wrap around mode when read data from spiram."]
46    #[inline(always)]
47    pub fn cache_sram_rd_wrap_around(
48        &mut self,
49    ) -> CACHE_SRAM_RD_WRAP_AROUND_W<CACHE_WRAP_AROUND_CTRL_SPEC> {
50        CACHE_SRAM_RD_WRAP_AROUND_W::new(self, 1)
51    }
52}
53#[doc = "******* Description ***********\n\nYou can [`read`](crate::Reg::read) this register and get [`cache_wrap_around_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cache_wrap_around_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
54pub struct CACHE_WRAP_AROUND_CTRL_SPEC;
55impl crate::RegisterSpec for CACHE_WRAP_AROUND_CTRL_SPEC {
56    type Ux = u32;
57}
58#[doc = "`read()` method returns [`cache_wrap_around_ctrl::R`](R) reader structure"]
59impl crate::Readable for CACHE_WRAP_AROUND_CTRL_SPEC {}
60#[doc = "`write(|w| ..)` method takes [`cache_wrap_around_ctrl::W`](W) writer structure"]
61impl crate::Writable for CACHE_WRAP_AROUND_CTRL_SPEC {
62    type Safety = crate::Unsafe;
63    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
64    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65}
66#[doc = "`reset()` method sets CACHE_WRAP_AROUND_CTRL to value 0"]
67impl crate::Resettable for CACHE_WRAP_AROUND_CTRL_SPEC {
68    const RESET_VALUE: u32 = 0;
69}