gd32e5/gd32e503/can0/
tmp1.rs1#[doc = "Register `TMP1` reader"]
2pub type R = crate::R<Tmp1Spec>;
3#[doc = "Register `TMP1` writer"]
4pub type W = crate::W<Tmp1Spec>;
5#[doc = "Field `DLENC` reader - Data length code"]
6pub type DlencR = crate::FieldReader;
7#[doc = "Field `DLENC` writer - Data length code"]
8pub type DlencW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `TSEN` reader - Time stamp enable"]
10pub type TsenR = crate::BitReader;
11#[doc = "Field `TSEN` writer - Time stamp enable"]
12pub type TsenW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TS` reader - Time stamp"]
14pub type TsR = crate::FieldReader<u16>;
15#[doc = "Field `TS` writer - Time stamp"]
16pub type TsW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
17impl R {
18 #[doc = "Bits 0:3 - Data length code"]
19 #[inline(always)]
20 pub fn dlenc(&self) -> DlencR {
21 DlencR::new((self.bits & 0x0f) as u8)
22 }
23 #[doc = "Bit 8 - Time stamp enable"]
24 #[inline(always)]
25 pub fn tsen(&self) -> TsenR {
26 TsenR::new(((self.bits >> 8) & 1) != 0)
27 }
28 #[doc = "Bits 16:31 - Time stamp"]
29 #[inline(always)]
30 pub fn ts(&self) -> TsR {
31 TsR::new(((self.bits >> 16) & 0xffff) as u16)
32 }
33}
34impl W {
35 #[doc = "Bits 0:3 - Data length code"]
36 #[inline(always)]
37 #[must_use]
38 pub fn dlenc(&mut self) -> DlencW<Tmp1Spec> {
39 DlencW::new(self, 0)
40 }
41 #[doc = "Bit 8 - Time stamp enable"]
42 #[inline(always)]
43 #[must_use]
44 pub fn tsen(&mut self) -> TsenW<Tmp1Spec> {
45 TsenW::new(self, 8)
46 }
47 #[doc = "Bits 16:31 - Time stamp"]
48 #[inline(always)]
49 #[must_use]
50 pub fn ts(&mut self) -> TsW<Tmp1Spec> {
51 TsW::new(self, 16)
52 }
53}
54#[doc = "Transmit mailbox property register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tmp1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tmp1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct Tmp1Spec;
56impl crate::RegisterSpec for Tmp1Spec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`tmp1::R`](R) reader structure"]
60impl crate::Readable for Tmp1Spec {}
61#[doc = "`write(|w| ..)` method takes [`tmp1::W`](W) writer structure"]
62impl crate::Writable for Tmp1Spec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets TMP1 to value 0"]
68impl crate::Resettable for Tmp1Spec {
69 const RESET_VALUE: u32 = 0;
70}