1#[doc = "Register `MOAMR` reader"]
2pub type R = crate::R<MOAMR_SPEC>;
3#[doc = "Register `MOAMR` writer"]
4pub type W = crate::W<MOAMR_SPEC>;
5#[doc = "Field `AM` reader - Acceptance Mask for Message Identifier"]
6pub type AM_R = crate::FieldReader<u32>;
7#[doc = "Field `AM` writer - Acceptance Mask for Message Identifier"]
8pub type AM_W<'a, REG> = crate::FieldWriter<'a, REG, 29, u32>;
9#[doc = "Acceptance Mask Bit for Message IDE Bit\n\nValue on reset: 1"]
10#[derive(Clone, Copy, Debug, PartialEq, Eq)]
11pub enum MIDE_A {
12 #[doc = "0: Message object n accepts the reception of both, standard and extended frames."]
13 VALUE1 = 0,
14 #[doc = "1: Message object n receives frames only with matching IDE bit."]
15 VALUE2 = 1,
16}
17impl From<MIDE_A> for bool {
18 #[inline(always)]
19 fn from(variant: MIDE_A) -> Self {
20 variant as u8 != 0
21 }
22}
23#[doc = "Field `MIDE` reader - Acceptance Mask Bit for Message IDE Bit"]
24pub type MIDE_R = crate::BitReader<MIDE_A>;
25impl MIDE_R {
26 #[doc = "Get enumerated values variant"]
27 #[inline(always)]
28 pub const fn variant(&self) -> MIDE_A {
29 match self.bits {
30 false => MIDE_A::VALUE1,
31 true => MIDE_A::VALUE2,
32 }
33 }
34 #[doc = "Message object n accepts the reception of both, standard and extended frames."]
35 #[inline(always)]
36 pub fn is_value1(&self) -> bool {
37 *self == MIDE_A::VALUE1
38 }
39 #[doc = "Message object n receives frames only with matching IDE bit."]
40 #[inline(always)]
41 pub fn is_value2(&self) -> bool {
42 *self == MIDE_A::VALUE2
43 }
44}
45#[doc = "Field `MIDE` writer - Acceptance Mask Bit for Message IDE Bit"]
46pub type MIDE_W<'a, REG> = crate::BitWriter<'a, REG, MIDE_A>;
47impl<'a, REG> MIDE_W<'a, REG>
48where
49 REG: crate::Writable + crate::RegisterSpec,
50{
51 #[doc = "Message object n accepts the reception of both, standard and extended frames."]
52 #[inline(always)]
53 pub fn value1(self) -> &'a mut crate::W<REG> {
54 self.variant(MIDE_A::VALUE1)
55 }
56 #[doc = "Message object n receives frames only with matching IDE bit."]
57 #[inline(always)]
58 pub fn value2(self) -> &'a mut crate::W<REG> {
59 self.variant(MIDE_A::VALUE2)
60 }
61}
62impl R {
63 #[doc = "Bits 0:28 - Acceptance Mask for Message Identifier"]
64 #[inline(always)]
65 pub fn am(&self) -> AM_R {
66 AM_R::new(self.bits & 0x1fff_ffff)
67 }
68 #[doc = "Bit 29 - Acceptance Mask Bit for Message IDE Bit"]
69 #[inline(always)]
70 pub fn mide(&self) -> MIDE_R {
71 MIDE_R::new(((self.bits >> 29) & 1) != 0)
72 }
73}
74impl W {
75 #[doc = "Bits 0:28 - Acceptance Mask for Message Identifier"]
76 #[inline(always)]
77 pub fn am(&mut self) -> AM_W<MOAMR_SPEC> {
78 AM_W::new(self, 0)
79 }
80 #[doc = "Bit 29 - Acceptance Mask Bit for Message IDE Bit"]
81 #[inline(always)]
82 pub fn mide(&mut self) -> MIDE_W<MOAMR_SPEC> {
83 MIDE_W::new(self, 29)
84 }
85}
86#[doc = "Message Object Acceptance Mask Register\n\nYou can [`read`](crate::Reg::read) this register and get [`moamr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`moamr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
87pub struct MOAMR_SPEC;
88impl crate::RegisterSpec for MOAMR_SPEC {
89 type Ux = u32;
90}
91#[doc = "`read()` method returns [`moamr::R`](R) reader structure"]
92impl crate::Readable for MOAMR_SPEC {}
93#[doc = "`write(|w| ..)` method takes [`moamr::W`](W) writer structure"]
94impl crate::Writable for MOAMR_SPEC {
95 type Safety = crate::Unsafe;
96 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
97 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
98}
99#[doc = "`reset()` method sets MOAMR to value 0x3fff_ffff"]
100impl crate::Resettable for MOAMR_SPEC {
101 const RESET_VALUE: u32 = 0x3fff_ffff;
102}