nrf5340_net_pac/wdt_ns/
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 `TIMEOUT` reader - Write '1' to disable interrupt for event TIMEOUT"]
38pub type TIMEOUT_R = crate::BitReader<TIMEOUT_A>;
39#[doc = "Write '1' to disable interrupt for event TIMEOUT\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum TIMEOUT_A {
42    #[doc = "0: Read: Disabled"]
43    DISABLED = 0,
44    #[doc = "1: Read: Enabled"]
45    ENABLED = 1,
46}
47impl From<TIMEOUT_A> for bool {
48    #[inline(always)]
49    fn from(variant: TIMEOUT_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl TIMEOUT_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> TIMEOUT_A {
57        match self.bits {
58            false => TIMEOUT_A::DISABLED,
59            true => TIMEOUT_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 == TIMEOUT_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 == TIMEOUT_A::ENABLED
71    }
72}
73#[doc = "Write '1' to disable interrupt for event TIMEOUT\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum TIMEOUT_AW {
76    #[doc = "1: Disable"]
77    CLEAR = 1,
78}
79impl From<TIMEOUT_AW> for bool {
80    #[inline(always)]
81    fn from(variant: TIMEOUT_AW) -> Self {
82        variant as u8 != 0
83    }
84}
85#[doc = "Field `TIMEOUT` writer - Write '1' to disable interrupt for event TIMEOUT"]
86pub type TIMEOUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, TIMEOUT_AW, O>;
87impl<'a, const O: u8> TIMEOUT_W<'a, O> {
88    #[doc = "Disable"]
89    #[inline(always)]
90    pub fn clear(self) -> &'a mut W {
91        self.variant(TIMEOUT_AW::CLEAR)
92    }
93}
94#[doc = "Field `STOPPED` reader - Write '1' to disable interrupt for event STOPPED"]
95pub type STOPPED_R = crate::BitReader<STOPPED_A>;
96#[doc = "Write '1' to disable interrupt for event STOPPED\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq)]
98pub enum STOPPED_A {
99    #[doc = "0: Read: Disabled"]
100    DISABLED = 0,
101    #[doc = "1: Read: Enabled"]
102    ENABLED = 1,
103}
104impl From<STOPPED_A> for bool {
105    #[inline(always)]
106    fn from(variant: STOPPED_A) -> Self {
107        variant as u8 != 0
108    }
109}
110impl STOPPED_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> STOPPED_A {
114        match self.bits {
115            false => STOPPED_A::DISABLED,
116            true => STOPPED_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 == STOPPED_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 == STOPPED_A::ENABLED
128    }
129}
130#[doc = "Write '1' to disable interrupt for event STOPPED\n\nValue on reset: 0"]
131#[derive(Clone, Copy, Debug, PartialEq)]
132pub enum STOPPED_AW {
133    #[doc = "1: Disable"]
134    CLEAR = 1,
135}
136impl From<STOPPED_AW> for bool {
137    #[inline(always)]
138    fn from(variant: STOPPED_AW) -> Self {
139        variant as u8 != 0
140    }
141}
142#[doc = "Field `STOPPED` writer - Write '1' to disable interrupt for event STOPPED"]
143pub type STOPPED_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, STOPPED_AW, O>;
144impl<'a, const O: u8> STOPPED_W<'a, O> {
145    #[doc = "Disable"]
146    #[inline(always)]
147    pub fn clear(self) -> &'a mut W {
148        self.variant(STOPPED_AW::CLEAR)
149    }
150}
151impl R {
152    #[doc = "Bit 0 - Write '1' to disable interrupt for event TIMEOUT"]
153    #[inline(always)]
154    pub fn timeout(&self) -> TIMEOUT_R {
155        TIMEOUT_R::new((self.bits & 1) != 0)
156    }
157    #[doc = "Bit 1 - Write '1' to disable interrupt for event STOPPED"]
158    #[inline(always)]
159    pub fn stopped(&self) -> STOPPED_R {
160        STOPPED_R::new(((self.bits >> 1) & 1) != 0)
161    }
162}
163impl W {
164    #[doc = "Bit 0 - Write '1' to disable interrupt for event TIMEOUT"]
165    #[inline(always)]
166    pub fn timeout(&mut self) -> TIMEOUT_W<0> {
167        TIMEOUT_W::new(self)
168    }
169    #[doc = "Bit 1 - Write '1' to disable interrupt for event STOPPED"]
170    #[inline(always)]
171    pub fn stopped(&mut self) -> STOPPED_W<1> {
172        STOPPED_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}