esp32/efuse/
blk0_wdata0.rs

1#[doc = "Register `BLK0_WDATA0` reader"]
2pub type R = crate::R<BLK0_WDATA0_SPEC>;
3#[doc = "Register `BLK0_WDATA0` writer"]
4pub type W = crate::W<BLK0_WDATA0_SPEC>;
5#[doc = "Field `WR_DIS` reader - "]
6pub type WR_DIS_R = crate::FieldReader<u16>;
7#[doc = "Field `WR_DIS` writer - "]
8pub type WR_DIS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `RD_DIS` reader - "]
10pub type RD_DIS_R = crate::FieldReader;
11#[doc = "Field `RD_DIS` writer - "]
12pub type RD_DIS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `FLASH_CRYPT_CNT` reader - "]
14pub type FLASH_CRYPT_CNT_R = crate::FieldReader;
15#[doc = "Field `FLASH_CRYPT_CNT` writer - "]
16pub type FLASH_CRYPT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
17impl R {
18    #[doc = "Bits 0:15"]
19    #[inline(always)]
20    pub fn wr_dis(&self) -> WR_DIS_R {
21        WR_DIS_R::new((self.bits & 0xffff) as u16)
22    }
23    #[doc = "Bits 16:19"]
24    #[inline(always)]
25    pub fn rd_dis(&self) -> RD_DIS_R {
26        RD_DIS_R::new(((self.bits >> 16) & 0x0f) as u8)
27    }
28    #[doc = "Bits 20:26"]
29    #[inline(always)]
30    pub fn flash_crypt_cnt(&self) -> FLASH_CRYPT_CNT_R {
31        FLASH_CRYPT_CNT_R::new(((self.bits >> 20) & 0x7f) as u8)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("BLK0_WDATA0")
38            .field("wr_dis", &self.wr_dis())
39            .field("rd_dis", &self.rd_dis())
40            .field("flash_crypt_cnt", &self.flash_crypt_cnt())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:15"]
46    #[inline(always)]
47    pub fn wr_dis(&mut self) -> WR_DIS_W<BLK0_WDATA0_SPEC> {
48        WR_DIS_W::new(self, 0)
49    }
50    #[doc = "Bits 16:19"]
51    #[inline(always)]
52    pub fn rd_dis(&mut self) -> RD_DIS_W<BLK0_WDATA0_SPEC> {
53        RD_DIS_W::new(self, 16)
54    }
55    #[doc = "Bits 20:26"]
56    #[inline(always)]
57    pub fn flash_crypt_cnt(&mut self) -> FLASH_CRYPT_CNT_W<BLK0_WDATA0_SPEC> {
58        FLASH_CRYPT_CNT_W::new(self, 20)
59    }
60}
61#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`blk0_wdata0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`blk0_wdata0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct BLK0_WDATA0_SPEC;
63impl crate::RegisterSpec for BLK0_WDATA0_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`blk0_wdata0::R`](R) reader structure"]
67impl crate::Readable for BLK0_WDATA0_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`blk0_wdata0::W`](W) writer structure"]
69impl crate::Writable for BLK0_WDATA0_SPEC {
70    type Safety = crate::Unsafe;
71}
72#[doc = "`reset()` method sets BLK0_WDATA0 to value 0"]
73impl crate::Resettable for BLK0_WDATA0_SPEC {}