nrf51_pac/gpiote/
intenclr.rs

1#[doc = "Register `INTENCLR` reader"]
2pub struct R(crate::R<INTENCLR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTENCLR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTENCLR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTENCLR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTENCLR` writer"]
17pub struct W(crate::W<INTENCLR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTENCLR_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<INTENCLR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTENCLR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `IN0` reader - Disable interrupt on IN\\[0\\]
38event."]
39pub type IN0_R = crate::BitReader<IN0_A>;
40#[doc = "Disable interrupt on IN\\[0\\]
41event.\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum IN0_A {
44    #[doc = "0: Interrupt disabled."]
45    DISABLED = 0,
46    #[doc = "1: Interrupt enabled."]
47    ENABLED = 1,
48}
49impl From<IN0_A> for bool {
50    #[inline(always)]
51    fn from(variant: IN0_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl IN0_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub fn variant(&self) -> IN0_A {
59        match self.bits {
60            false => IN0_A::DISABLED,
61            true => IN0_A::ENABLED,
62        }
63    }
64    #[doc = "Checks if the value of the field is `DISABLED`"]
65    #[inline(always)]
66    pub fn is_disabled(&self) -> bool {
67        *self == IN0_A::DISABLED
68    }
69    #[doc = "Checks if the value of the field is `ENABLED`"]
70    #[inline(always)]
71    pub fn is_enabled(&self) -> bool {
72        *self == IN0_A::ENABLED
73    }
74}
75#[doc = "Disable interrupt on IN\\[0\\]
76event.\n\nValue on reset: 0"]
77#[derive(Clone, Copy, Debug, PartialEq)]
78pub enum IN0_AW {
79    #[doc = "1: Disable interrupt on write."]
80    CLEAR = 1,
81}
82impl From<IN0_AW> for bool {
83    #[inline(always)]
84    fn from(variant: IN0_AW) -> Self {
85        variant as u8 != 0
86    }
87}
88#[doc = "Field `IN0` writer - Disable interrupt on IN\\[0\\]
89event."]
90pub type IN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, IN0_AW, O>;
91impl<'a, const O: u8> IN0_W<'a, O> {
92    #[doc = "Disable interrupt on write."]
93    #[inline(always)]
94    pub fn clear(self) -> &'a mut W {
95        self.variant(IN0_AW::CLEAR)
96    }
97}
98#[doc = "Field `IN1` reader - Disable interrupt on IN\\[1\\]
99event."]
100pub type IN1_R = crate::BitReader<IN1_A>;
101#[doc = "Disable interrupt on IN\\[1\\]
102event.\n\nValue on reset: 0"]
103#[derive(Clone, Copy, Debug, PartialEq)]
104pub enum IN1_A {
105    #[doc = "0: Interrupt disabled."]
106    DISABLED = 0,
107    #[doc = "1: Interrupt enabled."]
108    ENABLED = 1,
109}
110impl From<IN1_A> for bool {
111    #[inline(always)]
112    fn from(variant: IN1_A) -> Self {
113        variant as u8 != 0
114    }
115}
116impl IN1_R {
117    #[doc = "Get enumerated values variant"]
118    #[inline(always)]
119    pub fn variant(&self) -> IN1_A {
120        match self.bits {
121            false => IN1_A::DISABLED,
122            true => IN1_A::ENABLED,
123        }
124    }
125    #[doc = "Checks if the value of the field is `DISABLED`"]
126    #[inline(always)]
127    pub fn is_disabled(&self) -> bool {
128        *self == IN1_A::DISABLED
129    }
130    #[doc = "Checks if the value of the field is `ENABLED`"]
131    #[inline(always)]
132    pub fn is_enabled(&self) -> bool {
133        *self == IN1_A::ENABLED
134    }
135}
136#[doc = "Disable interrupt on IN\\[1\\]
137event.\n\nValue on reset: 0"]
138#[derive(Clone, Copy, Debug, PartialEq)]
139pub enum IN1_AW {
140    #[doc = "1: Disable interrupt on write."]
141    CLEAR = 1,
142}
143impl From<IN1_AW> for bool {
144    #[inline(always)]
145    fn from(variant: IN1_AW) -> Self {
146        variant as u8 != 0
147    }
148}
149#[doc = "Field `IN1` writer - Disable interrupt on IN\\[1\\]
150event."]
151pub type IN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, IN1_AW, O>;
152impl<'a, const O: u8> IN1_W<'a, O> {
153    #[doc = "Disable interrupt on write."]
154    #[inline(always)]
155    pub fn clear(self) -> &'a mut W {
156        self.variant(IN1_AW::CLEAR)
157    }
158}
159#[doc = "Field `IN2` reader - Disable interrupt on IN\\[2\\]
160event."]
161pub type IN2_R = crate::BitReader<IN2_A>;
162#[doc = "Disable interrupt on IN\\[2\\]
163event.\n\nValue on reset: 0"]
164#[derive(Clone, Copy, Debug, PartialEq)]
165pub enum IN2_A {
166    #[doc = "0: Interrupt disabled."]
167    DISABLED = 0,
168    #[doc = "1: Interrupt enabled."]
169    ENABLED = 1,
170}
171impl From<IN2_A> for bool {
172    #[inline(always)]
173    fn from(variant: IN2_A) -> Self {
174        variant as u8 != 0
175    }
176}
177impl IN2_R {
178    #[doc = "Get enumerated values variant"]
179    #[inline(always)]
180    pub fn variant(&self) -> IN2_A {
181        match self.bits {
182            false => IN2_A::DISABLED,
183            true => IN2_A::ENABLED,
184        }
185    }
186    #[doc = "Checks if the value of the field is `DISABLED`"]
187    #[inline(always)]
188    pub fn is_disabled(&self) -> bool {
189        *self == IN2_A::DISABLED
190    }
191    #[doc = "Checks if the value of the field is `ENABLED`"]
192    #[inline(always)]
193    pub fn is_enabled(&self) -> bool {
194        *self == IN2_A::ENABLED
195    }
196}
197#[doc = "Disable interrupt on IN\\[2\\]
198event.\n\nValue on reset: 0"]
199#[derive(Clone, Copy, Debug, PartialEq)]
200pub enum IN2_AW {
201    #[doc = "1: Disable interrupt on write."]
202    CLEAR = 1,
203}
204impl From<IN2_AW> for bool {
205    #[inline(always)]
206    fn from(variant: IN2_AW) -> Self {
207        variant as u8 != 0
208    }
209}
210#[doc = "Field `IN2` writer - Disable interrupt on IN\\[2\\]
211event."]
212pub type IN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, IN2_AW, O>;
213impl<'a, const O: u8> IN2_W<'a, O> {
214    #[doc = "Disable interrupt on write."]
215    #[inline(always)]
216    pub fn clear(self) -> &'a mut W {
217        self.variant(IN2_AW::CLEAR)
218    }
219}
220#[doc = "Field `IN3` reader - Disable interrupt on IN\\[3\\]
221event."]
222pub type IN3_R = crate::BitReader<IN3_A>;
223#[doc = "Disable interrupt on IN\\[3\\]
224event.\n\nValue on reset: 0"]
225#[derive(Clone, Copy, Debug, PartialEq)]
226pub enum IN3_A {
227    #[doc = "0: Interrupt disabled."]
228    DISABLED = 0,
229    #[doc = "1: Interrupt enabled."]
230    ENABLED = 1,
231}
232impl From<IN3_A> for bool {
233    #[inline(always)]
234    fn from(variant: IN3_A) -> Self {
235        variant as u8 != 0
236    }
237}
238impl IN3_R {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub fn variant(&self) -> IN3_A {
242        match self.bits {
243            false => IN3_A::DISABLED,
244            true => IN3_A::ENABLED,
245        }
246    }
247    #[doc = "Checks if the value of the field is `DISABLED`"]
248    #[inline(always)]
249    pub fn is_disabled(&self) -> bool {
250        *self == IN3_A::DISABLED
251    }
252    #[doc = "Checks if the value of the field is `ENABLED`"]
253    #[inline(always)]
254    pub fn is_enabled(&self) -> bool {
255        *self == IN3_A::ENABLED
256    }
257}
258#[doc = "Disable interrupt on IN\\[3\\]
259event.\n\nValue on reset: 0"]
260#[derive(Clone, Copy, Debug, PartialEq)]
261pub enum IN3_AW {
262    #[doc = "1: Disable interrupt on write."]
263    CLEAR = 1,
264}
265impl From<IN3_AW> for bool {
266    #[inline(always)]
267    fn from(variant: IN3_AW) -> Self {
268        variant as u8 != 0
269    }
270}
271#[doc = "Field `IN3` writer - Disable interrupt on IN\\[3\\]
272event."]
273pub type IN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, IN3_AW, O>;
274impl<'a, const O: u8> IN3_W<'a, O> {
275    #[doc = "Disable interrupt on write."]
276    #[inline(always)]
277    pub fn clear(self) -> &'a mut W {
278        self.variant(IN3_AW::CLEAR)
279    }
280}
281#[doc = "Field `PORT` reader - Disable interrupt on PORT event."]
282pub type PORT_R = crate::BitReader<PORT_A>;
283#[doc = "Disable interrupt on PORT event.\n\nValue on reset: 0"]
284#[derive(Clone, Copy, Debug, PartialEq)]
285pub enum PORT_A {
286    #[doc = "0: Interrupt disabled."]
287    DISABLED = 0,
288    #[doc = "1: Interrupt enabled."]
289    ENABLED = 1,
290}
291impl From<PORT_A> for bool {
292    #[inline(always)]
293    fn from(variant: PORT_A) -> Self {
294        variant as u8 != 0
295    }
296}
297impl PORT_R {
298    #[doc = "Get enumerated values variant"]
299    #[inline(always)]
300    pub fn variant(&self) -> PORT_A {
301        match self.bits {
302            false => PORT_A::DISABLED,
303            true => PORT_A::ENABLED,
304        }
305    }
306    #[doc = "Checks if the value of the field is `DISABLED`"]
307    #[inline(always)]
308    pub fn is_disabled(&self) -> bool {
309        *self == PORT_A::DISABLED
310    }
311    #[doc = "Checks if the value of the field is `ENABLED`"]
312    #[inline(always)]
313    pub fn is_enabled(&self) -> bool {
314        *self == PORT_A::ENABLED
315    }
316}
317#[doc = "Disable interrupt on PORT event.\n\nValue on reset: 0"]
318#[derive(Clone, Copy, Debug, PartialEq)]
319pub enum PORT_AW {
320    #[doc = "1: Disable interrupt on write."]
321    CLEAR = 1,
322}
323impl From<PORT_AW> for bool {
324    #[inline(always)]
325    fn from(variant: PORT_AW) -> Self {
326        variant as u8 != 0
327    }
328}
329#[doc = "Field `PORT` writer - Disable interrupt on PORT event."]
330pub type PORT_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, PORT_AW, O>;
331impl<'a, const O: u8> PORT_W<'a, O> {
332    #[doc = "Disable interrupt on write."]
333    #[inline(always)]
334    pub fn clear(self) -> &'a mut W {
335        self.variant(PORT_AW::CLEAR)
336    }
337}
338impl R {
339    #[doc = "Bit 0 - Disable interrupt on IN\\[0\\]
340event."]
341    #[inline(always)]
342    pub fn in0(&self) -> IN0_R {
343        IN0_R::new((self.bits & 1) != 0)
344    }
345    #[doc = "Bit 1 - Disable interrupt on IN\\[1\\]
346event."]
347    #[inline(always)]
348    pub fn in1(&self) -> IN1_R {
349        IN1_R::new(((self.bits >> 1) & 1) != 0)
350    }
351    #[doc = "Bit 2 - Disable interrupt on IN\\[2\\]
352event."]
353    #[inline(always)]
354    pub fn in2(&self) -> IN2_R {
355        IN2_R::new(((self.bits >> 2) & 1) != 0)
356    }
357    #[doc = "Bit 3 - Disable interrupt on IN\\[3\\]
358event."]
359    #[inline(always)]
360    pub fn in3(&self) -> IN3_R {
361        IN3_R::new(((self.bits >> 3) & 1) != 0)
362    }
363    #[doc = "Bit 31 - Disable interrupt on PORT event."]
364    #[inline(always)]
365    pub fn port(&self) -> PORT_R {
366        PORT_R::new(((self.bits >> 31) & 1) != 0)
367    }
368}
369impl W {
370    #[doc = "Bit 0 - Disable interrupt on IN\\[0\\]
371event."]
372    #[inline(always)]
373    pub fn in0(&mut self) -> IN0_W<0> {
374        IN0_W::new(self)
375    }
376    #[doc = "Bit 1 - Disable interrupt on IN\\[1\\]
377event."]
378    #[inline(always)]
379    pub fn in1(&mut self) -> IN1_W<1> {
380        IN1_W::new(self)
381    }
382    #[doc = "Bit 2 - Disable interrupt on IN\\[2\\]
383event."]
384    #[inline(always)]
385    pub fn in2(&mut self) -> IN2_W<2> {
386        IN2_W::new(self)
387    }
388    #[doc = "Bit 3 - Disable interrupt on IN\\[3\\]
389event."]
390    #[inline(always)]
391    pub fn in3(&mut self) -> IN3_W<3> {
392        IN3_W::new(self)
393    }
394    #[doc = "Bit 31 - Disable interrupt on PORT event."]
395    #[inline(always)]
396    pub fn port(&mut self) -> PORT_W<31> {
397        PORT_W::new(self)
398    }
399    #[doc = "Writes raw bits to the register."]
400    #[inline(always)]
401    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
402        self.0.bits(bits);
403        self
404    }
405}
406#[doc = "Interrupt enable clear register.\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 [intenclr](index.html) module"]
407pub struct INTENCLR_SPEC;
408impl crate::RegisterSpec for INTENCLR_SPEC {
409    type Ux = u32;
410}
411#[doc = "`read()` method returns [intenclr::R](R) reader structure"]
412impl crate::Readable for INTENCLR_SPEC {
413    type Reader = R;
414}
415#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"]
416impl crate::Writable for INTENCLR_SPEC {
417    type Writer = W;
418}
419#[doc = "`reset()` method sets INTENCLR to value 0"]
420impl crate::Resettable for INTENCLR_SPEC {
421    #[inline(always)]
422    fn reset_value() -> Self::Ux {
423        0
424    }
425}