mcxn947_pac/crc0/
data.rs

1#[doc = "Register `DATA` reader"]
2pub type R = crate::R<DATA_SPEC>;
3#[doc = "Register `DATA` writer"]
4pub type W = crate::W<DATA_SPEC>;
5#[doc = "Field `LL` reader - CRC Low Lower Byte"]
6pub type LL_R = crate::FieldReader;
7#[doc = "Field `LL` writer - CRC Low Lower Byte"]
8pub type LL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `LU` reader - CRC Low Upper Byte"]
10pub type LU_R = crate::FieldReader;
11#[doc = "Field `LU` writer - CRC Low Upper Byte"]
12pub type LU_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `HL` reader - CRC High Lower Byte"]
14pub type HL_R = crate::FieldReader;
15#[doc = "Field `HL` writer - CRC High Lower Byte"]
16pub type HL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `HU` reader - CRC High Upper Byte"]
18pub type HU_R = crate::FieldReader;
19#[doc = "Field `HU` writer - CRC High Upper Byte"]
20pub type HU_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    #[doc = "Bits 0:7 - CRC Low Lower Byte"]
23    #[inline(always)]
24    pub fn ll(&self) -> LL_R {
25        LL_R::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - CRC Low Upper Byte"]
28    #[inline(always)]
29    pub fn lu(&self) -> LU_R {
30        LU_R::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:23 - CRC High Lower Byte"]
33    #[inline(always)]
34    pub fn hl(&self) -> HL_R {
35        HL_R::new(((self.bits >> 16) & 0xff) as u8)
36    }
37    #[doc = "Bits 24:31 - CRC High Upper Byte"]
38    #[inline(always)]
39    pub fn hu(&self) -> HU_R {
40        HU_R::new(((self.bits >> 24) & 0xff) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:7 - CRC Low Lower Byte"]
45    #[inline(always)]
46    #[must_use]
47    pub fn ll(&mut self) -> LL_W<DATA_SPEC> {
48        LL_W::new(self, 0)
49    }
50    #[doc = "Bits 8:15 - CRC Low Upper Byte"]
51    #[inline(always)]
52    #[must_use]
53    pub fn lu(&mut self) -> LU_W<DATA_SPEC> {
54        LU_W::new(self, 8)
55    }
56    #[doc = "Bits 16:23 - CRC High Lower Byte"]
57    #[inline(always)]
58    #[must_use]
59    pub fn hl(&mut self) -> HL_W<DATA_SPEC> {
60        HL_W::new(self, 16)
61    }
62    #[doc = "Bits 24:31 - CRC High Upper Byte"]
63    #[inline(always)]
64    #[must_use]
65    pub fn hu(&mut self) -> HU_W<DATA_SPEC> {
66        HU_W::new(self, 24)
67    }
68    #[doc = r" Writes raw bits to the register."]
69    #[doc = r""]
70    #[doc = r" # Safety"]
71    #[doc = r""]
72    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
73    #[inline(always)]
74    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
75        self.bits = bits;
76        self
77    }
78}
79#[doc = "CRC Data\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`data::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 [`data::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct DATA_SPEC;
81impl crate::RegisterSpec for DATA_SPEC {
82    type Ux = u32;
83}
84#[doc = "`read()` method returns [`data::R`](R) reader structure"]
85impl crate::Readable for DATA_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`data::W`](W) writer structure"]
87impl crate::Writable for DATA_SPEC {
88    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
89    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
90}
91#[doc = "`reset()` method sets DATA to value 0xffff_ffff"]
92impl crate::Resettable for DATA_SPEC {
93    const RESET_VALUE: u32 = 0xffff_ffff;
94}