1#[doc = "Register `HOST_IOT_KPRTL_LOCK` reader"]
2pub struct R(crate::R<HOST_IOT_KPRTL_LOCK_SPEC>);
3impl core::ops::Deref for R {
4type Target = crate::R<HOST_IOT_KPRTL_LOCK_SPEC>;
5#[inline(always)]
6fn deref(&self) -> &Self::Target {
7&self.0
8}
9}
10impl From<crate::R<HOST_IOT_KPRTL_LOCK_SPEC>> for R {
11#[inline(always)]
12fn from(reader: crate::R<HOST_IOT_KPRTL_LOCK_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HOST_IOT_KPRTL_LOCK` writer"]
17pub struct W(crate::W<HOST_IOT_KPRTL_LOCK_SPEC>);
18impl core::ops::Deref for W {
19type Target = crate::W<HOST_IOT_KPRTL_LOCK_SPEC>;
20#[inline(always)]
21fn deref(&self) -> &Self::Target {
22&self.0
23}
24}
25impl core::ops::DerefMut for W {
26#[inline(always)]
27fn deref_mut(&mut self) -> &mut Self::Target {
28&mut self.0
29}
30}
31impl From<crate::W<HOST_IOT_KPRTL_LOCK_SPEC>> for W {
32#[inline(always)]
33fn from(writer: crate::W<HOST_IOT_KPRTL_LOCK_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `HOST_IOT_KPRTL_LOCK` reader - This register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain."]
38pub type HOST_IOT_KPRTL_LOCK_R = crate::BitReader<HOST_IOT_KPRTL_LOCK_A>;
39#[doc = "This register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum HOST_IOT_KPRTL_LOCK_A {
42#[doc = "0: K_PRTL can be selected for use from register HOST_CRYPTOKEY_SEL"]
43DISABLED = 0,
44#[doc = "1: K_PRTL has been locked until next power-on reset (POR). If K_PRTL is selected anyway, a zeroed key will be used instead."]
45ENABLED = 1,
46}
47impl From<HOST_IOT_KPRTL_LOCK_A> for bool {
48#[inline(always)]
49fn from(variant: HOST_IOT_KPRTL_LOCK_A) -> Self {
50 variant as u8 != 0
51}
52}
53impl HOST_IOT_KPRTL_LOCK_R {
54#[doc = "Get enumerated values variant"]
55 #[inline(always)]
56pub fn variant(&self) -> HOST_IOT_KPRTL_LOCK_A {
57match self.bits {
58false => HOST_IOT_KPRTL_LOCK_A::DISABLED,
59true => HOST_IOT_KPRTL_LOCK_A::ENABLED,
60 }
61 }
62#[doc = "Checks if the value of the field is `DISABLED`"]
63 #[inline(always)]
64pub fn is_disabled(&self) -> bool {
65*self == HOST_IOT_KPRTL_LOCK_A::DISABLED
66 }
67#[doc = "Checks if the value of the field is `ENABLED`"]
68 #[inline(always)]
69pub fn is_enabled(&self) -> bool {
70*self == HOST_IOT_KPRTL_LOCK_A::ENABLED
71 }
72}
73#[doc = "Field `HOST_IOT_KPRTL_LOCK` writer - This register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain."]
74pub type HOST_IOT_KPRTL_LOCK_W<'a, const O: u8> =
75crate::BitWriter<'a, u32, HOST_IOT_KPRTL_LOCK_SPEC, HOST_IOT_KPRTL_LOCK_A, O>;
76impl<'a, const O: u8> HOST_IOT_KPRTL_LOCK_W<'a, O> {
77#[doc = "K_PRTL can be selected for use from register HOST_CRYPTOKEY_SEL"]
78 #[inline(always)]
79pub fn disabled(self) -> &'a mut W {
80self.variant(HOST_IOT_KPRTL_LOCK_A::DISABLED)
81 }
82#[doc = "K_PRTL has been locked until next power-on reset (POR). If K_PRTL is selected anyway, a zeroed key will be used instead."]
83 #[inline(always)]
84pub fn enabled(self) -> &'a mut W {
85self.variant(HOST_IOT_KPRTL_LOCK_A::ENABLED)
86 }
87}
88impl R {
89#[doc = "Bit 0 - This register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain."]
90 #[inline(always)]
91pub fn host_iot_kprtl_lock(&self) -> HOST_IOT_KPRTL_LOCK_R {
92 HOST_IOT_KPRTL_LOCK_R::new((self.bits & 1) != 0)
93 }
94}
95impl W {
96#[doc = "Bit 0 - This register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain."]
97 #[inline(always)]
98pub fn host_iot_kprtl_lock(&mut self) -> HOST_IOT_KPRTL_LOCK_W<0> {
99 HOST_IOT_KPRTL_LOCK_W::new(self)
100 }
101#[doc = "Writes raw bits to the register."]
102 #[inline(always)]
103pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
104self.0.bits(bits);
105self
106}
107}
108#[doc = "This write-once register is the K_PRTL lock register. When this register is set, K_PRTL can not be used and a zeroed key will be used instead. The value of this register is saved in the CRYPTOCELL AO power domain.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [host_iot_kprtl_lock](index.html) module"]
109pub struct HOST_IOT_KPRTL_LOCK_SPEC;
110impl crate::RegisterSpec for HOST_IOT_KPRTL_LOCK_SPEC {
111type Ux = u32;
112}
113#[doc = "`read()` method returns [host_iot_kprtl_lock::R](R) reader structure"]
114impl crate::Readable for HOST_IOT_KPRTL_LOCK_SPEC {
115type Reader = R;
116}
117#[doc = "`write(|w| ..)` method takes [host_iot_kprtl_lock::W](W) writer structure"]
118impl crate::Writable for HOST_IOT_KPRTL_LOCK_SPEC {
119type Writer = W;
120}
121#[doc = "`reset()` method sets HOST_IOT_KPRTL_LOCK to value 0"]
122impl crate::Resettable for HOST_IOT_KPRTL_LOCK_SPEC {
123#[inline(always)]
124fn reset_value() -> Self::Ux {
1250
126}
127}