va416xx/can0/
data2_hcmb.rs

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