ra2e2_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.40.00, with svd2pac 0.6.0 on Thu, 24 Jul 2025 04:46:37 +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"Cyclic Redundancy Check 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 Register 0"]
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 Register 1"]
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"]
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"]
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"]
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 Register 0"]
141pub type Crccr0 = crate::RegValueT<Crccr0_SPEC>;
142
143impl Crccr0 {
144    #[doc = "CRC Generating Polynomial Switching"]
145    #[inline(always)]
146    pub fn gps(
147        self,
148    ) -> crate::common::RegisterField<
149        0,
150        0x7,
151        1,
152        0,
153        crccr0::Gps,
154        crccr0::Gps,
155        Crccr0_SPEC,
156        crate::common::RW,
157    > {
158        crate::common::RegisterField::<
159            0,
160            0x7,
161            1,
162            0,
163            crccr0::Gps,
164            crccr0::Gps,
165            Crccr0_SPEC,
166            crate::common::RW,
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 = "CRCDOR/CRCDOR_HA/CRCDOR_BY Register Clear"]
197    #[inline(always)]
198    pub fn dorclr(
199        self,
200    ) -> crate::common::RegisterField<
201        7,
202        0x1,
203        1,
204        0,
205        crccr0::Dorclr,
206        crccr0::Dorclr,
207        Crccr0_SPEC,
208        crate::common::W,
209    > {
210        crate::common::RegisterField::<
211            7,
212            0x1,
213            1,
214            0,
215            crccr0::Dorclr,
216            crccr0::Dorclr,
217            Crccr0_SPEC,
218            crate::common::W,
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 Gps_SPEC;
232    pub type Gps = crate::EnumBitfieldStruct<u8, Gps_SPEC>;
233    impl Gps {
234        #[doc = "8-bit CRC-8 (X8 + X2 + X + 1)"]
235        pub const _001: Self = Self::new(1);
236
237        #[doc = "16-bit CRC-16 (X16 + X15 + X2 + 1)"]
238        pub const _010: Self = Self::new(2);
239
240        #[doc = "16-bit CRC-CCITT (X16 + X12 + X5 + 1)"]
241        pub const _011: Self = Self::new(3);
242
243        #[doc = "32-bit CRC-32 (X32 + X26 + X23 + X22 + X16 + X12 + X11 +X10 + X8 + X7 + X5 + X4 + X2 + X + 1)"]
244        pub const _100: Self = Self::new(4);
245
246        #[doc = "32-bit CRC-32C (X32 + X28 + X27 + X26 + X25 + X23 + X22 + X20 + X19 + X18 + X14 + X13 + X11 + X10 + X9 + X8 + X6 + 1)"]
247        pub const _101: Self = Self::new(5);
248
249        #[doc = "No calculation is executed"]
250        pub const OTHERS: Self = Self::new(0);
251    }
252    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
253    pub struct Lms_SPEC;
254    pub type Lms = crate::EnumBitfieldStruct<u8, Lms_SPEC>;
255    impl Lms {
256        #[doc = "Generate CRC code for LSB-first communication"]
257        pub const _0: Self = Self::new(0);
258
259        #[doc = "Generate CRC code for MSB-first communication"]
260        pub const _1: Self = Self::new(1);
261    }
262    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
263    pub struct Dorclr_SPEC;
264    pub type Dorclr = crate::EnumBitfieldStruct<u8, Dorclr_SPEC>;
265    impl Dorclr {
266        #[doc = "No effect"]
267        pub const _0: Self = Self::new(0);
268
269        #[doc = "Clear the CRCDOR/CRCDOR_HA/CRCDOR_BY register"]
270        pub const _1: Self = Self::new(1);
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 Register 1"]
281pub type Crccr1 = crate::RegValueT<Crccr1_SPEC>;
282
283impl Crccr1 {
284    #[doc = "Snoop-On-Write/Read Switch"]
285    #[inline(always)]
286    pub fn crcswr(
287        self,
288    ) -> crate::common::RegisterField<
289        6,
290        0x1,
291        1,
292        0,
293        crccr1::Crcswr,
294        crccr1::Crcswr,
295        Crccr1_SPEC,
296        crate::common::RW,
297    > {
298        crate::common::RegisterField::<
299            6,
300            0x1,
301            1,
302            0,
303            crccr1::Crcswr,
304            crccr1::Crcswr,
305            Crccr1_SPEC,
306            crate::common::RW,
307        >::from_register(self, 0)
308    }
309
310    #[doc = "Snoop Enable"]
311    #[inline(always)]
312    pub fn crcsen(
313        self,
314    ) -> crate::common::RegisterField<
315        7,
316        0x1,
317        1,
318        0,
319        crccr1::Crcsen,
320        crccr1::Crcsen,
321        Crccr1_SPEC,
322        crate::common::RW,
323    > {
324        crate::common::RegisterField::<
325            7,
326            0x1,
327            1,
328            0,
329            crccr1::Crcsen,
330            crccr1::Crcsen,
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 Crcswr_SPEC;
346    pub type Crcswr = crate::EnumBitfieldStruct<u8, Crcswr_SPEC>;
347    impl Crcswr {
348        #[doc = "Snoop-on-read"]
349        pub const _0: Self = Self::new(0);
350
351        #[doc = "Snoop-on-write"]
352        pub const _1: Self = Self::new(1);
353    }
354    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
355    pub struct Crcsen_SPEC;
356    pub type Crcsen = crate::EnumBitfieldStruct<u8, Crcsen_SPEC>;
357    impl Crcsen {
358        #[doc = "Disabled"]
359        pub const _0: Self = Self::new(0);
360
361        #[doc = "Enabled"]
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 NoBitfieldReg<Crcdir_SPEC> for Crcdir {}
376impl ::core::default::Default for Crcdir {
377    #[inline(always)]
378    fn default() -> Crcdir {
379        <crate::RegValueT<Crcdir_SPEC> as RegisterValue<_>>::new(0)
380    }
381}
382
383#[doc(hidden)]
384#[derive(Copy, Clone, Eq, PartialEq)]
385pub struct CrcdirBy_SPEC;
386impl crate::sealed::RegSpec for CrcdirBy_SPEC {
387    type DataType = u8;
388}
389
390#[doc = "CRC Data Input Register"]
391pub type CrcdirBy = crate::RegValueT<CrcdirBy_SPEC>;
392
393impl NoBitfieldReg<CrcdirBy_SPEC> for CrcdirBy {}
394impl ::core::default::Default for CrcdirBy {
395    #[inline(always)]
396    fn default() -> CrcdirBy {
397        <crate::RegValueT<CrcdirBy_SPEC> as RegisterValue<_>>::new(0)
398    }
399}
400
401#[doc(hidden)]
402#[derive(Copy, Clone, Eq, PartialEq)]
403pub struct Crcdor_SPEC;
404impl crate::sealed::RegSpec for Crcdor_SPEC {
405    type DataType = u32;
406}
407
408#[doc = "CRC Data Output Register"]
409pub type Crcdor = crate::RegValueT<Crcdor_SPEC>;
410
411impl NoBitfieldReg<Crcdor_SPEC> for Crcdor {}
412impl ::core::default::Default for Crcdor {
413    #[inline(always)]
414    fn default() -> Crcdor {
415        <crate::RegValueT<Crcdor_SPEC> as RegisterValue<_>>::new(0)
416    }
417}
418
419#[doc(hidden)]
420#[derive(Copy, Clone, Eq, PartialEq)]
421pub struct CrcdorHa_SPEC;
422impl crate::sealed::RegSpec for CrcdorHa_SPEC {
423    type DataType = u16;
424}
425
426#[doc = "CRC Data Output Register"]
427pub type CrcdorHa = crate::RegValueT<CrcdorHa_SPEC>;
428
429impl NoBitfieldReg<CrcdorHa_SPEC> for CrcdorHa {}
430impl ::core::default::Default for CrcdorHa {
431    #[inline(always)]
432    fn default() -> CrcdorHa {
433        <crate::RegValueT<CrcdorHa_SPEC> as RegisterValue<_>>::new(0)
434    }
435}
436
437#[doc(hidden)]
438#[derive(Copy, Clone, Eq, PartialEq)]
439pub struct CrcdorBy_SPEC;
440impl crate::sealed::RegSpec for CrcdorBy_SPEC {
441    type DataType = u8;
442}
443
444#[doc = "CRC Data Output Register"]
445pub type CrcdorBy = crate::RegValueT<CrcdorBy_SPEC>;
446
447impl NoBitfieldReg<CrcdorBy_SPEC> for CrcdorBy {}
448impl ::core::default::Default for CrcdorBy {
449    #[inline(always)]
450    fn default() -> CrcdorBy {
451        <crate::RegValueT<CrcdorBy_SPEC> as RegisterValue<_>>::new(0)
452    }
453}
454
455#[doc(hidden)]
456#[derive(Copy, Clone, Eq, PartialEq)]
457pub struct Crcsar_SPEC;
458impl crate::sealed::RegSpec for Crcsar_SPEC {
459    type DataType = u16;
460}
461
462#[doc = "Snoop Address Register"]
463pub type Crcsar = crate::RegValueT<Crcsar_SPEC>;
464
465impl Crcsar {
466    #[doc = "Register Snoop Address"]
467    #[inline(always)]
468    pub fn crcsa(
469        self,
470    ) -> crate::common::RegisterField<0, 0x3fff, 1, 0, u16, u16, Crcsar_SPEC, crate::common::RW>
471    {
472        crate::common::RegisterField::<0,0x3fff,1,0,u16,u16,Crcsar_SPEC,crate::common::RW>::from_register(self,0)
473    }
474}
475impl ::core::default::Default for Crcsar {
476    #[inline(always)]
477    fn default() -> Crcsar {
478        <crate::RegValueT<Crcsar_SPEC> as RegisterValue<_>>::new(0)
479    }
480}