nrf52840_pac/qdec/
shorts.rs

1#[doc = "Register `SHORTS` reader"]
2pub struct R(crate::R<SHORTS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SHORTS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SHORTS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SHORTS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SHORTS` writer"]
17pub struct W(crate::W<SHORTS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SHORTS_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<SHORTS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SHORTS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `REPORTRDY_READCLRACC` reader - Shortcut between REPORTRDY event and READCLRACC task"]
38pub type REPORTRDY_READCLRACC_R = crate::BitReader<REPORTRDY_READCLRACC_A>;
39#[doc = "Shortcut between REPORTRDY event and READCLRACC task\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum REPORTRDY_READCLRACC_A {
42    #[doc = "0: Disable shortcut"]
43    DISABLED = 0,
44    #[doc = "1: Enable shortcut"]
45    ENABLED = 1,
46}
47impl From<REPORTRDY_READCLRACC_A> for bool {
48    #[inline(always)]
49    fn from(variant: REPORTRDY_READCLRACC_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl REPORTRDY_READCLRACC_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> REPORTRDY_READCLRACC_A {
57        match self.bits {
58            false => REPORTRDY_READCLRACC_A::DISABLED,
59            true => REPORTRDY_READCLRACC_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 == REPORTRDY_READCLRACC_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 == REPORTRDY_READCLRACC_A::ENABLED
71    }
72}
73#[doc = "Field `REPORTRDY_READCLRACC` writer - Shortcut between REPORTRDY event and READCLRACC task"]
74pub type REPORTRDY_READCLRACC_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, SHORTS_SPEC, REPORTRDY_READCLRACC_A, O>;
76impl<'a, const O: u8> REPORTRDY_READCLRACC_W<'a, O> {
77    #[doc = "Disable shortcut"]
78    #[inline(always)]
79    pub fn disabled(self) -> &'a mut W {
80        self.variant(REPORTRDY_READCLRACC_A::DISABLED)
81    }
82    #[doc = "Enable shortcut"]
83    #[inline(always)]
84    pub fn enabled(self) -> &'a mut W {
85        self.variant(REPORTRDY_READCLRACC_A::ENABLED)
86    }
87}
88#[doc = "Field `SAMPLERDY_STOP` reader - Shortcut between SAMPLERDY event and STOP task"]
89pub type SAMPLERDY_STOP_R = crate::BitReader<SAMPLERDY_STOP_A>;
90#[doc = "Shortcut between SAMPLERDY event and STOP task\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum SAMPLERDY_STOP_A {
93    #[doc = "0: Disable shortcut"]
94    DISABLED = 0,
95    #[doc = "1: Enable shortcut"]
96    ENABLED = 1,
97}
98impl From<SAMPLERDY_STOP_A> for bool {
99    #[inline(always)]
100    fn from(variant: SAMPLERDY_STOP_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl SAMPLERDY_STOP_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> SAMPLERDY_STOP_A {
108        match self.bits {
109            false => SAMPLERDY_STOP_A::DISABLED,
110            true => SAMPLERDY_STOP_A::ENABLED,
111        }
112    }
113    #[doc = "Checks if the value of the field is `DISABLED`"]
114    #[inline(always)]
115    pub fn is_disabled(&self) -> bool {
116        *self == SAMPLERDY_STOP_A::DISABLED
117    }
118    #[doc = "Checks if the value of the field is `ENABLED`"]
119    #[inline(always)]
120    pub fn is_enabled(&self) -> bool {
121        *self == SAMPLERDY_STOP_A::ENABLED
122    }
123}
124#[doc = "Field `SAMPLERDY_STOP` writer - Shortcut between SAMPLERDY event and STOP task"]
125pub type SAMPLERDY_STOP_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, SHORTS_SPEC, SAMPLERDY_STOP_A, O>;
127impl<'a, const O: u8> SAMPLERDY_STOP_W<'a, O> {
128    #[doc = "Disable shortcut"]
129    #[inline(always)]
130    pub fn disabled(self) -> &'a mut W {
131        self.variant(SAMPLERDY_STOP_A::DISABLED)
132    }
133    #[doc = "Enable shortcut"]
134    #[inline(always)]
135    pub fn enabled(self) -> &'a mut W {
136        self.variant(SAMPLERDY_STOP_A::ENABLED)
137    }
138}
139#[doc = "Field `REPORTRDY_RDCLRACC` reader - Shortcut between REPORTRDY event and RDCLRACC task"]
140pub type REPORTRDY_RDCLRACC_R = crate::BitReader<REPORTRDY_RDCLRACC_A>;
141#[doc = "Shortcut between REPORTRDY event and RDCLRACC task\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143pub enum REPORTRDY_RDCLRACC_A {
144    #[doc = "0: Disable shortcut"]
145    DISABLED = 0,
146    #[doc = "1: Enable shortcut"]
147    ENABLED = 1,
148}
149impl From<REPORTRDY_RDCLRACC_A> for bool {
150    #[inline(always)]
151    fn from(variant: REPORTRDY_RDCLRACC_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl REPORTRDY_RDCLRACC_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> REPORTRDY_RDCLRACC_A {
159        match self.bits {
160            false => REPORTRDY_RDCLRACC_A::DISABLED,
161            true => REPORTRDY_RDCLRACC_A::ENABLED,
162        }
163    }
164    #[doc = "Checks if the value of the field is `DISABLED`"]
165    #[inline(always)]
166    pub fn is_disabled(&self) -> bool {
167        *self == REPORTRDY_RDCLRACC_A::DISABLED
168    }
169    #[doc = "Checks if the value of the field is `ENABLED`"]
170    #[inline(always)]
171    pub fn is_enabled(&self) -> bool {
172        *self == REPORTRDY_RDCLRACC_A::ENABLED
173    }
174}
175#[doc = "Field `REPORTRDY_RDCLRACC` writer - Shortcut between REPORTRDY event and RDCLRACC task"]
176pub type REPORTRDY_RDCLRACC_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, SHORTS_SPEC, REPORTRDY_RDCLRACC_A, O>;
178impl<'a, const O: u8> REPORTRDY_RDCLRACC_W<'a, O> {
179    #[doc = "Disable shortcut"]
180    #[inline(always)]
181    pub fn disabled(self) -> &'a mut W {
182        self.variant(REPORTRDY_RDCLRACC_A::DISABLED)
183    }
184    #[doc = "Enable shortcut"]
185    #[inline(always)]
186    pub fn enabled(self) -> &'a mut W {
187        self.variant(REPORTRDY_RDCLRACC_A::ENABLED)
188    }
189}
190#[doc = "Field `REPORTRDY_STOP` reader - Shortcut between REPORTRDY event and STOP task"]
191pub type REPORTRDY_STOP_R = crate::BitReader<REPORTRDY_STOP_A>;
192#[doc = "Shortcut between REPORTRDY event and STOP task\n\nValue on reset: 0"]
193#[derive(Clone, Copy, Debug, PartialEq)]
194pub enum REPORTRDY_STOP_A {
195    #[doc = "0: Disable shortcut"]
196    DISABLED = 0,
197    #[doc = "1: Enable shortcut"]
198    ENABLED = 1,
199}
200impl From<REPORTRDY_STOP_A> for bool {
201    #[inline(always)]
202    fn from(variant: REPORTRDY_STOP_A) -> Self {
203        variant as u8 != 0
204    }
205}
206impl REPORTRDY_STOP_R {
207    #[doc = "Get enumerated values variant"]
208    #[inline(always)]
209    pub fn variant(&self) -> REPORTRDY_STOP_A {
210        match self.bits {
211            false => REPORTRDY_STOP_A::DISABLED,
212            true => REPORTRDY_STOP_A::ENABLED,
213        }
214    }
215    #[doc = "Checks if the value of the field is `DISABLED`"]
216    #[inline(always)]
217    pub fn is_disabled(&self) -> bool {
218        *self == REPORTRDY_STOP_A::DISABLED
219    }
220    #[doc = "Checks if the value of the field is `ENABLED`"]
221    #[inline(always)]
222    pub fn is_enabled(&self) -> bool {
223        *self == REPORTRDY_STOP_A::ENABLED
224    }
225}
226#[doc = "Field `REPORTRDY_STOP` writer - Shortcut between REPORTRDY event and STOP task"]
227pub type REPORTRDY_STOP_W<'a, const O: u8> =
228    crate::BitWriter<'a, u32, SHORTS_SPEC, REPORTRDY_STOP_A, O>;
229impl<'a, const O: u8> REPORTRDY_STOP_W<'a, O> {
230    #[doc = "Disable shortcut"]
231    #[inline(always)]
232    pub fn disabled(self) -> &'a mut W {
233        self.variant(REPORTRDY_STOP_A::DISABLED)
234    }
235    #[doc = "Enable shortcut"]
236    #[inline(always)]
237    pub fn enabled(self) -> &'a mut W {
238        self.variant(REPORTRDY_STOP_A::ENABLED)
239    }
240}
241#[doc = "Field `DBLRDY_RDCLRDBL` reader - Shortcut between DBLRDY event and RDCLRDBL task"]
242pub type DBLRDY_RDCLRDBL_R = crate::BitReader<DBLRDY_RDCLRDBL_A>;
243#[doc = "Shortcut between DBLRDY event and RDCLRDBL task\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq)]
245pub enum DBLRDY_RDCLRDBL_A {
246    #[doc = "0: Disable shortcut"]
247    DISABLED = 0,
248    #[doc = "1: Enable shortcut"]
249    ENABLED = 1,
250}
251impl From<DBLRDY_RDCLRDBL_A> for bool {
252    #[inline(always)]
253    fn from(variant: DBLRDY_RDCLRDBL_A) -> Self {
254        variant as u8 != 0
255    }
256}
257impl DBLRDY_RDCLRDBL_R {
258    #[doc = "Get enumerated values variant"]
259    #[inline(always)]
260    pub fn variant(&self) -> DBLRDY_RDCLRDBL_A {
261        match self.bits {
262            false => DBLRDY_RDCLRDBL_A::DISABLED,
263            true => DBLRDY_RDCLRDBL_A::ENABLED,
264        }
265    }
266    #[doc = "Checks if the value of the field is `DISABLED`"]
267    #[inline(always)]
268    pub fn is_disabled(&self) -> bool {
269        *self == DBLRDY_RDCLRDBL_A::DISABLED
270    }
271    #[doc = "Checks if the value of the field is `ENABLED`"]
272    #[inline(always)]
273    pub fn is_enabled(&self) -> bool {
274        *self == DBLRDY_RDCLRDBL_A::ENABLED
275    }
276}
277#[doc = "Field `DBLRDY_RDCLRDBL` writer - Shortcut between DBLRDY event and RDCLRDBL task"]
278pub type DBLRDY_RDCLRDBL_W<'a, const O: u8> =
279    crate::BitWriter<'a, u32, SHORTS_SPEC, DBLRDY_RDCLRDBL_A, O>;
280impl<'a, const O: u8> DBLRDY_RDCLRDBL_W<'a, O> {
281    #[doc = "Disable shortcut"]
282    #[inline(always)]
283    pub fn disabled(self) -> &'a mut W {
284        self.variant(DBLRDY_RDCLRDBL_A::DISABLED)
285    }
286    #[doc = "Enable shortcut"]
287    #[inline(always)]
288    pub fn enabled(self) -> &'a mut W {
289        self.variant(DBLRDY_RDCLRDBL_A::ENABLED)
290    }
291}
292#[doc = "Field `DBLRDY_STOP` reader - Shortcut between DBLRDY event and STOP task"]
293pub type DBLRDY_STOP_R = crate::BitReader<DBLRDY_STOP_A>;
294#[doc = "Shortcut between DBLRDY event and STOP task\n\nValue on reset: 0"]
295#[derive(Clone, Copy, Debug, PartialEq)]
296pub enum DBLRDY_STOP_A {
297    #[doc = "0: Disable shortcut"]
298    DISABLED = 0,
299    #[doc = "1: Enable shortcut"]
300    ENABLED = 1,
301}
302impl From<DBLRDY_STOP_A> for bool {
303    #[inline(always)]
304    fn from(variant: DBLRDY_STOP_A) -> Self {
305        variant as u8 != 0
306    }
307}
308impl DBLRDY_STOP_R {
309    #[doc = "Get enumerated values variant"]
310    #[inline(always)]
311    pub fn variant(&self) -> DBLRDY_STOP_A {
312        match self.bits {
313            false => DBLRDY_STOP_A::DISABLED,
314            true => DBLRDY_STOP_A::ENABLED,
315        }
316    }
317    #[doc = "Checks if the value of the field is `DISABLED`"]
318    #[inline(always)]
319    pub fn is_disabled(&self) -> bool {
320        *self == DBLRDY_STOP_A::DISABLED
321    }
322    #[doc = "Checks if the value of the field is `ENABLED`"]
323    #[inline(always)]
324    pub fn is_enabled(&self) -> bool {
325        *self == DBLRDY_STOP_A::ENABLED
326    }
327}
328#[doc = "Field `DBLRDY_STOP` writer - Shortcut between DBLRDY event and STOP task"]
329pub type DBLRDY_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, DBLRDY_STOP_A, O>;
330impl<'a, const O: u8> DBLRDY_STOP_W<'a, O> {
331    #[doc = "Disable shortcut"]
332    #[inline(always)]
333    pub fn disabled(self) -> &'a mut W {
334        self.variant(DBLRDY_STOP_A::DISABLED)
335    }
336    #[doc = "Enable shortcut"]
337    #[inline(always)]
338    pub fn enabled(self) -> &'a mut W {
339        self.variant(DBLRDY_STOP_A::ENABLED)
340    }
341}
342#[doc = "Field `SAMPLERDY_READCLRACC` reader - Shortcut between SAMPLERDY event and READCLRACC task"]
343pub type SAMPLERDY_READCLRACC_R = crate::BitReader<SAMPLERDY_READCLRACC_A>;
344#[doc = "Shortcut between SAMPLERDY event and READCLRACC task\n\nValue on reset: 0"]
345#[derive(Clone, Copy, Debug, PartialEq)]
346pub enum SAMPLERDY_READCLRACC_A {
347    #[doc = "0: Disable shortcut"]
348    DISABLED = 0,
349    #[doc = "1: Enable shortcut"]
350    ENABLED = 1,
351}
352impl From<SAMPLERDY_READCLRACC_A> for bool {
353    #[inline(always)]
354    fn from(variant: SAMPLERDY_READCLRACC_A) -> Self {
355        variant as u8 != 0
356    }
357}
358impl SAMPLERDY_READCLRACC_R {
359    #[doc = "Get enumerated values variant"]
360    #[inline(always)]
361    pub fn variant(&self) -> SAMPLERDY_READCLRACC_A {
362        match self.bits {
363            false => SAMPLERDY_READCLRACC_A::DISABLED,
364            true => SAMPLERDY_READCLRACC_A::ENABLED,
365        }
366    }
367    #[doc = "Checks if the value of the field is `DISABLED`"]
368    #[inline(always)]
369    pub fn is_disabled(&self) -> bool {
370        *self == SAMPLERDY_READCLRACC_A::DISABLED
371    }
372    #[doc = "Checks if the value of the field is `ENABLED`"]
373    #[inline(always)]
374    pub fn is_enabled(&self) -> bool {
375        *self == SAMPLERDY_READCLRACC_A::ENABLED
376    }
377}
378#[doc = "Field `SAMPLERDY_READCLRACC` writer - Shortcut between SAMPLERDY event and READCLRACC task"]
379pub type SAMPLERDY_READCLRACC_W<'a, const O: u8> =
380    crate::BitWriter<'a, u32, SHORTS_SPEC, SAMPLERDY_READCLRACC_A, O>;
381impl<'a, const O: u8> SAMPLERDY_READCLRACC_W<'a, O> {
382    #[doc = "Disable shortcut"]
383    #[inline(always)]
384    pub fn disabled(self) -> &'a mut W {
385        self.variant(SAMPLERDY_READCLRACC_A::DISABLED)
386    }
387    #[doc = "Enable shortcut"]
388    #[inline(always)]
389    pub fn enabled(self) -> &'a mut W {
390        self.variant(SAMPLERDY_READCLRACC_A::ENABLED)
391    }
392}
393impl R {
394    #[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task"]
395    #[inline(always)]
396    pub fn reportrdy_readclracc(&self) -> REPORTRDY_READCLRACC_R {
397        REPORTRDY_READCLRACC_R::new((self.bits & 1) != 0)
398    }
399    #[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task"]
400    #[inline(always)]
401    pub fn samplerdy_stop(&self) -> SAMPLERDY_STOP_R {
402        SAMPLERDY_STOP_R::new(((self.bits >> 1) & 1) != 0)
403    }
404    #[doc = "Bit 2 - Shortcut between REPORTRDY event and RDCLRACC task"]
405    #[inline(always)]
406    pub fn reportrdy_rdclracc(&self) -> REPORTRDY_RDCLRACC_R {
407        REPORTRDY_RDCLRACC_R::new(((self.bits >> 2) & 1) != 0)
408    }
409    #[doc = "Bit 3 - Shortcut between REPORTRDY event and STOP task"]
410    #[inline(always)]
411    pub fn reportrdy_stop(&self) -> REPORTRDY_STOP_R {
412        REPORTRDY_STOP_R::new(((self.bits >> 3) & 1) != 0)
413    }
414    #[doc = "Bit 4 - Shortcut between DBLRDY event and RDCLRDBL task"]
415    #[inline(always)]
416    pub fn dblrdy_rdclrdbl(&self) -> DBLRDY_RDCLRDBL_R {
417        DBLRDY_RDCLRDBL_R::new(((self.bits >> 4) & 1) != 0)
418    }
419    #[doc = "Bit 5 - Shortcut between DBLRDY event and STOP task"]
420    #[inline(always)]
421    pub fn dblrdy_stop(&self) -> DBLRDY_STOP_R {
422        DBLRDY_STOP_R::new(((self.bits >> 5) & 1) != 0)
423    }
424    #[doc = "Bit 6 - Shortcut between SAMPLERDY event and READCLRACC task"]
425    #[inline(always)]
426    pub fn samplerdy_readclracc(&self) -> SAMPLERDY_READCLRACC_R {
427        SAMPLERDY_READCLRACC_R::new(((self.bits >> 6) & 1) != 0)
428    }
429}
430impl W {
431    #[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task"]
432    #[inline(always)]
433    pub fn reportrdy_readclracc(&mut self) -> REPORTRDY_READCLRACC_W<0> {
434        REPORTRDY_READCLRACC_W::new(self)
435    }
436    #[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task"]
437    #[inline(always)]
438    pub fn samplerdy_stop(&mut self) -> SAMPLERDY_STOP_W<1> {
439        SAMPLERDY_STOP_W::new(self)
440    }
441    #[doc = "Bit 2 - Shortcut between REPORTRDY event and RDCLRACC task"]
442    #[inline(always)]
443    pub fn reportrdy_rdclracc(&mut self) -> REPORTRDY_RDCLRACC_W<2> {
444        REPORTRDY_RDCLRACC_W::new(self)
445    }
446    #[doc = "Bit 3 - Shortcut between REPORTRDY event and STOP task"]
447    #[inline(always)]
448    pub fn reportrdy_stop(&mut self) -> REPORTRDY_STOP_W<3> {
449        REPORTRDY_STOP_W::new(self)
450    }
451    #[doc = "Bit 4 - Shortcut between DBLRDY event and RDCLRDBL task"]
452    #[inline(always)]
453    pub fn dblrdy_rdclrdbl(&mut self) -> DBLRDY_RDCLRDBL_W<4> {
454        DBLRDY_RDCLRDBL_W::new(self)
455    }
456    #[doc = "Bit 5 - Shortcut between DBLRDY event and STOP task"]
457    #[inline(always)]
458    pub fn dblrdy_stop(&mut self) -> DBLRDY_STOP_W<5> {
459        DBLRDY_STOP_W::new(self)
460    }
461    #[doc = "Bit 6 - Shortcut between SAMPLERDY event and READCLRACC task"]
462    #[inline(always)]
463    pub fn samplerdy_readclracc(&mut self) -> SAMPLERDY_READCLRACC_W<6> {
464        SAMPLERDY_READCLRACC_W::new(self)
465    }
466    #[doc = "Writes raw bits to the register."]
467    #[inline(always)]
468    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
469        self.0.bits(bits);
470        self
471    }
472}
473#[doc = "Shortcut register\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 [shorts](index.html) module"]
474pub struct SHORTS_SPEC;
475impl crate::RegisterSpec for SHORTS_SPEC {
476    type Ux = u32;
477}
478#[doc = "`read()` method returns [shorts::R](R) reader structure"]
479impl crate::Readable for SHORTS_SPEC {
480    type Reader = R;
481}
482#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
483impl crate::Writable for SHORTS_SPEC {
484    type Writer = W;
485}
486#[doc = "`reset()` method sets SHORTS to value 0"]
487impl crate::Resettable for SHORTS_SPEC {
488    #[inline(always)]
489    fn reset_value() -> Self::Ux {
490        0
491    }
492}