nrf52832_pac/clock/
intenset.rs1#[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 `HFCLKSTARTED` reader - Write '1' to Enable interrupt for HFCLKSTARTED event"]
38pub type HFCLKSTARTED_R = crate::BitReader<HFCLKSTARTED_A>;
39#[doc = "Write '1' to Enable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum HFCLKSTARTED_A {
42 #[doc = "0: Read: Disabled"]
43 DISABLED = 0,
44 #[doc = "1: Read: Enabled"]
45 ENABLED = 1,
46}
47impl From<HFCLKSTARTED_A> for bool {
48 #[inline(always)]
49 fn from(variant: HFCLKSTARTED_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl HFCLKSTARTED_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> HFCLKSTARTED_A {
57 match self.bits {
58 false => HFCLKSTARTED_A::DISABLED,
59 true => HFCLKSTARTED_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 == HFCLKSTARTED_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 == HFCLKSTARTED_A::ENABLED
71 }
72}
73#[doc = "Write '1' to Enable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum HFCLKSTARTED_AW {
76 #[doc = "1: Enable"]
77 SET = 1,
78}
79impl From<HFCLKSTARTED_AW> for bool {
80 #[inline(always)]
81 fn from(variant: HFCLKSTARTED_AW) -> Self {
82 variant as u8 != 0
83 }
84}
85#[doc = "Field `HFCLKSTARTED` writer - Write '1' to Enable interrupt for HFCLKSTARTED event"]
86pub type HFCLKSTARTED_W<'a, const O: u8> =
87 crate::BitWriter<'a, u32, INTENSET_SPEC, HFCLKSTARTED_AW, O>;
88impl<'a, const O: u8> HFCLKSTARTED_W<'a, O> {
89 #[doc = "Enable"]
90 #[inline(always)]
91 pub fn set(self) -> &'a mut W {
92 self.variant(HFCLKSTARTED_AW::SET)
93 }
94}
95#[doc = "Field `LFCLKSTARTED` reader - Write '1' to Enable interrupt for LFCLKSTARTED event"]
96pub type LFCLKSTARTED_R = crate::BitReader<LFCLKSTARTED_A>;
97#[doc = "Write '1' to Enable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"]
98#[derive(Clone, Copy, Debug, PartialEq)]
99pub enum LFCLKSTARTED_A {
100 #[doc = "0: Read: Disabled"]
101 DISABLED = 0,
102 #[doc = "1: Read: Enabled"]
103 ENABLED = 1,
104}
105impl From<LFCLKSTARTED_A> for bool {
106 #[inline(always)]
107 fn from(variant: LFCLKSTARTED_A) -> Self {
108 variant as u8 != 0
109 }
110}
111impl LFCLKSTARTED_R {
112 #[doc = "Get enumerated values variant"]
113 #[inline(always)]
114 pub fn variant(&self) -> LFCLKSTARTED_A {
115 match self.bits {
116 false => LFCLKSTARTED_A::DISABLED,
117 true => LFCLKSTARTED_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 == LFCLKSTARTED_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 == LFCLKSTARTED_A::ENABLED
129 }
130}
131#[doc = "Write '1' to Enable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"]
132#[derive(Clone, Copy, Debug, PartialEq)]
133pub enum LFCLKSTARTED_AW {
134 #[doc = "1: Enable"]
135 SET = 1,
136}
137impl From<LFCLKSTARTED_AW> for bool {
138 #[inline(always)]
139 fn from(variant: LFCLKSTARTED_AW) -> Self {
140 variant as u8 != 0
141 }
142}
143#[doc = "Field `LFCLKSTARTED` writer - Write '1' to Enable interrupt for LFCLKSTARTED event"]
144pub type LFCLKSTARTED_W<'a, const O: u8> =
145 crate::BitWriter<'a, u32, INTENSET_SPEC, LFCLKSTARTED_AW, O>;
146impl<'a, const O: u8> LFCLKSTARTED_W<'a, O> {
147 #[doc = "Enable"]
148 #[inline(always)]
149 pub fn set(self) -> &'a mut W {
150 self.variant(LFCLKSTARTED_AW::SET)
151 }
152}
153#[doc = "Field `DONE` reader - Write '1' to Enable interrupt for DONE event"]
154pub type DONE_R = crate::BitReader<DONE_A>;
155#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"]
156#[derive(Clone, Copy, Debug, PartialEq)]
157pub enum DONE_A {
158 #[doc = "0: Read: Disabled"]
159 DISABLED = 0,
160 #[doc = "1: Read: Enabled"]
161 ENABLED = 1,
162}
163impl From<DONE_A> for bool {
164 #[inline(always)]
165 fn from(variant: DONE_A) -> Self {
166 variant as u8 != 0
167 }
168}
169impl DONE_R {
170 #[doc = "Get enumerated values variant"]
171 #[inline(always)]
172 pub fn variant(&self) -> DONE_A {
173 match self.bits {
174 false => DONE_A::DISABLED,
175 true => DONE_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 == DONE_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 == DONE_A::ENABLED
187 }
188}
189#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum DONE_AW {
192 #[doc = "1: Enable"]
193 SET = 1,
194}
195impl From<DONE_AW> for bool {
196 #[inline(always)]
197 fn from(variant: DONE_AW) -> Self {
198 variant as u8 != 0
199 }
200}
201#[doc = "Field `DONE` writer - Write '1' to Enable interrupt for DONE event"]
202pub type DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, DONE_AW, O>;
203impl<'a, const O: u8> DONE_W<'a, O> {
204 #[doc = "Enable"]
205 #[inline(always)]
206 pub fn set(self) -> &'a mut W {
207 self.variant(DONE_AW::SET)
208 }
209}
210#[doc = "Field `CTTO` reader - Write '1' to Enable interrupt for CTTO event"]
211pub type CTTO_R = crate::BitReader<CTTO_A>;
212#[doc = "Write '1' to Enable interrupt for CTTO event\n\nValue on reset: 0"]
213#[derive(Clone, Copy, Debug, PartialEq)]
214pub enum CTTO_A {
215 #[doc = "0: Read: Disabled"]
216 DISABLED = 0,
217 #[doc = "1: Read: Enabled"]
218 ENABLED = 1,
219}
220impl From<CTTO_A> for bool {
221 #[inline(always)]
222 fn from(variant: CTTO_A) -> Self {
223 variant as u8 != 0
224 }
225}
226impl CTTO_R {
227 #[doc = "Get enumerated values variant"]
228 #[inline(always)]
229 pub fn variant(&self) -> CTTO_A {
230 match self.bits {
231 false => CTTO_A::DISABLED,
232 true => CTTO_A::ENABLED,
233 }
234 }
235 #[doc = "Checks if the value of the field is `DISABLED`"]
236 #[inline(always)]
237 pub fn is_disabled(&self) -> bool {
238 *self == CTTO_A::DISABLED
239 }
240 #[doc = "Checks if the value of the field is `ENABLED`"]
241 #[inline(always)]
242 pub fn is_enabled(&self) -> bool {
243 *self == CTTO_A::ENABLED
244 }
245}
246#[doc = "Write '1' to Enable interrupt for CTTO event\n\nValue on reset: 0"]
247#[derive(Clone, Copy, Debug, PartialEq)]
248pub enum CTTO_AW {
249 #[doc = "1: Enable"]
250 SET = 1,
251}
252impl From<CTTO_AW> for bool {
253 #[inline(always)]
254 fn from(variant: CTTO_AW) -> Self {
255 variant as u8 != 0
256 }
257}
258#[doc = "Field `CTTO` writer - Write '1' to Enable interrupt for CTTO event"]
259pub type CTTO_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, CTTO_AW, O>;
260impl<'a, const O: u8> CTTO_W<'a, O> {
261 #[doc = "Enable"]
262 #[inline(always)]
263 pub fn set(self) -> &'a mut W {
264 self.variant(CTTO_AW::SET)
265 }
266}
267impl R {
268 #[doc = "Bit 0 - Write '1' to Enable interrupt for HFCLKSTARTED event"]
269 #[inline(always)]
270 pub fn hfclkstarted(&self) -> HFCLKSTARTED_R {
271 HFCLKSTARTED_R::new((self.bits & 1) != 0)
272 }
273 #[doc = "Bit 1 - Write '1' to Enable interrupt for LFCLKSTARTED event"]
274 #[inline(always)]
275 pub fn lfclkstarted(&self) -> LFCLKSTARTED_R {
276 LFCLKSTARTED_R::new(((self.bits >> 1) & 1) != 0)
277 }
278 #[doc = "Bit 3 - Write '1' to Enable interrupt for DONE event"]
279 #[inline(always)]
280 pub fn done(&self) -> DONE_R {
281 DONE_R::new(((self.bits >> 3) & 1) != 0)
282 }
283 #[doc = "Bit 4 - Write '1' to Enable interrupt for CTTO event"]
284 #[inline(always)]
285 pub fn ctto(&self) -> CTTO_R {
286 CTTO_R::new(((self.bits >> 4) & 1) != 0)
287 }
288}
289impl W {
290 #[doc = "Bit 0 - Write '1' to Enable interrupt for HFCLKSTARTED event"]
291 #[inline(always)]
292 pub fn hfclkstarted(&mut self) -> HFCLKSTARTED_W<0> {
293 HFCLKSTARTED_W::new(self)
294 }
295 #[doc = "Bit 1 - Write '1' to Enable interrupt for LFCLKSTARTED event"]
296 #[inline(always)]
297 pub fn lfclkstarted(&mut self) -> LFCLKSTARTED_W<1> {
298 LFCLKSTARTED_W::new(self)
299 }
300 #[doc = "Bit 3 - Write '1' to Enable interrupt for DONE event"]
301 #[inline(always)]
302 pub fn done(&mut self) -> DONE_W<3> {
303 DONE_W::new(self)
304 }
305 #[doc = "Bit 4 - Write '1' to Enable interrupt for CTTO event"]
306 #[inline(always)]
307 pub fn ctto(&mut self) -> CTTO_W<4> {
308 CTTO_W::new(self)
309 }
310 #[doc = "Writes raw bits to the register."]
311 #[inline(always)]
312 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
313 self.0.bits(bits);
314 self
315 }
316}
317#[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"]
318pub struct INTENSET_SPEC;
319impl crate::RegisterSpec for INTENSET_SPEC {
320 type Ux = u32;
321}
322#[doc = "`read()` method returns [intenset::R](R) reader structure"]
323impl crate::Readable for INTENSET_SPEC {
324 type Reader = R;
325}
326#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
327impl crate::Writable for INTENSET_SPEC {
328 type Writer = W;
329}
330#[doc = "`reset()` method sets INTENSET to value 0"]
331impl crate::Resettable for INTENSET_SPEC {
332 #[inline(always)]
333 fn reset_value() -> Self::Ux {
334 0
335 }
336}