nrf52840_pac/ecb/
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 `ENDECB` reader - Write '1' to disable interrupt for ENDECB event"]
38pub type ENDECB_R = crate::BitReader<ENDECB_A>;
39#[doc = "Write '1' to disable interrupt for ENDECB event\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum ENDECB_A {
42    #[doc = "0: Read: Disabled"]
43    DISABLED = 0,
44    #[doc = "1: Read: Enabled"]
45    ENABLED = 1,
46}
47impl From<ENDECB_A> for bool {
48    #[inline(always)]
49    fn from(variant: ENDECB_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl ENDECB_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> ENDECB_A {
57        match self.bits {
58            false => ENDECB_A::DISABLED,
59            true => ENDECB_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 == ENDECB_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 == ENDECB_A::ENABLED
71    }
72}
73#[doc = "Write '1' to disable interrupt for ENDECB event\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum ENDECB_AW {
76    #[doc = "1: Disable"]
77    CLEAR = 1,
78}
79impl From<ENDECB_AW> for bool {
80    #[inline(always)]
81    fn from(variant: ENDECB_AW) -> Self {
82        variant as u8 != 0
83    }
84}
85#[doc = "Field `ENDECB` writer - Write '1' to disable interrupt for ENDECB event"]
86pub type ENDECB_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, ENDECB_AW, O>;
87impl<'a, const O: u8> ENDECB_W<'a, O> {
88    #[doc = "Disable"]
89    #[inline(always)]
90    pub fn clear(self) -> &'a mut W {
91        self.variant(ENDECB_AW::CLEAR)
92    }
93}
94#[doc = "Field `ERRORECB` reader - Write '1' to disable interrupt for ERRORECB event"]
95pub type ERRORECB_R = crate::BitReader<ERRORECB_A>;
96#[doc = "Write '1' to disable interrupt for ERRORECB event\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq)]
98pub enum ERRORECB_A {
99    #[doc = "0: Read: Disabled"]
100    DISABLED = 0,
101    #[doc = "1: Read: Enabled"]
102    ENABLED = 1,
103}
104impl From<ERRORECB_A> for bool {
105    #[inline(always)]
106    fn from(variant: ERRORECB_A) -> Self {
107        variant as u8 != 0
108    }
109}
110impl ERRORECB_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> ERRORECB_A {
114        match self.bits {
115            false => ERRORECB_A::DISABLED,
116            true => ERRORECB_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 == ERRORECB_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 == ERRORECB_A::ENABLED
128    }
129}
130#[doc = "Write '1' to disable interrupt for ERRORECB event\n\nValue on reset: 0"]
131#[derive(Clone, Copy, Debug, PartialEq)]
132pub enum ERRORECB_AW {
133    #[doc = "1: Disable"]
134    CLEAR = 1,
135}
136impl From<ERRORECB_AW> for bool {
137    #[inline(always)]
138    fn from(variant: ERRORECB_AW) -> Self {
139        variant as u8 != 0
140    }
141}
142#[doc = "Field `ERRORECB` writer - Write '1' to disable interrupt for ERRORECB event"]
143pub type ERRORECB_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, ERRORECB_AW, O>;
144impl<'a, const O: u8> ERRORECB_W<'a, O> {
145    #[doc = "Disable"]
146    #[inline(always)]
147    pub fn clear(self) -> &'a mut W {
148        self.variant(ERRORECB_AW::CLEAR)
149    }
150}
151impl R {
152    #[doc = "Bit 0 - Write '1' to disable interrupt for ENDECB event"]
153    #[inline(always)]
154    pub fn endecb(&self) -> ENDECB_R {
155        ENDECB_R::new((self.bits & 1) != 0)
156    }
157    #[doc = "Bit 1 - Write '1' to disable interrupt for ERRORECB event"]
158    #[inline(always)]
159    pub fn errorecb(&self) -> ERRORECB_R {
160        ERRORECB_R::new(((self.bits >> 1) & 1) != 0)
161    }
162}
163impl W {
164    #[doc = "Bit 0 - Write '1' to disable interrupt for ENDECB event"]
165    #[inline(always)]
166    pub fn endecb(&mut self) -> ENDECB_W<0> {
167        ENDECB_W::new(self)
168    }
169    #[doc = "Bit 1 - Write '1' to disable interrupt for ERRORECB event"]
170    #[inline(always)]
171    pub fn errorecb(&mut self) -> ERRORECB_W<1> {
172        ERRORECB_W::new(self)
173    }
174    #[doc = "Writes raw bits to the register."]
175    #[inline(always)]
176    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
177        self.0.bits(bits);
178        self
179    }
180}
181#[doc = "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 [intenclr](index.html) module"]
182pub struct INTENCLR_SPEC;
183impl crate::RegisterSpec for INTENCLR_SPEC {
184    type Ux = u32;
185}
186#[doc = "`read()` method returns [intenclr::R](R) reader structure"]
187impl crate::Readable for INTENCLR_SPEC {
188    type Reader = R;
189}
190#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"]
191impl crate::Writable for INTENCLR_SPEC {
192    type Writer = W;
193}
194#[doc = "`reset()` method sets INTENCLR to value 0"]
195impl crate::Resettable for INTENCLR_SPEC {
196    #[inline(always)]
197    fn reset_value() -> Self::Ux {
198        0
199    }
200}