cc2538/gptimer1/
mis.rs

1#[doc = "Reader of register MIS"]
2pub type R = crate::R<u32, super::MIS>;
3#[doc = "Writer for register MIS"]
4pub type W = crate::W<u32, super::MIS>;
5#[doc = "Register MIS `reset()`'s with value 0"]
6impl crate::ResetValue for super::MIS {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `Reserved32`"]
14pub type RESERVED32_R = crate::R<u32, u32>;
15#[doc = "Write proxy for field `Reserved32`"]
16pub struct RESERVED32_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RESERVED32_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u32) -> &'a mut W {
23        self.w.bits = (self.w.bits & !(0x000f_ffff << 12)) | (((value as u32) & 0x000f_ffff) << 12);
24        self.w
25    }
26}
27#[doc = "Reader of field `TBMMIS`"]
28pub type TBMMIS_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `TBMMIS`"]
30pub struct TBMMIS_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> TBMMIS_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 << 11)) | (((value as u32) & 0x01) << 11);
48        self.w
49    }
50}
51#[doc = "Reader of field `CBEMIS`"]
52pub type CBEMIS_R = crate::R<bool, bool>;
53#[doc = "Write proxy for field `CBEMIS`"]
54pub struct CBEMIS_W<'a> {
55    w: &'a mut W,
56}
57impl<'a> CBEMIS_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 << 10)) | (((value as u32) & 0x01) << 10);
72        self.w
73    }
74}
75#[doc = "Reader of field `CBMMIS`"]
76pub type CBMMIS_R = crate::R<bool, bool>;
77#[doc = "Write proxy for field `CBMMIS`"]
78pub struct CBMMIS_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> CBMMIS_W<'a> {
82    #[doc = r"Sets the field bit"]
83    #[inline(always)]
84    pub fn set_bit(self) -> &'a mut W {
85        self.bit(true)
86    }
87    #[doc = r"Clears the field bit"]
88    #[inline(always)]
89    pub fn clear_bit(self) -> &'a mut W {
90        self.bit(false)
91    }
92    #[doc = r"Writes raw bits to the field"]
93    #[inline(always)]
94    pub fn bit(self, value: bool) -> &'a mut W {
95        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
96        self.w
97    }
98}
99#[doc = "Reader of field `TBTOMIS`"]
100pub type TBTOMIS_R = crate::R<bool, bool>;
101#[doc = "Write proxy for field `TBTOMIS`"]
102pub struct TBTOMIS_W<'a> {
103    w: &'a mut W,
104}
105impl<'a> TBTOMIS_W<'a> {
106    #[doc = r"Sets the field bit"]
107    #[inline(always)]
108    pub fn set_bit(self) -> &'a mut W {
109        self.bit(true)
110    }
111    #[doc = r"Clears the field bit"]
112    #[inline(always)]
113    pub fn clear_bit(self) -> &'a mut W {
114        self.bit(false)
115    }
116    #[doc = r"Writes raw bits to the field"]
117    #[inline(always)]
118    pub fn bit(self, value: bool) -> &'a mut W {
119        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
120        self.w
121    }
122}
123#[doc = "Reader of field `Reserved8`"]
124pub type RESERVED8_R = crate::R<u8, u8>;
125#[doc = "Write proxy for field `Reserved8`"]
126pub struct RESERVED8_W<'a> {
127    w: &'a mut W,
128}
129impl<'a> RESERVED8_W<'a> {
130    #[doc = r"Writes raw bits to the field"]
131    #[inline(always)]
132    pub unsafe fn bits(self, value: u8) -> &'a mut W {
133        self.w.bits = (self.w.bits & !(0x07 << 5)) | (((value as u32) & 0x07) << 5);
134        self.w
135    }
136}
137#[doc = "Reader of field `TAMRIS`"]
138pub type TAMRIS_R = crate::R<bool, bool>;
139#[doc = "Write proxy for field `TAMRIS`"]
140pub struct TAMRIS_W<'a> {
141    w: &'a mut W,
142}
143impl<'a> TAMRIS_W<'a> {
144    #[doc = r"Sets the field bit"]
145    #[inline(always)]
146    pub fn set_bit(self) -> &'a mut W {
147        self.bit(true)
148    }
149    #[doc = r"Clears the field bit"]
150    #[inline(always)]
151    pub fn clear_bit(self) -> &'a mut W {
152        self.bit(false)
153    }
154    #[doc = r"Writes raw bits to the field"]
155    #[inline(always)]
156    pub fn bit(self, value: bool) -> &'a mut W {
157        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
158        self.w
159    }
160}
161#[doc = "Reader of field `Reserved3`"]
162pub type RESERVED3_R = crate::R<bool, bool>;
163#[doc = "Write proxy for field `Reserved3`"]
164pub struct RESERVED3_W<'a> {
165    w: &'a mut W,
166}
167impl<'a> RESERVED3_W<'a> {
168    #[doc = r"Sets the field bit"]
169    #[inline(always)]
170    pub fn set_bit(self) -> &'a mut W {
171        self.bit(true)
172    }
173    #[doc = r"Clears the field bit"]
174    #[inline(always)]
175    pub fn clear_bit(self) -> &'a mut W {
176        self.bit(false)
177    }
178    #[doc = r"Writes raw bits to the field"]
179    #[inline(always)]
180    pub fn bit(self, value: bool) -> &'a mut W {
181        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
182        self.w
183    }
184}
185#[doc = "Reader of field `CAEMIS`"]
186pub type CAEMIS_R = crate::R<bool, bool>;
187#[doc = "Write proxy for field `CAEMIS`"]
188pub struct CAEMIS_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> CAEMIS_W<'a> {
192    #[doc = r"Sets the field bit"]
193    #[inline(always)]
194    pub fn set_bit(self) -> &'a mut W {
195        self.bit(true)
196    }
197    #[doc = r"Clears the field bit"]
198    #[inline(always)]
199    pub fn clear_bit(self) -> &'a mut W {
200        self.bit(false)
201    }
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub fn bit(self, value: bool) -> &'a mut W {
205        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
206        self.w
207    }
208}
209#[doc = "Reader of field `CAMMIS`"]
210pub type CAMMIS_R = crate::R<bool, bool>;
211#[doc = "Write proxy for field `CAMMIS`"]
212pub struct CAMMIS_W<'a> {
213    w: &'a mut W,
214}
215impl<'a> CAMMIS_W<'a> {
216    #[doc = r"Sets the field bit"]
217    #[inline(always)]
218    pub fn set_bit(self) -> &'a mut W {
219        self.bit(true)
220    }
221    #[doc = r"Clears the field bit"]
222    #[inline(always)]
223    pub fn clear_bit(self) -> &'a mut W {
224        self.bit(false)
225    }
226    #[doc = r"Writes raw bits to the field"]
227    #[inline(always)]
228    pub fn bit(self, value: bool) -> &'a mut W {
229        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
230        self.w
231    }
232}
233#[doc = "Reader of field `TATOMIS`"]
234pub type TATOMIS_R = crate::R<bool, bool>;
235#[doc = "Write proxy for field `TATOMIS`"]
236pub struct TATOMIS_W<'a> {
237    w: &'a mut W,
238}
239impl<'a> TATOMIS_W<'a> {
240    #[doc = r"Sets the field bit"]
241    #[inline(always)]
242    pub fn set_bit(self) -> &'a mut W {
243        self.bit(true)
244    }
245    #[doc = r"Clears the field bit"]
246    #[inline(always)]
247    pub fn clear_bit(self) -> &'a mut W {
248        self.bit(false)
249    }
250    #[doc = r"Writes raw bits to the field"]
251    #[inline(always)]
252    pub fn bit(self, value: bool) -> &'a mut W {
253        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
254        self.w
255    }
256}
257impl R {
258    #[doc = "Bits 12:31 - 31:12\\] Software should not rely on the value of a reserved bit. To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation."]
259    #[inline(always)]
260    pub fn reserved32(&self) -> RESERVED32_R {
261        RESERVED32_R::new(((self.bits >> 12) & 0x000f_ffff) as u32)
262    }
263    #[doc = "Bit 11 - 11:11\\] GPTM Timer B match masked interrupt"]
264    #[inline(always)]
265    pub fn tbmmis(&self) -> TBMMIS_R {
266        TBMMIS_R::new(((self.bits >> 11) & 0x01) != 0)
267    }
268    #[doc = "Bit 10 - 10:10\\] GPTM Timer B capture event masked interrupt"]
269    #[inline(always)]
270    pub fn cbemis(&self) -> CBEMIS_R {
271        CBEMIS_R::new(((self.bits >> 10) & 0x01) != 0)
272    }
273    #[doc = "Bit 9 - 9:9\\] GPTM Timer B capture match masked interrupt"]
274    #[inline(always)]
275    pub fn cbmmis(&self) -> CBMMIS_R {
276        CBMMIS_R::new(((self.bits >> 9) & 0x01) != 0)
277    }
278    #[doc = "Bit 8 - 8:8\\] GPTM Timer B time-out masked interrupt"]
279    #[inline(always)]
280    pub fn tbtomis(&self) -> TBTOMIS_R {
281        TBTOMIS_R::new(((self.bits >> 8) & 0x01) != 0)
282    }
283    #[doc = "Bits 5:7 - 7:5\\] Software should not rely on the value of a reserved bit. To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation."]
284    #[inline(always)]
285    pub fn reserved8(&self) -> RESERVED8_R {
286        RESERVED8_R::new(((self.bits >> 5) & 0x07) as u8)
287    }
288    #[doc = "Bit 4 - 4:4\\] GPTM Timer A match raw interrupt"]
289    #[inline(always)]
290    pub fn tamris(&self) -> TAMRIS_R {
291        TAMRIS_R::new(((self.bits >> 4) & 0x01) != 0)
292    }
293    #[doc = "Bit 3 - 3:3\\] Reserved"]
294    #[inline(always)]
295    pub fn reserved3(&self) -> RESERVED3_R {
296        RESERVED3_R::new(((self.bits >> 3) & 0x01) != 0)
297    }
298    #[doc = "Bit 2 - 2:2\\] GPTM Timer A capture event raw interrupt"]
299    #[inline(always)]
300    pub fn caemis(&self) -> CAEMIS_R {
301        CAEMIS_R::new(((self.bits >> 2) & 0x01) != 0)
302    }
303    #[doc = "Bit 1 - 1:1\\] GPTM Timer A capture match raw interrupt"]
304    #[inline(always)]
305    pub fn cammis(&self) -> CAMMIS_R {
306        CAMMIS_R::new(((self.bits >> 1) & 0x01) != 0)
307    }
308    #[doc = "Bit 0 - 0:0\\] GPTM Timer A time-out raw interrupt"]
309    #[inline(always)]
310    pub fn tatomis(&self) -> TATOMIS_R {
311        TATOMIS_R::new((self.bits & 0x01) != 0)
312    }
313}
314impl W {
315    #[doc = "Bits 12:31 - 31:12\\] Software should not rely on the value of a reserved bit. To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation."]
316    #[inline(always)]
317    pub fn reserved32(&mut self) -> RESERVED32_W {
318        RESERVED32_W { w: self }
319    }
320    #[doc = "Bit 11 - 11:11\\] GPTM Timer B match masked interrupt"]
321    #[inline(always)]
322    pub fn tbmmis(&mut self) -> TBMMIS_W {
323        TBMMIS_W { w: self }
324    }
325    #[doc = "Bit 10 - 10:10\\] GPTM Timer B capture event masked interrupt"]
326    #[inline(always)]
327    pub fn cbemis(&mut self) -> CBEMIS_W {
328        CBEMIS_W { w: self }
329    }
330    #[doc = "Bit 9 - 9:9\\] GPTM Timer B capture match masked interrupt"]
331    #[inline(always)]
332    pub fn cbmmis(&mut self) -> CBMMIS_W {
333        CBMMIS_W { w: self }
334    }
335    #[doc = "Bit 8 - 8:8\\] GPTM Timer B time-out masked interrupt"]
336    #[inline(always)]
337    pub fn tbtomis(&mut self) -> TBTOMIS_W {
338        TBTOMIS_W { w: self }
339    }
340    #[doc = "Bits 5:7 - 7:5\\] Software should not rely on the value of a reserved bit. To provide compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation."]
341    #[inline(always)]
342    pub fn reserved8(&mut self) -> RESERVED8_W {
343        RESERVED8_W { w: self }
344    }
345    #[doc = "Bit 4 - 4:4\\] GPTM Timer A match raw interrupt"]
346    #[inline(always)]
347    pub fn tamris(&mut self) -> TAMRIS_W {
348        TAMRIS_W { w: self }
349    }
350    #[doc = "Bit 3 - 3:3\\] Reserved"]
351    #[inline(always)]
352    pub fn reserved3(&mut self) -> RESERVED3_W {
353        RESERVED3_W { w: self }
354    }
355    #[doc = "Bit 2 - 2:2\\] GPTM Timer A capture event raw interrupt"]
356    #[inline(always)]
357    pub fn caemis(&mut self) -> CAEMIS_W {
358        CAEMIS_W { w: self }
359    }
360    #[doc = "Bit 1 - 1:1\\] GPTM Timer A capture match raw interrupt"]
361    #[inline(always)]
362    pub fn cammis(&mut self) -> CAMMIS_W {
363        CAMMIS_W { w: self }
364    }
365    #[doc = "Bit 0 - 0:0\\] GPTM Timer A time-out raw interrupt"]
366    #[inline(always)]
367    pub fn tatomis(&mut self) -> TATOMIS_W {
368        TATOMIS_W { w: self }
369    }
370}