nrf5340_app_pac/kmu_ns/
intenset.rs

1#[doc = "Register `INTENSET` reader"]
2pub struct R(crate::R<INTENSET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTENSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTENSET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTENSET` writer"]
17pub struct W(crate::W<INTENSET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTENSET_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<INTENSET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `KEYSLOT_PUSHED` reader - Write '1' to enable interrupt for event KEYSLOT_PUSHED"]
38pub type KEYSLOT_PUSHED_R = crate::BitReader<KEYSLOT_PUSHED_A>;
39#[doc = "Write '1' to enable interrupt for event KEYSLOT_PUSHED\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum KEYSLOT_PUSHED_A {
42    #[doc = "0: Read: Disabled"]
43    DISABLED = 0,
44    #[doc = "1: Read: Enabled"]
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 = "Write '1' to enable interrupt for event KEYSLOT_PUSHED\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum KEYSLOT_PUSHED_AW {
76    #[doc = "1: Enable"]
77    SET = 1,
78}
79impl From<KEYSLOT_PUSHED_AW> for bool {
80    #[inline(always)]
81    fn from(variant: KEYSLOT_PUSHED_AW) -> Self {
82        variant as u8 != 0
83    }
84}
85#[doc = "Field `KEYSLOT_PUSHED` writer - Write '1' to enable interrupt for event KEYSLOT_PUSHED"]
86pub type KEYSLOT_PUSHED_W<'a, const O: u8> =
87    crate::BitWriter<'a, u32, INTENSET_SPEC, KEYSLOT_PUSHED_AW, O>;
88impl<'a, const O: u8> KEYSLOT_PUSHED_W<'a, O> {
89    #[doc = "Enable"]
90    #[inline(always)]
91    pub fn set(self) -> &'a mut W {
92        self.variant(KEYSLOT_PUSHED_AW::SET)
93    }
94}
95#[doc = "Field `KEYSLOT_REVOKED` reader - Write '1' to enable interrupt for event KEYSLOT_REVOKED"]
96pub type KEYSLOT_REVOKED_R = crate::BitReader<KEYSLOT_REVOKED_A>;
97#[doc = "Write '1' to enable interrupt for event KEYSLOT_REVOKED\n\nValue on reset: 0"]
98#[derive(Clone, Copy, Debug, PartialEq)]
99pub enum KEYSLOT_REVOKED_A {
100    #[doc = "0: Read: Disabled"]
101    DISABLED = 0,
102    #[doc = "1: Read: Enabled"]
103    ENABLED = 1,
104}
105impl From<KEYSLOT_REVOKED_A> for bool {
106    #[inline(always)]
107    fn from(variant: KEYSLOT_REVOKED_A) -> Self {
108        variant as u8 != 0
109    }
110}
111impl KEYSLOT_REVOKED_R {
112    #[doc = "Get enumerated values variant"]
113    #[inline(always)]
114    pub fn variant(&self) -> KEYSLOT_REVOKED_A {
115        match self.bits {
116            false => KEYSLOT_REVOKED_A::DISABLED,
117            true => KEYSLOT_REVOKED_A::ENABLED,
118        }
119    }
120    #[doc = "Checks if the value of the field is `DISABLED`"]
121    #[inline(always)]
122    pub fn is_disabled(&self) -> bool {
123        *self == KEYSLOT_REVOKED_A::DISABLED
124    }
125    #[doc = "Checks if the value of the field is `ENABLED`"]
126    #[inline(always)]
127    pub fn is_enabled(&self) -> bool {
128        *self == KEYSLOT_REVOKED_A::ENABLED
129    }
130}
131#[doc = "Write '1' to enable interrupt for event KEYSLOT_REVOKED\n\nValue on reset: 0"]
132#[derive(Clone, Copy, Debug, PartialEq)]
133pub enum KEYSLOT_REVOKED_AW {
134    #[doc = "1: Enable"]
135    SET = 1,
136}
137impl From<KEYSLOT_REVOKED_AW> for bool {
138    #[inline(always)]
139    fn from(variant: KEYSLOT_REVOKED_AW) -> Self {
140        variant as u8 != 0
141    }
142}
143#[doc = "Field `KEYSLOT_REVOKED` writer - Write '1' to enable interrupt for event KEYSLOT_REVOKED"]
144pub type KEYSLOT_REVOKED_W<'a, const O: u8> =
145    crate::BitWriter<'a, u32, INTENSET_SPEC, KEYSLOT_REVOKED_AW, O>;
146impl<'a, const O: u8> KEYSLOT_REVOKED_W<'a, O> {
147    #[doc = "Enable"]
148    #[inline(always)]
149    pub fn set(self) -> &'a mut W {
150        self.variant(KEYSLOT_REVOKED_AW::SET)
151    }
152}
153#[doc = "Field `KEYSLOT_ERROR` reader - Write '1' to enable interrupt for event KEYSLOT_ERROR"]
154pub type KEYSLOT_ERROR_R = crate::BitReader<KEYSLOT_ERROR_A>;
155#[doc = "Write '1' to enable interrupt for event KEYSLOT_ERROR\n\nValue on reset: 0"]
156#[derive(Clone, Copy, Debug, PartialEq)]
157pub enum KEYSLOT_ERROR_A {
158    #[doc = "0: Read: Disabled"]
159    DISABLED = 0,
160    #[doc = "1: Read: Enabled"]
161    ENABLED = 1,
162}
163impl From<KEYSLOT_ERROR_A> for bool {
164    #[inline(always)]
165    fn from(variant: KEYSLOT_ERROR_A) -> Self {
166        variant as u8 != 0
167    }
168}
169impl KEYSLOT_ERROR_R {
170    #[doc = "Get enumerated values variant"]
171    #[inline(always)]
172    pub fn variant(&self) -> KEYSLOT_ERROR_A {
173        match self.bits {
174            false => KEYSLOT_ERROR_A::DISABLED,
175            true => KEYSLOT_ERROR_A::ENABLED,
176        }
177    }
178    #[doc = "Checks if the value of the field is `DISABLED`"]
179    #[inline(always)]
180    pub fn is_disabled(&self) -> bool {
181        *self == KEYSLOT_ERROR_A::DISABLED
182    }
183    #[doc = "Checks if the value of the field is `ENABLED`"]
184    #[inline(always)]
185    pub fn is_enabled(&self) -> bool {
186        *self == KEYSLOT_ERROR_A::ENABLED
187    }
188}
189#[doc = "Write '1' to enable interrupt for event KEYSLOT_ERROR\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum KEYSLOT_ERROR_AW {
192    #[doc = "1: Enable"]
193    SET = 1,
194}
195impl From<KEYSLOT_ERROR_AW> for bool {
196    #[inline(always)]
197    fn from(variant: KEYSLOT_ERROR_AW) -> Self {
198        variant as u8 != 0
199    }
200}
201#[doc = "Field `KEYSLOT_ERROR` writer - Write '1' to enable interrupt for event KEYSLOT_ERROR"]
202pub type KEYSLOT_ERROR_W<'a, const O: u8> =
203    crate::BitWriter<'a, u32, INTENSET_SPEC, KEYSLOT_ERROR_AW, O>;
204impl<'a, const O: u8> KEYSLOT_ERROR_W<'a, O> {
205    #[doc = "Enable"]
206    #[inline(always)]
207    pub fn set(self) -> &'a mut W {
208        self.variant(KEYSLOT_ERROR_AW::SET)
209    }
210}
211impl R {
212    #[doc = "Bit 0 - Write '1' to enable interrupt for event KEYSLOT_PUSHED"]
213    #[inline(always)]
214    pub fn keyslot_pushed(&self) -> KEYSLOT_PUSHED_R {
215        KEYSLOT_PUSHED_R::new((self.bits & 1) != 0)
216    }
217    #[doc = "Bit 1 - Write '1' to enable interrupt for event KEYSLOT_REVOKED"]
218    #[inline(always)]
219    pub fn keyslot_revoked(&self) -> KEYSLOT_REVOKED_R {
220        KEYSLOT_REVOKED_R::new(((self.bits >> 1) & 1) != 0)
221    }
222    #[doc = "Bit 2 - Write '1' to enable interrupt for event KEYSLOT_ERROR"]
223    #[inline(always)]
224    pub fn keyslot_error(&self) -> KEYSLOT_ERROR_R {
225        KEYSLOT_ERROR_R::new(((self.bits >> 2) & 1) != 0)
226    }
227}
228impl W {
229    #[doc = "Bit 0 - Write '1' to enable interrupt for event KEYSLOT_PUSHED"]
230    #[inline(always)]
231    pub fn keyslot_pushed(&mut self) -> KEYSLOT_PUSHED_W<0> {
232        KEYSLOT_PUSHED_W::new(self)
233    }
234    #[doc = "Bit 1 - Write '1' to enable interrupt for event KEYSLOT_REVOKED"]
235    #[inline(always)]
236    pub fn keyslot_revoked(&mut self) -> KEYSLOT_REVOKED_W<1> {
237        KEYSLOT_REVOKED_W::new(self)
238    }
239    #[doc = "Bit 2 - Write '1' to enable interrupt for event KEYSLOT_ERROR"]
240    #[inline(always)]
241    pub fn keyslot_error(&mut self) -> KEYSLOT_ERROR_W<2> {
242        KEYSLOT_ERROR_W::new(self)
243    }
244    #[doc = "Writes raw bits to the register."]
245    #[inline(always)]
246    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
247        self.0.bits(bits);
248        self
249    }
250}
251#[doc = "Enable 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 [intenset](index.html) module"]
252pub struct INTENSET_SPEC;
253impl crate::RegisterSpec for INTENSET_SPEC {
254    type Ux = u32;
255}
256#[doc = "`read()` method returns [intenset::R](R) reader structure"]
257impl crate::Readable for INTENSET_SPEC {
258    type Reader = R;
259}
260#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
261impl crate::Writable for INTENSET_SPEC {
262    type Writer = W;
263}
264#[doc = "`reset()` method sets INTENSET to value 0"]
265impl crate::Resettable for INTENSET_SPEC {
266    #[inline(always)]
267    fn reset_value() -> Self::Ux {
268        0
269    }
270}