efm32gg11b820/emu/
templimits.rs1#[doc = "Reader of register TEMPLIMITS"]
2pub type R = crate::R<u32, super::TEMPLIMITS>;
3#[doc = "Writer for register TEMPLIMITS"]
4pub type W = crate::W<u32, super::TEMPLIMITS>;
5#[doc = "Register TEMPLIMITS `reset()`'s with value 0xff00"]
6impl crate::ResetValue for super::TEMPLIMITS {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0xff00
11 }
12}
13#[doc = "Reader of field `TEMPLOW`"]
14pub type TEMPLOW_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `TEMPLOW`"]
16pub struct TEMPLOW_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> TEMPLOW_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 & !0xff) | ((value as u32) & 0xff);
24 self.w
25 }
26}
27#[doc = "Reader of field `TEMPHIGH`"]
28pub type TEMPHIGH_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `TEMPHIGH`"]
30pub struct TEMPHIGH_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> TEMPHIGH_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 & !(0xff << 8)) | (((value as u32) & 0xff) << 8);
38 self.w
39 }
40}
41#[doc = "Reader of field `EM4WUEN`"]
42pub type EM4WUEN_R = crate::R<bool, bool>;
43#[doc = "Write proxy for field `EM4WUEN`"]
44pub struct EM4WUEN_W<'a> {
45 w: &'a mut W,
46}
47impl<'a> EM4WUEN_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 << 16)) | (((value as u32) & 0x01) << 16);
62 self.w
63 }
64}
65impl R {
66 #[doc = "Bits 0:7 - Temperature Low Limit"]
67 #[inline(always)]
68 pub fn templow(&self) -> TEMPLOW_R {
69 TEMPLOW_R::new((self.bits & 0xff) as u8)
70 }
71 #[doc = "Bits 8:15 - Temperature High Limit"]
72 #[inline(always)]
73 pub fn temphigh(&self) -> TEMPHIGH_R {
74 TEMPHIGH_R::new(((self.bits >> 8) & 0xff) as u8)
75 }
76 #[doc = "Bit 16 - Enable EM4 Wakeup Due to Low/high Temperature"]
77 #[inline(always)]
78 pub fn em4wuen(&self) -> EM4WUEN_R {
79 EM4WUEN_R::new(((self.bits >> 16) & 0x01) != 0)
80 }
81}
82impl W {
83 #[doc = "Bits 0:7 - Temperature Low Limit"]
84 #[inline(always)]
85 pub fn templow(&mut self) -> TEMPLOW_W {
86 TEMPLOW_W { w: self }
87 }
88 #[doc = "Bits 8:15 - Temperature High Limit"]
89 #[inline(always)]
90 pub fn temphigh(&mut self) -> TEMPHIGH_W {
91 TEMPHIGH_W { w: self }
92 }
93 #[doc = "Bit 16 - Enable EM4 Wakeup Due to Low/high Temperature"]
94 #[inline(always)]
95 pub fn em4wuen(&mut self) -> EM4WUEN_W {
96 EM4WUEN_W { w: self }
97 }
98}