esp32p4/lp_huk/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<STATUS_SPEC>;
3#[doc = "Field `STATUS` reader - The HUK generation status. 0: HUK is not generated. 1: HUK is generated and valid. 2: HUK is generated but invalid. 3: reserved."]
4pub type STATUS_R = crate::FieldReader;
5#[doc = "Field `RISK_LEVEL` reader - The risk level of HUK. 0-6: the higher the risk level is, the more error bits there are in the PUF SRAM. 7: Error Level, HUK is invalid."]
6pub type RISK_LEVEL_R = crate::FieldReader;
7impl R {
8    #[doc = "Bits 0:1 - The HUK generation status. 0: HUK is not generated. 1: HUK is generated and valid. 2: HUK is generated but invalid. 3: reserved."]
9    #[inline(always)]
10    pub fn status(&self) -> STATUS_R {
11        STATUS_R::new((self.bits & 3) as u8)
12    }
13    #[doc = "Bits 2:4 - The risk level of HUK. 0-6: the higher the risk level is, the more error bits there are in the PUF SRAM. 7: Error Level, HUK is invalid."]
14    #[inline(always)]
15    pub fn risk_level(&self) -> RISK_LEVEL_R {
16        RISK_LEVEL_R::new(((self.bits >> 2) & 7) as u8)
17    }
18}
19#[cfg(feature = "impl-register-debug")]
20impl core::fmt::Debug for R {
21    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
22        f.debug_struct("STATUS")
23            .field("status", &format_args!("{}", self.status().bits()))
24            .field("risk_level", &format_args!("{}", self.risk_level().bits()))
25            .finish()
26    }
27}
28#[cfg(feature = "impl-register-debug")]
29impl core::fmt::Debug for crate::generic::Reg<STATUS_SPEC> {
30    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
31        core::fmt::Debug::fmt(&self.read(), f)
32    }
33}
34#[doc = "HUK Generator HUK status register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
35pub struct STATUS_SPEC;
36impl crate::RegisterSpec for STATUS_SPEC {
37    type Ux = u32;
38}
39#[doc = "`read()` method returns [`status::R`](R) reader structure"]
40impl crate::Readable for STATUS_SPEC {}
41#[doc = "`reset()` method sets STATUS to value 0"]
42impl crate::Resettable for STATUS_SPEC {
43    const RESET_VALUE: u32 = 0;
44}