efm32gg_pac/efm32gg995/ebi/
wrtiming2.rs

1#[doc = "Register `WRTIMING2` reader"]
2pub struct R(crate::R<WRTIMING2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<WRTIMING2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<WRTIMING2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<WRTIMING2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `WRTIMING2` writer"]
17pub struct W(crate::W<WRTIMING2_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<WRTIMING2_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<WRTIMING2_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<WRTIMING2_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `WRSETUP` reader - Write Setup Time"]
38pub type WRSETUP_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `WRSETUP` writer - Write Setup Time"]
40pub type WRSETUP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WRTIMING2_SPEC, u8, u8, 2, O>;
41#[doc = "Field `WRSTRB` reader - Write Strobe Time"]
42pub type WRSTRB_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `WRSTRB` writer - Write Strobe Time"]
44pub type WRSTRB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WRTIMING2_SPEC, u8, u8, 6, O>;
45#[doc = "Field `WRHOLD` reader - Write Hold Time"]
46pub type WRHOLD_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `WRHOLD` writer - Write Hold Time"]
48pub type WRHOLD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WRTIMING2_SPEC, u8, u8, 2, O>;
49#[doc = "Field `HALFWE` reader - Half Cycle WEn Strobe Duration Enable"]
50pub type HALFWE_R = crate::BitReader<bool>;
51#[doc = "Field `HALFWE` writer - Half Cycle WEn Strobe Duration Enable"]
52pub type HALFWE_W<'a, const O: u8> = crate::BitWriter<'a, u32, WRTIMING2_SPEC, bool, O>;
53#[doc = "Field `WBUFDIS` reader - Write Buffer Disable"]
54pub type WBUFDIS_R = crate::BitReader<bool>;
55#[doc = "Field `WBUFDIS` writer - Write Buffer Disable"]
56pub type WBUFDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, WRTIMING2_SPEC, bool, O>;
57impl R {
58    #[doc = "Bits 0:1 - Write Setup Time"]
59    #[inline(always)]
60    pub fn wrsetup(&self) -> WRSETUP_R {
61        WRSETUP_R::new((self.bits & 3) as u8)
62    }
63    #[doc = "Bits 8:13 - Write Strobe Time"]
64    #[inline(always)]
65    pub fn wrstrb(&self) -> WRSTRB_R {
66        WRSTRB_R::new(((self.bits >> 8) & 0x3f) as u8)
67    }
68    #[doc = "Bits 16:17 - Write Hold Time"]
69    #[inline(always)]
70    pub fn wrhold(&self) -> WRHOLD_R {
71        WRHOLD_R::new(((self.bits >> 16) & 3) as u8)
72    }
73    #[doc = "Bit 28 - Half Cycle WEn Strobe Duration Enable"]
74    #[inline(always)]
75    pub fn halfwe(&self) -> HALFWE_R {
76        HALFWE_R::new(((self.bits >> 28) & 1) != 0)
77    }
78    #[doc = "Bit 29 - Write Buffer Disable"]
79    #[inline(always)]
80    pub fn wbufdis(&self) -> WBUFDIS_R {
81        WBUFDIS_R::new(((self.bits >> 29) & 1) != 0)
82    }
83}
84impl W {
85    #[doc = "Bits 0:1 - Write Setup Time"]
86    #[inline(always)]
87    #[must_use]
88    pub fn wrsetup(&mut self) -> WRSETUP_W<0> {
89        WRSETUP_W::new(self)
90    }
91    #[doc = "Bits 8:13 - Write Strobe Time"]
92    #[inline(always)]
93    #[must_use]
94    pub fn wrstrb(&mut self) -> WRSTRB_W<8> {
95        WRSTRB_W::new(self)
96    }
97    #[doc = "Bits 16:17 - Write Hold Time"]
98    #[inline(always)]
99    #[must_use]
100    pub fn wrhold(&mut self) -> WRHOLD_W<16> {
101        WRHOLD_W::new(self)
102    }
103    #[doc = "Bit 28 - Half Cycle WEn Strobe Duration Enable"]
104    #[inline(always)]
105    #[must_use]
106    pub fn halfwe(&mut self) -> HALFWE_W<28> {
107        HALFWE_W::new(self)
108    }
109    #[doc = "Bit 29 - Write Buffer Disable"]
110    #[inline(always)]
111    #[must_use]
112    pub fn wbufdis(&mut self) -> WBUFDIS_W<29> {
113        WBUFDIS_W::new(self)
114    }
115    #[doc = "Writes raw bits to the register."]
116    #[inline(always)]
117    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
118        self.0.bits(bits);
119        self
120    }
121}
122#[doc = "Write Timing Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wrtiming2](index.html) module"]
123pub struct WRTIMING2_SPEC;
124impl crate::RegisterSpec for WRTIMING2_SPEC {
125    type Ux = u32;
126}
127#[doc = "`read()` method returns [wrtiming2::R](R) reader structure"]
128impl crate::Readable for WRTIMING2_SPEC {
129    type Reader = R;
130}
131#[doc = "`write(|w| ..)` method takes [wrtiming2::W](W) writer structure"]
132impl crate::Writable for WRTIMING2_SPEC {
133    type Writer = W;
134    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
135    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
136}
137#[doc = "`reset()` method sets WRTIMING2 to value 0x0003_3f03"]
138impl crate::Resettable for WRTIMING2_SPEC {
139    const RESET_VALUE: Self::Ux = 0x0003_3f03;
140}