Skip to main content

ra4e1_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.00, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:04:18 +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 Data Input Register"]
50    #[inline(always)]
51    pub const fn crcdir(
52        &self,
53    ) -> &'static crate::common::Reg<self::Crcdir_SPEC, crate::common::RW> {
54        unsafe {
55            crate::common::Reg::<self::Crcdir_SPEC, crate::common::RW>::from_ptr(
56                self._svd2pac_as_ptr().add(4usize),
57            )
58        }
59    }
60
61    #[doc = "CRC Data Input Register"]
62    #[inline(always)]
63    pub const fn crcdir_by(
64        &self,
65    ) -> &'static crate::common::Reg<self::CrcdirBy_SPEC, crate::common::RW> {
66        unsafe {
67            crate::common::Reg::<self::CrcdirBy_SPEC, crate::common::RW>::from_ptr(
68                self._svd2pac_as_ptr().add(4usize),
69            )
70        }
71    }
72
73    #[doc = "CRC Data Output Register"]
74    #[inline(always)]
75    pub const fn crcdor(
76        &self,
77    ) -> &'static crate::common::Reg<self::Crcdor_SPEC, crate::common::RW> {
78        unsafe {
79            crate::common::Reg::<self::Crcdor_SPEC, crate::common::RW>::from_ptr(
80                self._svd2pac_as_ptr().add(8usize),
81            )
82        }
83    }
84
85    #[doc = "CRC Data Output Register"]
86    #[inline(always)]
87    pub const fn crcdor_ha(
88        &self,
89    ) -> &'static crate::common::Reg<self::CrcdorHa_SPEC, crate::common::RW> {
90        unsafe {
91            crate::common::Reg::<self::CrcdorHa_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_by(
100        &self,
101    ) -> &'static crate::common::Reg<self::CrcdorBy_SPEC, crate::common::RW> {
102        unsafe {
103            crate::common::Reg::<self::CrcdorBy_SPEC, crate::common::RW>::from_ptr(
104                self._svd2pac_as_ptr().add(8usize),
105            )
106        }
107    }
108}
109#[doc(hidden)]
110#[derive(Copy, Clone, Eq, PartialEq)]
111pub struct Crccr0_SPEC;
112impl crate::sealed::RegSpec for Crccr0_SPEC {
113    type DataType = u8;
114}
115
116#[doc = "CRC Control Register 0"]
117pub type Crccr0 = crate::RegValueT<Crccr0_SPEC>;
118
119impl Crccr0 {
120    #[doc = "CRC Generating Polynomial Switching"]
121    #[inline(always)]
122    pub fn gps(
123        self,
124    ) -> crate::common::RegisterField<
125        0,
126        0x7,
127        1,
128        0,
129        crccr0::Gps,
130        crccr0::Gps,
131        Crccr0_SPEC,
132        crate::common::RW,
133    > {
134        crate::common::RegisterField::<
135            0,
136            0x7,
137            1,
138            0,
139            crccr0::Gps,
140            crccr0::Gps,
141            Crccr0_SPEC,
142            crate::common::RW,
143        >::from_register(self, 0)
144    }
145
146    #[doc = "CRC Calculation Switching"]
147    #[inline(always)]
148    pub fn lms(
149        self,
150    ) -> crate::common::RegisterField<
151        6,
152        0x1,
153        1,
154        0,
155        crccr0::Lms,
156        crccr0::Lms,
157        Crccr0_SPEC,
158        crate::common::RW,
159    > {
160        crate::common::RegisterField::<
161            6,
162            0x1,
163            1,
164            0,
165            crccr0::Lms,
166            crccr0::Lms,
167            Crccr0_SPEC,
168            crate::common::RW,
169        >::from_register(self, 0)
170    }
171
172    #[doc = "CRCDOR/CRCDOR_HA/CRCDOR_BY Register Clear"]
173    #[inline(always)]
174    pub fn dorclr(
175        self,
176    ) -> crate::common::RegisterField<
177        7,
178        0x1,
179        1,
180        0,
181        crccr0::Dorclr,
182        crccr0::Dorclr,
183        Crccr0_SPEC,
184        crate::common::W,
185    > {
186        crate::common::RegisterField::<
187            7,
188            0x1,
189            1,
190            0,
191            crccr0::Dorclr,
192            crccr0::Dorclr,
193            Crccr0_SPEC,
194            crate::common::W,
195        >::from_register(self, 0)
196    }
197}
198impl ::core::default::Default for Crccr0 {
199    #[inline(always)]
200    fn default() -> Crccr0 {
201        <crate::RegValueT<Crccr0_SPEC> as RegisterValue<_>>::new(0)
202    }
203}
204pub mod crccr0 {
205
206    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
207    pub struct Gps_SPEC;
208    pub type Gps = crate::EnumBitfieldStruct<u8, Gps_SPEC>;
209    impl Gps {
210        #[doc = "8-bit CRC-8 (X8 + X2 + X + 1)"]
211        pub const _001: Self = Self::new(1);
212
213        #[doc = "16-bit CRC-16 (X16 + X15 + X2 + 1)"]
214        pub const _010: Self = Self::new(2);
215
216        #[doc = "16-bit CRC-CCITT (X16 + X12 + X5 + 1)"]
217        pub const _011: Self = Self::new(3);
218
219        #[doc = "32-bit CRC-32 (X32 + X26 + X23 + X22 + X16 + X12 + X11 +X10 + X8 + X7 + X5 + X4 + X2 + X + 1)"]
220        pub const _100: Self = Self::new(4);
221
222        #[doc = "32-bit CRC-32C (X32 + X28 + X27 + X26 + X25 + X23 + X22 + X20 + X19 + X18 + X14 + X13 + X11 + X10 + X9 + X8 + X6 + 1)"]
223        pub const _101: Self = Self::new(5);
224    }
225    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
226    pub struct Lms_SPEC;
227    pub type Lms = crate::EnumBitfieldStruct<u8, Lms_SPEC>;
228    impl Lms {
229        #[doc = "Generate CRC code for LSB-first communication"]
230        pub const _0: Self = Self::new(0);
231
232        #[doc = "Generate CRC code for MSB-first communication"]
233        pub const _1: Self = Self::new(1);
234    }
235    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
236    pub struct Dorclr_SPEC;
237    pub type Dorclr = crate::EnumBitfieldStruct<u8, Dorclr_SPEC>;
238    impl Dorclr {
239        #[doc = "No effect"]
240        pub const _0: Self = Self::new(0);
241
242        #[doc = "Clear the CRCDOR/CRCDOR_HA/CRCDOR_BY register"]
243        pub const _1: Self = Self::new(1);
244    }
245}
246#[doc(hidden)]
247#[derive(Copy, Clone, Eq, PartialEq)]
248pub struct Crcdir_SPEC;
249impl crate::sealed::RegSpec for Crcdir_SPEC {
250    type DataType = u32;
251}
252
253#[doc = "CRC Data Input Register"]
254pub type Crcdir = crate::RegValueT<Crcdir_SPEC>;
255
256impl NoBitfieldReg<Crcdir_SPEC> for Crcdir {}
257impl ::core::default::Default for Crcdir {
258    #[inline(always)]
259    fn default() -> Crcdir {
260        <crate::RegValueT<Crcdir_SPEC> as RegisterValue<_>>::new(0)
261    }
262}
263
264#[doc(hidden)]
265#[derive(Copy, Clone, Eq, PartialEq)]
266pub struct CrcdirBy_SPEC;
267impl crate::sealed::RegSpec for CrcdirBy_SPEC {
268    type DataType = u8;
269}
270
271#[doc = "CRC Data Input Register"]
272pub type CrcdirBy = crate::RegValueT<CrcdirBy_SPEC>;
273
274impl NoBitfieldReg<CrcdirBy_SPEC> for CrcdirBy {}
275impl ::core::default::Default for CrcdirBy {
276    #[inline(always)]
277    fn default() -> CrcdirBy {
278        <crate::RegValueT<CrcdirBy_SPEC> as RegisterValue<_>>::new(0)
279    }
280}
281
282#[doc(hidden)]
283#[derive(Copy, Clone, Eq, PartialEq)]
284pub struct Crcdor_SPEC;
285impl crate::sealed::RegSpec for Crcdor_SPEC {
286    type DataType = u32;
287}
288
289#[doc = "CRC Data Output Register"]
290pub type Crcdor = crate::RegValueT<Crcdor_SPEC>;
291
292impl NoBitfieldReg<Crcdor_SPEC> for Crcdor {}
293impl ::core::default::Default for Crcdor {
294    #[inline(always)]
295    fn default() -> Crcdor {
296        <crate::RegValueT<Crcdor_SPEC> as RegisterValue<_>>::new(0)
297    }
298}
299
300#[doc(hidden)]
301#[derive(Copy, Clone, Eq, PartialEq)]
302pub struct CrcdorHa_SPEC;
303impl crate::sealed::RegSpec for CrcdorHa_SPEC {
304    type DataType = u16;
305}
306
307#[doc = "CRC Data Output Register"]
308pub type CrcdorHa = crate::RegValueT<CrcdorHa_SPEC>;
309
310impl NoBitfieldReg<CrcdorHa_SPEC> for CrcdorHa {}
311impl ::core::default::Default for CrcdorHa {
312    #[inline(always)]
313    fn default() -> CrcdorHa {
314        <crate::RegValueT<CrcdorHa_SPEC> as RegisterValue<_>>::new(0)
315    }
316}
317
318#[doc(hidden)]
319#[derive(Copy, Clone, Eq, PartialEq)]
320pub struct CrcdorBy_SPEC;
321impl crate::sealed::RegSpec for CrcdorBy_SPEC {
322    type DataType = u8;
323}
324
325#[doc = "CRC Data Output Register"]
326pub type CrcdorBy = crate::RegValueT<CrcdorBy_SPEC>;
327
328impl NoBitfieldReg<CrcdorBy_SPEC> for CrcdorBy {}
329impl ::core::default::Default for CrcdorBy {
330    #[inline(always)]
331    fn default() -> CrcdorBy {
332        <crate::RegValueT<CrcdorBy_SPEC> as RegisterValue<_>>::new(0)
333    }
334}