esp32h2/spi1/
ddr.rs

1#[doc = "Register `DDR` reader"]
2pub type R = crate::R<DDR_SPEC>;
3#[doc = "Field `SPI_FMEM_DDR_EN` reader - 1: in ddr mode, 0 in sdr mode"]
4pub type SPI_FMEM_DDR_EN_R = crate::BitReader;
5#[doc = "Field `SPI_FMEM_VAR_DUMMY` reader - Set the bit to enable variable dummy cycle in spi ddr mode."]
6pub type SPI_FMEM_VAR_DUMMY_R = crate::BitReader;
7#[doc = "Field `SPI_FMEM_DDR_RDAT_SWP` reader - Set the bit to reorder rx data of the word in spi ddr mode."]
8pub type SPI_FMEM_DDR_RDAT_SWP_R = crate::BitReader;
9#[doc = "Field `SPI_FMEM_DDR_WDAT_SWP` reader - Set the bit to reorder tx data of the word in spi ddr mode."]
10pub type SPI_FMEM_DDR_WDAT_SWP_R = crate::BitReader;
11#[doc = "Field `SPI_FMEM_DDR_CMD_DIS` reader - the bit is used to disable dual edge in command phase when ddr mode."]
12pub type SPI_FMEM_DDR_CMD_DIS_R = crate::BitReader;
13#[doc = "Field `SPI_FMEM_OUTMINBYTELEN` reader - It is the minimum output data length in the panda device."]
14pub type SPI_FMEM_OUTMINBYTELEN_R = crate::FieldReader;
15#[doc = "Field `SPI_FMEM_USR_DDR_DQS_THD` reader - The delay number of data strobe which from memory based on SPI clock."]
16pub type SPI_FMEM_USR_DDR_DQS_THD_R = crate::FieldReader;
17#[doc = "Field `SPI_FMEM_DDR_DQS_LOOP` reader - 1: Do not need the input of SPI_DQS signal, SPI0 starts to receive data when spi0_slv_st is in SPI_MEM_DIN state. It is used when there is no SPI_DQS signal or SPI_DQS signal is not stable. 0: SPI0 starts to store data at the positive and negative edge of SPI_DQS."]
18pub type SPI_FMEM_DDR_DQS_LOOP_R = crate::BitReader;
19#[doc = "Field `SPI_FMEM_CLK_DIFF_EN` reader - Set this bit to enable the differential SPI_CLK#."]
20pub type SPI_FMEM_CLK_DIFF_EN_R = crate::BitReader;
21#[doc = "Field `SPI_FMEM_DQS_CA_IN` reader - Set this bit to enable the input of SPI_DQS signal in SPI phases of CMD and ADDR."]
22pub type SPI_FMEM_DQS_CA_IN_R = crate::BitReader;
23#[doc = "Field `SPI_FMEM_HYPERBUS_DUMMY_2X` reader - Set this bit to enable the vary dummy function in SPI HyperBus mode, when SPI0 accesses flash or SPI1 accesses flash or sram."]
24pub type SPI_FMEM_HYPERBUS_DUMMY_2X_R = crate::BitReader;
25#[doc = "Field `SPI_FMEM_CLK_DIFF_INV` reader - Set this bit to invert SPI_DIFF when accesses to flash. ."]
26pub type SPI_FMEM_CLK_DIFF_INV_R = crate::BitReader;
27#[doc = "Field `SPI_FMEM_OCTA_RAM_ADDR` reader - Set this bit to enable octa_ram address out when accesses to flash, which means ADDR_OUT\\[31:0\\] = {spi_usr_addr_value\\[25:4\\], 6'd0, spi_usr_addr_value\\[3:1\\], 1'b0}."]
28pub type SPI_FMEM_OCTA_RAM_ADDR_R = crate::BitReader;
29#[doc = "Field `SPI_FMEM_HYPERBUS_CA` reader - Set this bit to enable HyperRAM address out when accesses to flash, which means ADDR_OUT\\[31:0\\] = {spi_usr_addr_value\\[19:4\\], 13'd0, spi_usr_addr_value\\[3:1\\]}."]
30pub type SPI_FMEM_HYPERBUS_CA_R = crate::BitReader;
31impl R {
32    #[doc = "Bit 0 - 1: in ddr mode, 0 in sdr mode"]
33    #[inline(always)]
34    pub fn spi_fmem_ddr_en(&self) -> SPI_FMEM_DDR_EN_R {
35        SPI_FMEM_DDR_EN_R::new((self.bits & 1) != 0)
36    }
37    #[doc = "Bit 1 - Set the bit to enable variable dummy cycle in spi ddr mode."]
38    #[inline(always)]
39    pub fn spi_fmem_var_dummy(&self) -> SPI_FMEM_VAR_DUMMY_R {
40        SPI_FMEM_VAR_DUMMY_R::new(((self.bits >> 1) & 1) != 0)
41    }
42    #[doc = "Bit 2 - Set the bit to reorder rx data of the word in spi ddr mode."]
43    #[inline(always)]
44    pub fn spi_fmem_ddr_rdat_swp(&self) -> SPI_FMEM_DDR_RDAT_SWP_R {
45        SPI_FMEM_DDR_RDAT_SWP_R::new(((self.bits >> 2) & 1) != 0)
46    }
47    #[doc = "Bit 3 - Set the bit to reorder tx data of the word in spi ddr mode."]
48    #[inline(always)]
49    pub fn spi_fmem_ddr_wdat_swp(&self) -> SPI_FMEM_DDR_WDAT_SWP_R {
50        SPI_FMEM_DDR_WDAT_SWP_R::new(((self.bits >> 3) & 1) != 0)
51    }
52    #[doc = "Bit 4 - the bit is used to disable dual edge in command phase when ddr mode."]
53    #[inline(always)]
54    pub fn spi_fmem_ddr_cmd_dis(&self) -> SPI_FMEM_DDR_CMD_DIS_R {
55        SPI_FMEM_DDR_CMD_DIS_R::new(((self.bits >> 4) & 1) != 0)
56    }
57    #[doc = "Bits 5:11 - It is the minimum output data length in the panda device."]
58    #[inline(always)]
59    pub fn spi_fmem_outminbytelen(&self) -> SPI_FMEM_OUTMINBYTELEN_R {
60        SPI_FMEM_OUTMINBYTELEN_R::new(((self.bits >> 5) & 0x7f) as u8)
61    }
62    #[doc = "Bits 14:20 - The delay number of data strobe which from memory based on SPI clock."]
63    #[inline(always)]
64    pub fn spi_fmem_usr_ddr_dqs_thd(&self) -> SPI_FMEM_USR_DDR_DQS_THD_R {
65        SPI_FMEM_USR_DDR_DQS_THD_R::new(((self.bits >> 14) & 0x7f) as u8)
66    }
67    #[doc = "Bit 21 - 1: Do not need the input of SPI_DQS signal, SPI0 starts to receive data when spi0_slv_st is in SPI_MEM_DIN state. It is used when there is no SPI_DQS signal or SPI_DQS signal is not stable. 0: SPI0 starts to store data at the positive and negative edge of SPI_DQS."]
68    #[inline(always)]
69    pub fn spi_fmem_ddr_dqs_loop(&self) -> SPI_FMEM_DDR_DQS_LOOP_R {
70        SPI_FMEM_DDR_DQS_LOOP_R::new(((self.bits >> 21) & 1) != 0)
71    }
72    #[doc = "Bit 24 - Set this bit to enable the differential SPI_CLK#."]
73    #[inline(always)]
74    pub fn spi_fmem_clk_diff_en(&self) -> SPI_FMEM_CLK_DIFF_EN_R {
75        SPI_FMEM_CLK_DIFF_EN_R::new(((self.bits >> 24) & 1) != 0)
76    }
77    #[doc = "Bit 26 - Set this bit to enable the input of SPI_DQS signal in SPI phases of CMD and ADDR."]
78    #[inline(always)]
79    pub fn spi_fmem_dqs_ca_in(&self) -> SPI_FMEM_DQS_CA_IN_R {
80        SPI_FMEM_DQS_CA_IN_R::new(((self.bits >> 26) & 1) != 0)
81    }
82    #[doc = "Bit 27 - Set this bit to enable the vary dummy function in SPI HyperBus mode, when SPI0 accesses flash or SPI1 accesses flash or sram."]
83    #[inline(always)]
84    pub fn spi_fmem_hyperbus_dummy_2x(&self) -> SPI_FMEM_HYPERBUS_DUMMY_2X_R {
85        SPI_FMEM_HYPERBUS_DUMMY_2X_R::new(((self.bits >> 27) & 1) != 0)
86    }
87    #[doc = "Bit 28 - Set this bit to invert SPI_DIFF when accesses to flash. ."]
88    #[inline(always)]
89    pub fn spi_fmem_clk_diff_inv(&self) -> SPI_FMEM_CLK_DIFF_INV_R {
90        SPI_FMEM_CLK_DIFF_INV_R::new(((self.bits >> 28) & 1) != 0)
91    }
92    #[doc = "Bit 29 - Set this bit to enable octa_ram address out when accesses to flash, which means ADDR_OUT\\[31:0\\] = {spi_usr_addr_value\\[25:4\\], 6'd0, spi_usr_addr_value\\[3:1\\], 1'b0}."]
93    #[inline(always)]
94    pub fn spi_fmem_octa_ram_addr(&self) -> SPI_FMEM_OCTA_RAM_ADDR_R {
95        SPI_FMEM_OCTA_RAM_ADDR_R::new(((self.bits >> 29) & 1) != 0)
96    }
97    #[doc = "Bit 30 - Set this bit to enable HyperRAM address out when accesses to flash, which means ADDR_OUT\\[31:0\\] = {spi_usr_addr_value\\[19:4\\], 13'd0, spi_usr_addr_value\\[3:1\\]}."]
98    #[inline(always)]
99    pub fn spi_fmem_hyperbus_ca(&self) -> SPI_FMEM_HYPERBUS_CA_R {
100        SPI_FMEM_HYPERBUS_CA_R::new(((self.bits >> 30) & 1) != 0)
101    }
102}
103#[cfg(feature = "impl-register-debug")]
104impl core::fmt::Debug for R {
105    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
106        f.debug_struct("DDR")
107            .field("spi_fmem_ddr_en", &self.spi_fmem_ddr_en())
108            .field("spi_fmem_var_dummy", &self.spi_fmem_var_dummy())
109            .field("spi_fmem_ddr_rdat_swp", &self.spi_fmem_ddr_rdat_swp())
110            .field("spi_fmem_ddr_wdat_swp", &self.spi_fmem_ddr_wdat_swp())
111            .field("spi_fmem_ddr_cmd_dis", &self.spi_fmem_ddr_cmd_dis())
112            .field("spi_fmem_outminbytelen", &self.spi_fmem_outminbytelen())
113            .field("spi_fmem_usr_ddr_dqs_thd", &self.spi_fmem_usr_ddr_dqs_thd())
114            .field("spi_fmem_ddr_dqs_loop", &self.spi_fmem_ddr_dqs_loop())
115            .field("spi_fmem_clk_diff_en", &self.spi_fmem_clk_diff_en())
116            .field("spi_fmem_dqs_ca_in", &self.spi_fmem_dqs_ca_in())
117            .field(
118                "spi_fmem_hyperbus_dummy_2x",
119                &self.spi_fmem_hyperbus_dummy_2x(),
120            )
121            .field("spi_fmem_clk_diff_inv", &self.spi_fmem_clk_diff_inv())
122            .field("spi_fmem_octa_ram_addr", &self.spi_fmem_octa_ram_addr())
123            .field("spi_fmem_hyperbus_ca", &self.spi_fmem_hyperbus_ca())
124            .finish()
125    }
126}
127#[doc = "SPI1 DDR control register\n\nYou can [`read`](crate::Reg::read) this register and get [`ddr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
128pub struct DDR_SPEC;
129impl crate::RegisterSpec for DDR_SPEC {
130    type Ux = u32;
131}
132#[doc = "`read()` method returns [`ddr::R`](R) reader structure"]
133impl crate::Readable for DDR_SPEC {}
134#[doc = "`reset()` method sets DDR to value 0x20"]
135impl crate::Resettable for DDR_SPEC {
136    const RESET_VALUE: u32 = 0x20;
137}