va416xx/can0/
data1_cmb0.rs

1#[doc = "Register `DATA1_CMB0` reader"]
2pub type R = crate::R<Data1Cmb0Spec>;
3#[doc = "Register `DATA1_CMB0` writer"]
4pub type W = crate::W<Data1Cmb0Spec>;
5#[doc = "Field `BYTE4` reader - Data Byte 4"]
6pub type Byte4R = crate::FieldReader;
7#[doc = "Field `BYTE4` writer - Data Byte 4"]
8pub type Byte4W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `BYTE3` reader - Data Byte 3"]
10pub type Byte3R = crate::FieldReader;
11#[doc = "Field `BYTE3` writer - Data Byte 3"]
12pub type Byte3W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14    #[doc = "Bits 0:7 - Data Byte 4"]
15    #[inline(always)]
16    pub fn byte4(&self) -> Byte4R {
17        Byte4R::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 8:15 - Data Byte 3"]
20    #[inline(always)]
21    pub fn byte3(&self) -> Byte3R {
22        Byte3R::new(((self.bits >> 8) & 0xff) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:7 - Data Byte 4"]
27    #[inline(always)]
28    pub fn byte4(&mut self) -> Byte4W<'_, Data1Cmb0Spec> {
29        Byte4W::new(self, 0)
30    }
31    #[doc = "Bits 8:15 - Data Byte 3"]
32    #[inline(always)]
33    pub fn byte3(&mut self) -> Byte3W<'_, Data1Cmb0Spec> {
34        Byte3W::new(self, 8)
35    }
36}
37#[doc = "CAN Frame Data Word 1\n\nYou can [`read`](crate::Reg::read) this register and get [`data1_cmb0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data1_cmb0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct Data1Cmb0Spec;
39impl crate::RegisterSpec for Data1Cmb0Spec {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`data1_cmb0::R`](R) reader structure"]
43impl crate::Readable for Data1Cmb0Spec {}
44#[doc = "`write(|w| ..)` method takes [`data1_cmb0::W`](W) writer structure"]
45impl crate::Writable for Data1Cmb0Spec {
46    type Safety = crate::Unsafe;
47}
48#[doc = "`reset()` method sets DATA1_CMB0 to value 0"]
49impl crate::Resettable for Data1Cmb0Spec {}