nrf5340_app_pac/kmu_ns/
inten.rs

1#[doc = "Register `INTEN` reader"]
2pub struct R(crate::R<INTEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTEN` writer"]
17pub struct W(crate::W<INTEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTEN_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<INTEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `KEYSLOT_PUSHED` reader - Enable or disable interrupt for event KEYSLOT_PUSHED"]
38pub type KEYSLOT_PUSHED_R = crate::BitReader<KEYSLOT_PUSHED_A>;
39#[doc = "Enable or disable interrupt for event KEYSLOT_PUSHED\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum KEYSLOT_PUSHED_A {
42    #[doc = "0: Disable"]
43    DISABLED = 0,
44    #[doc = "1: Enable"]
45    ENABLED = 1,
46}
47impl From<KEYSLOT_PUSHED_A> for bool {
48    #[inline(always)]
49    fn from(variant: KEYSLOT_PUSHED_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl KEYSLOT_PUSHED_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> KEYSLOT_PUSHED_A {
57        match self.bits {
58            false => KEYSLOT_PUSHED_A::DISABLED,
59            true => KEYSLOT_PUSHED_A::ENABLED,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLED`"]
63    #[inline(always)]
64    pub fn is_disabled(&self) -> bool {
65        *self == KEYSLOT_PUSHED_A::DISABLED
66    }
67    #[doc = "Checks if the value of the field is `ENABLED`"]
68    #[inline(always)]
69    pub fn is_enabled(&self) -> bool {
70        *self == KEYSLOT_PUSHED_A::ENABLED
71    }
72}
73#[doc = "Field `KEYSLOT_PUSHED` writer - Enable or disable interrupt for event KEYSLOT_PUSHED"]
74pub type KEYSLOT_PUSHED_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, INTEN_SPEC, KEYSLOT_PUSHED_A, O>;
76impl<'a, const O: u8> KEYSLOT_PUSHED_W<'a, O> {
77    #[doc = "Disable"]
78    #[inline(always)]
79    pub fn disabled(self) -> &'a mut W {
80        self.variant(KEYSLOT_PUSHED_A::DISABLED)
81    }
82    #[doc = "Enable"]
83    #[inline(always)]
84    pub fn enabled(self) -> &'a mut W {
85        self.variant(KEYSLOT_PUSHED_A::ENABLED)
86    }
87}
88#[doc = "Field `KEYSLOT_REVOKED` reader - Enable or disable interrupt for event KEYSLOT_REVOKED"]
89pub type KEYSLOT_REVOKED_R = crate::BitReader<KEYSLOT_REVOKED_A>;
90#[doc = "Enable or disable interrupt for event KEYSLOT_REVOKED\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum KEYSLOT_REVOKED_A {
93    #[doc = "0: Disable"]
94    DISABLED = 0,
95    #[doc = "1: Enable"]
96    ENABLED = 1,
97}
98impl From<KEYSLOT_REVOKED_A> for bool {
99    #[inline(always)]
100    fn from(variant: KEYSLOT_REVOKED_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl KEYSLOT_REVOKED_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> KEYSLOT_REVOKED_A {
108        match self.bits {
109            false => KEYSLOT_REVOKED_A::DISABLED,
110            true => KEYSLOT_REVOKED_A::ENABLED,
111        }
112    }
113    #[doc = "Checks if the value of the field is `DISABLED`"]
114    #[inline(always)]
115    pub fn is_disabled(&self) -> bool {
116        *self == KEYSLOT_REVOKED_A::DISABLED
117    }
118    #[doc = "Checks if the value of the field is `ENABLED`"]
119    #[inline(always)]
120    pub fn is_enabled(&self) -> bool {
121        *self == KEYSLOT_REVOKED_A::ENABLED
122    }
123}
124#[doc = "Field `KEYSLOT_REVOKED` writer - Enable or disable interrupt for event KEYSLOT_REVOKED"]
125pub type KEYSLOT_REVOKED_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, INTEN_SPEC, KEYSLOT_REVOKED_A, O>;
127impl<'a, const O: u8> KEYSLOT_REVOKED_W<'a, O> {
128    #[doc = "Disable"]
129    #[inline(always)]
130    pub fn disabled(self) -> &'a mut W {
131        self.variant(KEYSLOT_REVOKED_A::DISABLED)
132    }
133    #[doc = "Enable"]
134    #[inline(always)]
135    pub fn enabled(self) -> &'a mut W {
136        self.variant(KEYSLOT_REVOKED_A::ENABLED)
137    }
138}
139#[doc = "Field `KEYSLOT_ERROR` reader - Enable or disable interrupt for event KEYSLOT_ERROR"]
140pub type KEYSLOT_ERROR_R = crate::BitReader<KEYSLOT_ERROR_A>;
141#[doc = "Enable or disable interrupt for event KEYSLOT_ERROR\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143pub enum KEYSLOT_ERROR_A {
144    #[doc = "0: Disable"]
145    DISABLED = 0,
146    #[doc = "1: Enable"]
147    ENABLED = 1,
148}
149impl From<KEYSLOT_ERROR_A> for bool {
150    #[inline(always)]
151    fn from(variant: KEYSLOT_ERROR_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl KEYSLOT_ERROR_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> KEYSLOT_ERROR_A {
159        match self.bits {
160            false => KEYSLOT_ERROR_A::DISABLED,
161            true => KEYSLOT_ERROR_A::ENABLED,
162        }
163    }
164    #[doc = "Checks if the value of the field is `DISABLED`"]
165    #[inline(always)]
166    pub fn is_disabled(&self) -> bool {
167        *self == KEYSLOT_ERROR_A::DISABLED
168    }
169    #[doc = "Checks if the value of the field is `ENABLED`"]
170    #[inline(always)]
171    pub fn is_enabled(&self) -> bool {
172        *self == KEYSLOT_ERROR_A::ENABLED
173    }
174}
175#[doc = "Field `KEYSLOT_ERROR` writer - Enable or disable interrupt for event KEYSLOT_ERROR"]
176pub type KEYSLOT_ERROR_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, INTEN_SPEC, KEYSLOT_ERROR_A, O>;
178impl<'a, const O: u8> KEYSLOT_ERROR_W<'a, O> {
179    #[doc = "Disable"]
180    #[inline(always)]
181    pub fn disabled(self) -> &'a mut W {
182        self.variant(KEYSLOT_ERROR_A::DISABLED)
183    }
184    #[doc = "Enable"]
185    #[inline(always)]
186    pub fn enabled(self) -> &'a mut W {
187        self.variant(KEYSLOT_ERROR_A::ENABLED)
188    }
189}
190impl R {
191    #[doc = "Bit 0 - Enable or disable interrupt for event KEYSLOT_PUSHED"]
192    #[inline(always)]
193    pub fn keyslot_pushed(&self) -> KEYSLOT_PUSHED_R {
194        KEYSLOT_PUSHED_R::new((self.bits & 1) != 0)
195    }
196    #[doc = "Bit 1 - Enable or disable interrupt for event KEYSLOT_REVOKED"]
197    #[inline(always)]
198    pub fn keyslot_revoked(&self) -> KEYSLOT_REVOKED_R {
199        KEYSLOT_REVOKED_R::new(((self.bits >> 1) & 1) != 0)
200    }
201    #[doc = "Bit 2 - Enable or disable interrupt for event KEYSLOT_ERROR"]
202    #[inline(always)]
203    pub fn keyslot_error(&self) -> KEYSLOT_ERROR_R {
204        KEYSLOT_ERROR_R::new(((self.bits >> 2) & 1) != 0)
205    }
206}
207impl W {
208    #[doc = "Bit 0 - Enable or disable interrupt for event KEYSLOT_PUSHED"]
209    #[inline(always)]
210    pub fn keyslot_pushed(&mut self) -> KEYSLOT_PUSHED_W<0> {
211        KEYSLOT_PUSHED_W::new(self)
212    }
213    #[doc = "Bit 1 - Enable or disable interrupt for event KEYSLOT_REVOKED"]
214    #[inline(always)]
215    pub fn keyslot_revoked(&mut self) -> KEYSLOT_REVOKED_W<1> {
216        KEYSLOT_REVOKED_W::new(self)
217    }
218    #[doc = "Bit 2 - Enable or disable interrupt for event KEYSLOT_ERROR"]
219    #[inline(always)]
220    pub fn keyslot_error(&mut self) -> KEYSLOT_ERROR_W<2> {
221        KEYSLOT_ERROR_W::new(self)
222    }
223    #[doc = "Writes raw bits to the register."]
224    #[inline(always)]
225    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
226        self.0.bits(bits);
227        self
228    }
229}
230#[doc = "Enable or disable interrupt\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 [inten](index.html) module"]
231pub struct INTEN_SPEC;
232impl crate::RegisterSpec for INTEN_SPEC {
233    type Ux = u32;
234}
235#[doc = "`read()` method returns [inten::R](R) reader structure"]
236impl crate::Readable for INTEN_SPEC {
237    type Reader = R;
238}
239#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"]
240impl crate::Writable for INTEN_SPEC {
241    type Writer = W;
242}
243#[doc = "`reset()` method sets INTEN to value 0"]
244impl crate::Resettable for INTEN_SPEC {
245    #[inline(always)]
246    fn reset_value() -> Self::Ux {
247        0
248    }
249}