nrf5340_app_pac/usbd_ns/
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 `EP0DATADONE_STARTEPIN0` reader - Shortcut between event EP0DATADONE and task STARTEPIN\\[0\\]"]
38pub type EP0DATADONE_STARTEPIN0_R = crate::BitReader<EP0DATADONE_STARTEPIN0_A>;
39#[doc = "Shortcut between event EP0DATADONE and task STARTEPIN\\[0\\]\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum EP0DATADONE_STARTEPIN0_A {
42    #[doc = "0: Disable shortcut"]
43    DISABLED = 0,
44    #[doc = "1: Enable shortcut"]
45    ENABLED = 1,
46}
47impl From<EP0DATADONE_STARTEPIN0_A> for bool {
48    #[inline(always)]
49    fn from(variant: EP0DATADONE_STARTEPIN0_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl EP0DATADONE_STARTEPIN0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> EP0DATADONE_STARTEPIN0_A {
57        match self.bits {
58            false => EP0DATADONE_STARTEPIN0_A::DISABLED,
59            true => EP0DATADONE_STARTEPIN0_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 == EP0DATADONE_STARTEPIN0_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 == EP0DATADONE_STARTEPIN0_A::ENABLED
71    }
72}
73#[doc = "Field `EP0DATADONE_STARTEPIN0` writer - Shortcut between event EP0DATADONE and task STARTEPIN\\[0\\]"]
74pub type EP0DATADONE_STARTEPIN0_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, SHORTS_SPEC, EP0DATADONE_STARTEPIN0_A, O>;
76impl<'a, const O: u8> EP0DATADONE_STARTEPIN0_W<'a, O> {
77    #[doc = "Disable shortcut"]
78    #[inline(always)]
79    pub fn disabled(self) -> &'a mut W {
80        self.variant(EP0DATADONE_STARTEPIN0_A::DISABLED)
81    }
82    #[doc = "Enable shortcut"]
83    #[inline(always)]
84    pub fn enabled(self) -> &'a mut W {
85        self.variant(EP0DATADONE_STARTEPIN0_A::ENABLED)
86    }
87}
88#[doc = "Field `EP0DATADONE_STARTEPOUT0` reader - Shortcut between event EP0DATADONE and task STARTEPOUT\\[0\\]"]
89pub type EP0DATADONE_STARTEPOUT0_R = crate::BitReader<EP0DATADONE_STARTEPOUT0_A>;
90#[doc = "Shortcut between event EP0DATADONE and task STARTEPOUT\\[0\\]\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum EP0DATADONE_STARTEPOUT0_A {
93    #[doc = "0: Disable shortcut"]
94    DISABLED = 0,
95    #[doc = "1: Enable shortcut"]
96    ENABLED = 1,
97}
98impl From<EP0DATADONE_STARTEPOUT0_A> for bool {
99    #[inline(always)]
100    fn from(variant: EP0DATADONE_STARTEPOUT0_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl EP0DATADONE_STARTEPOUT0_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> EP0DATADONE_STARTEPOUT0_A {
108        match self.bits {
109            false => EP0DATADONE_STARTEPOUT0_A::DISABLED,
110            true => EP0DATADONE_STARTEPOUT0_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 == EP0DATADONE_STARTEPOUT0_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 == EP0DATADONE_STARTEPOUT0_A::ENABLED
122    }
123}
124#[doc = "Field `EP0DATADONE_STARTEPOUT0` writer - Shortcut between event EP0DATADONE and task STARTEPOUT\\[0\\]"]
125pub type EP0DATADONE_STARTEPOUT0_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, SHORTS_SPEC, EP0DATADONE_STARTEPOUT0_A, O>;
127impl<'a, const O: u8> EP0DATADONE_STARTEPOUT0_W<'a, O> {
128    #[doc = "Disable shortcut"]
129    #[inline(always)]
130    pub fn disabled(self) -> &'a mut W {
131        self.variant(EP0DATADONE_STARTEPOUT0_A::DISABLED)
132    }
133    #[doc = "Enable shortcut"]
134    #[inline(always)]
135    pub fn enabled(self) -> &'a mut W {
136        self.variant(EP0DATADONE_STARTEPOUT0_A::ENABLED)
137    }
138}
139#[doc = "Field `EP0DATADONE_EP0STATUS` reader - Shortcut between event EP0DATADONE and task EP0STATUS"]
140pub type EP0DATADONE_EP0STATUS_R = crate::BitReader<EP0DATADONE_EP0STATUS_A>;
141#[doc = "Shortcut between event EP0DATADONE and task EP0STATUS\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143pub enum EP0DATADONE_EP0STATUS_A {
144    #[doc = "0: Disable shortcut"]
145    DISABLED = 0,
146    #[doc = "1: Enable shortcut"]
147    ENABLED = 1,
148}
149impl From<EP0DATADONE_EP0STATUS_A> for bool {
150    #[inline(always)]
151    fn from(variant: EP0DATADONE_EP0STATUS_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl EP0DATADONE_EP0STATUS_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> EP0DATADONE_EP0STATUS_A {
159        match self.bits {
160            false => EP0DATADONE_EP0STATUS_A::DISABLED,
161            true => EP0DATADONE_EP0STATUS_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 == EP0DATADONE_EP0STATUS_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 == EP0DATADONE_EP0STATUS_A::ENABLED
173    }
174}
175#[doc = "Field `EP0DATADONE_EP0STATUS` writer - Shortcut between event EP0DATADONE and task EP0STATUS"]
176pub type EP0DATADONE_EP0STATUS_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, SHORTS_SPEC, EP0DATADONE_EP0STATUS_A, O>;
178impl<'a, const O: u8> EP0DATADONE_EP0STATUS_W<'a, O> {
179    #[doc = "Disable shortcut"]
180    #[inline(always)]
181    pub fn disabled(self) -> &'a mut W {
182        self.variant(EP0DATADONE_EP0STATUS_A::DISABLED)
183    }
184    #[doc = "Enable shortcut"]
185    #[inline(always)]
186    pub fn enabled(self) -> &'a mut W {
187        self.variant(EP0DATADONE_EP0STATUS_A::ENABLED)
188    }
189}
190#[doc = "Field `ENDEPOUT0_EP0STATUS` reader - Shortcut between event ENDEPOUT\\[0\\]
191and task EP0STATUS"]
192pub type ENDEPOUT0_EP0STATUS_R = crate::BitReader<ENDEPOUT0_EP0STATUS_A>;
193#[doc = "Shortcut between event ENDEPOUT\\[0\\]
194and task EP0STATUS\n\nValue on reset: 0"]
195#[derive(Clone, Copy, Debug, PartialEq)]
196pub enum ENDEPOUT0_EP0STATUS_A {
197    #[doc = "0: Disable shortcut"]
198    DISABLED = 0,
199    #[doc = "1: Enable shortcut"]
200    ENABLED = 1,
201}
202impl From<ENDEPOUT0_EP0STATUS_A> for bool {
203    #[inline(always)]
204    fn from(variant: ENDEPOUT0_EP0STATUS_A) -> Self {
205        variant as u8 != 0
206    }
207}
208impl ENDEPOUT0_EP0STATUS_R {
209    #[doc = "Get enumerated values variant"]
210    #[inline(always)]
211    pub fn variant(&self) -> ENDEPOUT0_EP0STATUS_A {
212        match self.bits {
213            false => ENDEPOUT0_EP0STATUS_A::DISABLED,
214            true => ENDEPOUT0_EP0STATUS_A::ENABLED,
215        }
216    }
217    #[doc = "Checks if the value of the field is `DISABLED`"]
218    #[inline(always)]
219    pub fn is_disabled(&self) -> bool {
220        *self == ENDEPOUT0_EP0STATUS_A::DISABLED
221    }
222    #[doc = "Checks if the value of the field is `ENABLED`"]
223    #[inline(always)]
224    pub fn is_enabled(&self) -> bool {
225        *self == ENDEPOUT0_EP0STATUS_A::ENABLED
226    }
227}
228#[doc = "Field `ENDEPOUT0_EP0STATUS` writer - Shortcut between event ENDEPOUT\\[0\\]
229and task EP0STATUS"]
230pub type ENDEPOUT0_EP0STATUS_W<'a, const O: u8> =
231    crate::BitWriter<'a, u32, SHORTS_SPEC, ENDEPOUT0_EP0STATUS_A, O>;
232impl<'a, const O: u8> ENDEPOUT0_EP0STATUS_W<'a, O> {
233    #[doc = "Disable shortcut"]
234    #[inline(always)]
235    pub fn disabled(self) -> &'a mut W {
236        self.variant(ENDEPOUT0_EP0STATUS_A::DISABLED)
237    }
238    #[doc = "Enable shortcut"]
239    #[inline(always)]
240    pub fn enabled(self) -> &'a mut W {
241        self.variant(ENDEPOUT0_EP0STATUS_A::ENABLED)
242    }
243}
244#[doc = "Field `ENDEPOUT0_EP0RCVOUT` reader - Shortcut between event ENDEPOUT\\[0\\]
245and task EP0RCVOUT"]
246pub type ENDEPOUT0_EP0RCVOUT_R = crate::BitReader<ENDEPOUT0_EP0RCVOUT_A>;
247#[doc = "Shortcut between event ENDEPOUT\\[0\\]
248and task EP0RCVOUT\n\nValue on reset: 0"]
249#[derive(Clone, Copy, Debug, PartialEq)]
250pub enum ENDEPOUT0_EP0RCVOUT_A {
251    #[doc = "0: Disable shortcut"]
252    DISABLED = 0,
253    #[doc = "1: Enable shortcut"]
254    ENABLED = 1,
255}
256impl From<ENDEPOUT0_EP0RCVOUT_A> for bool {
257    #[inline(always)]
258    fn from(variant: ENDEPOUT0_EP0RCVOUT_A) -> Self {
259        variant as u8 != 0
260    }
261}
262impl ENDEPOUT0_EP0RCVOUT_R {
263    #[doc = "Get enumerated values variant"]
264    #[inline(always)]
265    pub fn variant(&self) -> ENDEPOUT0_EP0RCVOUT_A {
266        match self.bits {
267            false => ENDEPOUT0_EP0RCVOUT_A::DISABLED,
268            true => ENDEPOUT0_EP0RCVOUT_A::ENABLED,
269        }
270    }
271    #[doc = "Checks if the value of the field is `DISABLED`"]
272    #[inline(always)]
273    pub fn is_disabled(&self) -> bool {
274        *self == ENDEPOUT0_EP0RCVOUT_A::DISABLED
275    }
276    #[doc = "Checks if the value of the field is `ENABLED`"]
277    #[inline(always)]
278    pub fn is_enabled(&self) -> bool {
279        *self == ENDEPOUT0_EP0RCVOUT_A::ENABLED
280    }
281}
282#[doc = "Field `ENDEPOUT0_EP0RCVOUT` writer - Shortcut between event ENDEPOUT\\[0\\]
283and task EP0RCVOUT"]
284pub type ENDEPOUT0_EP0RCVOUT_W<'a, const O: u8> =
285    crate::BitWriter<'a, u32, SHORTS_SPEC, ENDEPOUT0_EP0RCVOUT_A, O>;
286impl<'a, const O: u8> ENDEPOUT0_EP0RCVOUT_W<'a, O> {
287    #[doc = "Disable shortcut"]
288    #[inline(always)]
289    pub fn disabled(self) -> &'a mut W {
290        self.variant(ENDEPOUT0_EP0RCVOUT_A::DISABLED)
291    }
292    #[doc = "Enable shortcut"]
293    #[inline(always)]
294    pub fn enabled(self) -> &'a mut W {
295        self.variant(ENDEPOUT0_EP0RCVOUT_A::ENABLED)
296    }
297}
298impl R {
299    #[doc = "Bit 0 - Shortcut between event EP0DATADONE and task STARTEPIN\\[0\\]"]
300    #[inline(always)]
301    pub fn ep0datadone_startepin0(&self) -> EP0DATADONE_STARTEPIN0_R {
302        EP0DATADONE_STARTEPIN0_R::new((self.bits & 1) != 0)
303    }
304    #[doc = "Bit 1 - Shortcut between event EP0DATADONE and task STARTEPOUT\\[0\\]"]
305    #[inline(always)]
306    pub fn ep0datadone_startepout0(&self) -> EP0DATADONE_STARTEPOUT0_R {
307        EP0DATADONE_STARTEPOUT0_R::new(((self.bits >> 1) & 1) != 0)
308    }
309    #[doc = "Bit 2 - Shortcut between event EP0DATADONE and task EP0STATUS"]
310    #[inline(always)]
311    pub fn ep0datadone_ep0status(&self) -> EP0DATADONE_EP0STATUS_R {
312        EP0DATADONE_EP0STATUS_R::new(((self.bits >> 2) & 1) != 0)
313    }
314    #[doc = "Bit 3 - Shortcut between event ENDEPOUT\\[0\\]
315and task EP0STATUS"]
316    #[inline(always)]
317    pub fn endepout0_ep0status(&self) -> ENDEPOUT0_EP0STATUS_R {
318        ENDEPOUT0_EP0STATUS_R::new(((self.bits >> 3) & 1) != 0)
319    }
320    #[doc = "Bit 4 - Shortcut between event ENDEPOUT\\[0\\]
321and task EP0RCVOUT"]
322    #[inline(always)]
323    pub fn endepout0_ep0rcvout(&self) -> ENDEPOUT0_EP0RCVOUT_R {
324        ENDEPOUT0_EP0RCVOUT_R::new(((self.bits >> 4) & 1) != 0)
325    }
326}
327impl W {
328    #[doc = "Bit 0 - Shortcut between event EP0DATADONE and task STARTEPIN\\[0\\]"]
329    #[inline(always)]
330    pub fn ep0datadone_startepin0(&mut self) -> EP0DATADONE_STARTEPIN0_W<0> {
331        EP0DATADONE_STARTEPIN0_W::new(self)
332    }
333    #[doc = "Bit 1 - Shortcut between event EP0DATADONE and task STARTEPOUT\\[0\\]"]
334    #[inline(always)]
335    pub fn ep0datadone_startepout0(&mut self) -> EP0DATADONE_STARTEPOUT0_W<1> {
336        EP0DATADONE_STARTEPOUT0_W::new(self)
337    }
338    #[doc = "Bit 2 - Shortcut between event EP0DATADONE and task EP0STATUS"]
339    #[inline(always)]
340    pub fn ep0datadone_ep0status(&mut self) -> EP0DATADONE_EP0STATUS_W<2> {
341        EP0DATADONE_EP0STATUS_W::new(self)
342    }
343    #[doc = "Bit 3 - Shortcut between event ENDEPOUT\\[0\\]
344and task EP0STATUS"]
345    #[inline(always)]
346    pub fn endepout0_ep0status(&mut self) -> ENDEPOUT0_EP0STATUS_W<3> {
347        ENDEPOUT0_EP0STATUS_W::new(self)
348    }
349    #[doc = "Bit 4 - Shortcut between event ENDEPOUT\\[0\\]
350and task EP0RCVOUT"]
351    #[inline(always)]
352    pub fn endepout0_ep0rcvout(&mut self) -> ENDEPOUT0_EP0RCVOUT_W<4> {
353        ENDEPOUT0_EP0RCVOUT_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}