efm32gg11b820/ebi/
addrtiming3.rs

1#[doc = "Reader of register ADDRTIMING3"]
2pub type R = crate::R<u32, super::ADDRTIMING3>;
3#[doc = "Writer for register ADDRTIMING3"]
4pub type W = crate::W<u32, super::ADDRTIMING3>;
5#[doc = "Register ADDRTIMING3 `reset()`'s with value 0x0707"]
6impl crate::ResetValue for super::ADDRTIMING3 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x0707
11    }
12}
13#[doc = "Reader of field `ADDRSETUP`"]
14pub type ADDRSETUP_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `ADDRSETUP`"]
16pub struct ADDRSETUP_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> ADDRSETUP_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
24        self.w
25    }
26}
27#[doc = "Reader of field `ADDRHOLD`"]
28pub type ADDRHOLD_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `ADDRHOLD`"]
30pub struct ADDRHOLD_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> ADDRHOLD_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
38        self.w
39    }
40}
41#[doc = "Reader of field `HALFALE`"]
42pub type HALFALE_R = crate::R<bool, bool>;
43#[doc = "Write proxy for field `HALFALE`"]
44pub struct HALFALE_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> HALFALE_W<'a> {
48    #[doc = r"Sets the field bit"]
49    #[inline(always)]
50    pub fn set_bit(self) -> &'a mut W {
51        self.bit(true)
52    }
53    #[doc = r"Clears the field bit"]
54    #[inline(always)]
55    pub fn clear_bit(self) -> &'a mut W {
56        self.bit(false)
57    }
58    #[doc = r"Writes raw bits to the field"]
59    #[inline(always)]
60    pub fn bit(self, value: bool) -> &'a mut W {
61        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
62        self.w
63    }
64}
65impl R {
66    #[doc = "Bits 0:2 - Address Setup Time"]
67    #[inline(always)]
68    pub fn addrsetup(&self) -> ADDRSETUP_R {
69        ADDRSETUP_R::new((self.bits & 0x07) as u8)
70    }
71    #[doc = "Bits 8:10 - Address Hold Time"]
72    #[inline(always)]
73    pub fn addrhold(&self) -> ADDRHOLD_R {
74        ADDRHOLD_R::new(((self.bits >> 8) & 0x07) as u8)
75    }
76    #[doc = "Bit 28 - Half Cycle ALE Strobe Duration Enable"]
77    #[inline(always)]
78    pub fn halfale(&self) -> HALFALE_R {
79        HALFALE_R::new(((self.bits >> 28) & 0x01) != 0)
80    }
81}
82impl W {
83    #[doc = "Bits 0:2 - Address Setup Time"]
84    #[inline(always)]
85    pub fn addrsetup(&mut self) -> ADDRSETUP_W {
86        ADDRSETUP_W { w: self }
87    }
88    #[doc = "Bits 8:10 - Address Hold Time"]
89    #[inline(always)]
90    pub fn addrhold(&mut self) -> ADDRHOLD_W {
91        ADDRHOLD_W { w: self }
92    }
93    #[doc = "Bit 28 - Half Cycle ALE Strobe Duration Enable"]
94    #[inline(always)]
95    pub fn halfale(&mut self) -> HALFALE_W {
96        HALFALE_W { w: self }
97    }
98}