xmc4700/can_mo/mo/
mofgpr.rs

1#[doc = "Register `MOFGPR` reader"]
2pub type R = crate::R<MOFGPR_SPEC>;
3#[doc = "Register `MOFGPR` writer"]
4pub type W = crate::W<MOFGPR_SPEC>;
5#[doc = "Field `BOT` reader - Bottom Pointer"]
6pub type BOT_R = crate::FieldReader;
7#[doc = "Field `BOT` writer - Bottom Pointer"]
8pub type BOT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `TOP` reader - Top Pointer"]
10pub type TOP_R = crate::FieldReader;
11#[doc = "Field `TOP` writer - Top Pointer"]
12pub type TOP_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `CUR` reader - Current Object Pointer"]
14pub type CUR_R = crate::FieldReader;
15#[doc = "Field `CUR` writer - Current Object Pointer"]
16pub type CUR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `SEL` reader - Object Select Pointer"]
18pub type SEL_R = crate::FieldReader;
19#[doc = "Field `SEL` writer - Object Select Pointer"]
20pub type SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    #[doc = "Bits 0:7 - Bottom Pointer"]
23    #[inline(always)]
24    pub fn bot(&self) -> BOT_R {
25        BOT_R::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - Top Pointer"]
28    #[inline(always)]
29    pub fn top(&self) -> TOP_R {
30        TOP_R::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:23 - Current Object Pointer"]
33    #[inline(always)]
34    pub fn cur(&self) -> CUR_R {
35        CUR_R::new(((self.bits >> 16) & 0xff) as u8)
36    }
37    #[doc = "Bits 24:31 - Object Select Pointer"]
38    #[inline(always)]
39    pub fn sel(&self) -> SEL_R {
40        SEL_R::new(((self.bits >> 24) & 0xff) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:7 - Bottom Pointer"]
45    #[inline(always)]
46    pub fn bot(&mut self) -> BOT_W<MOFGPR_SPEC> {
47        BOT_W::new(self, 0)
48    }
49    #[doc = "Bits 8:15 - Top Pointer"]
50    #[inline(always)]
51    pub fn top(&mut self) -> TOP_W<MOFGPR_SPEC> {
52        TOP_W::new(self, 8)
53    }
54    #[doc = "Bits 16:23 - Current Object Pointer"]
55    #[inline(always)]
56    pub fn cur(&mut self) -> CUR_W<MOFGPR_SPEC> {
57        CUR_W::new(self, 16)
58    }
59    #[doc = "Bits 24:31 - Object Select Pointer"]
60    #[inline(always)]
61    pub fn sel(&mut self) -> SEL_W<MOFGPR_SPEC> {
62        SEL_W::new(self, 24)
63    }
64}
65#[doc = "Message Object FIFO/Gateway Pointer Register\n\nYou can [`read`](crate::Reg::read) this register and get [`mofgpr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mofgpr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
66pub struct MOFGPR_SPEC;
67impl crate::RegisterSpec for MOFGPR_SPEC {
68    type Ux = u32;
69}
70#[doc = "`read()` method returns [`mofgpr::R`](R) reader structure"]
71impl crate::Readable for MOFGPR_SPEC {}
72#[doc = "`write(|w| ..)` method takes [`mofgpr::W`](W) writer structure"]
73impl crate::Writable for MOFGPR_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 MOFGPR to value 0"]
79impl crate::Resettable for MOFGPR_SPEC {
80    const RESET_VALUE: u32 = 0;
81}