ht32f523x2/crc/
cr.rs

1#[doc = "Register `CR` reader"]
2pub type R = crate::R<CrSpec>;
3#[doc = "Register `CR` writer"]
4pub type W = crate::W<CrSpec>;
5#[doc = "Field `POLY` reader - POLY"]
6pub type PolyR = crate::FieldReader;
7#[doc = "Field `POLY` writer - POLY"]
8pub type PolyW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `DATBIRV` reader - DATBIRV"]
10pub type DatbirvR = crate::BitReader;
11#[doc = "Field `DATBIRV` writer - DATBIRV"]
12pub type DatbirvW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DATBYRV` reader - DATBYRV"]
14pub type DatbyrvR = crate::BitReader;
15#[doc = "Field `DATBYRV` writer - DATBYRV"]
16pub type DatbyrvW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DATCMPL` reader - DATCMPL"]
18pub type DatcmplR = crate::BitReader;
19#[doc = "Field `DATCMPL` writer - DATCMPL"]
20pub type DatcmplW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SUMBIRV` reader - SUMBIRV"]
22pub type SumbirvR = crate::BitReader;
23#[doc = "Field `SUMBIRV` writer - SUMBIRV"]
24pub type SumbirvW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `SUMBYRV` reader - SUMBYRV"]
26pub type SumbyrvR = crate::BitReader;
27#[doc = "Field `SUMBYRV` writer - SUMBYRV"]
28pub type SumbyrvW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `SUMCMPL` reader - SUMCMPL"]
30pub type SumcmplR = crate::BitReader;
31#[doc = "Field `SUMCMPL` writer - SUMCMPL"]
32pub type SumcmplW<'a, REG> = crate::BitWriter<'a, REG>;
33impl R {
34    #[doc = "Bits 0:1 - POLY"]
35    #[inline(always)]
36    pub fn poly(&self) -> PolyR {
37        PolyR::new((self.bits & 3) as u8)
38    }
39    #[doc = "Bit 2 - DATBIRV"]
40    #[inline(always)]
41    pub fn datbirv(&self) -> DatbirvR {
42        DatbirvR::new(((self.bits >> 2) & 1) != 0)
43    }
44    #[doc = "Bit 3 - DATBYRV"]
45    #[inline(always)]
46    pub fn datbyrv(&self) -> DatbyrvR {
47        DatbyrvR::new(((self.bits >> 3) & 1) != 0)
48    }
49    #[doc = "Bit 4 - DATCMPL"]
50    #[inline(always)]
51    pub fn datcmpl(&self) -> DatcmplR {
52        DatcmplR::new(((self.bits >> 4) & 1) != 0)
53    }
54    #[doc = "Bit 5 - SUMBIRV"]
55    #[inline(always)]
56    pub fn sumbirv(&self) -> SumbirvR {
57        SumbirvR::new(((self.bits >> 5) & 1) != 0)
58    }
59    #[doc = "Bit 6 - SUMBYRV"]
60    #[inline(always)]
61    pub fn sumbyrv(&self) -> SumbyrvR {
62        SumbyrvR::new(((self.bits >> 6) & 1) != 0)
63    }
64    #[doc = "Bit 7 - SUMCMPL"]
65    #[inline(always)]
66    pub fn sumcmpl(&self) -> SumcmplR {
67        SumcmplR::new(((self.bits >> 7) & 1) != 0)
68    }
69}
70impl W {
71    #[doc = "Bits 0:1 - POLY"]
72    #[inline(always)]
73    #[must_use]
74    pub fn poly(&mut self) -> PolyW<CrSpec> {
75        PolyW::new(self, 0)
76    }
77    #[doc = "Bit 2 - DATBIRV"]
78    #[inline(always)]
79    #[must_use]
80    pub fn datbirv(&mut self) -> DatbirvW<CrSpec> {
81        DatbirvW::new(self, 2)
82    }
83    #[doc = "Bit 3 - DATBYRV"]
84    #[inline(always)]
85    #[must_use]
86    pub fn datbyrv(&mut self) -> DatbyrvW<CrSpec> {
87        DatbyrvW::new(self, 3)
88    }
89    #[doc = "Bit 4 - DATCMPL"]
90    #[inline(always)]
91    #[must_use]
92    pub fn datcmpl(&mut self) -> DatcmplW<CrSpec> {
93        DatcmplW::new(self, 4)
94    }
95    #[doc = "Bit 5 - SUMBIRV"]
96    #[inline(always)]
97    #[must_use]
98    pub fn sumbirv(&mut self) -> SumbirvW<CrSpec> {
99        SumbirvW::new(self, 5)
100    }
101    #[doc = "Bit 6 - SUMBYRV"]
102    #[inline(always)]
103    #[must_use]
104    pub fn sumbyrv(&mut self) -> SumbyrvW<CrSpec> {
105        SumbyrvW::new(self, 6)
106    }
107    #[doc = "Bit 7 - SUMCMPL"]
108    #[inline(always)]
109    #[must_use]
110    pub fn sumcmpl(&mut self) -> SumcmplW<CrSpec> {
111        SumcmplW::new(self, 7)
112    }
113}
114#[doc = "CR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
115pub struct CrSpec;
116impl crate::RegisterSpec for CrSpec {
117    type Ux = u32;
118}
119#[doc = "`read()` method returns [`cr::R`](R) reader structure"]
120impl crate::Readable for CrSpec {}
121#[doc = "`write(|w| ..)` method takes [`cr::W`](W) writer structure"]
122impl crate::Writable for CrSpec {
123    type Safety = crate::Unsafe;
124    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
125    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
126}
127#[doc = "`reset()` method sets CR to value 0"]
128impl crate::Resettable for CrSpec {
129    const RESET_VALUE: u32 = 0;
130}