Skip to main content

mcxa_pac/can0/
mb0_32b_word3.rs

1#[doc = "Register `MB0_32B_WORD3` reader"]
2pub type R = crate::R<Mb0_32bWord3Spec>;
3#[doc = "Register `MB0_32B_WORD3` writer"]
4pub type W = crate::W<Mb0_32bWord3Spec>;
5#[doc = "Field `DATA_BYTE_15` reader - Data byte 0 of Rx/Tx frame."]
6pub type DataByte15R = crate::FieldReader;
7#[doc = "Field `DATA_BYTE_15` writer - Data byte 0 of Rx/Tx frame."]
8pub type DataByte15W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `DATA_BYTE_14` reader - Data byte 1 of Rx/Tx frame."]
10pub type DataByte14R = crate::FieldReader;
11#[doc = "Field `DATA_BYTE_14` writer - Data byte 1 of Rx/Tx frame."]
12pub type DataByte14W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `DATA_BYTE_13` reader - Data byte 2 of Rx/Tx frame."]
14pub type DataByte13R = crate::FieldReader;
15#[doc = "Field `DATA_BYTE_13` writer - Data byte 2 of Rx/Tx frame."]
16pub type DataByte13W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `DATA_BYTE_12` reader - Data byte 3 of Rx/Tx frame."]
18pub type DataByte12R = crate::FieldReader;
19#[doc = "Field `DATA_BYTE_12` writer - Data byte 3 of Rx/Tx frame."]
20pub type DataByte12W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    #[doc = "Bits 0:7 - Data byte 0 of Rx/Tx frame."]
23    #[inline(always)]
24    pub fn data_byte_15(&self) -> DataByte15R {
25        DataByte15R::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - Data byte 1 of Rx/Tx frame."]
28    #[inline(always)]
29    pub fn data_byte_14(&self) -> DataByte14R {
30        DataByte14R::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:23 - Data byte 2 of Rx/Tx frame."]
33    #[inline(always)]
34    pub fn data_byte_13(&self) -> DataByte13R {
35        DataByte13R::new(((self.bits >> 16) & 0xff) as u8)
36    }
37    #[doc = "Bits 24:31 - Data byte 3 of Rx/Tx frame."]
38    #[inline(always)]
39    pub fn data_byte_12(&self) -> DataByte12R {
40        DataByte12R::new(((self.bits >> 24) & 0xff) as u8)
41    }
42}
43#[cfg(feature = "debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("MB0_32B_WORD3")
47            .field("data_byte_15", &self.data_byte_15())
48            .field("data_byte_14", &self.data_byte_14())
49            .field("data_byte_13", &self.data_byte_13())
50            .field("data_byte_12", &self.data_byte_12())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bits 0:7 - Data byte 0 of Rx/Tx frame."]
56    #[inline(always)]
57    pub fn data_byte_15(&mut self) -> DataByte15W<'_, Mb0_32bWord3Spec> {
58        DataByte15W::new(self, 0)
59    }
60    #[doc = "Bits 8:15 - Data byte 1 of Rx/Tx frame."]
61    #[inline(always)]
62    pub fn data_byte_14(&mut self) -> DataByte14W<'_, Mb0_32bWord3Spec> {
63        DataByte14W::new(self, 8)
64    }
65    #[doc = "Bits 16:23 - Data byte 2 of Rx/Tx frame."]
66    #[inline(always)]
67    pub fn data_byte_13(&mut self) -> DataByte13W<'_, Mb0_32bWord3Spec> {
68        DataByte13W::new(self, 16)
69    }
70    #[doc = "Bits 24:31 - Data byte 3 of Rx/Tx frame."]
71    #[inline(always)]
72    pub fn data_byte_12(&mut self) -> DataByte12W<'_, Mb0_32bWord3Spec> {
73        DataByte12W::new(self, 24)
74    }
75}
76#[doc = "Message Buffer 0 WORD_32B Register\n\nYou can [`read`](crate::Reg::read) this register and get [`mb0_32b_word3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mb0_32b_word3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct Mb0_32bWord3Spec;
78impl crate::RegisterSpec for Mb0_32bWord3Spec {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`mb0_32b_word3::R`](R) reader structure"]
82impl crate::Readable for Mb0_32bWord3Spec {}
83#[doc = "`write(|w| ..)` method takes [`mb0_32b_word3::W`](W) writer structure"]
84impl crate::Writable for Mb0_32bWord3Spec {
85    type Safety = crate::Unsafe;
86}
87#[doc = "`reset()` method sets MB0_32B_WORD3 to value 0"]
88impl crate::Resettable for Mb0_32bWord3Spec {}