swm341_pac/timrg/
en.rs

1#[doc = "Register `EN` reader"]
2pub struct R(crate::R<EN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<EN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<EN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<EN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `EN` writer"]
17pub struct W(crate::W<EN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<EN_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<EN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<EN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TIMR0` reader - TIMR0 field"]
38pub type TIMR0_R = crate::BitReader<bool>;
39#[doc = "Field `TIMR0` writer - TIMR0 field"]
40pub type TIMR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
41#[doc = "Field `TIMR1` reader - TIMR1 field"]
42pub type TIMR1_R = crate::BitReader<bool>;
43#[doc = "Field `TIMR1` writer - TIMR1 field"]
44pub type TIMR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
45#[doc = "Field `TIMR2` reader - TIMR2 field"]
46pub type TIMR2_R = crate::BitReader<bool>;
47#[doc = "Field `TIMR2` writer - TIMR2 field"]
48pub type TIMR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
49#[doc = "Field `TIMR3` reader - TIMR3 field"]
50pub type TIMR3_R = crate::BitReader<bool>;
51#[doc = "Field `TIMR3` writer - TIMR3 field"]
52pub type TIMR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
53#[doc = "Field `TIMR4` reader - TIMR4 field"]
54pub type TIMR4_R = crate::BitReader<bool>;
55#[doc = "Field `TIMR4` writer - TIMR4 field"]
56pub type TIMR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
57#[doc = "Field `TIMR5` reader - TIMR5 field"]
58pub type TIMR5_R = crate::BitReader<bool>;
59#[doc = "Field `TIMR5` writer - TIMR5 field"]
60pub type TIMR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
61#[doc = "Field `TIMR6` reader - TIMR6 field"]
62pub type TIMR6_R = crate::BitReader<bool>;
63#[doc = "Field `TIMR6` writer - TIMR6 field"]
64pub type TIMR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
65#[doc = "Field `TIMR7` reader - TIMR7 field"]
66pub type TIMR7_R = crate::BitReader<bool>;
67#[doc = "Field `TIMR7` writer - TIMR7 field"]
68pub type TIMR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
69#[doc = "Field `TIMR8` reader - TIMR8 field"]
70pub type TIMR8_R = crate::BitReader<bool>;
71#[doc = "Field `TIMR8` writer - TIMR8 field"]
72pub type TIMR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
73#[doc = "Field `TIMR9` reader - TIMR9 field"]
74pub type TIMR9_R = crate::BitReader<bool>;
75#[doc = "Field `TIMR9` writer - TIMR9 field"]
76pub type TIMR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
77#[doc = "Field `TIMR10` reader - TIMR10 field"]
78pub type TIMR10_R = crate::BitReader<bool>;
79#[doc = "Field `TIMR10` writer - TIMR10 field"]
80pub type TIMR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
81#[doc = "Field `TIMR11` reader - TIMR11 field"]
82pub type TIMR11_R = crate::BitReader<bool>;
83#[doc = "Field `TIMR11` writer - TIMR11 field"]
84pub type TIMR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, EN_SPEC, bool, O>;
85impl R {
86    #[doc = "Bit 0 - TIMR0 field"]
87    #[inline(always)]
88    pub fn timr0(&self) -> TIMR0_R {
89        TIMR0_R::new((self.bits & 1) != 0)
90    }
91    #[doc = "Bit 1 - TIMR1 field"]
92    #[inline(always)]
93    pub fn timr1(&self) -> TIMR1_R {
94        TIMR1_R::new(((self.bits >> 1) & 1) != 0)
95    }
96    #[doc = "Bit 2 - TIMR2 field"]
97    #[inline(always)]
98    pub fn timr2(&self) -> TIMR2_R {
99        TIMR2_R::new(((self.bits >> 2) & 1) != 0)
100    }
101    #[doc = "Bit 3 - TIMR3 field"]
102    #[inline(always)]
103    pub fn timr3(&self) -> TIMR3_R {
104        TIMR3_R::new(((self.bits >> 3) & 1) != 0)
105    }
106    #[doc = "Bit 4 - TIMR4 field"]
107    #[inline(always)]
108    pub fn timr4(&self) -> TIMR4_R {
109        TIMR4_R::new(((self.bits >> 4) & 1) != 0)
110    }
111    #[doc = "Bit 5 - TIMR5 field"]
112    #[inline(always)]
113    pub fn timr5(&self) -> TIMR5_R {
114        TIMR5_R::new(((self.bits >> 5) & 1) != 0)
115    }
116    #[doc = "Bit 6 - TIMR6 field"]
117    #[inline(always)]
118    pub fn timr6(&self) -> TIMR6_R {
119        TIMR6_R::new(((self.bits >> 6) & 1) != 0)
120    }
121    #[doc = "Bit 7 - TIMR7 field"]
122    #[inline(always)]
123    pub fn timr7(&self) -> TIMR7_R {
124        TIMR7_R::new(((self.bits >> 7) & 1) != 0)
125    }
126    #[doc = "Bit 8 - TIMR8 field"]
127    #[inline(always)]
128    pub fn timr8(&self) -> TIMR8_R {
129        TIMR8_R::new(((self.bits >> 8) & 1) != 0)
130    }
131    #[doc = "Bit 9 - TIMR9 field"]
132    #[inline(always)]
133    pub fn timr9(&self) -> TIMR9_R {
134        TIMR9_R::new(((self.bits >> 9) & 1) != 0)
135    }
136    #[doc = "Bit 10 - TIMR10 field"]
137    #[inline(always)]
138    pub fn timr10(&self) -> TIMR10_R {
139        TIMR10_R::new(((self.bits >> 10) & 1) != 0)
140    }
141    #[doc = "Bit 11 - TIMR11 field"]
142    #[inline(always)]
143    pub fn timr11(&self) -> TIMR11_R {
144        TIMR11_R::new(((self.bits >> 11) & 1) != 0)
145    }
146}
147impl W {
148    #[doc = "Bit 0 - TIMR0 field"]
149    #[inline(always)]
150    pub fn timr0(&mut self) -> TIMR0_W<0> {
151        TIMR0_W::new(self)
152    }
153    #[doc = "Bit 1 - TIMR1 field"]
154    #[inline(always)]
155    pub fn timr1(&mut self) -> TIMR1_W<1> {
156        TIMR1_W::new(self)
157    }
158    #[doc = "Bit 2 - TIMR2 field"]
159    #[inline(always)]
160    pub fn timr2(&mut self) -> TIMR2_W<2> {
161        TIMR2_W::new(self)
162    }
163    #[doc = "Bit 3 - TIMR3 field"]
164    #[inline(always)]
165    pub fn timr3(&mut self) -> TIMR3_W<3> {
166        TIMR3_W::new(self)
167    }
168    #[doc = "Bit 4 - TIMR4 field"]
169    #[inline(always)]
170    pub fn timr4(&mut self) -> TIMR4_W<4> {
171        TIMR4_W::new(self)
172    }
173    #[doc = "Bit 5 - TIMR5 field"]
174    #[inline(always)]
175    pub fn timr5(&mut self) -> TIMR5_W<5> {
176        TIMR5_W::new(self)
177    }
178    #[doc = "Bit 6 - TIMR6 field"]
179    #[inline(always)]
180    pub fn timr6(&mut self) -> TIMR6_W<6> {
181        TIMR6_W::new(self)
182    }
183    #[doc = "Bit 7 - TIMR7 field"]
184    #[inline(always)]
185    pub fn timr7(&mut self) -> TIMR7_W<7> {
186        TIMR7_W::new(self)
187    }
188    #[doc = "Bit 8 - TIMR8 field"]
189    #[inline(always)]
190    pub fn timr8(&mut self) -> TIMR8_W<8> {
191        TIMR8_W::new(self)
192    }
193    #[doc = "Bit 9 - TIMR9 field"]
194    #[inline(always)]
195    pub fn timr9(&mut self) -> TIMR9_W<9> {
196        TIMR9_W::new(self)
197    }
198    #[doc = "Bit 10 - TIMR10 field"]
199    #[inline(always)]
200    pub fn timr10(&mut self) -> TIMR10_W<10> {
201        TIMR10_W::new(self)
202    }
203    #[doc = "Bit 11 - TIMR11 field"]
204    #[inline(always)]
205    pub fn timr11(&mut self) -> TIMR11_W<11> {
206        TIMR11_W::new(self)
207    }
208    #[doc = "Writes raw bits to the register."]
209    #[inline(always)]
210    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
211        self.0.bits(bits);
212        self
213    }
214}
215#[doc = "EN 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 [en](index.html) module"]
216pub struct EN_SPEC;
217impl crate::RegisterSpec for EN_SPEC {
218    type Ux = u32;
219}
220#[doc = "`read()` method returns [en::R](R) reader structure"]
221impl crate::Readable for EN_SPEC {
222    type Reader = R;
223}
224#[doc = "`write(|w| ..)` method takes [en::W](W) writer structure"]
225impl crate::Writable for EN_SPEC {
226    type Writer = W;
227}
228#[doc = "`reset()` method sets EN to value 0"]
229impl crate::Resettable for EN_SPEC {
230    #[inline(always)]
231    fn reset_value() -> Self::Ux {
232        0
233    }
234}