Skip to main content

ra2a2_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.20.02, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:01:00 +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    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
250    pub struct Lms_SPEC;
251    pub type Lms = crate::EnumBitfieldStruct<u8, Lms_SPEC>;
252    impl Lms {
253        #[doc = "Generate CRC code for LSB-first communication"]
254        pub const _0: Self = Self::new(0);
255
256        #[doc = "Generate CRC code for MSB-first communication"]
257        pub const _1: Self = Self::new(1);
258    }
259    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
260    pub struct Dorclr_SPEC;
261    pub type Dorclr = crate::EnumBitfieldStruct<u8, Dorclr_SPEC>;
262    impl Dorclr {
263        #[doc = "No effect"]
264        pub const _0: Self = Self::new(0);
265
266        #[doc = "Clear the CRCDOR/CRCDOR_HA/CRCDOR_BY register"]
267        pub const _1: Self = Self::new(1);
268    }
269}
270#[doc(hidden)]
271#[derive(Copy, Clone, Eq, PartialEq)]
272pub struct Crccr1_SPEC;
273impl crate::sealed::RegSpec for Crccr1_SPEC {
274    type DataType = u8;
275}
276
277#[doc = "CRC Control Register 1"]
278pub type Crccr1 = crate::RegValueT<Crccr1_SPEC>;
279
280impl Crccr1 {
281    #[doc = "Snoop-On-Write/Read Switch"]
282    #[inline(always)]
283    pub fn crcswr(
284        self,
285    ) -> crate::common::RegisterField<
286        6,
287        0x1,
288        1,
289        0,
290        crccr1::Crcswr,
291        crccr1::Crcswr,
292        Crccr1_SPEC,
293        crate::common::RW,
294    > {
295        crate::common::RegisterField::<
296            6,
297            0x1,
298            1,
299            0,
300            crccr1::Crcswr,
301            crccr1::Crcswr,
302            Crccr1_SPEC,
303            crate::common::RW,
304        >::from_register(self, 0)
305    }
306
307    #[doc = "Snoop Enable"]
308    #[inline(always)]
309    pub fn crcsen(
310        self,
311    ) -> crate::common::RegisterField<
312        7,
313        0x1,
314        1,
315        0,
316        crccr1::Crcsen,
317        crccr1::Crcsen,
318        Crccr1_SPEC,
319        crate::common::RW,
320    > {
321        crate::common::RegisterField::<
322            7,
323            0x1,
324            1,
325            0,
326            crccr1::Crcsen,
327            crccr1::Crcsen,
328            Crccr1_SPEC,
329            crate::common::RW,
330        >::from_register(self, 0)
331    }
332}
333impl ::core::default::Default for Crccr1 {
334    #[inline(always)]
335    fn default() -> Crccr1 {
336        <crate::RegValueT<Crccr1_SPEC> as RegisterValue<_>>::new(0)
337    }
338}
339pub mod crccr1 {
340
341    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
342    pub struct Crcswr_SPEC;
343    pub type Crcswr = crate::EnumBitfieldStruct<u8, Crcswr_SPEC>;
344    impl Crcswr {
345        #[doc = "Snoop-on-read"]
346        pub const _0: Self = Self::new(0);
347
348        #[doc = "Snoop-on-write"]
349        pub const _1: Self = Self::new(1);
350    }
351    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
352    pub struct Crcsen_SPEC;
353    pub type Crcsen = crate::EnumBitfieldStruct<u8, Crcsen_SPEC>;
354    impl Crcsen {
355        #[doc = "Disabled"]
356        pub const _0: Self = Self::new(0);
357
358        #[doc = "Enabled"]
359        pub const _1: Self = Self::new(1);
360    }
361}
362#[doc(hidden)]
363#[derive(Copy, Clone, Eq, PartialEq)]
364pub struct Crcdir_SPEC;
365impl crate::sealed::RegSpec for Crcdir_SPEC {
366    type DataType = u32;
367}
368
369#[doc = "CRC Data Input Register"]
370pub type Crcdir = crate::RegValueT<Crcdir_SPEC>;
371
372impl NoBitfieldReg<Crcdir_SPEC> for Crcdir {}
373impl ::core::default::Default for Crcdir {
374    #[inline(always)]
375    fn default() -> Crcdir {
376        <crate::RegValueT<Crcdir_SPEC> as RegisterValue<_>>::new(0)
377    }
378}
379
380#[doc(hidden)]
381#[derive(Copy, Clone, Eq, PartialEq)]
382pub struct CrcdirBy_SPEC;
383impl crate::sealed::RegSpec for CrcdirBy_SPEC {
384    type DataType = u8;
385}
386
387#[doc = "CRC Data Input Register"]
388pub type CrcdirBy = crate::RegValueT<CrcdirBy_SPEC>;
389
390impl NoBitfieldReg<CrcdirBy_SPEC> for CrcdirBy {}
391impl ::core::default::Default for CrcdirBy {
392    #[inline(always)]
393    fn default() -> CrcdirBy {
394        <crate::RegValueT<CrcdirBy_SPEC> as RegisterValue<_>>::new(0)
395    }
396}
397
398#[doc(hidden)]
399#[derive(Copy, Clone, Eq, PartialEq)]
400pub struct Crcdor_SPEC;
401impl crate::sealed::RegSpec for Crcdor_SPEC {
402    type DataType = u32;
403}
404
405#[doc = "CRC Data Output Register"]
406pub type Crcdor = crate::RegValueT<Crcdor_SPEC>;
407
408impl NoBitfieldReg<Crcdor_SPEC> for Crcdor {}
409impl ::core::default::Default for Crcdor {
410    #[inline(always)]
411    fn default() -> Crcdor {
412        <crate::RegValueT<Crcdor_SPEC> as RegisterValue<_>>::new(0)
413    }
414}
415
416#[doc(hidden)]
417#[derive(Copy, Clone, Eq, PartialEq)]
418pub struct CrcdorHa_SPEC;
419impl crate::sealed::RegSpec for CrcdorHa_SPEC {
420    type DataType = u16;
421}
422
423#[doc = "CRC Data Output Register"]
424pub type CrcdorHa = crate::RegValueT<CrcdorHa_SPEC>;
425
426impl NoBitfieldReg<CrcdorHa_SPEC> for CrcdorHa {}
427impl ::core::default::Default for CrcdorHa {
428    #[inline(always)]
429    fn default() -> CrcdorHa {
430        <crate::RegValueT<CrcdorHa_SPEC> as RegisterValue<_>>::new(0)
431    }
432}
433
434#[doc(hidden)]
435#[derive(Copy, Clone, Eq, PartialEq)]
436pub struct CrcdorBy_SPEC;
437impl crate::sealed::RegSpec for CrcdorBy_SPEC {
438    type DataType = u8;
439}
440
441#[doc = "CRC Data Output Register"]
442pub type CrcdorBy = crate::RegValueT<CrcdorBy_SPEC>;
443
444impl NoBitfieldReg<CrcdorBy_SPEC> for CrcdorBy {}
445impl ::core::default::Default for CrcdorBy {
446    #[inline(always)]
447    fn default() -> CrcdorBy {
448        <crate::RegValueT<CrcdorBy_SPEC> as RegisterValue<_>>::new(0)
449    }
450}
451
452#[doc(hidden)]
453#[derive(Copy, Clone, Eq, PartialEq)]
454pub struct Crcsar_SPEC;
455impl crate::sealed::RegSpec for Crcsar_SPEC {
456    type DataType = u16;
457}
458
459#[doc = "Snoop Address Register"]
460pub type Crcsar = crate::RegValueT<Crcsar_SPEC>;
461
462impl Crcsar {
463    #[doc = "Register Snoop Address"]
464    #[inline(always)]
465    pub fn crcsa(
466        self,
467    ) -> crate::common::RegisterField<0, 0x3fff, 1, 0, u16, u16, Crcsar_SPEC, crate::common::RW>
468    {
469        crate::common::RegisterField::<0,0x3fff,1,0,u16,u16,Crcsar_SPEC,crate::common::RW>::from_register(self,0)
470    }
471}
472impl ::core::default::Default for Crcsar {
473    #[inline(always)]
474    fn default() -> Crcsar {
475        <crate::RegValueT<Crcsar_SPEC> as RegisterValue<_>>::new(0)
476    }
477}