lpc54606_pac/usb0/
inten.rs

1#[doc = "Reader of register INTEN"]
2pub type R = crate::R<u32, super::INTEN>;
3#[doc = "Writer for register INTEN"]
4pub type W = crate::W<u32, super::INTEN>;
5#[doc = "Register INTEN `reset()`'s with value 0"]
6impl crate::ResetValue for super::INTEN {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `EP_INT_EN`"]
14pub type EP_INT_EN_R = crate::R<u16, u16>;
15#[doc = "Write proxy for field `EP_INT_EN`"]
16pub struct EP_INT_EN_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> EP_INT_EN_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u16) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x03ff) | ((value as u32) & 0x03ff);
24        self.w
25    }
26}
27#[doc = "Reader of field `FRAME_INT_EN`"]
28pub type FRAME_INT_EN_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `FRAME_INT_EN`"]
30pub struct FRAME_INT_EN_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> FRAME_INT_EN_W<'a> {
34    #[doc = r"Sets the field bit"]
35    #[inline(always)]
36    pub fn set_bit(self) -> &'a mut W {
37        self.bit(true)
38    }
39    #[doc = r"Clears the field bit"]
40    #[inline(always)]
41    pub fn clear_bit(self) -> &'a mut W {
42        self.bit(false)
43    }
44    #[doc = r"Writes raw bits to the field"]
45    #[inline(always)]
46    pub fn bit(self, value: bool) -> &'a mut W {
47        self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30);
48        self.w
49    }
50}
51#[doc = "Reader of field `DEV_INT_EN`"]
52pub type DEV_INT_EN_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `DEV_INT_EN`"]
54pub struct DEV_INT_EN_W<'a> {
55    w: &'a mut W,
56}
57impl<'a> DEV_INT_EN_W<'a> {
58    #[doc = r"Sets the field bit"]
59    #[inline(always)]
60    pub fn set_bit(self) -> &'a mut W {
61        self.bit(true)
62    }
63    #[doc = r"Clears the field bit"]
64    #[inline(always)]
65    pub fn clear_bit(self) -> &'a mut W {
66        self.bit(false)
67    }
68    #[doc = r"Writes raw bits to the field"]
69    #[inline(always)]
70    pub fn bit(self, value: bool) -> &'a mut W {
71        self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
72        self.w
73    }
74}
75impl R {
76    #[doc = "Bits 0:9 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
77    #[inline(always)]
78    pub fn ep_int_en(&self) -> EP_INT_EN_R {
79        EP_INT_EN_R::new((self.bits & 0x03ff) as u16)
80    }
81    #[doc = "Bit 30 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
82    #[inline(always)]
83    pub fn frame_int_en(&self) -> FRAME_INT_EN_R {
84        FRAME_INT_EN_R::new(((self.bits >> 30) & 0x01) != 0)
85    }
86    #[doc = "Bit 31 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
87    #[inline(always)]
88    pub fn dev_int_en(&self) -> DEV_INT_EN_R {
89        DEV_INT_EN_R::new(((self.bits >> 31) & 0x01) != 0)
90    }
91}
92impl W {
93    #[doc = "Bits 0:9 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
94    #[inline(always)]
95    pub fn ep_int_en(&mut self) -> EP_INT_EN_W {
96        EP_INT_EN_W { w: self }
97    }
98    #[doc = "Bit 30 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
99    #[inline(always)]
100    pub fn frame_int_en(&mut self) -> FRAME_INT_EN_W {
101        FRAME_INT_EN_W { w: self }
102    }
103    #[doc = "Bit 31 - If this bit is set and the corresponding USB interrupt status bit is set, a HW interrupt is generated on the interrupt line indicated by the corresponding USB interrupt routing bit."]
104    #[inline(always)]
105    pub fn dev_int_en(&mut self) -> DEV_INT_EN_W {
106        DEV_INT_EN_W { w: self }
107    }
108}