efm32tg11b320_pac/emu/
vmonavddctrl.rs

1#[doc = "Register `VMONAVDDCTRL` reader"]
2pub struct R(crate::R<VMONAVDDCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<VMONAVDDCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<VMONAVDDCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<VMONAVDDCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `VMONAVDDCTRL` writer"]
17pub struct W(crate::W<VMONAVDDCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<VMONAVDDCTRL_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<VMONAVDDCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<VMONAVDDCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `EN` reader - Enable"]
38pub type EN_R = crate::BitReader<bool>;
39#[doc = "Field `EN` writer - Enable"]
40pub type EN_W<'a> = crate::BitWriter<'a, u32, VMONAVDDCTRL_SPEC, bool, 0>;
41#[doc = "Field `RISEWU` reader - Rise Wakeup"]
42pub type RISEWU_R = crate::BitReader<bool>;
43#[doc = "Field `RISEWU` writer - Rise Wakeup"]
44pub type RISEWU_W<'a> = crate::BitWriter<'a, u32, VMONAVDDCTRL_SPEC, bool, 2>;
45#[doc = "Field `FALLWU` reader - Fall Wakeup"]
46pub type FALLWU_R = crate::BitReader<bool>;
47#[doc = "Field `FALLWU` writer - Fall Wakeup"]
48pub type FALLWU_W<'a> = crate::BitWriter<'a, u32, VMONAVDDCTRL_SPEC, bool, 3>;
49#[doc = "Field `FALLTHRESFINE` reader - Falling Threshold Fine Adjust"]
50pub type FALLTHRESFINE_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `FALLTHRESFINE` writer - Falling Threshold Fine Adjust"]
52pub type FALLTHRESFINE_W<'a> = crate::FieldWriter<'a, u32, VMONAVDDCTRL_SPEC, u8, u8, 4, 8>;
53#[doc = "Field `FALLTHRESCOARSE` reader - Falling Threshold Coarse Adjust"]
54pub type FALLTHRESCOARSE_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `FALLTHRESCOARSE` writer - Falling Threshold Coarse Adjust"]
56pub type FALLTHRESCOARSE_W<'a> = crate::FieldWriter<'a, u32, VMONAVDDCTRL_SPEC, u8, u8, 4, 12>;
57#[doc = "Field `RISETHRESFINE` reader - Rising Threshold Fine Adjust"]
58pub type RISETHRESFINE_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `RISETHRESFINE` writer - Rising Threshold Fine Adjust"]
60pub type RISETHRESFINE_W<'a> = crate::FieldWriter<'a, u32, VMONAVDDCTRL_SPEC, u8, u8, 4, 16>;
61#[doc = "Field `RISETHRESCOARSE` reader - Rising Threshold Coarse Adjust"]
62pub type RISETHRESCOARSE_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `RISETHRESCOARSE` writer - Rising Threshold Coarse Adjust"]
64pub type RISETHRESCOARSE_W<'a> = crate::FieldWriter<'a, u32, VMONAVDDCTRL_SPEC, u8, u8, 4, 20>;
65impl R {
66    #[doc = "Bit 0 - Enable"]
67    #[inline(always)]
68    pub fn en(&self) -> EN_R {
69        EN_R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 2 - Rise Wakeup"]
72    #[inline(always)]
73    pub fn risewu(&self) -> RISEWU_R {
74        RISEWU_R::new(((self.bits >> 2) & 1) != 0)
75    }
76    #[doc = "Bit 3 - Fall Wakeup"]
77    #[inline(always)]
78    pub fn fallwu(&self) -> FALLWU_R {
79        FALLWU_R::new(((self.bits >> 3) & 1) != 0)
80    }
81    #[doc = "Bits 8:11 - Falling Threshold Fine Adjust"]
82    #[inline(always)]
83    pub fn fallthresfine(&self) -> FALLTHRESFINE_R {
84        FALLTHRESFINE_R::new(((self.bits >> 8) & 0x0f) as u8)
85    }
86    #[doc = "Bits 12:15 - Falling Threshold Coarse Adjust"]
87    #[inline(always)]
88    pub fn fallthrescoarse(&self) -> FALLTHRESCOARSE_R {
89        FALLTHRESCOARSE_R::new(((self.bits >> 12) & 0x0f) as u8)
90    }
91    #[doc = "Bits 16:19 - Rising Threshold Fine Adjust"]
92    #[inline(always)]
93    pub fn risethresfine(&self) -> RISETHRESFINE_R {
94        RISETHRESFINE_R::new(((self.bits >> 16) & 0x0f) as u8)
95    }
96    #[doc = "Bits 20:23 - Rising Threshold Coarse Adjust"]
97    #[inline(always)]
98    pub fn risethrescoarse(&self) -> RISETHRESCOARSE_R {
99        RISETHRESCOARSE_R::new(((self.bits >> 20) & 0x0f) as u8)
100    }
101}
102impl W {
103    #[doc = "Bit 0 - Enable"]
104    #[inline(always)]
105    pub fn en(&mut self) -> EN_W {
106        EN_W::new(self)
107    }
108    #[doc = "Bit 2 - Rise Wakeup"]
109    #[inline(always)]
110    pub fn risewu(&mut self) -> RISEWU_W {
111        RISEWU_W::new(self)
112    }
113    #[doc = "Bit 3 - Fall Wakeup"]
114    #[inline(always)]
115    pub fn fallwu(&mut self) -> FALLWU_W {
116        FALLWU_W::new(self)
117    }
118    #[doc = "Bits 8:11 - Falling Threshold Fine Adjust"]
119    #[inline(always)]
120    pub fn fallthresfine(&mut self) -> FALLTHRESFINE_W {
121        FALLTHRESFINE_W::new(self)
122    }
123    #[doc = "Bits 12:15 - Falling Threshold Coarse Adjust"]
124    #[inline(always)]
125    pub fn fallthrescoarse(&mut self) -> FALLTHRESCOARSE_W {
126        FALLTHRESCOARSE_W::new(self)
127    }
128    #[doc = "Bits 16:19 - Rising Threshold Fine Adjust"]
129    #[inline(always)]
130    pub fn risethresfine(&mut self) -> RISETHRESFINE_W {
131        RISETHRESFINE_W::new(self)
132    }
133    #[doc = "Bits 20:23 - Rising Threshold Coarse Adjust"]
134    #[inline(always)]
135    pub fn risethrescoarse(&mut self) -> RISETHRESCOARSE_W {
136        RISETHRESCOARSE_W::new(self)
137    }
138    #[doc = "Writes raw bits to the register."]
139    #[inline(always)]
140    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
141        self.0.bits(bits);
142        self
143    }
144}
145#[doc = "VMON AVDD Channel Control\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 [vmonavddctrl](index.html) module"]
146pub struct VMONAVDDCTRL_SPEC;
147impl crate::RegisterSpec for VMONAVDDCTRL_SPEC {
148    type Ux = u32;
149}
150#[doc = "`read()` method returns [vmonavddctrl::R](R) reader structure"]
151impl crate::Readable for VMONAVDDCTRL_SPEC {
152    type Reader = R;
153}
154#[doc = "`write(|w| ..)` method takes [vmonavddctrl::W](W) writer structure"]
155impl crate::Writable for VMONAVDDCTRL_SPEC {
156    type Writer = W;
157}
158#[doc = "`reset()` method sets VMONAVDDCTRL to value 0"]
159impl crate::Resettable for VMONAVDDCTRL_SPEC {
160    #[inline(always)]
161    fn reset_value() -> Self::Ux {
162        0
163    }
164}