esp32s3/apb_ctrl/
spi_mem_ecc_ctrl.rs1#[doc = "Register `SPI_MEM_ECC_CTRL` reader"]
2pub type R = crate::R<SPI_MEM_ECC_CTRL_SPEC>;
3#[doc = "Register `SPI_MEM_ECC_CTRL` writer"]
4pub type W = crate::W<SPI_MEM_ECC_CTRL_SPEC>;
5#[doc = "Field `FLASH_PAGE_SIZE` reader - Set the page size of the used MSPI flash. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
6pub type FLASH_PAGE_SIZE_R = crate::FieldReader;
7#[doc = "Field `FLASH_PAGE_SIZE` writer - Set the page size of the used MSPI flash. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
8pub type FLASH_PAGE_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `SRAM_PAGE_SIZE` reader - Set the page size of the used MSPI external RAM. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
10pub type SRAM_PAGE_SIZE_R = crate::FieldReader;
11#[doc = "Field `SRAM_PAGE_SIZE` writer - Set the page size of the used MSPI external RAM. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
12pub type SRAM_PAGE_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13impl R {
14 #[doc = "Bits 18:19 - Set the page size of the used MSPI flash. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
15 #[inline(always)]
16 pub fn flash_page_size(&self) -> FLASH_PAGE_SIZE_R {
17 FLASH_PAGE_SIZE_R::new(((self.bits >> 18) & 3) as u8)
18 }
19 #[doc = "Bits 20:21 - Set the page size of the used MSPI external RAM. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
20 #[inline(always)]
21 pub fn sram_page_size(&self) -> SRAM_PAGE_SIZE_R {
22 SRAM_PAGE_SIZE_R::new(((self.bits >> 20) & 3) as u8)
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("SPI_MEM_ECC_CTRL")
29 .field("flash_page_size", &self.flash_page_size())
30 .field("sram_page_size", &self.sram_page_size())
31 .finish()
32 }
33}
34impl W {
35 #[doc = "Bits 18:19 - Set the page size of the used MSPI flash. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
36 #[inline(always)]
37 pub fn flash_page_size(&mut self) -> FLASH_PAGE_SIZE_W<SPI_MEM_ECC_CTRL_SPEC> {
38 FLASH_PAGE_SIZE_W::new(self, 18)
39 }
40 #[doc = "Bits 20:21 - Set the page size of the used MSPI external RAM. 0: 256 bytes. 1: 512 bytes. 2: 1024 bytes. 3: 2048 bytes."]
41 #[inline(always)]
42 pub fn sram_page_size(&mut self) -> SRAM_PAGE_SIZE_W<SPI_MEM_ECC_CTRL_SPEC> {
43 SRAM_PAGE_SIZE_W::new(self, 20)
44 }
45}
46#[doc = "******* Description ***********\n\nYou can [`read`](crate::Reg::read) this register and get [`spi_mem_ecc_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`spi_mem_ecc_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct SPI_MEM_ECC_CTRL_SPEC;
48impl crate::RegisterSpec for SPI_MEM_ECC_CTRL_SPEC {
49 type Ux = u32;
50}
51#[doc = "`read()` method returns [`spi_mem_ecc_ctrl::R`](R) reader structure"]
52impl crate::Readable for SPI_MEM_ECC_CTRL_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`spi_mem_ecc_ctrl::W`](W) writer structure"]
54impl crate::Writable for SPI_MEM_ECC_CTRL_SPEC {
55 type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets SPI_MEM_ECC_CTRL to value 0x0020_0000"]
58impl crate::Resettable for SPI_MEM_ECC_CTRL_SPEC {
59 const RESET_VALUE: u32 = 0x0020_0000;
60}