esp32p4/efuse/
rd_repeat_data2.rs

1#[doc = "Register `RD_REPEAT_DATA2` reader"]
2pub type R = crate::R<RD_REPEAT_DATA2_SPEC>;
3#[doc = "Field `KEY_PURPOSE_2` reader - Represents the purpose of Key2."]
4pub type KEY_PURPOSE_2_R = crate::FieldReader;
5#[doc = "Field `KEY_PURPOSE_3` reader - Represents the purpose of Key3."]
6pub type KEY_PURPOSE_3_R = crate::FieldReader;
7#[doc = "Field `KEY_PURPOSE_4` reader - Represents the purpose of Key4."]
8pub type KEY_PURPOSE_4_R = crate::FieldReader;
9#[doc = "Field `KEY_PURPOSE_5` reader - Represents the purpose of Key5."]
10pub type KEY_PURPOSE_5_R = crate::FieldReader;
11#[doc = "Field `SEC_DPA_LEVEL` reader - Represents the spa secure level by configuring the clock random divide mode."]
12pub type SEC_DPA_LEVEL_R = crate::FieldReader;
13#[doc = "Field `ECDSA_ENABLE_SOFT_K` reader - Represents whether hardware random number k is forced used in ESDCA. 1: force used. 0: not force used."]
14pub type ECDSA_ENABLE_SOFT_K_R = crate::BitReader;
15#[doc = "Field `CRYPT_DPA_ENABLE` reader - Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled."]
16pub type CRYPT_DPA_ENABLE_R = crate::BitReader;
17#[doc = "Field `SECURE_BOOT_EN` reader - Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled."]
18pub type SECURE_BOOT_EN_R = crate::BitReader;
19#[doc = "Field `SECURE_BOOT_AGGRESSIVE_REVOKE` reader - Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled."]
20pub type SECURE_BOOT_AGGRESSIVE_REVOKE_R = crate::BitReader;
21#[doc = "Field `FLASH_TYPE` reader - The type of interfaced flash. 0: four data lines, 1: eight data lines."]
22pub type FLASH_TYPE_R = crate::BitReader;
23#[doc = "Field `FLASH_PAGE_SIZE` reader - Set flash page size."]
24pub type FLASH_PAGE_SIZE_R = crate::FieldReader;
25#[doc = "Field `FLASH_ECC_EN` reader - Set this bit to enable ecc for flash boot."]
26pub type FLASH_ECC_EN_R = crate::BitReader;
27#[doc = "Field `DIS_USB_OTG_DOWNLOAD_MODE` reader - Set this bit to disable download via USB-OTG."]
28pub type DIS_USB_OTG_DOWNLOAD_MODE_R = crate::BitReader;
29#[doc = "Field `FLASH_TPUW` reader - Represents the flash waiting time after power-up, in unit of ms. When the value less than 15, the waiting time is the programmed value. Otherwise, the waiting time is 2 times the programmed value."]
30pub type FLASH_TPUW_R = crate::FieldReader;
31impl R {
32    #[doc = "Bits 0:3 - Represents the purpose of Key2."]
33    #[inline(always)]
34    pub fn key_purpose_2(&self) -> KEY_PURPOSE_2_R {
35        KEY_PURPOSE_2_R::new((self.bits & 0x0f) as u8)
36    }
37    #[doc = "Bits 4:7 - Represents the purpose of Key3."]
38    #[inline(always)]
39    pub fn key_purpose_3(&self) -> KEY_PURPOSE_3_R {
40        KEY_PURPOSE_3_R::new(((self.bits >> 4) & 0x0f) as u8)
41    }
42    #[doc = "Bits 8:11 - Represents the purpose of Key4."]
43    #[inline(always)]
44    pub fn key_purpose_4(&self) -> KEY_PURPOSE_4_R {
45        KEY_PURPOSE_4_R::new(((self.bits >> 8) & 0x0f) as u8)
46    }
47    #[doc = "Bits 12:15 - Represents the purpose of Key5."]
48    #[inline(always)]
49    pub fn key_purpose_5(&self) -> KEY_PURPOSE_5_R {
50        KEY_PURPOSE_5_R::new(((self.bits >> 12) & 0x0f) as u8)
51    }
52    #[doc = "Bits 16:17 - Represents the spa secure level by configuring the clock random divide mode."]
53    #[inline(always)]
54    pub fn sec_dpa_level(&self) -> SEC_DPA_LEVEL_R {
55        SEC_DPA_LEVEL_R::new(((self.bits >> 16) & 3) as u8)
56    }
57    #[doc = "Bit 18 - Represents whether hardware random number k is forced used in ESDCA. 1: force used. 0: not force used."]
58    #[inline(always)]
59    pub fn ecdsa_enable_soft_k(&self) -> ECDSA_ENABLE_SOFT_K_R {
60        ECDSA_ENABLE_SOFT_K_R::new(((self.bits >> 18) & 1) != 0)
61    }
62    #[doc = "Bit 19 - Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled."]
63    #[inline(always)]
64    pub fn crypt_dpa_enable(&self) -> CRYPT_DPA_ENABLE_R {
65        CRYPT_DPA_ENABLE_R::new(((self.bits >> 19) & 1) != 0)
66    }
67    #[doc = "Bit 20 - Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled."]
68    #[inline(always)]
69    pub fn secure_boot_en(&self) -> SECURE_BOOT_EN_R {
70        SECURE_BOOT_EN_R::new(((self.bits >> 20) & 1) != 0)
71    }
72    #[doc = "Bit 21 - Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled."]
73    #[inline(always)]
74    pub fn secure_boot_aggressive_revoke(&self) -> SECURE_BOOT_AGGRESSIVE_REVOKE_R {
75        SECURE_BOOT_AGGRESSIVE_REVOKE_R::new(((self.bits >> 21) & 1) != 0)
76    }
77    #[doc = "Bit 23 - The type of interfaced flash. 0: four data lines, 1: eight data lines."]
78    #[inline(always)]
79    pub fn flash_type(&self) -> FLASH_TYPE_R {
80        FLASH_TYPE_R::new(((self.bits >> 23) & 1) != 0)
81    }
82    #[doc = "Bits 24:25 - Set flash page size."]
83    #[inline(always)]
84    pub fn flash_page_size(&self) -> FLASH_PAGE_SIZE_R {
85        FLASH_PAGE_SIZE_R::new(((self.bits >> 24) & 3) as u8)
86    }
87    #[doc = "Bit 26 - Set this bit to enable ecc for flash boot."]
88    #[inline(always)]
89    pub fn flash_ecc_en(&self) -> FLASH_ECC_EN_R {
90        FLASH_ECC_EN_R::new(((self.bits >> 26) & 1) != 0)
91    }
92    #[doc = "Bit 27 - Set this bit to disable download via USB-OTG."]
93    #[inline(always)]
94    pub fn dis_usb_otg_download_mode(&self) -> DIS_USB_OTG_DOWNLOAD_MODE_R {
95        DIS_USB_OTG_DOWNLOAD_MODE_R::new(((self.bits >> 27) & 1) != 0)
96    }
97    #[doc = "Bits 28:31 - Represents the flash waiting time after power-up, in unit of ms. When the value less than 15, the waiting time is the programmed value. Otherwise, the waiting time is 2 times the programmed value."]
98    #[inline(always)]
99    pub fn flash_tpuw(&self) -> FLASH_TPUW_R {
100        FLASH_TPUW_R::new(((self.bits >> 28) & 0x0f) as u8)
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("RD_REPEAT_DATA2")
107            .field(
108                "key_purpose_2",
109                &format_args!("{}", self.key_purpose_2().bits()),
110            )
111            .field(
112                "key_purpose_3",
113                &format_args!("{}", self.key_purpose_3().bits()),
114            )
115            .field(
116                "key_purpose_4",
117                &format_args!("{}", self.key_purpose_4().bits()),
118            )
119            .field(
120                "key_purpose_5",
121                &format_args!("{}", self.key_purpose_5().bits()),
122            )
123            .field(
124                "sec_dpa_level",
125                &format_args!("{}", self.sec_dpa_level().bits()),
126            )
127            .field(
128                "ecdsa_enable_soft_k",
129                &format_args!("{}", self.ecdsa_enable_soft_k().bit()),
130            )
131            .field(
132                "crypt_dpa_enable",
133                &format_args!("{}", self.crypt_dpa_enable().bit()),
134            )
135            .field(
136                "secure_boot_en",
137                &format_args!("{}", self.secure_boot_en().bit()),
138            )
139            .field(
140                "secure_boot_aggressive_revoke",
141                &format_args!("{}", self.secure_boot_aggressive_revoke().bit()),
142            )
143            .field("flash_type", &format_args!("{}", self.flash_type().bit()))
144            .field(
145                "flash_page_size",
146                &format_args!("{}", self.flash_page_size().bits()),
147            )
148            .field(
149                "flash_ecc_en",
150                &format_args!("{}", self.flash_ecc_en().bit()),
151            )
152            .field(
153                "dis_usb_otg_download_mode",
154                &format_args!("{}", self.dis_usb_otg_download_mode().bit()),
155            )
156            .field("flash_tpuw", &format_args!("{}", self.flash_tpuw().bits()))
157            .finish()
158    }
159}
160#[cfg(feature = "impl-register-debug")]
161impl core::fmt::Debug for crate::generic::Reg<RD_REPEAT_DATA2_SPEC> {
162    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
163        core::fmt::Debug::fmt(&self.read(), f)
164    }
165}
166#[doc = "BLOCK0 data register 3.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rd_repeat_data2::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
167pub struct RD_REPEAT_DATA2_SPEC;
168impl crate::RegisterSpec for RD_REPEAT_DATA2_SPEC {
169    type Ux = u32;
170}
171#[doc = "`read()` method returns [`rd_repeat_data2::R`](R) reader structure"]
172impl crate::Readable for RD_REPEAT_DATA2_SPEC {}
173#[doc = "`reset()` method sets RD_REPEAT_DATA2 to value 0x0008_0000"]
174impl crate::Resettable for RD_REPEAT_DATA2_SPEC {
175    const RESET_VALUE: u32 = 0x0008_0000;
176}