atsam4e8e_pac/can0/
msr4.rs1#[doc = "Register `MSR4` reader"]
2pub struct R(crate::R<MSR4_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<MSR4_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<MSR4_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<MSR4_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `MTIMESTAMP` reader - Timer value"]
17pub type MTIMESTAMP_R = crate::FieldReader<u16, u16>;
18#[doc = "Field `MDLC` reader - Mailbox Data Length Code"]
19pub type MDLC_R = crate::FieldReader<u8, u8>;
20#[doc = "Field `MRTR` reader - Mailbox Remote Transmission Request"]
21pub type MRTR_R = crate::BitReader<bool>;
22#[doc = "Field `MABT` reader - Mailbox Message Abort"]
23pub type MABT_R = crate::BitReader<bool>;
24#[doc = "Field `MRDY` reader - Mailbox Ready"]
25pub type MRDY_R = crate::BitReader<bool>;
26#[doc = "Field `MMI` reader - Mailbox Message Ignored"]
27pub type MMI_R = crate::BitReader<bool>;
28impl R {
29 #[doc = "Bits 0:15 - Timer value"]
30 #[inline(always)]
31 pub fn mtimestamp(&self) -> MTIMESTAMP_R {
32 MTIMESTAMP_R::new((self.bits & 0xffff) as u16)
33 }
34 #[doc = "Bits 16:19 - Mailbox Data Length Code"]
35 #[inline(always)]
36 pub fn mdlc(&self) -> MDLC_R {
37 MDLC_R::new(((self.bits >> 16) & 0x0f) as u8)
38 }
39 #[doc = "Bit 20 - Mailbox Remote Transmission Request"]
40 #[inline(always)]
41 pub fn mrtr(&self) -> MRTR_R {
42 MRTR_R::new(((self.bits >> 20) & 1) != 0)
43 }
44 #[doc = "Bit 22 - Mailbox Message Abort"]
45 #[inline(always)]
46 pub fn mabt(&self) -> MABT_R {
47 MABT_R::new(((self.bits >> 22) & 1) != 0)
48 }
49 #[doc = "Bit 23 - Mailbox Ready"]
50 #[inline(always)]
51 pub fn mrdy(&self) -> MRDY_R {
52 MRDY_R::new(((self.bits >> 23) & 1) != 0)
53 }
54 #[doc = "Bit 24 - Mailbox Message Ignored"]
55 #[inline(always)]
56 pub fn mmi(&self) -> MMI_R {
57 MMI_R::new(((self.bits >> 24) & 1) != 0)
58 }
59}
60#[doc = "Mailbox Status Register (MB = 4)\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [msr4](index.html) module"]
61pub struct MSR4_SPEC;
62impl crate::RegisterSpec for MSR4_SPEC {
63 type Ux = u32;
64}
65#[doc = "`read()` method returns [msr4::R](R) reader structure"]
66impl crate::Readable for MSR4_SPEC {
67 type Reader = R;
68}
69#[doc = "`reset()` method sets MSR4 to value 0"]
70impl crate::Resettable for MSR4_SPEC {
71 const RESET_VALUE: Self::Ux = 0;
72}