nrf52840_pac/aar/
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 `END` reader - Write '1' to enable interrupt for END event"]
38pub type END_R = crate::BitReader<END_A>;
39#[doc = "Write '1' to enable interrupt for END event\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum END_A {
42    #[doc = "0: Read: Disabled"]
43    DISABLED = 0,
44    #[doc = "1: Read: Enabled"]
45    ENABLED = 1,
46}
47impl From<END_A> for bool {
48    #[inline(always)]
49    fn from(variant: END_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl END_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> END_A {
57        match self.bits {
58            false => END_A::DISABLED,
59            true => END_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 == END_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 == END_A::ENABLED
71    }
72}
73#[doc = "Write '1' to enable interrupt for END event\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum END_AW {
76    #[doc = "1: Enable"]
77    SET = 1,
78}
79impl From<END_AW> for bool {
80    #[inline(always)]
81    fn from(variant: END_AW) -> Self {
82        variant as u8 != 0
83    }
84}
85#[doc = "Field `END` writer - Write '1' to enable interrupt for END event"]
86pub type END_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, END_AW, O>;
87impl<'a, const O: u8> END_W<'a, O> {
88    #[doc = "Enable"]
89    #[inline(always)]
90    pub fn set(self) -> &'a mut W {
91        self.variant(END_AW::SET)
92    }
93}
94#[doc = "Field `RESOLVED` reader - Write '1' to enable interrupt for RESOLVED event"]
95pub type RESOLVED_R = crate::BitReader<RESOLVED_A>;
96#[doc = "Write '1' to enable interrupt for RESOLVED event\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq)]
98pub enum RESOLVED_A {
99    #[doc = "0: Read: Disabled"]
100    DISABLED = 0,
101    #[doc = "1: Read: Enabled"]
102    ENABLED = 1,
103}
104impl From<RESOLVED_A> for bool {
105    #[inline(always)]
106    fn from(variant: RESOLVED_A) -> Self {
107        variant as u8 != 0
108    }
109}
110impl RESOLVED_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> RESOLVED_A {
114        match self.bits {
115            false => RESOLVED_A::DISABLED,
116            true => RESOLVED_A::ENABLED,
117        }
118    }
119    #[doc = "Checks if the value of the field is `DISABLED`"]
120    #[inline(always)]
121    pub fn is_disabled(&self) -> bool {
122        *self == RESOLVED_A::DISABLED
123    }
124    #[doc = "Checks if the value of the field is `ENABLED`"]
125    #[inline(always)]
126    pub fn is_enabled(&self) -> bool {
127        *self == RESOLVED_A::ENABLED
128    }
129}
130#[doc = "Write '1' to enable interrupt for RESOLVED event\n\nValue on reset: 0"]
131#[derive(Clone, Copy, Debug, PartialEq)]
132pub enum RESOLVED_AW {
133    #[doc = "1: Enable"]
134    SET = 1,
135}
136impl From<RESOLVED_AW> for bool {
137    #[inline(always)]
138    fn from(variant: RESOLVED_AW) -> Self {
139        variant as u8 != 0
140    }
141}
142#[doc = "Field `RESOLVED` writer - Write '1' to enable interrupt for RESOLVED event"]
143pub type RESOLVED_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, RESOLVED_AW, O>;
144impl<'a, const O: u8> RESOLVED_W<'a, O> {
145    #[doc = "Enable"]
146    #[inline(always)]
147    pub fn set(self) -> &'a mut W {
148        self.variant(RESOLVED_AW::SET)
149    }
150}
151#[doc = "Field `NOTRESOLVED` reader - Write '1' to enable interrupt for NOTRESOLVED event"]
152pub type NOTRESOLVED_R = crate::BitReader<NOTRESOLVED_A>;
153#[doc = "Write '1' to enable interrupt for NOTRESOLVED event\n\nValue on reset: 0"]
154#[derive(Clone, Copy, Debug, PartialEq)]
155pub enum NOTRESOLVED_A {
156    #[doc = "0: Read: Disabled"]
157    DISABLED = 0,
158    #[doc = "1: Read: Enabled"]
159    ENABLED = 1,
160}
161impl From<NOTRESOLVED_A> for bool {
162    #[inline(always)]
163    fn from(variant: NOTRESOLVED_A) -> Self {
164        variant as u8 != 0
165    }
166}
167impl NOTRESOLVED_R {
168    #[doc = "Get enumerated values variant"]
169    #[inline(always)]
170    pub fn variant(&self) -> NOTRESOLVED_A {
171        match self.bits {
172            false => NOTRESOLVED_A::DISABLED,
173            true => NOTRESOLVED_A::ENABLED,
174        }
175    }
176    #[doc = "Checks if the value of the field is `DISABLED`"]
177    #[inline(always)]
178    pub fn is_disabled(&self) -> bool {
179        *self == NOTRESOLVED_A::DISABLED
180    }
181    #[doc = "Checks if the value of the field is `ENABLED`"]
182    #[inline(always)]
183    pub fn is_enabled(&self) -> bool {
184        *self == NOTRESOLVED_A::ENABLED
185    }
186}
187#[doc = "Write '1' to enable interrupt for NOTRESOLVED event\n\nValue on reset: 0"]
188#[derive(Clone, Copy, Debug, PartialEq)]
189pub enum NOTRESOLVED_AW {
190    #[doc = "1: Enable"]
191    SET = 1,
192}
193impl From<NOTRESOLVED_AW> for bool {
194    #[inline(always)]
195    fn from(variant: NOTRESOLVED_AW) -> Self {
196        variant as u8 != 0
197    }
198}
199#[doc = "Field `NOTRESOLVED` writer - Write '1' to enable interrupt for NOTRESOLVED event"]
200pub type NOTRESOLVED_W<'a, const O: u8> =
201    crate::BitWriter<'a, u32, INTENSET_SPEC, NOTRESOLVED_AW, O>;
202impl<'a, const O: u8> NOTRESOLVED_W<'a, O> {
203    #[doc = "Enable"]
204    #[inline(always)]
205    pub fn set(self) -> &'a mut W {
206        self.variant(NOTRESOLVED_AW::SET)
207    }
208}
209impl R {
210    #[doc = "Bit 0 - Write '1' to enable interrupt for END event"]
211    #[inline(always)]
212    pub fn end(&self) -> END_R {
213        END_R::new((self.bits & 1) != 0)
214    }
215    #[doc = "Bit 1 - Write '1' to enable interrupt for RESOLVED event"]
216    #[inline(always)]
217    pub fn resolved(&self) -> RESOLVED_R {
218        RESOLVED_R::new(((self.bits >> 1) & 1) != 0)
219    }
220    #[doc = "Bit 2 - Write '1' to enable interrupt for NOTRESOLVED event"]
221    #[inline(always)]
222    pub fn notresolved(&self) -> NOTRESOLVED_R {
223        NOTRESOLVED_R::new(((self.bits >> 2) & 1) != 0)
224    }
225}
226impl W {
227    #[doc = "Bit 0 - Write '1' to enable interrupt for END event"]
228    #[inline(always)]
229    pub fn end(&mut self) -> END_W<0> {
230        END_W::new(self)
231    }
232    #[doc = "Bit 1 - Write '1' to enable interrupt for RESOLVED event"]
233    #[inline(always)]
234    pub fn resolved(&mut self) -> RESOLVED_W<1> {
235        RESOLVED_W::new(self)
236    }
237    #[doc = "Bit 2 - Write '1' to enable interrupt for NOTRESOLVED event"]
238    #[inline(always)]
239    pub fn notresolved(&mut self) -> NOTRESOLVED_W<2> {
240        NOTRESOLVED_W::new(self)
241    }
242    #[doc = "Writes raw bits to the register."]
243    #[inline(always)]
244    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
245        self.0.bits(bits);
246        self
247    }
248}
249#[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"]
250pub struct INTENSET_SPEC;
251impl crate::RegisterSpec for INTENSET_SPEC {
252    type Ux = u32;
253}
254#[doc = "`read()` method returns [intenset::R](R) reader structure"]
255impl crate::Readable for INTENSET_SPEC {
256    type Reader = R;
257}
258#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
259impl crate::Writable for INTENSET_SPEC {
260    type Writer = W;
261}
262#[doc = "`reset()` method sets INTENSET to value 0"]
263impl crate::Resettable for INTENSET_SPEC {
264    #[inline(always)]
265    fn reset_value() -> Self::Ux {
266        0
267    }
268}