esp32c2/efuse/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<STATUS_SPEC>;
3#[doc = "Field `STATE` reader - Indicates the state of the eFuse state machine."]
4pub type STATE_R = crate::FieldReader;
5#[doc = "Field `OTP_LOAD_SW` reader - The value of OTP_LOAD_SW."]
6pub type OTP_LOAD_SW_R = crate::BitReader;
7#[doc = "Field `OTP_VDDQ_C_SYNC2` reader - The value of OTP_VDDQ_C_SYNC2."]
8pub type OTP_VDDQ_C_SYNC2_R = crate::BitReader;
9#[doc = "Field `OTP_STROBE_SW` reader - The value of OTP_STROBE_SW."]
10pub type OTP_STROBE_SW_R = crate::BitReader;
11#[doc = "Field `OTP_CSB_SW` reader - The value of OTP_CSB_SW."]
12pub type OTP_CSB_SW_R = crate::BitReader;
13#[doc = "Field `OTP_PGENB_SW` reader - The value of OTP_PGENB_SW."]
14pub type OTP_PGENB_SW_R = crate::BitReader;
15#[doc = "Field `OTP_VDDQ_IS_SW` reader - The value of OTP_VDDQ_IS_SW."]
16pub type OTP_VDDQ_IS_SW_R = crate::BitReader;
17#[doc = "Field `BLK0_VALID_BIT_CNT` reader - Record the number of bit '1' in BLOCK0."]
18pub type BLK0_VALID_BIT_CNT_R = crate::FieldReader;
19impl R {
20    #[doc = "Bits 0:3 - Indicates the state of the eFuse state machine."]
21    #[inline(always)]
22    pub fn state(&self) -> STATE_R {
23        STATE_R::new((self.bits & 0x0f) as u8)
24    }
25    #[doc = "Bit 4 - The value of OTP_LOAD_SW."]
26    #[inline(always)]
27    pub fn otp_load_sw(&self) -> OTP_LOAD_SW_R {
28        OTP_LOAD_SW_R::new(((self.bits >> 4) & 1) != 0)
29    }
30    #[doc = "Bit 5 - The value of OTP_VDDQ_C_SYNC2."]
31    #[inline(always)]
32    pub fn otp_vddq_c_sync2(&self) -> OTP_VDDQ_C_SYNC2_R {
33        OTP_VDDQ_C_SYNC2_R::new(((self.bits >> 5) & 1) != 0)
34    }
35    #[doc = "Bit 6 - The value of OTP_STROBE_SW."]
36    #[inline(always)]
37    pub fn otp_strobe_sw(&self) -> OTP_STROBE_SW_R {
38        OTP_STROBE_SW_R::new(((self.bits >> 6) & 1) != 0)
39    }
40    #[doc = "Bit 7 - The value of OTP_CSB_SW."]
41    #[inline(always)]
42    pub fn otp_csb_sw(&self) -> OTP_CSB_SW_R {
43        OTP_CSB_SW_R::new(((self.bits >> 7) & 1) != 0)
44    }
45    #[doc = "Bit 8 - The value of OTP_PGENB_SW."]
46    #[inline(always)]
47    pub fn otp_pgenb_sw(&self) -> OTP_PGENB_SW_R {
48        OTP_PGENB_SW_R::new(((self.bits >> 8) & 1) != 0)
49    }
50    #[doc = "Bit 9 - The value of OTP_VDDQ_IS_SW."]
51    #[inline(always)]
52    pub fn otp_vddq_is_sw(&self) -> OTP_VDDQ_IS_SW_R {
53        OTP_VDDQ_IS_SW_R::new(((self.bits >> 9) & 1) != 0)
54    }
55    #[doc = "Bits 10:15 - Record the number of bit '1' in BLOCK0."]
56    #[inline(always)]
57    pub fn blk0_valid_bit_cnt(&self) -> BLK0_VALID_BIT_CNT_R {
58        BLK0_VALID_BIT_CNT_R::new(((self.bits >> 10) & 0x3f) as u8)
59    }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("STATUS")
65            .field("state", &self.state())
66            .field("otp_load_sw", &self.otp_load_sw())
67            .field("otp_vddq_c_sync2", &self.otp_vddq_c_sync2())
68            .field("otp_strobe_sw", &self.otp_strobe_sw())
69            .field("otp_csb_sw", &self.otp_csb_sw())
70            .field("otp_pgenb_sw", &self.otp_pgenb_sw())
71            .field("otp_vddq_is_sw", &self.otp_vddq_is_sw())
72            .field("blk0_valid_bit_cnt", &self.blk0_valid_bit_cnt())
73            .finish()
74    }
75}
76#[doc = "eFuse status register.\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct STATUS_SPEC;
78impl crate::RegisterSpec for STATUS_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`status::R`](R) reader structure"]
82impl crate::Readable for STATUS_SPEC {}
83#[doc = "`reset()` method sets STATUS to value 0"]
84impl crate::Resettable for STATUS_SPEC {
85    const RESET_VALUE: u32 = 0;
86}