ra6m1/crc/
crcsar.rs

1#[doc = "Register `CRCSAR` reader"]
2pub struct R(crate::R<CRCSAR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CRCSAR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CRCSAR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CRCSAR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CRCSAR` writer"]
17pub struct W(crate::W<CRCSAR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CRCSAR_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<CRCSAR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CRCSAR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CRCSA` reader - snoop address bitSet the I/O register address to snoop"]
38pub type CRCSA_R = crate::FieldReader<u16, CRCSA_A>;
39#[doc = "snoop address bitSet the I/O register address to snoop\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u16)]
42pub enum CRCSA_A {
43    #[doc = "3: SCI0.TDR"]
44    _0X0003 = 3,
45    #[doc = "5: SCI0.RDR"]
46    _0X0005 = 5,
47    #[doc = "35: SCI1.TDR"]
48    _0X0023 = 35,
49    #[doc = "37: SCI1.RDR"]
50    _0X0025 = 37,
51    #[doc = "67: SCI2.TDR"]
52    _0X0043 = 67,
53    #[doc = "69: SCI2.RDR"]
54    _0X0045 = 69,
55    #[doc = "99: SCI3.TDR"]
56    _0X0063 = 99,
57    #[doc = "101: SCI3.RDR"]
58    _0X0065 = 101,
59    #[doc = "131: SCI4.TDR"]
60    _0X0083 = 131,
61    #[doc = "133: SCI4.RDR"]
62    _0X0085 = 133,
63    #[doc = "163: SCI5.TDR"]
64    _0X00A3 = 163,
65    #[doc = "165: SCI5.RDR"]
66    _0X00A5 = 165,
67    #[doc = "195: SCI6.TDR"]
68    _0X00C3 = 195,
69    #[doc = "197: SCI6.RDR"]
70    _0X00C5 = 197,
71    #[doc = "227: SCI7.TDR"]
72    _0X00E3 = 227,
73    #[doc = "229: SCI7.RDR"]
74    _0X00E5 = 229,
75    #[doc = "259: SCI8.TDR"]
76    _0X0103 = 259,
77    #[doc = "261: SCI8.RDR"]
78    _0X0105 = 261,
79    #[doc = "291: SCI9.TDR"]
80    _0X0123 = 291,
81    #[doc = "293: SCI9.RDR"]
82    _0X0125 = 293,
83}
84impl From<CRCSA_A> for u16 {
85    #[inline(always)]
86    fn from(variant: CRCSA_A) -> Self {
87        variant as _
88    }
89}
90impl CRCSA_R {
91    #[doc = "Get enumerated values variant"]
92    #[inline(always)]
93    pub fn variant(&self) -> Option<CRCSA_A> {
94        match self.bits {
95            3 => Some(CRCSA_A::_0X0003),
96            5 => Some(CRCSA_A::_0X0005),
97            35 => Some(CRCSA_A::_0X0023),
98            37 => Some(CRCSA_A::_0X0025),
99            67 => Some(CRCSA_A::_0X0043),
100            69 => Some(CRCSA_A::_0X0045),
101            99 => Some(CRCSA_A::_0X0063),
102            101 => Some(CRCSA_A::_0X0065),
103            131 => Some(CRCSA_A::_0X0083),
104            133 => Some(CRCSA_A::_0X0085),
105            163 => Some(CRCSA_A::_0X00A3),
106            165 => Some(CRCSA_A::_0X00A5),
107            195 => Some(CRCSA_A::_0X00C3),
108            197 => Some(CRCSA_A::_0X00C5),
109            227 => Some(CRCSA_A::_0X00E3),
110            229 => Some(CRCSA_A::_0X00E5),
111            259 => Some(CRCSA_A::_0X0103),
112            261 => Some(CRCSA_A::_0X0105),
113            291 => Some(CRCSA_A::_0X0123),
114            293 => Some(CRCSA_A::_0X0125),
115            _ => None,
116        }
117    }
118    #[doc = "Checks if the value of the field is `_0X0003`"]
119    #[inline(always)]
120    pub fn is_0x0003(&self) -> bool {
121        *self == CRCSA_A::_0X0003
122    }
123    #[doc = "Checks if the value of the field is `_0X0005`"]
124    #[inline(always)]
125    pub fn is_0x0005(&self) -> bool {
126        *self == CRCSA_A::_0X0005
127    }
128    #[doc = "Checks if the value of the field is `_0X0023`"]
129    #[inline(always)]
130    pub fn is_0x0023(&self) -> bool {
131        *self == CRCSA_A::_0X0023
132    }
133    #[doc = "Checks if the value of the field is `_0X0025`"]
134    #[inline(always)]
135    pub fn is_0x0025(&self) -> bool {
136        *self == CRCSA_A::_0X0025
137    }
138    #[doc = "Checks if the value of the field is `_0X0043`"]
139    #[inline(always)]
140    pub fn is_0x0043(&self) -> bool {
141        *self == CRCSA_A::_0X0043
142    }
143    #[doc = "Checks if the value of the field is `_0X0045`"]
144    #[inline(always)]
145    pub fn is_0x0045(&self) -> bool {
146        *self == CRCSA_A::_0X0045
147    }
148    #[doc = "Checks if the value of the field is `_0X0063`"]
149    #[inline(always)]
150    pub fn is_0x0063(&self) -> bool {
151        *self == CRCSA_A::_0X0063
152    }
153    #[doc = "Checks if the value of the field is `_0X0065`"]
154    #[inline(always)]
155    pub fn is_0x0065(&self) -> bool {
156        *self == CRCSA_A::_0X0065
157    }
158    #[doc = "Checks if the value of the field is `_0X0083`"]
159    #[inline(always)]
160    pub fn is_0x0083(&self) -> bool {
161        *self == CRCSA_A::_0X0083
162    }
163    #[doc = "Checks if the value of the field is `_0X0085`"]
164    #[inline(always)]
165    pub fn is_0x0085(&self) -> bool {
166        *self == CRCSA_A::_0X0085
167    }
168    #[doc = "Checks if the value of the field is `_0X00A3`"]
169    #[inline(always)]
170    pub fn is_0x00a3(&self) -> bool {
171        *self == CRCSA_A::_0X00A3
172    }
173    #[doc = "Checks if the value of the field is `_0X00A5`"]
174    #[inline(always)]
175    pub fn is_0x00a5(&self) -> bool {
176        *self == CRCSA_A::_0X00A5
177    }
178    #[doc = "Checks if the value of the field is `_0X00C3`"]
179    #[inline(always)]
180    pub fn is_0x00c3(&self) -> bool {
181        *self == CRCSA_A::_0X00C3
182    }
183    #[doc = "Checks if the value of the field is `_0X00C5`"]
184    #[inline(always)]
185    pub fn is_0x00c5(&self) -> bool {
186        *self == CRCSA_A::_0X00C5
187    }
188    #[doc = "Checks if the value of the field is `_0X00E3`"]
189    #[inline(always)]
190    pub fn is_0x00e3(&self) -> bool {
191        *self == CRCSA_A::_0X00E3
192    }
193    #[doc = "Checks if the value of the field is `_0X00E5`"]
194    #[inline(always)]
195    pub fn is_0x00e5(&self) -> bool {
196        *self == CRCSA_A::_0X00E5
197    }
198    #[doc = "Checks if the value of the field is `_0X0103`"]
199    #[inline(always)]
200    pub fn is_0x0103(&self) -> bool {
201        *self == CRCSA_A::_0X0103
202    }
203    #[doc = "Checks if the value of the field is `_0X0105`"]
204    #[inline(always)]
205    pub fn is_0x0105(&self) -> bool {
206        *self == CRCSA_A::_0X0105
207    }
208    #[doc = "Checks if the value of the field is `_0X0123`"]
209    #[inline(always)]
210    pub fn is_0x0123(&self) -> bool {
211        *self == CRCSA_A::_0X0123
212    }
213    #[doc = "Checks if the value of the field is `_0X0125`"]
214    #[inline(always)]
215    pub fn is_0x0125(&self) -> bool {
216        *self == CRCSA_A::_0X0125
217    }
218}
219#[doc = "Field `CRCSA` writer - snoop address bitSet the I/O register address to snoop"]
220pub type CRCSA_W<'a, const O: u8> = crate::FieldWriter<'a, u16, CRCSAR_SPEC, u16, CRCSA_A, 14, O>;
221impl<'a, const O: u8> CRCSA_W<'a, O> {
222    #[doc = "SCI0.TDR"]
223    #[inline(always)]
224    pub fn _0x0003(self) -> &'a mut W {
225        self.variant(CRCSA_A::_0X0003)
226    }
227    #[doc = "SCI0.RDR"]
228    #[inline(always)]
229    pub fn _0x0005(self) -> &'a mut W {
230        self.variant(CRCSA_A::_0X0005)
231    }
232    #[doc = "SCI1.TDR"]
233    #[inline(always)]
234    pub fn _0x0023(self) -> &'a mut W {
235        self.variant(CRCSA_A::_0X0023)
236    }
237    #[doc = "SCI1.RDR"]
238    #[inline(always)]
239    pub fn _0x0025(self) -> &'a mut W {
240        self.variant(CRCSA_A::_0X0025)
241    }
242    #[doc = "SCI2.TDR"]
243    #[inline(always)]
244    pub fn _0x0043(self) -> &'a mut W {
245        self.variant(CRCSA_A::_0X0043)
246    }
247    #[doc = "SCI2.RDR"]
248    #[inline(always)]
249    pub fn _0x0045(self) -> &'a mut W {
250        self.variant(CRCSA_A::_0X0045)
251    }
252    #[doc = "SCI3.TDR"]
253    #[inline(always)]
254    pub fn _0x0063(self) -> &'a mut W {
255        self.variant(CRCSA_A::_0X0063)
256    }
257    #[doc = "SCI3.RDR"]
258    #[inline(always)]
259    pub fn _0x0065(self) -> &'a mut W {
260        self.variant(CRCSA_A::_0X0065)
261    }
262    #[doc = "SCI4.TDR"]
263    #[inline(always)]
264    pub fn _0x0083(self) -> &'a mut W {
265        self.variant(CRCSA_A::_0X0083)
266    }
267    #[doc = "SCI4.RDR"]
268    #[inline(always)]
269    pub fn _0x0085(self) -> &'a mut W {
270        self.variant(CRCSA_A::_0X0085)
271    }
272    #[doc = "SCI5.TDR"]
273    #[inline(always)]
274    pub fn _0x00a3(self) -> &'a mut W {
275        self.variant(CRCSA_A::_0X00A3)
276    }
277    #[doc = "SCI5.RDR"]
278    #[inline(always)]
279    pub fn _0x00a5(self) -> &'a mut W {
280        self.variant(CRCSA_A::_0X00A5)
281    }
282    #[doc = "SCI6.TDR"]
283    #[inline(always)]
284    pub fn _0x00c3(self) -> &'a mut W {
285        self.variant(CRCSA_A::_0X00C3)
286    }
287    #[doc = "SCI6.RDR"]
288    #[inline(always)]
289    pub fn _0x00c5(self) -> &'a mut W {
290        self.variant(CRCSA_A::_0X00C5)
291    }
292    #[doc = "SCI7.TDR"]
293    #[inline(always)]
294    pub fn _0x00e3(self) -> &'a mut W {
295        self.variant(CRCSA_A::_0X00E3)
296    }
297    #[doc = "SCI7.RDR"]
298    #[inline(always)]
299    pub fn _0x00e5(self) -> &'a mut W {
300        self.variant(CRCSA_A::_0X00E5)
301    }
302    #[doc = "SCI8.TDR"]
303    #[inline(always)]
304    pub fn _0x0103(self) -> &'a mut W {
305        self.variant(CRCSA_A::_0X0103)
306    }
307    #[doc = "SCI8.RDR"]
308    #[inline(always)]
309    pub fn _0x0105(self) -> &'a mut W {
310        self.variant(CRCSA_A::_0X0105)
311    }
312    #[doc = "SCI9.TDR"]
313    #[inline(always)]
314    pub fn _0x0123(self) -> &'a mut W {
315        self.variant(CRCSA_A::_0X0123)
316    }
317    #[doc = "SCI9.RDR"]
318    #[inline(always)]
319    pub fn _0x0125(self) -> &'a mut W {
320        self.variant(CRCSA_A::_0X0125)
321    }
322}
323impl R {
324    #[doc = "Bits 0:13 - snoop address bitSet the I/O register address to snoop"]
325    #[inline(always)]
326    pub fn crcsa(&self) -> CRCSA_R {
327        CRCSA_R::new(self.bits & 0x3fff)
328    }
329}
330impl W {
331    #[doc = "Bits 0:13 - snoop address bitSet the I/O register address to snoop"]
332    #[inline(always)]
333    #[must_use]
334    pub fn crcsa(&mut self) -> CRCSA_W<0> {
335        CRCSA_W::new(self)
336    }
337    #[doc = "Writes raw bits to the register."]
338    #[inline(always)]
339    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
340        self.0.bits(bits);
341        self
342    }
343}
344#[doc = "Snoop Address 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 [crcsar](index.html) module"]
345pub struct CRCSAR_SPEC;
346impl crate::RegisterSpec for CRCSAR_SPEC {
347    type Ux = u16;
348}
349#[doc = "`read()` method returns [crcsar::R](R) reader structure"]
350impl crate::Readable for CRCSAR_SPEC {
351    type Reader = R;
352}
353#[doc = "`write(|w| ..)` method takes [crcsar::W](W) writer structure"]
354impl crate::Writable for CRCSAR_SPEC {
355    type Writer = W;
356    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
357    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
358}
359#[doc = "`reset()` method sets CRCSAR to value 0"]
360impl crate::Resettable for CRCSAR_SPEC {
361    const RESET_VALUE: Self::Ux = 0;
362}