k64/can0/
crcr.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::CRCR {
6    #[doc = r" Reads the contents of the register"]
7    #[inline]
8    pub fn read(&self) -> R {
9        R {
10            bits: self.register.get(),
11        }
12    }
13}
14#[doc = r" Value of the field"]
15pub struct TXCRCR {
16    bits: u16,
17}
18impl TXCRCR {
19    #[doc = r" Value of the field as raw bits"]
20    #[inline]
21    pub fn bits(&self) -> u16 {
22        self.bits
23    }
24}
25#[doc = r" Value of the field"]
26pub struct MBCRCR {
27    bits: u8,
28}
29impl MBCRCR {
30    #[doc = r" Value of the field as raw bits"]
31    #[inline]
32    pub fn bits(&self) -> u8 {
33        self.bits
34    }
35}
36impl R {
37    #[doc = r" Value of the register as raw bits"]
38    #[inline]
39    pub fn bits(&self) -> u32 {
40        self.bits
41    }
42    #[doc = "Bits 0:14 - CRC Transmitted"]
43    #[inline]
44    pub fn txcrc(&self) -> TXCRCR {
45        let bits = {
46            const MASK: u16 = 32767;
47            const OFFSET: u8 = 0;
48            ((self.bits >> OFFSET) & MASK as u32) as u16
49        };
50        TXCRCR { bits }
51    }
52    #[doc = "Bits 16:22 - CRC Mailbox"]
53    #[inline]
54    pub fn mbcrc(&self) -> MBCRCR {
55        let bits = {
56            const MASK: u8 = 127;
57            const OFFSET: u8 = 16;
58            ((self.bits >> OFFSET) & MASK as u32) as u8
59        };
60        MBCRCR { bits }
61    }
62}