mimxrt685s_pac/puf/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub type R = crate::R<CtrlSpec>;
3#[doc = "Register `CTRL` writer"]
4pub type W = crate::W<CtrlSpec>;
5#[doc = "Field `ZEROIZE` reader - Zeroize. Begin Zeroize operation for Quiddikey and go to Error state"]
6pub type ZeroizeR = crate::BitReader;
7#[doc = "Field `ZEROIZE` writer - Zeroize. Begin Zeroize operation for Quiddikey and go to Error state"]
8pub type ZeroizeW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ENROLL` reader - Enroll. Begin Enroll operation"]
10pub type EnrollR = crate::BitReader;
11#[doc = "Field `ENROLL` writer - Enroll. Begin Enroll operation"]
12pub type EnrollW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `START` reader - Start. Begin Start operation"]
14pub type StartR = crate::BitReader;
15#[doc = "Field `START` writer - Start. Begin Start operation"]
16pub type StartW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `GENERATEKEY` reader - Set Intrinsic Key. Begin Set Intrinsic Key operation"]
18pub type GeneratekeyR = crate::BitReader;
19#[doc = "Field `GENERATEKEY` writer - Set Intrinsic Key. Begin Set Intrinsic Key operation"]
20pub type GeneratekeyW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SETKEY` reader - Set Key. Begin Set User Key operation"]
22pub type SetkeyR = crate::BitReader;
23#[doc = "Field `SETKEY` writer - Set Key. Begin Set User Key operation"]
24pub type SetkeyW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `GETKEY` reader - Get Key. Begin Get Key operation"]
26pub type GetkeyR = crate::BitReader;
27#[doc = "Field `GETKEY` writer - Get Key. Begin Get Key operation"]
28pub type GetkeyW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - Zeroize. Begin Zeroize operation for Quiddikey and go to Error state"]
31    #[inline(always)]
32    pub fn zeroize(&self) -> ZeroizeR {
33        ZeroizeR::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - Enroll. Begin Enroll operation"]
36    #[inline(always)]
37    pub fn enroll(&self) -> EnrollR {
38        EnrollR::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - Start. Begin Start operation"]
41    #[inline(always)]
42    pub fn start(&self) -> StartR {
43        StartR::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - Set Intrinsic Key. Begin Set Intrinsic Key operation"]
46    #[inline(always)]
47    pub fn generatekey(&self) -> GeneratekeyR {
48        GeneratekeyR::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - Set Key. Begin Set User Key operation"]
51    #[inline(always)]
52    pub fn setkey(&self) -> SetkeyR {
53        SetkeyR::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 6 - Get Key. Begin Get Key operation"]
56    #[inline(always)]
57    pub fn getkey(&self) -> GetkeyR {
58        GetkeyR::new(((self.bits >> 6) & 1) != 0)
59    }
60}
61#[cfg(feature = "debug")]
62impl core::fmt::Debug for R {
63    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64        f.debug_struct("CTRL")
65            .field("zeroize", &self.zeroize())
66            .field("enroll", &self.enroll())
67            .field("start", &self.start())
68            .field("generatekey", &self.generatekey())
69            .field("setkey", &self.setkey())
70            .field("getkey", &self.getkey())
71            .finish()
72    }
73}
74impl W {
75    #[doc = "Bit 0 - Zeroize. Begin Zeroize operation for Quiddikey and go to Error state"]
76    #[inline(always)]
77    pub fn zeroize(&mut self) -> ZeroizeW<CtrlSpec> {
78        ZeroizeW::new(self, 0)
79    }
80    #[doc = "Bit 1 - Enroll. Begin Enroll operation"]
81    #[inline(always)]
82    pub fn enroll(&mut self) -> EnrollW<CtrlSpec> {
83        EnrollW::new(self, 1)
84    }
85    #[doc = "Bit 2 - Start. Begin Start operation"]
86    #[inline(always)]
87    pub fn start(&mut self) -> StartW<CtrlSpec> {
88        StartW::new(self, 2)
89    }
90    #[doc = "Bit 3 - Set Intrinsic Key. Begin Set Intrinsic Key operation"]
91    #[inline(always)]
92    pub fn generatekey(&mut self) -> GeneratekeyW<CtrlSpec> {
93        GeneratekeyW::new(self, 3)
94    }
95    #[doc = "Bit 4 - Set Key. Begin Set User Key operation"]
96    #[inline(always)]
97    pub fn setkey(&mut self) -> SetkeyW<CtrlSpec> {
98        SetkeyW::new(self, 4)
99    }
100    #[doc = "Bit 6 - Get Key. Begin Get Key operation"]
101    #[inline(always)]
102    pub fn getkey(&mut self) -> GetkeyW<CtrlSpec> {
103        GetkeyW::new(self, 6)
104    }
105}
106#[doc = "PUF Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
107pub struct CtrlSpec;
108impl crate::RegisterSpec for CtrlSpec {
109    type Ux = u32;
110}
111#[doc = "`read()` method returns [`ctrl::R`](R) reader structure"]
112impl crate::Readable for CtrlSpec {}
113#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
114impl crate::Writable for CtrlSpec {
115    type Safety = crate::Unsafe;
116    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
117    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
118}
119#[doc = "`reset()` method sets CTRL to value 0"]
120impl crate::Resettable for CtrlSpec {
121    const RESET_VALUE: u32 = 0;
122}