nrf52810_pac/rtc0/
evten.rs

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