Skip to main content

ra6m2_pac/
crc.rs

1/*
2DISCLAIMER
3This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
4No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5applicable laws, including copyright laws.
6THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
7OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
8NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
9LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
10INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
11ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
13of this software. By using this software, you agree to the additional terms and conditions found by accessing the
14following link:
15http://www.renesas.com/disclaimer
16
17*/
18// Generated from SVD 1.2, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:11:44 +0000
19
20#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"CRC Calculator"]
28unsafe impl ::core::marker::Send for super::Crc {}
29unsafe impl ::core::marker::Sync for super::Crc {}
30impl super::Crc {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "CRC Control Register0"]
38    #[inline(always)]
39    pub const fn crccr0(
40        &self,
41    ) -> &'static crate::common::Reg<self::Crccr0_SPEC, crate::common::RW> {
42        unsafe {
43            crate::common::Reg::<self::Crccr0_SPEC, crate::common::RW>::from_ptr(
44                self._svd2pac_as_ptr().add(0usize),
45            )
46        }
47    }
48
49    #[doc = "CRC Control Register1"]
50    #[inline(always)]
51    pub const fn crccr1(
52        &self,
53    ) -> &'static crate::common::Reg<self::Crccr1_SPEC, crate::common::RW> {
54        unsafe {
55            crate::common::Reg::<self::Crccr1_SPEC, crate::common::RW>::from_ptr(
56                self._svd2pac_as_ptr().add(1usize),
57            )
58        }
59    }
60
61    #[doc = "CRC Data Input Register"]
62    #[inline(always)]
63    pub const fn crcdir(
64        &self,
65    ) -> &'static crate::common::Reg<self::Crcdir_SPEC, crate::common::RW> {
66        unsafe {
67            crate::common::Reg::<self::Crcdir_SPEC, crate::common::RW>::from_ptr(
68                self._svd2pac_as_ptr().add(4usize),
69            )
70        }
71    }
72
73    #[doc = "CRC Data Input Register (byte access)"]
74    #[inline(always)]
75    pub const fn crcdir_by(
76        &self,
77    ) -> &'static crate::common::Reg<self::CrcdirBy_SPEC, crate::common::RW> {
78        unsafe {
79            crate::common::Reg::<self::CrcdirBy_SPEC, crate::common::RW>::from_ptr(
80                self._svd2pac_as_ptr().add(4usize),
81            )
82        }
83    }
84
85    #[doc = "CRC Data Output Register"]
86    #[inline(always)]
87    pub const fn crcdor(
88        &self,
89    ) -> &'static crate::common::Reg<self::Crcdor_SPEC, crate::common::RW> {
90        unsafe {
91            crate::common::Reg::<self::Crcdor_SPEC, crate::common::RW>::from_ptr(
92                self._svd2pac_as_ptr().add(8usize),
93            )
94        }
95    }
96
97    #[doc = "CRC Data Output Register (halfword access)"]
98    #[inline(always)]
99    pub const fn crcdor_ha(
100        &self,
101    ) -> &'static crate::common::Reg<self::CrcdorHa_SPEC, crate::common::RW> {
102        unsafe {
103            crate::common::Reg::<self::CrcdorHa_SPEC, crate::common::RW>::from_ptr(
104                self._svd2pac_as_ptr().add(8usize),
105            )
106        }
107    }
108
109    #[doc = "CRC Data Output Register(byte access)"]
110    #[inline(always)]
111    pub const fn crcdor_by(
112        &self,
113    ) -> &'static crate::common::Reg<self::CrcdorBy_SPEC, crate::common::RW> {
114        unsafe {
115            crate::common::Reg::<self::CrcdorBy_SPEC, crate::common::RW>::from_ptr(
116                self._svd2pac_as_ptr().add(8usize),
117            )
118        }
119    }
120
121    #[doc = "Snoop Address Register"]
122    #[inline(always)]
123    pub const fn crcsar(
124        &self,
125    ) -> &'static crate::common::Reg<self::Crcsar_SPEC, crate::common::RW> {
126        unsafe {
127            crate::common::Reg::<self::Crcsar_SPEC, crate::common::RW>::from_ptr(
128                self._svd2pac_as_ptr().add(12usize),
129            )
130        }
131    }
132}
133#[doc(hidden)]
134#[derive(Copy, Clone, Eq, PartialEq)]
135pub struct Crccr0_SPEC;
136impl crate::sealed::RegSpec for Crccr0_SPEC {
137    type DataType = u8;
138}
139
140#[doc = "CRC Control Register0"]
141pub type Crccr0 = crate::RegValueT<Crccr0_SPEC>;
142
143impl Crccr0 {
144    #[doc = "CRCDOR Register Clear"]
145    #[inline(always)]
146    pub fn dorclr(
147        self,
148    ) -> crate::common::RegisterField<
149        7,
150        0x1,
151        1,
152        0,
153        crccr0::Dorclr,
154        crccr0::Dorclr,
155        Crccr0_SPEC,
156        crate::common::W,
157    > {
158        crate::common::RegisterField::<
159            7,
160            0x1,
161            1,
162            0,
163            crccr0::Dorclr,
164            crccr0::Dorclr,
165            Crccr0_SPEC,
166            crate::common::W,
167        >::from_register(self, 0)
168    }
169
170    #[doc = "CRC Calculation Switching"]
171    #[inline(always)]
172    pub fn lms(
173        self,
174    ) -> crate::common::RegisterField<
175        6,
176        0x1,
177        1,
178        0,
179        crccr0::Lms,
180        crccr0::Lms,
181        Crccr0_SPEC,
182        crate::common::RW,
183    > {
184        crate::common::RegisterField::<
185            6,
186            0x1,
187            1,
188            0,
189            crccr0::Lms,
190            crccr0::Lms,
191            Crccr0_SPEC,
192            crate::common::RW,
193        >::from_register(self, 0)
194    }
195
196    #[doc = "CRC Generating Polynomial Switching"]
197    #[inline(always)]
198    pub fn gps(
199        self,
200    ) -> crate::common::RegisterField<
201        0,
202        0x7,
203        1,
204        0,
205        crccr0::Gps,
206        crccr0::Gps,
207        Crccr0_SPEC,
208        crate::common::RW,
209    > {
210        crate::common::RegisterField::<
211            0,
212            0x7,
213            1,
214            0,
215            crccr0::Gps,
216            crccr0::Gps,
217            Crccr0_SPEC,
218            crate::common::RW,
219        >::from_register(self, 0)
220    }
221}
222impl ::core::default::Default for Crccr0 {
223    #[inline(always)]
224    fn default() -> Crccr0 {
225        <crate::RegValueT<Crccr0_SPEC> as RegisterValue<_>>::new(0)
226    }
227}
228pub mod crccr0 {
229
230    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
231    pub struct Dorclr_SPEC;
232    pub type Dorclr = crate::EnumBitfieldStruct<u8, Dorclr_SPEC>;
233    impl Dorclr {
234        #[doc = "No effect."]
235        pub const _0: Self = Self::new(0);
236
237        #[doc = "Clears the CRCDOR register."]
238        pub const _1: Self = Self::new(1);
239    }
240    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
241    pub struct Lms_SPEC;
242    pub type Lms = crate::EnumBitfieldStruct<u8, Lms_SPEC>;
243    impl Lms {
244        #[doc = "Generates CRC for LSB first communication."]
245        pub const _0: Self = Self::new(0);
246
247        #[doc = "Generates CRC for MSB first communication."]
248        pub const _1: Self = Self::new(1);
249    }
250    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
251    pub struct Gps_SPEC;
252    pub type Gps = crate::EnumBitfieldStruct<u8, Gps_SPEC>;
253    impl Gps {
254        #[doc = "No calculation is executed."]
255        pub const _000: Self = Self::new(0);
256
257        #[doc = "8-bit CRC-8 (X8 + X2 + X + 1)"]
258        pub const _001: Self = Self::new(1);
259
260        #[doc = "16-bit CRC-16 (X16 + X15 + X2 + 1)"]
261        pub const _010: Self = Self::new(2);
262
263        #[doc = "16-bit CRC-CCITT (X16 + X12 + X5 + 1)"]
264        pub const _011: Self = Self::new(3);
265
266        #[doc = "32-bit CRC-32 (X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1)"]
267        pub const _100: Self = Self::new(4);
268
269        #[doc = "32-bit CRC-32C (X32+X28+X27+X26+ X25+X23+X22+X20+X19+X18+X14+X13+X11+X10+X9+X8+X6+1)"]
270        pub const _101: Self = Self::new(5);
271    }
272}
273#[doc(hidden)]
274#[derive(Copy, Clone, Eq, PartialEq)]
275pub struct Crccr1_SPEC;
276impl crate::sealed::RegSpec for Crccr1_SPEC {
277    type DataType = u8;
278}
279
280#[doc = "CRC Control Register1"]
281pub type Crccr1 = crate::RegValueT<Crccr1_SPEC>;
282
283impl Crccr1 {
284    #[doc = "Snoop enable bit"]
285    #[inline(always)]
286    pub fn crcsen(
287        self,
288    ) -> crate::common::RegisterField<
289        7,
290        0x1,
291        1,
292        0,
293        crccr1::Crcsen,
294        crccr1::Crcsen,
295        Crccr1_SPEC,
296        crate::common::RW,
297    > {
298        crate::common::RegisterField::<
299            7,
300            0x1,
301            1,
302            0,
303            crccr1::Crcsen,
304            crccr1::Crcsen,
305            Crccr1_SPEC,
306            crate::common::RW,
307        >::from_register(self, 0)
308    }
309
310    #[doc = "Snoop-on-write/read switch bit"]
311    #[inline(always)]
312    pub fn crcswr(
313        self,
314    ) -> crate::common::RegisterField<
315        6,
316        0x1,
317        1,
318        0,
319        crccr1::Crcswr,
320        crccr1::Crcswr,
321        Crccr1_SPEC,
322        crate::common::RW,
323    > {
324        crate::common::RegisterField::<
325            6,
326            0x1,
327            1,
328            0,
329            crccr1::Crcswr,
330            crccr1::Crcswr,
331            Crccr1_SPEC,
332            crate::common::RW,
333        >::from_register(self, 0)
334    }
335}
336impl ::core::default::Default for Crccr1 {
337    #[inline(always)]
338    fn default() -> Crccr1 {
339        <crate::RegValueT<Crccr1_SPEC> as RegisterValue<_>>::new(0)
340    }
341}
342pub mod crccr1 {
343
344    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
345    pub struct Crcsen_SPEC;
346    pub type Crcsen = crate::EnumBitfieldStruct<u8, Crcsen_SPEC>;
347    impl Crcsen {
348        #[doc = "Disabled"]
349        pub const _0: Self = Self::new(0);
350
351        #[doc = "Enabled"]
352        pub const _1: Self = Self::new(1);
353    }
354    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
355    pub struct Crcswr_SPEC;
356    pub type Crcswr = crate::EnumBitfieldStruct<u8, Crcswr_SPEC>;
357    impl Crcswr {
358        #[doc = "Snoop-on-read"]
359        pub const _0: Self = Self::new(0);
360
361        #[doc = "Snoop-on-write"]
362        pub const _1: Self = Self::new(1);
363    }
364}
365#[doc(hidden)]
366#[derive(Copy, Clone, Eq, PartialEq)]
367pub struct Crcdir_SPEC;
368impl crate::sealed::RegSpec for Crcdir_SPEC {
369    type DataType = u32;
370}
371
372#[doc = "CRC Data Input Register"]
373pub type Crcdir = crate::RegValueT<Crcdir_SPEC>;
374
375impl Crcdir {
376    #[doc = "Calculation input Data (Case of CRC-32, CRC-32C )"]
377    #[inline(always)]
378    pub fn crcdir(
379        self,
380    ) -> crate::common::RegisterField<0, 0xffffffff, 1, 0, u32, u32, Crcdir_SPEC, crate::common::RW>
381    {
382        crate::common::RegisterField::<0,0xffffffff,1,0,u32,u32,Crcdir_SPEC,crate::common::RW>::from_register(self,0)
383    }
384}
385impl ::core::default::Default for Crcdir {
386    #[inline(always)]
387    fn default() -> Crcdir {
388        <crate::RegValueT<Crcdir_SPEC> as RegisterValue<_>>::new(0)
389    }
390}
391
392#[doc(hidden)]
393#[derive(Copy, Clone, Eq, PartialEq)]
394pub struct CrcdirBy_SPEC;
395impl crate::sealed::RegSpec for CrcdirBy_SPEC {
396    type DataType = u8;
397}
398
399#[doc = "CRC Data Input Register (byte access)"]
400pub type CrcdirBy = crate::RegValueT<CrcdirBy_SPEC>;
401
402impl CrcdirBy {
403    #[doc = "Calculation input Data ( Case of CRC-8, CRC-16 or CRC-CCITT )"]
404    #[inline(always)]
405    pub fn crcdir_by(
406        self,
407    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, CrcdirBy_SPEC, crate::common::RW> {
408        crate::common::RegisterField::<0,0xff,1,0,u8,u8,CrcdirBy_SPEC,crate::common::RW>::from_register(self,0)
409    }
410}
411impl ::core::default::Default for CrcdirBy {
412    #[inline(always)]
413    fn default() -> CrcdirBy {
414        <crate::RegValueT<CrcdirBy_SPEC> as RegisterValue<_>>::new(0)
415    }
416}
417
418#[doc(hidden)]
419#[derive(Copy, Clone, Eq, PartialEq)]
420pub struct Crcdor_SPEC;
421impl crate::sealed::RegSpec for Crcdor_SPEC {
422    type DataType = u32;
423}
424
425#[doc = "CRC Data Output Register"]
426pub type Crcdor = crate::RegValueT<Crcdor_SPEC>;
427
428impl Crcdor {
429    #[doc = "Calculation output Data (Case of CRC-32, CRC-32C )"]
430    #[inline(always)]
431    pub fn crcdor(
432        self,
433    ) -> crate::common::RegisterField<0, 0xffffffff, 1, 0, u32, u32, Crcdor_SPEC, crate::common::RW>
434    {
435        crate::common::RegisterField::<0,0xffffffff,1,0,u32,u32,Crcdor_SPEC,crate::common::RW>::from_register(self,0)
436    }
437}
438impl ::core::default::Default for Crcdor {
439    #[inline(always)]
440    fn default() -> Crcdor {
441        <crate::RegValueT<Crcdor_SPEC> as RegisterValue<_>>::new(0)
442    }
443}
444
445#[doc(hidden)]
446#[derive(Copy, Clone, Eq, PartialEq)]
447pub struct CrcdorHa_SPEC;
448impl crate::sealed::RegSpec for CrcdorHa_SPEC {
449    type DataType = u16;
450}
451
452#[doc = "CRC Data Output Register (halfword access)"]
453pub type CrcdorHa = crate::RegValueT<CrcdorHa_SPEC>;
454
455impl CrcdorHa {
456    #[doc = "Calculation output Data (Case of CRC-16 or CRC-CCITT )"]
457    #[inline(always)]
458    pub fn crcdor_ha(
459        self,
460    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, CrcdorHa_SPEC, crate::common::RW>
461    {
462        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,CrcdorHa_SPEC,crate::common::RW>::from_register(self,0)
463    }
464}
465impl ::core::default::Default for CrcdorHa {
466    #[inline(always)]
467    fn default() -> CrcdorHa {
468        <crate::RegValueT<CrcdorHa_SPEC> as RegisterValue<_>>::new(0)
469    }
470}
471
472#[doc(hidden)]
473#[derive(Copy, Clone, Eq, PartialEq)]
474pub struct CrcdorBy_SPEC;
475impl crate::sealed::RegSpec for CrcdorBy_SPEC {
476    type DataType = u8;
477}
478
479#[doc = "CRC Data Output Register(byte access)"]
480pub type CrcdorBy = crate::RegValueT<CrcdorBy_SPEC>;
481
482impl CrcdorBy {
483    #[doc = "Calculation output Data (Case of CRC-8 )"]
484    #[inline(always)]
485    pub fn crcdor_by(
486        self,
487    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, CrcdorBy_SPEC, crate::common::RW> {
488        crate::common::RegisterField::<0,0xff,1,0,u8,u8,CrcdorBy_SPEC,crate::common::RW>::from_register(self,0)
489    }
490}
491impl ::core::default::Default for CrcdorBy {
492    #[inline(always)]
493    fn default() -> CrcdorBy {
494        <crate::RegValueT<CrcdorBy_SPEC> as RegisterValue<_>>::new(0)
495    }
496}
497
498#[doc(hidden)]
499#[derive(Copy, Clone, Eq, PartialEq)]
500pub struct Crcsar_SPEC;
501impl crate::sealed::RegSpec for Crcsar_SPEC {
502    type DataType = u16;
503}
504
505#[doc = "Snoop Address Register"]
506pub type Crcsar = crate::RegValueT<Crcsar_SPEC>;
507
508impl Crcsar {
509    #[doc = "snoop address bitSet the I/O register address to snoop"]
510    #[inline(always)]
511    pub fn crcsa(
512        self,
513    ) -> crate::common::RegisterField<
514        0,
515        0x3fff,
516        1,
517        0,
518        crcsar::Crcsa,
519        crcsar::Crcsa,
520        Crcsar_SPEC,
521        crate::common::RW,
522    > {
523        crate::common::RegisterField::<
524            0,
525            0x3fff,
526            1,
527            0,
528            crcsar::Crcsa,
529            crcsar::Crcsa,
530            Crcsar_SPEC,
531            crate::common::RW,
532        >::from_register(self, 0)
533    }
534}
535impl ::core::default::Default for Crcsar {
536    #[inline(always)]
537    fn default() -> Crcsar {
538        <crate::RegValueT<Crcsar_SPEC> as RegisterValue<_>>::new(0)
539    }
540}
541pub mod crcsar {
542
543    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
544    pub struct Crcsa_SPEC;
545    pub type Crcsa = crate::EnumBitfieldStruct<u16, Crcsa_SPEC>;
546    impl Crcsa {
547        #[doc = "SCI0.TDR"]
548        pub const _0_X_0003: Self = Self::new(3);
549
550        #[doc = "SCI0.RDR"]
551        pub const _0_X_0005: Self = Self::new(5);
552
553        #[doc = "SCI1.TDR"]
554        pub const _0_X_0023: Self = Self::new(35);
555
556        #[doc = "SCI1.RDR"]
557        pub const _0_X_0025: Self = Self::new(37);
558
559        #[doc = "SCI2.TDR"]
560        pub const _0_X_0043: Self = Self::new(67);
561
562        #[doc = "SCI2.RDR"]
563        pub const _0_X_0045: Self = Self::new(69);
564
565        #[doc = "SCI3.TDR"]
566        pub const _0_X_0063: Self = Self::new(99);
567
568        #[doc = "SCI3.RDR"]
569        pub const _0_X_0065: Self = Self::new(101);
570
571        #[doc = "SCI4.TDR"]
572        pub const _0_X_0083: Self = Self::new(131);
573
574        #[doc = "SCI4.RDR"]
575        pub const _0_X_0085: Self = Self::new(133);
576
577        #[doc = "SCI5.TDR"]
578        pub const _0_X_00_A_3: Self = Self::new(163);
579
580        #[doc = "SCI5.RDR"]
581        pub const _0_X_00_A_5: Self = Self::new(165);
582
583        #[doc = "SCI6.TDR"]
584        pub const _0_X_00_C_3: Self = Self::new(195);
585
586        #[doc = "SCI6.RDR"]
587        pub const _0_X_00_C_5: Self = Self::new(197);
588
589        #[doc = "SCI7.TDR"]
590        pub const _0_X_00_E_3: Self = Self::new(227);
591
592        #[doc = "SCI7.RDR"]
593        pub const _0_X_00_E_5: Self = Self::new(229);
594
595        #[doc = "SCI8.TDR"]
596        pub const _0_X_0103: Self = Self::new(259);
597
598        #[doc = "SCI8.RDR"]
599        pub const _0_X_0105: Self = Self::new(261);
600
601        #[doc = "SCI9.TDR"]
602        pub const _0_X_0123: Self = Self::new(291);
603
604        #[doc = "SCI9.RDR"]
605        pub const _0_X_0125: Self = Self::new(293);
606    }
607}