nrf5340_app_pac/clock_ns/
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 `HFCLKSTARTED` reader - Write '1' to enable interrupt for event HFCLKSTARTED"]
38pub type HFCLKSTARTED_R = crate::BitReader<HFCLKSTARTED_A>;
39#[doc = "Write '1' to enable interrupt for event HFCLKSTARTED\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 event HFCLKSTARTED\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 event HFCLKSTARTED"]
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 event LFCLKSTARTED"]
96pub type LFCLKSTARTED_R = crate::BitReader<LFCLKSTARTED_A>;
97#[doc = "Write '1' to enable interrupt for event LFCLKSTARTED\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 event LFCLKSTARTED\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 event LFCLKSTARTED"]
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 event DONE"]
154pub type DONE_R = crate::BitReader<DONE_A>;
155#[doc = "Write '1' to enable interrupt for event DONE\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 event DONE\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 event DONE"]
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 `HFCLKAUDIOSTARTED` reader - Write '1' to enable interrupt for event HFCLKAUDIOSTARTED"]
211pub type HFCLKAUDIOSTARTED_R = crate::BitReader<HFCLKAUDIOSTARTED_A>;
212#[doc = "Write '1' to enable interrupt for event HFCLKAUDIOSTARTED\n\nValue on reset: 0"]
213#[derive(Clone, Copy, Debug, PartialEq)]
214pub enum HFCLKAUDIOSTARTED_A {
215    #[doc = "0: Read: Disabled"]
216    DISABLED = 0,
217    #[doc = "1: Read: Enabled"]
218    ENABLED = 1,
219}
220impl From<HFCLKAUDIOSTARTED_A> for bool {
221    #[inline(always)]
222    fn from(variant: HFCLKAUDIOSTARTED_A) -> Self {
223        variant as u8 != 0
224    }
225}
226impl HFCLKAUDIOSTARTED_R {
227    #[doc = "Get enumerated values variant"]
228    #[inline(always)]
229    pub fn variant(&self) -> HFCLKAUDIOSTARTED_A {
230        match self.bits {
231            false => HFCLKAUDIOSTARTED_A::DISABLED,
232            true => HFCLKAUDIOSTARTED_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 == HFCLKAUDIOSTARTED_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 == HFCLKAUDIOSTARTED_A::ENABLED
244    }
245}
246#[doc = "Write '1' to enable interrupt for event HFCLKAUDIOSTARTED\n\nValue on reset: 0"]
247#[derive(Clone, Copy, Debug, PartialEq)]
248pub enum HFCLKAUDIOSTARTED_AW {
249    #[doc = "1: Enable"]
250    SET = 1,
251}
252impl From<HFCLKAUDIOSTARTED_AW> for bool {
253    #[inline(always)]
254    fn from(variant: HFCLKAUDIOSTARTED_AW) -> Self {
255        variant as u8 != 0
256    }
257}
258#[doc = "Field `HFCLKAUDIOSTARTED` writer - Write '1' to enable interrupt for event HFCLKAUDIOSTARTED"]
259pub type HFCLKAUDIOSTARTED_W<'a, const O: u8> =
260    crate::BitWriter<'a, u32, INTENSET_SPEC, HFCLKAUDIOSTARTED_AW, O>;
261impl<'a, const O: u8> HFCLKAUDIOSTARTED_W<'a, O> {
262    #[doc = "Enable"]
263    #[inline(always)]
264    pub fn set(self) -> &'a mut W {
265        self.variant(HFCLKAUDIOSTARTED_AW::SET)
266    }
267}
268#[doc = "Field `HFCLK192MSTARTED` reader - Write '1' to enable interrupt for event HFCLK192MSTARTED"]
269pub type HFCLK192MSTARTED_R = crate::BitReader<HFCLK192MSTARTED_A>;
270#[doc = "Write '1' to enable interrupt for event HFCLK192MSTARTED\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq)]
272pub enum HFCLK192MSTARTED_A {
273    #[doc = "0: Read: Disabled"]
274    DISABLED = 0,
275    #[doc = "1: Read: Enabled"]
276    ENABLED = 1,
277}
278impl From<HFCLK192MSTARTED_A> for bool {
279    #[inline(always)]
280    fn from(variant: HFCLK192MSTARTED_A) -> Self {
281        variant as u8 != 0
282    }
283}
284impl HFCLK192MSTARTED_R {
285    #[doc = "Get enumerated values variant"]
286    #[inline(always)]
287    pub fn variant(&self) -> HFCLK192MSTARTED_A {
288        match self.bits {
289            false => HFCLK192MSTARTED_A::DISABLED,
290            true => HFCLK192MSTARTED_A::ENABLED,
291        }
292    }
293    #[doc = "Checks if the value of the field is `DISABLED`"]
294    #[inline(always)]
295    pub fn is_disabled(&self) -> bool {
296        *self == HFCLK192MSTARTED_A::DISABLED
297    }
298    #[doc = "Checks if the value of the field is `ENABLED`"]
299    #[inline(always)]
300    pub fn is_enabled(&self) -> bool {
301        *self == HFCLK192MSTARTED_A::ENABLED
302    }
303}
304#[doc = "Write '1' to enable interrupt for event HFCLK192MSTARTED\n\nValue on reset: 0"]
305#[derive(Clone, Copy, Debug, PartialEq)]
306pub enum HFCLK192MSTARTED_AW {
307    #[doc = "1: Enable"]
308    SET = 1,
309}
310impl From<HFCLK192MSTARTED_AW> for bool {
311    #[inline(always)]
312    fn from(variant: HFCLK192MSTARTED_AW) -> Self {
313        variant as u8 != 0
314    }
315}
316#[doc = "Field `HFCLK192MSTARTED` writer - Write '1' to enable interrupt for event HFCLK192MSTARTED"]
317pub type HFCLK192MSTARTED_W<'a, const O: u8> =
318    crate::BitWriter<'a, u32, INTENSET_SPEC, HFCLK192MSTARTED_AW, O>;
319impl<'a, const O: u8> HFCLK192MSTARTED_W<'a, O> {
320    #[doc = "Enable"]
321    #[inline(always)]
322    pub fn set(self) -> &'a mut W {
323        self.variant(HFCLK192MSTARTED_AW::SET)
324    }
325}
326impl R {
327    #[doc = "Bit 0 - Write '1' to enable interrupt for event HFCLKSTARTED"]
328    #[inline(always)]
329    pub fn hfclkstarted(&self) -> HFCLKSTARTED_R {
330        HFCLKSTARTED_R::new((self.bits & 1) != 0)
331    }
332    #[doc = "Bit 1 - Write '1' to enable interrupt for event LFCLKSTARTED"]
333    #[inline(always)]
334    pub fn lfclkstarted(&self) -> LFCLKSTARTED_R {
335        LFCLKSTARTED_R::new(((self.bits >> 1) & 1) != 0)
336    }
337    #[doc = "Bit 7 - Write '1' to enable interrupt for event DONE"]
338    #[inline(always)]
339    pub fn done(&self) -> DONE_R {
340        DONE_R::new(((self.bits >> 7) & 1) != 0)
341    }
342    #[doc = "Bit 8 - Write '1' to enable interrupt for event HFCLKAUDIOSTARTED"]
343    #[inline(always)]
344    pub fn hfclkaudiostarted(&self) -> HFCLKAUDIOSTARTED_R {
345        HFCLKAUDIOSTARTED_R::new(((self.bits >> 8) & 1) != 0)
346    }
347    #[doc = "Bit 9 - Write '1' to enable interrupt for event HFCLK192MSTARTED"]
348    #[inline(always)]
349    pub fn hfclk192mstarted(&self) -> HFCLK192MSTARTED_R {
350        HFCLK192MSTARTED_R::new(((self.bits >> 9) & 1) != 0)
351    }
352}
353impl W {
354    #[doc = "Bit 0 - Write '1' to enable interrupt for event HFCLKSTARTED"]
355    #[inline(always)]
356    pub fn hfclkstarted(&mut self) -> HFCLKSTARTED_W<0> {
357        HFCLKSTARTED_W::new(self)
358    }
359    #[doc = "Bit 1 - Write '1' to enable interrupt for event LFCLKSTARTED"]
360    #[inline(always)]
361    pub fn lfclkstarted(&mut self) -> LFCLKSTARTED_W<1> {
362        LFCLKSTARTED_W::new(self)
363    }
364    #[doc = "Bit 7 - Write '1' to enable interrupt for event DONE"]
365    #[inline(always)]
366    pub fn done(&mut self) -> DONE_W<7> {
367        DONE_W::new(self)
368    }
369    #[doc = "Bit 8 - Write '1' to enable interrupt for event HFCLKAUDIOSTARTED"]
370    #[inline(always)]
371    pub fn hfclkaudiostarted(&mut self) -> HFCLKAUDIOSTARTED_W<8> {
372        HFCLKAUDIOSTARTED_W::new(self)
373    }
374    #[doc = "Bit 9 - Write '1' to enable interrupt for event HFCLK192MSTARTED"]
375    #[inline(always)]
376    pub fn hfclk192mstarted(&mut self) -> HFCLK192MSTARTED_W<9> {
377        HFCLK192MSTARTED_W::new(self)
378    }
379    #[doc = "Writes raw bits to the register."]
380    #[inline(always)]
381    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
382        self.0.bits(bits);
383        self
384    }
385}
386#[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"]
387pub struct INTENSET_SPEC;
388impl crate::RegisterSpec for INTENSET_SPEC {
389    type Ux = u32;
390}
391#[doc = "`read()` method returns [intenset::R](R) reader structure"]
392impl crate::Readable for INTENSET_SPEC {
393    type Reader = R;
394}
395#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
396impl crate::Writable for INTENSET_SPEC {
397    type Writer = W;
398}
399#[doc = "`reset()` method sets INTENSET to value 0"]
400impl crate::Resettable for INTENSET_SPEC {
401    #[inline(always)]
402    fn reset_value() -> Self::Ux {
403        0
404    }
405}