swm341_pac/usbd/
devie.rs

1#[doc = "Register `DEVIE` reader"]
2pub struct R(crate::R<DEVIE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DEVIE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DEVIE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DEVIE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DEVIE` writer"]
17pub struct W(crate::W<DEVIE_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DEVIE_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<DEVIE_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DEVIE_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `SETCFG` reader - SETCFG field"]
38pub type SETCFG_R = crate::BitReader<bool>;
39#[doc = "Field `SETCFG` writer - SETCFG field"]
40pub type SETCFG_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
41#[doc = "Field `SETINTF` reader - SETINTF field"]
42pub type SETINTF_R = crate::BitReader<bool>;
43#[doc = "Field `SETINTF` writer - SETINTF field"]
44pub type SETINTF_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
45#[doc = "Field `RST` reader - RST field"]
46pub type RST_R = crate::BitReader<bool>;
47#[doc = "Field `RST` writer - RST field"]
48pub type RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
49#[doc = "Field `SUSP` reader - SUSP field"]
50pub type SUSP_R = crate::BitReader<bool>;
51#[doc = "Field `SUSP` writer - SUSP field"]
52pub type SUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
53#[doc = "Field `SOF` reader - SOF field"]
54pub type SOF_R = crate::BitReader<bool>;
55#[doc = "Field `SOF` writer - SOF field"]
56pub type SOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
57#[doc = "Field `SETUP` reader - SETUP field"]
58pub type SETUP_R = crate::BitReader<bool>;
59#[doc = "Field `SETUP` writer - SETUP field"]
60pub type SETUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
61#[doc = "Field `OUT` reader - OUT field"]
62pub type OUT_R = crate::BitReader<bool>;
63#[doc = "Field `OUT` writer - OUT field"]
64pub type OUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DEVIE_SPEC, bool, O>;
65impl R {
66    #[doc = "Bit 0 - SETCFG field"]
67    #[inline(always)]
68    pub fn setcfg(&self) -> SETCFG_R {
69        SETCFG_R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 1 - SETINTF field"]
72    #[inline(always)]
73    pub fn setintf(&self) -> SETINTF_R {
74        SETINTF_R::new(((self.bits >> 1) & 1) != 0)
75    }
76    #[doc = "Bit 3 - RST field"]
77    #[inline(always)]
78    pub fn rst(&self) -> RST_R {
79        RST_R::new(((self.bits >> 3) & 1) != 0)
80    }
81    #[doc = "Bit 4 - SUSP field"]
82    #[inline(always)]
83    pub fn susp(&self) -> SUSP_R {
84        SUSP_R::new(((self.bits >> 4) & 1) != 0)
85    }
86    #[doc = "Bit 5 - SOF field"]
87    #[inline(always)]
88    pub fn sof(&self) -> SOF_R {
89        SOF_R::new(((self.bits >> 5) & 1) != 0)
90    }
91    #[doc = "Bit 6 - SETUP field"]
92    #[inline(always)]
93    pub fn setup(&self) -> SETUP_R {
94        SETUP_R::new(((self.bits >> 6) & 1) != 0)
95    }
96    #[doc = "Bit 7 - OUT field"]
97    #[inline(always)]
98    pub fn out(&self) -> OUT_R {
99        OUT_R::new(((self.bits >> 7) & 1) != 0)
100    }
101}
102impl W {
103    #[doc = "Bit 0 - SETCFG field"]
104    #[inline(always)]
105    pub fn setcfg(&mut self) -> SETCFG_W<0> {
106        SETCFG_W::new(self)
107    }
108    #[doc = "Bit 1 - SETINTF field"]
109    #[inline(always)]
110    pub fn setintf(&mut self) -> SETINTF_W<1> {
111        SETINTF_W::new(self)
112    }
113    #[doc = "Bit 3 - RST field"]
114    #[inline(always)]
115    pub fn rst(&mut self) -> RST_W<3> {
116        RST_W::new(self)
117    }
118    #[doc = "Bit 4 - SUSP field"]
119    #[inline(always)]
120    pub fn susp(&mut self) -> SUSP_W<4> {
121        SUSP_W::new(self)
122    }
123    #[doc = "Bit 5 - SOF field"]
124    #[inline(always)]
125    pub fn sof(&mut self) -> SOF_W<5> {
126        SOF_W::new(self)
127    }
128    #[doc = "Bit 6 - SETUP field"]
129    #[inline(always)]
130    pub fn setup(&mut self) -> SETUP_W<6> {
131        SETUP_W::new(self)
132    }
133    #[doc = "Bit 7 - OUT field"]
134    #[inline(always)]
135    pub fn out(&mut self) -> OUT_W<7> {
136        OUT_W::new(self)
137    }
138    #[doc = "Writes raw bits to the register."]
139    #[inline(always)]
140    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
141        self.0.bits(bits);
142        self
143    }
144}
145#[doc = "DEVIE 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 [devie](index.html) module"]
146pub struct DEVIE_SPEC;
147impl crate::RegisterSpec for DEVIE_SPEC {
148    type Ux = u32;
149}
150#[doc = "`read()` method returns [devie::R](R) reader structure"]
151impl crate::Readable for DEVIE_SPEC {
152    type Reader = R;
153}
154#[doc = "`write(|w| ..)` method takes [devie::W](W) writer structure"]
155impl crate::Writable for DEVIE_SPEC {
156    type Writer = W;
157}
158#[doc = "`reset()` method sets DEVIE to value 0"]
159impl crate::Resettable for DEVIE_SPEC {
160    #[inline(always)]
161    fn reset_value() -> Self::Ux {
162        0
163    }
164}