atsams70n21/usbhs/
usbhs_devimr.rs

1#[doc = "Register `USBHS_DEVIMR` reader"]
2pub struct R(crate::R<USBHS_DEVIMR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<USBHS_DEVIMR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<USBHS_DEVIMR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<USBHS_DEVIMR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `SUSPE` reader - Suspend Interrupt Mask"]
17pub struct SUSPE_R(crate::FieldReader<bool, bool>);
18impl SUSPE_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        SUSPE_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for SUSPE_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `MSOFE` reader - Micro Start of Frame Interrupt Mask"]
32pub struct MSOFE_R(crate::FieldReader<bool, bool>);
33impl MSOFE_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: bool) -> Self {
36        MSOFE_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for MSOFE_R {
40    type Target = crate::FieldReader<bool, bool>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46#[doc = "Field `SOFE` reader - Start of Frame Interrupt Mask"]
47pub struct SOFE_R(crate::FieldReader<bool, bool>);
48impl SOFE_R {
49    #[inline(always)]
50    pub(crate) fn new(bits: bool) -> Self {
51        SOFE_R(crate::FieldReader::new(bits))
52    }
53}
54impl core::ops::Deref for SOFE_R {
55    type Target = crate::FieldReader<bool, bool>;
56    #[inline(always)]
57    fn deref(&self) -> &Self::Target {
58        &self.0
59    }
60}
61#[doc = "Field `EORSTE` reader - End of Reset Interrupt Mask"]
62pub struct EORSTE_R(crate::FieldReader<bool, bool>);
63impl EORSTE_R {
64    #[inline(always)]
65    pub(crate) fn new(bits: bool) -> Self {
66        EORSTE_R(crate::FieldReader::new(bits))
67    }
68}
69impl core::ops::Deref for EORSTE_R {
70    type Target = crate::FieldReader<bool, bool>;
71    #[inline(always)]
72    fn deref(&self) -> &Self::Target {
73        &self.0
74    }
75}
76#[doc = "Field `WAKEUPE` reader - Wake-Up Interrupt Mask"]
77pub struct WAKEUPE_R(crate::FieldReader<bool, bool>);
78impl WAKEUPE_R {
79    #[inline(always)]
80    pub(crate) fn new(bits: bool) -> Self {
81        WAKEUPE_R(crate::FieldReader::new(bits))
82    }
83}
84impl core::ops::Deref for WAKEUPE_R {
85    type Target = crate::FieldReader<bool, bool>;
86    #[inline(always)]
87    fn deref(&self) -> &Self::Target {
88        &self.0
89    }
90}
91#[doc = "Field `EORSME` reader - End of Resume Interrupt Mask"]
92pub struct EORSME_R(crate::FieldReader<bool, bool>);
93impl EORSME_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: bool) -> Self {
96        EORSME_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for EORSME_R {
100    type Target = crate::FieldReader<bool, bool>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `UPRSME` reader - Upstream Resume Interrupt Mask"]
107pub struct UPRSME_R(crate::FieldReader<bool, bool>);
108impl UPRSME_R {
109    #[inline(always)]
110    pub(crate) fn new(bits: bool) -> Self {
111        UPRSME_R(crate::FieldReader::new(bits))
112    }
113}
114impl core::ops::Deref for UPRSME_R {
115    type Target = crate::FieldReader<bool, bool>;
116    #[inline(always)]
117    fn deref(&self) -> &Self::Target {
118        &self.0
119    }
120}
121#[doc = "Field `PEP_0` reader - Endpoint 0 Interrupt Mask"]
122pub struct PEP_0_R(crate::FieldReader<bool, bool>);
123impl PEP_0_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        PEP_0_R(crate::FieldReader::new(bits))
127    }
128}
129impl core::ops::Deref for PEP_0_R {
130    type Target = crate::FieldReader<bool, bool>;
131    #[inline(always)]
132    fn deref(&self) -> &Self::Target {
133        &self.0
134    }
135}
136#[doc = "Field `PEP_1` reader - Endpoint 1 Interrupt Mask"]
137pub struct PEP_1_R(crate::FieldReader<bool, bool>);
138impl PEP_1_R {
139    #[inline(always)]
140    pub(crate) fn new(bits: bool) -> Self {
141        PEP_1_R(crate::FieldReader::new(bits))
142    }
143}
144impl core::ops::Deref for PEP_1_R {
145    type Target = crate::FieldReader<bool, bool>;
146    #[inline(always)]
147    fn deref(&self) -> &Self::Target {
148        &self.0
149    }
150}
151#[doc = "Field `PEP_2` reader - Endpoint 2 Interrupt Mask"]
152pub struct PEP_2_R(crate::FieldReader<bool, bool>);
153impl PEP_2_R {
154    #[inline(always)]
155    pub(crate) fn new(bits: bool) -> Self {
156        PEP_2_R(crate::FieldReader::new(bits))
157    }
158}
159impl core::ops::Deref for PEP_2_R {
160    type Target = crate::FieldReader<bool, bool>;
161    #[inline(always)]
162    fn deref(&self) -> &Self::Target {
163        &self.0
164    }
165}
166#[doc = "Field `PEP_3` reader - Endpoint 3 Interrupt Mask"]
167pub struct PEP_3_R(crate::FieldReader<bool, bool>);
168impl PEP_3_R {
169    #[inline(always)]
170    pub(crate) fn new(bits: bool) -> Self {
171        PEP_3_R(crate::FieldReader::new(bits))
172    }
173}
174impl core::ops::Deref for PEP_3_R {
175    type Target = crate::FieldReader<bool, bool>;
176    #[inline(always)]
177    fn deref(&self) -> &Self::Target {
178        &self.0
179    }
180}
181#[doc = "Field `PEP_4` reader - Endpoint 4 Interrupt Mask"]
182pub struct PEP_4_R(crate::FieldReader<bool, bool>);
183impl PEP_4_R {
184    #[inline(always)]
185    pub(crate) fn new(bits: bool) -> Self {
186        PEP_4_R(crate::FieldReader::new(bits))
187    }
188}
189impl core::ops::Deref for PEP_4_R {
190    type Target = crate::FieldReader<bool, bool>;
191    #[inline(always)]
192    fn deref(&self) -> &Self::Target {
193        &self.0
194    }
195}
196#[doc = "Field `PEP_5` reader - Endpoint 5 Interrupt Mask"]
197pub struct PEP_5_R(crate::FieldReader<bool, bool>);
198impl PEP_5_R {
199    #[inline(always)]
200    pub(crate) fn new(bits: bool) -> Self {
201        PEP_5_R(crate::FieldReader::new(bits))
202    }
203}
204impl core::ops::Deref for PEP_5_R {
205    type Target = crate::FieldReader<bool, bool>;
206    #[inline(always)]
207    fn deref(&self) -> &Self::Target {
208        &self.0
209    }
210}
211#[doc = "Field `PEP_6` reader - Endpoint 6 Interrupt Mask"]
212pub struct PEP_6_R(crate::FieldReader<bool, bool>);
213impl PEP_6_R {
214    #[inline(always)]
215    pub(crate) fn new(bits: bool) -> Self {
216        PEP_6_R(crate::FieldReader::new(bits))
217    }
218}
219impl core::ops::Deref for PEP_6_R {
220    type Target = crate::FieldReader<bool, bool>;
221    #[inline(always)]
222    fn deref(&self) -> &Self::Target {
223        &self.0
224    }
225}
226#[doc = "Field `PEP_7` reader - Endpoint 7 Interrupt Mask"]
227pub struct PEP_7_R(crate::FieldReader<bool, bool>);
228impl PEP_7_R {
229    #[inline(always)]
230    pub(crate) fn new(bits: bool) -> Self {
231        PEP_7_R(crate::FieldReader::new(bits))
232    }
233}
234impl core::ops::Deref for PEP_7_R {
235    type Target = crate::FieldReader<bool, bool>;
236    #[inline(always)]
237    fn deref(&self) -> &Self::Target {
238        &self.0
239    }
240}
241#[doc = "Field `PEP_8` reader - Endpoint 8 Interrupt Mask"]
242pub struct PEP_8_R(crate::FieldReader<bool, bool>);
243impl PEP_8_R {
244    #[inline(always)]
245    pub(crate) fn new(bits: bool) -> Self {
246        PEP_8_R(crate::FieldReader::new(bits))
247    }
248}
249impl core::ops::Deref for PEP_8_R {
250    type Target = crate::FieldReader<bool, bool>;
251    #[inline(always)]
252    fn deref(&self) -> &Self::Target {
253        &self.0
254    }
255}
256#[doc = "Field `PEP_9` reader - Endpoint 9 Interrupt Mask"]
257pub struct PEP_9_R(crate::FieldReader<bool, bool>);
258impl PEP_9_R {
259    #[inline(always)]
260    pub(crate) fn new(bits: bool) -> Self {
261        PEP_9_R(crate::FieldReader::new(bits))
262    }
263}
264impl core::ops::Deref for PEP_9_R {
265    type Target = crate::FieldReader<bool, bool>;
266    #[inline(always)]
267    fn deref(&self) -> &Self::Target {
268        &self.0
269    }
270}
271#[doc = "Field `PEP_10` reader - Endpoint 10 Interrupt Mask"]
272pub struct PEP_10_R(crate::FieldReader<bool, bool>);
273impl PEP_10_R {
274    #[inline(always)]
275    pub(crate) fn new(bits: bool) -> Self {
276        PEP_10_R(crate::FieldReader::new(bits))
277    }
278}
279impl core::ops::Deref for PEP_10_R {
280    type Target = crate::FieldReader<bool, bool>;
281    #[inline(always)]
282    fn deref(&self) -> &Self::Target {
283        &self.0
284    }
285}
286#[doc = "Field `PEP_11` reader - Endpoint 11 Interrupt Mask"]
287pub struct PEP_11_R(crate::FieldReader<bool, bool>);
288impl PEP_11_R {
289    #[inline(always)]
290    pub(crate) fn new(bits: bool) -> Self {
291        PEP_11_R(crate::FieldReader::new(bits))
292    }
293}
294impl core::ops::Deref for PEP_11_R {
295    type Target = crate::FieldReader<bool, bool>;
296    #[inline(always)]
297    fn deref(&self) -> &Self::Target {
298        &self.0
299    }
300}
301#[doc = "Field `DMA_1` reader - DMA Channel 1 Interrupt Mask"]
302pub struct DMA_1_R(crate::FieldReader<bool, bool>);
303impl DMA_1_R {
304    #[inline(always)]
305    pub(crate) fn new(bits: bool) -> Self {
306        DMA_1_R(crate::FieldReader::new(bits))
307    }
308}
309impl core::ops::Deref for DMA_1_R {
310    type Target = crate::FieldReader<bool, bool>;
311    #[inline(always)]
312    fn deref(&self) -> &Self::Target {
313        &self.0
314    }
315}
316#[doc = "Field `DMA_2` reader - DMA Channel 2 Interrupt Mask"]
317pub struct DMA_2_R(crate::FieldReader<bool, bool>);
318impl DMA_2_R {
319    #[inline(always)]
320    pub(crate) fn new(bits: bool) -> Self {
321        DMA_2_R(crate::FieldReader::new(bits))
322    }
323}
324impl core::ops::Deref for DMA_2_R {
325    type Target = crate::FieldReader<bool, bool>;
326    #[inline(always)]
327    fn deref(&self) -> &Self::Target {
328        &self.0
329    }
330}
331#[doc = "Field `DMA_3` reader - DMA Channel 3 Interrupt Mask"]
332pub struct DMA_3_R(crate::FieldReader<bool, bool>);
333impl DMA_3_R {
334    #[inline(always)]
335    pub(crate) fn new(bits: bool) -> Self {
336        DMA_3_R(crate::FieldReader::new(bits))
337    }
338}
339impl core::ops::Deref for DMA_3_R {
340    type Target = crate::FieldReader<bool, bool>;
341    #[inline(always)]
342    fn deref(&self) -> &Self::Target {
343        &self.0
344    }
345}
346#[doc = "Field `DMA_4` reader - DMA Channel 4 Interrupt Mask"]
347pub struct DMA_4_R(crate::FieldReader<bool, bool>);
348impl DMA_4_R {
349    #[inline(always)]
350    pub(crate) fn new(bits: bool) -> Self {
351        DMA_4_R(crate::FieldReader::new(bits))
352    }
353}
354impl core::ops::Deref for DMA_4_R {
355    type Target = crate::FieldReader<bool, bool>;
356    #[inline(always)]
357    fn deref(&self) -> &Self::Target {
358        &self.0
359    }
360}
361#[doc = "Field `DMA_5` reader - DMA Channel 5 Interrupt Mask"]
362pub struct DMA_5_R(crate::FieldReader<bool, bool>);
363impl DMA_5_R {
364    #[inline(always)]
365    pub(crate) fn new(bits: bool) -> Self {
366        DMA_5_R(crate::FieldReader::new(bits))
367    }
368}
369impl core::ops::Deref for DMA_5_R {
370    type Target = crate::FieldReader<bool, bool>;
371    #[inline(always)]
372    fn deref(&self) -> &Self::Target {
373        &self.0
374    }
375}
376#[doc = "Field `DMA_6` reader - DMA Channel 6 Interrupt Mask"]
377pub struct DMA_6_R(crate::FieldReader<bool, bool>);
378impl DMA_6_R {
379    #[inline(always)]
380    pub(crate) fn new(bits: bool) -> Self {
381        DMA_6_R(crate::FieldReader::new(bits))
382    }
383}
384impl core::ops::Deref for DMA_6_R {
385    type Target = crate::FieldReader<bool, bool>;
386    #[inline(always)]
387    fn deref(&self) -> &Self::Target {
388        &self.0
389    }
390}
391#[doc = "Field `DMA_7` reader - DMA Channel 7 Interrupt Mask"]
392pub struct DMA_7_R(crate::FieldReader<bool, bool>);
393impl DMA_7_R {
394    #[inline(always)]
395    pub(crate) fn new(bits: bool) -> Self {
396        DMA_7_R(crate::FieldReader::new(bits))
397    }
398}
399impl core::ops::Deref for DMA_7_R {
400    type Target = crate::FieldReader<bool, bool>;
401    #[inline(always)]
402    fn deref(&self) -> &Self::Target {
403        &self.0
404    }
405}
406impl R {
407    #[doc = "Bit 0 - Suspend Interrupt Mask"]
408    #[inline(always)]
409    pub fn suspe(&self) -> SUSPE_R {
410        SUSPE_R::new((self.bits & 0x01) != 0)
411    }
412    #[doc = "Bit 1 - Micro Start of Frame Interrupt Mask"]
413    #[inline(always)]
414    pub fn msofe(&self) -> MSOFE_R {
415        MSOFE_R::new(((self.bits >> 1) & 0x01) != 0)
416    }
417    #[doc = "Bit 2 - Start of Frame Interrupt Mask"]
418    #[inline(always)]
419    pub fn sofe(&self) -> SOFE_R {
420        SOFE_R::new(((self.bits >> 2) & 0x01) != 0)
421    }
422    #[doc = "Bit 3 - End of Reset Interrupt Mask"]
423    #[inline(always)]
424    pub fn eorste(&self) -> EORSTE_R {
425        EORSTE_R::new(((self.bits >> 3) & 0x01) != 0)
426    }
427    #[doc = "Bit 4 - Wake-Up Interrupt Mask"]
428    #[inline(always)]
429    pub fn wakeupe(&self) -> WAKEUPE_R {
430        WAKEUPE_R::new(((self.bits >> 4) & 0x01) != 0)
431    }
432    #[doc = "Bit 5 - End of Resume Interrupt Mask"]
433    #[inline(always)]
434    pub fn eorsme(&self) -> EORSME_R {
435        EORSME_R::new(((self.bits >> 5) & 0x01) != 0)
436    }
437    #[doc = "Bit 6 - Upstream Resume Interrupt Mask"]
438    #[inline(always)]
439    pub fn uprsme(&self) -> UPRSME_R {
440        UPRSME_R::new(((self.bits >> 6) & 0x01) != 0)
441    }
442    #[doc = "Bit 12 - Endpoint 0 Interrupt Mask"]
443    #[inline(always)]
444    pub fn pep_0(&self) -> PEP_0_R {
445        PEP_0_R::new(((self.bits >> 12) & 0x01) != 0)
446    }
447    #[doc = "Bit 13 - Endpoint 1 Interrupt Mask"]
448    #[inline(always)]
449    pub fn pep_1(&self) -> PEP_1_R {
450        PEP_1_R::new(((self.bits >> 13) & 0x01) != 0)
451    }
452    #[doc = "Bit 14 - Endpoint 2 Interrupt Mask"]
453    #[inline(always)]
454    pub fn pep_2(&self) -> PEP_2_R {
455        PEP_2_R::new(((self.bits >> 14) & 0x01) != 0)
456    }
457    #[doc = "Bit 15 - Endpoint 3 Interrupt Mask"]
458    #[inline(always)]
459    pub fn pep_3(&self) -> PEP_3_R {
460        PEP_3_R::new(((self.bits >> 15) & 0x01) != 0)
461    }
462    #[doc = "Bit 16 - Endpoint 4 Interrupt Mask"]
463    #[inline(always)]
464    pub fn pep_4(&self) -> PEP_4_R {
465        PEP_4_R::new(((self.bits >> 16) & 0x01) != 0)
466    }
467    #[doc = "Bit 17 - Endpoint 5 Interrupt Mask"]
468    #[inline(always)]
469    pub fn pep_5(&self) -> PEP_5_R {
470        PEP_5_R::new(((self.bits >> 17) & 0x01) != 0)
471    }
472    #[doc = "Bit 18 - Endpoint 6 Interrupt Mask"]
473    #[inline(always)]
474    pub fn pep_6(&self) -> PEP_6_R {
475        PEP_6_R::new(((self.bits >> 18) & 0x01) != 0)
476    }
477    #[doc = "Bit 19 - Endpoint 7 Interrupt Mask"]
478    #[inline(always)]
479    pub fn pep_7(&self) -> PEP_7_R {
480        PEP_7_R::new(((self.bits >> 19) & 0x01) != 0)
481    }
482    #[doc = "Bit 20 - Endpoint 8 Interrupt Mask"]
483    #[inline(always)]
484    pub fn pep_8(&self) -> PEP_8_R {
485        PEP_8_R::new(((self.bits >> 20) & 0x01) != 0)
486    }
487    #[doc = "Bit 21 - Endpoint 9 Interrupt Mask"]
488    #[inline(always)]
489    pub fn pep_9(&self) -> PEP_9_R {
490        PEP_9_R::new(((self.bits >> 21) & 0x01) != 0)
491    }
492    #[doc = "Bit 22 - Endpoint 10 Interrupt Mask"]
493    #[inline(always)]
494    pub fn pep_10(&self) -> PEP_10_R {
495        PEP_10_R::new(((self.bits >> 22) & 0x01) != 0)
496    }
497    #[doc = "Bit 23 - Endpoint 11 Interrupt Mask"]
498    #[inline(always)]
499    pub fn pep_11(&self) -> PEP_11_R {
500        PEP_11_R::new(((self.bits >> 23) & 0x01) != 0)
501    }
502    #[doc = "Bit 25 - DMA Channel 1 Interrupt Mask"]
503    #[inline(always)]
504    pub fn dma_1(&self) -> DMA_1_R {
505        DMA_1_R::new(((self.bits >> 25) & 0x01) != 0)
506    }
507    #[doc = "Bit 26 - DMA Channel 2 Interrupt Mask"]
508    #[inline(always)]
509    pub fn dma_2(&self) -> DMA_2_R {
510        DMA_2_R::new(((self.bits >> 26) & 0x01) != 0)
511    }
512    #[doc = "Bit 27 - DMA Channel 3 Interrupt Mask"]
513    #[inline(always)]
514    pub fn dma_3(&self) -> DMA_3_R {
515        DMA_3_R::new(((self.bits >> 27) & 0x01) != 0)
516    }
517    #[doc = "Bit 28 - DMA Channel 4 Interrupt Mask"]
518    #[inline(always)]
519    pub fn dma_4(&self) -> DMA_4_R {
520        DMA_4_R::new(((self.bits >> 28) & 0x01) != 0)
521    }
522    #[doc = "Bit 29 - DMA Channel 5 Interrupt Mask"]
523    #[inline(always)]
524    pub fn dma_5(&self) -> DMA_5_R {
525        DMA_5_R::new(((self.bits >> 29) & 0x01) != 0)
526    }
527    #[doc = "Bit 30 - DMA Channel 6 Interrupt Mask"]
528    #[inline(always)]
529    pub fn dma_6(&self) -> DMA_6_R {
530        DMA_6_R::new(((self.bits >> 30) & 0x01) != 0)
531    }
532    #[doc = "Bit 31 - DMA Channel 7 Interrupt Mask"]
533    #[inline(always)]
534    pub fn dma_7(&self) -> DMA_7_R {
535        DMA_7_R::new(((self.bits >> 31) & 0x01) != 0)
536    }
537}
538#[doc = "Device Global Interrupt Mask Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [usbhs_devimr](index.html) module"]
539pub struct USBHS_DEVIMR_SPEC;
540impl crate::RegisterSpec for USBHS_DEVIMR_SPEC {
541    type Ux = u32;
542}
543#[doc = "`read()` method returns [usbhs_devimr::R](R) reader structure"]
544impl crate::Readable for USBHS_DEVIMR_SPEC {
545    type Reader = R;
546}
547#[doc = "`reset()` method sets USBHS_DEVIMR to value 0"]
548impl crate::Resettable for USBHS_DEVIMR_SPEC {
549    #[inline(always)]
550    fn reset_value() -> Self::Ux {
551        0
552    }
553}