nrf52810_pac/pwm0/
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 `SEQEND0_STOP` reader - Shortcut between event SEQEND\\[0\\]
38and task STOP"]
39pub type SEQEND0_STOP_R = crate::BitReader<SEQEND0_STOP_A>;
40#[doc = "Shortcut between event SEQEND\\[0\\]
41and task STOP\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum SEQEND0_STOP_A {
44    #[doc = "0: Disable shortcut"]
45    DISABLED = 0,
46    #[doc = "1: Enable shortcut"]
47    ENABLED = 1,
48}
49impl From<SEQEND0_STOP_A> for bool {
50    #[inline(always)]
51    fn from(variant: SEQEND0_STOP_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl SEQEND0_STOP_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub fn variant(&self) -> SEQEND0_STOP_A {
59        match self.bits {
60            false => SEQEND0_STOP_A::DISABLED,
61            true => SEQEND0_STOP_A::ENABLED,
62        }
63    }
64    #[doc = "Checks if the value of the field is `DISABLED`"]
65    #[inline(always)]
66    pub fn is_disabled(&self) -> bool {
67        *self == SEQEND0_STOP_A::DISABLED
68    }
69    #[doc = "Checks if the value of the field is `ENABLED`"]
70    #[inline(always)]
71    pub fn is_enabled(&self) -> bool {
72        *self == SEQEND0_STOP_A::ENABLED
73    }
74}
75#[doc = "Field `SEQEND0_STOP` writer - Shortcut between event SEQEND\\[0\\]
76and task STOP"]
77pub type SEQEND0_STOP_W<'a, const O: u8> =
78    crate::BitWriter<'a, u32, SHORTS_SPEC, SEQEND0_STOP_A, O>;
79impl<'a, const O: u8> SEQEND0_STOP_W<'a, O> {
80    #[doc = "Disable shortcut"]
81    #[inline(always)]
82    pub fn disabled(self) -> &'a mut W {
83        self.variant(SEQEND0_STOP_A::DISABLED)
84    }
85    #[doc = "Enable shortcut"]
86    #[inline(always)]
87    pub fn enabled(self) -> &'a mut W {
88        self.variant(SEQEND0_STOP_A::ENABLED)
89    }
90}
91#[doc = "Field `SEQEND1_STOP` reader - Shortcut between event SEQEND\\[1\\]
92and task STOP"]
93pub type SEQEND1_STOP_R = crate::BitReader<SEQEND1_STOP_A>;
94#[doc = "Shortcut between event SEQEND\\[1\\]
95and task STOP\n\nValue on reset: 0"]
96#[derive(Clone, Copy, Debug, PartialEq)]
97pub enum SEQEND1_STOP_A {
98    #[doc = "0: Disable shortcut"]
99    DISABLED = 0,
100    #[doc = "1: Enable shortcut"]
101    ENABLED = 1,
102}
103impl From<SEQEND1_STOP_A> for bool {
104    #[inline(always)]
105    fn from(variant: SEQEND1_STOP_A) -> Self {
106        variant as u8 != 0
107    }
108}
109impl SEQEND1_STOP_R {
110    #[doc = "Get enumerated values variant"]
111    #[inline(always)]
112    pub fn variant(&self) -> SEQEND1_STOP_A {
113        match self.bits {
114            false => SEQEND1_STOP_A::DISABLED,
115            true => SEQEND1_STOP_A::ENABLED,
116        }
117    }
118    #[doc = "Checks if the value of the field is `DISABLED`"]
119    #[inline(always)]
120    pub fn is_disabled(&self) -> bool {
121        *self == SEQEND1_STOP_A::DISABLED
122    }
123    #[doc = "Checks if the value of the field is `ENABLED`"]
124    #[inline(always)]
125    pub fn is_enabled(&self) -> bool {
126        *self == SEQEND1_STOP_A::ENABLED
127    }
128}
129#[doc = "Field `SEQEND1_STOP` writer - Shortcut between event SEQEND\\[1\\]
130and task STOP"]
131pub type SEQEND1_STOP_W<'a, const O: u8> =
132    crate::BitWriter<'a, u32, SHORTS_SPEC, SEQEND1_STOP_A, O>;
133impl<'a, const O: u8> SEQEND1_STOP_W<'a, O> {
134    #[doc = "Disable shortcut"]
135    #[inline(always)]
136    pub fn disabled(self) -> &'a mut W {
137        self.variant(SEQEND1_STOP_A::DISABLED)
138    }
139    #[doc = "Enable shortcut"]
140    #[inline(always)]
141    pub fn enabled(self) -> &'a mut W {
142        self.variant(SEQEND1_STOP_A::ENABLED)
143    }
144}
145#[doc = "Field `LOOPSDONE_SEQSTART0` reader - Shortcut between event LOOPSDONE and task SEQSTART\\[0\\]"]
146pub type LOOPSDONE_SEQSTART0_R = crate::BitReader<LOOPSDONE_SEQSTART0_A>;
147#[doc = "Shortcut between event LOOPSDONE and task SEQSTART\\[0\\]\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq)]
149pub enum LOOPSDONE_SEQSTART0_A {
150    #[doc = "0: Disable shortcut"]
151    DISABLED = 0,
152    #[doc = "1: Enable shortcut"]
153    ENABLED = 1,
154}
155impl From<LOOPSDONE_SEQSTART0_A> for bool {
156    #[inline(always)]
157    fn from(variant: LOOPSDONE_SEQSTART0_A) -> Self {
158        variant as u8 != 0
159    }
160}
161impl LOOPSDONE_SEQSTART0_R {
162    #[doc = "Get enumerated values variant"]
163    #[inline(always)]
164    pub fn variant(&self) -> LOOPSDONE_SEQSTART0_A {
165        match self.bits {
166            false => LOOPSDONE_SEQSTART0_A::DISABLED,
167            true => LOOPSDONE_SEQSTART0_A::ENABLED,
168        }
169    }
170    #[doc = "Checks if the value of the field is `DISABLED`"]
171    #[inline(always)]
172    pub fn is_disabled(&self) -> bool {
173        *self == LOOPSDONE_SEQSTART0_A::DISABLED
174    }
175    #[doc = "Checks if the value of the field is `ENABLED`"]
176    #[inline(always)]
177    pub fn is_enabled(&self) -> bool {
178        *self == LOOPSDONE_SEQSTART0_A::ENABLED
179    }
180}
181#[doc = "Field `LOOPSDONE_SEQSTART0` writer - Shortcut between event LOOPSDONE and task SEQSTART\\[0\\]"]
182pub type LOOPSDONE_SEQSTART0_W<'a, const O: u8> =
183    crate::BitWriter<'a, u32, SHORTS_SPEC, LOOPSDONE_SEQSTART0_A, O>;
184impl<'a, const O: u8> LOOPSDONE_SEQSTART0_W<'a, O> {
185    #[doc = "Disable shortcut"]
186    #[inline(always)]
187    pub fn disabled(self) -> &'a mut W {
188        self.variant(LOOPSDONE_SEQSTART0_A::DISABLED)
189    }
190    #[doc = "Enable shortcut"]
191    #[inline(always)]
192    pub fn enabled(self) -> &'a mut W {
193        self.variant(LOOPSDONE_SEQSTART0_A::ENABLED)
194    }
195}
196#[doc = "Field `LOOPSDONE_SEQSTART1` reader - Shortcut between event LOOPSDONE and task SEQSTART\\[1\\]"]
197pub type LOOPSDONE_SEQSTART1_R = crate::BitReader<LOOPSDONE_SEQSTART1_A>;
198#[doc = "Shortcut between event LOOPSDONE and task SEQSTART\\[1\\]\n\nValue on reset: 0"]
199#[derive(Clone, Copy, Debug, PartialEq)]
200pub enum LOOPSDONE_SEQSTART1_A {
201    #[doc = "0: Disable shortcut"]
202    DISABLED = 0,
203    #[doc = "1: Enable shortcut"]
204    ENABLED = 1,
205}
206impl From<LOOPSDONE_SEQSTART1_A> for bool {
207    #[inline(always)]
208    fn from(variant: LOOPSDONE_SEQSTART1_A) -> Self {
209        variant as u8 != 0
210    }
211}
212impl LOOPSDONE_SEQSTART1_R {
213    #[doc = "Get enumerated values variant"]
214    #[inline(always)]
215    pub fn variant(&self) -> LOOPSDONE_SEQSTART1_A {
216        match self.bits {
217            false => LOOPSDONE_SEQSTART1_A::DISABLED,
218            true => LOOPSDONE_SEQSTART1_A::ENABLED,
219        }
220    }
221    #[doc = "Checks if the value of the field is `DISABLED`"]
222    #[inline(always)]
223    pub fn is_disabled(&self) -> bool {
224        *self == LOOPSDONE_SEQSTART1_A::DISABLED
225    }
226    #[doc = "Checks if the value of the field is `ENABLED`"]
227    #[inline(always)]
228    pub fn is_enabled(&self) -> bool {
229        *self == LOOPSDONE_SEQSTART1_A::ENABLED
230    }
231}
232#[doc = "Field `LOOPSDONE_SEQSTART1` writer - Shortcut between event LOOPSDONE and task SEQSTART\\[1\\]"]
233pub type LOOPSDONE_SEQSTART1_W<'a, const O: u8> =
234    crate::BitWriter<'a, u32, SHORTS_SPEC, LOOPSDONE_SEQSTART1_A, O>;
235impl<'a, const O: u8> LOOPSDONE_SEQSTART1_W<'a, O> {
236    #[doc = "Disable shortcut"]
237    #[inline(always)]
238    pub fn disabled(self) -> &'a mut W {
239        self.variant(LOOPSDONE_SEQSTART1_A::DISABLED)
240    }
241    #[doc = "Enable shortcut"]
242    #[inline(always)]
243    pub fn enabled(self) -> &'a mut W {
244        self.variant(LOOPSDONE_SEQSTART1_A::ENABLED)
245    }
246}
247#[doc = "Field `LOOPSDONE_STOP` reader - Shortcut between event LOOPSDONE and task STOP"]
248pub type LOOPSDONE_STOP_R = crate::BitReader<LOOPSDONE_STOP_A>;
249#[doc = "Shortcut between event LOOPSDONE and task STOP\n\nValue on reset: 0"]
250#[derive(Clone, Copy, Debug, PartialEq)]
251pub enum LOOPSDONE_STOP_A {
252    #[doc = "0: Disable shortcut"]
253    DISABLED = 0,
254    #[doc = "1: Enable shortcut"]
255    ENABLED = 1,
256}
257impl From<LOOPSDONE_STOP_A> for bool {
258    #[inline(always)]
259    fn from(variant: LOOPSDONE_STOP_A) -> Self {
260        variant as u8 != 0
261    }
262}
263impl LOOPSDONE_STOP_R {
264    #[doc = "Get enumerated values variant"]
265    #[inline(always)]
266    pub fn variant(&self) -> LOOPSDONE_STOP_A {
267        match self.bits {
268            false => LOOPSDONE_STOP_A::DISABLED,
269            true => LOOPSDONE_STOP_A::ENABLED,
270        }
271    }
272    #[doc = "Checks if the value of the field is `DISABLED`"]
273    #[inline(always)]
274    pub fn is_disabled(&self) -> bool {
275        *self == LOOPSDONE_STOP_A::DISABLED
276    }
277    #[doc = "Checks if the value of the field is `ENABLED`"]
278    #[inline(always)]
279    pub fn is_enabled(&self) -> bool {
280        *self == LOOPSDONE_STOP_A::ENABLED
281    }
282}
283#[doc = "Field `LOOPSDONE_STOP` writer - Shortcut between event LOOPSDONE and task STOP"]
284pub type LOOPSDONE_STOP_W<'a, const O: u8> =
285    crate::BitWriter<'a, u32, SHORTS_SPEC, LOOPSDONE_STOP_A, O>;
286impl<'a, const O: u8> LOOPSDONE_STOP_W<'a, O> {
287    #[doc = "Disable shortcut"]
288    #[inline(always)]
289    pub fn disabled(self) -> &'a mut W {
290        self.variant(LOOPSDONE_STOP_A::DISABLED)
291    }
292    #[doc = "Enable shortcut"]
293    #[inline(always)]
294    pub fn enabled(self) -> &'a mut W {
295        self.variant(LOOPSDONE_STOP_A::ENABLED)
296    }
297}
298impl R {
299    #[doc = "Bit 0 - Shortcut between event SEQEND\\[0\\]
300and task STOP"]
301    #[inline(always)]
302    pub fn seqend0_stop(&self) -> SEQEND0_STOP_R {
303        SEQEND0_STOP_R::new((self.bits & 1) != 0)
304    }
305    #[doc = "Bit 1 - Shortcut between event SEQEND\\[1\\]
306and task STOP"]
307    #[inline(always)]
308    pub fn seqend1_stop(&self) -> SEQEND1_STOP_R {
309        SEQEND1_STOP_R::new(((self.bits >> 1) & 1) != 0)
310    }
311    #[doc = "Bit 2 - Shortcut between event LOOPSDONE and task SEQSTART\\[0\\]"]
312    #[inline(always)]
313    pub fn loopsdone_seqstart0(&self) -> LOOPSDONE_SEQSTART0_R {
314        LOOPSDONE_SEQSTART0_R::new(((self.bits >> 2) & 1) != 0)
315    }
316    #[doc = "Bit 3 - Shortcut between event LOOPSDONE and task SEQSTART\\[1\\]"]
317    #[inline(always)]
318    pub fn loopsdone_seqstart1(&self) -> LOOPSDONE_SEQSTART1_R {
319        LOOPSDONE_SEQSTART1_R::new(((self.bits >> 3) & 1) != 0)
320    }
321    #[doc = "Bit 4 - Shortcut between event LOOPSDONE and task STOP"]
322    #[inline(always)]
323    pub fn loopsdone_stop(&self) -> LOOPSDONE_STOP_R {
324        LOOPSDONE_STOP_R::new(((self.bits >> 4) & 1) != 0)
325    }
326}
327impl W {
328    #[doc = "Bit 0 - Shortcut between event SEQEND\\[0\\]
329and task STOP"]
330    #[inline(always)]
331    pub fn seqend0_stop(&mut self) -> SEQEND0_STOP_W<0> {
332        SEQEND0_STOP_W::new(self)
333    }
334    #[doc = "Bit 1 - Shortcut between event SEQEND\\[1\\]
335and task STOP"]
336    #[inline(always)]
337    pub fn seqend1_stop(&mut self) -> SEQEND1_STOP_W<1> {
338        SEQEND1_STOP_W::new(self)
339    }
340    #[doc = "Bit 2 - Shortcut between event LOOPSDONE and task SEQSTART\\[0\\]"]
341    #[inline(always)]
342    pub fn loopsdone_seqstart0(&mut self) -> LOOPSDONE_SEQSTART0_W<2> {
343        LOOPSDONE_SEQSTART0_W::new(self)
344    }
345    #[doc = "Bit 3 - Shortcut between event LOOPSDONE and task SEQSTART\\[1\\]"]
346    #[inline(always)]
347    pub fn loopsdone_seqstart1(&mut self) -> LOOPSDONE_SEQSTART1_W<3> {
348        LOOPSDONE_SEQSTART1_W::new(self)
349    }
350    #[doc = "Bit 4 - Shortcut between event LOOPSDONE and task STOP"]
351    #[inline(always)]
352    pub fn loopsdone_stop(&mut self) -> LOOPSDONE_STOP_W<4> {
353        LOOPSDONE_STOP_W::new(self)
354    }
355    #[doc = "Writes raw bits to the register."]
356    #[inline(always)]
357    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
358        self.0.bits(bits);
359        self
360    }
361}
362#[doc = "Shortcuts between local events and tasks\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"]
363pub struct SHORTS_SPEC;
364impl crate::RegisterSpec for SHORTS_SPEC {
365    type Ux = u32;
366}
367#[doc = "`read()` method returns [shorts::R](R) reader structure"]
368impl crate::Readable for SHORTS_SPEC {
369    type Reader = R;
370}
371#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
372impl crate::Writable for SHORTS_SPEC {
373    type Writer = W;
374}
375#[doc = "`reset()` method sets SHORTS to value 0"]
376impl crate::Resettable for SHORTS_SPEC {
377    #[inline(always)]
378    fn reset_value() -> Self::Ux {
379        0
380    }
381}