xmc4300/can_mo/mo/
modatal.rs1#[doc = "Register `MODATAL` reader"]
2pub type R = crate::R<MODATAL_SPEC>;
3#[doc = "Register `MODATAL` writer"]
4pub type W = crate::W<MODATAL_SPEC>;
5#[doc = "Field `DB0` reader - Data Byte 0 of Message Object n"]
6pub type DB0_R = crate::FieldReader;
7#[doc = "Field `DB0` writer - Data Byte 0 of Message Object n"]
8pub type DB0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `DB1` reader - Data Byte 1 of Message Object n"]
10pub type DB1_R = crate::FieldReader;
11#[doc = "Field `DB1` writer - Data Byte 1 of Message Object n"]
12pub type DB1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `DB2` reader - Data Byte 2 of Message Object n"]
14pub type DB2_R = crate::FieldReader;
15#[doc = "Field `DB2` writer - Data Byte 2 of Message Object n"]
16pub type DB2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `DB3` reader - Data Byte 3 of Message Object n"]
18pub type DB3_R = crate::FieldReader;
19#[doc = "Field `DB3` writer - Data Byte 3 of Message Object n"]
20pub type DB3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22 #[doc = "Bits 0:7 - Data Byte 0 of Message Object n"]
23 #[inline(always)]
24 pub fn db0(&self) -> DB0_R {
25 DB0_R::new((self.bits & 0xff) as u8)
26 }
27 #[doc = "Bits 8:15 - Data Byte 1 of Message Object n"]
28 #[inline(always)]
29 pub fn db1(&self) -> DB1_R {
30 DB1_R::new(((self.bits >> 8) & 0xff) as u8)
31 }
32 #[doc = "Bits 16:23 - Data Byte 2 of Message Object n"]
33 #[inline(always)]
34 pub fn db2(&self) -> DB2_R {
35 DB2_R::new(((self.bits >> 16) & 0xff) as u8)
36 }
37 #[doc = "Bits 24:31 - Data Byte 3 of Message Object n"]
38 #[inline(always)]
39 pub fn db3(&self) -> DB3_R {
40 DB3_R::new(((self.bits >> 24) & 0xff) as u8)
41 }
42}
43impl W {
44 #[doc = "Bits 0:7 - Data Byte 0 of Message Object n"]
45 #[inline(always)]
46 pub fn db0(&mut self) -> DB0_W<MODATAL_SPEC> {
47 DB0_W::new(self, 0)
48 }
49 #[doc = "Bits 8:15 - Data Byte 1 of Message Object n"]
50 #[inline(always)]
51 pub fn db1(&mut self) -> DB1_W<MODATAL_SPEC> {
52 DB1_W::new(self, 8)
53 }
54 #[doc = "Bits 16:23 - Data Byte 2 of Message Object n"]
55 #[inline(always)]
56 pub fn db2(&mut self) -> DB2_W<MODATAL_SPEC> {
57 DB2_W::new(self, 16)
58 }
59 #[doc = "Bits 24:31 - Data Byte 3 of Message Object n"]
60 #[inline(always)]
61 pub fn db3(&mut self) -> DB3_W<MODATAL_SPEC> {
62 DB3_W::new(self, 24)
63 }
64}
65#[doc = "Message Object Data Register Low\n\nYou can [`read`](crate::Reg::read) this register and get [`modatal::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`modatal::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
66pub struct MODATAL_SPEC;
67impl crate::RegisterSpec for MODATAL_SPEC {
68 type Ux = u32;
69}
70#[doc = "`read()` method returns [`modatal::R`](R) reader structure"]
71impl crate::Readable for MODATAL_SPEC {}
72#[doc = "`write(|w| ..)` method takes [`modatal::W`](W) writer structure"]
73impl crate::Writable for MODATAL_SPEC {
74 type Safety = crate::Unsafe;
75 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
77}
78#[doc = "`reset()` method sets MODATAL to value 0"]
79impl crate::Resettable for MODATAL_SPEC {
80 const RESET_VALUE: u32 = 0;
81}