bl702_pac/glb/
dig32k_wakeup_ctrl.rs1#[doc = "Register `DIG32K_WAKEUP_CTRL` reader"]
2pub struct R(crate::R<DIG32K_WAKEUP_CTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DIG32K_WAKEUP_CTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DIG32K_WAKEUP_CTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DIG32K_WAKEUP_CTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `DIG32K_WAKEUP_CTRL` writer"]
17pub struct W(crate::W<DIG32K_WAKEUP_CTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DIG32K_WAKEUP_CTRL_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<DIG32K_WAKEUP_CTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DIG32K_WAKEUP_CTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `dig_32k_div` reader - "]
38pub type DIG_32K_DIV_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `dig_32k_div` writer - "]
40pub type DIG_32K_DIV_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, u16, u16, 11, O>;
42#[doc = "Field `dig_32k_en` reader - "]
43pub type DIG_32K_EN_R = crate::BitReader<bool>;
44#[doc = "Field `dig_32k_en` writer - "]
45pub type DIG_32K_EN_W<'a, const O: u8> =
46 crate::BitWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, bool, O>;
47#[doc = "Field `dig_32k_comp` reader - "]
48pub type DIG_32K_COMP_R = crate::BitReader<bool>;
49#[doc = "Field `dig_32k_comp` writer - "]
50pub type DIG_32K_COMP_W<'a, const O: u8> =
51 crate::BitWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, bool, O>;
52#[doc = "Field `dig_512k_div` reader - "]
53pub type DIG_512K_DIV_R = crate::FieldReader<u8, u8>;
54#[doc = "Field `dig_512k_div` writer - "]
55pub type DIG_512K_DIV_W<'a, const O: u8> =
56 crate::FieldWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, u8, u8, 7, O>;
57#[doc = "Field `dig_512k_en` reader - "]
58pub type DIG_512K_EN_R = crate::BitReader<bool>;
59#[doc = "Field `dig_512k_en` writer - "]
60pub type DIG_512K_EN_W<'a, const O: u8> =
61 crate::BitWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, bool, O>;
62#[doc = "Field `dig_512k_comp` reader - "]
63pub type DIG_512K_COMP_R = crate::BitReader<bool>;
64#[doc = "Field `dig_512k_comp` writer - "]
65pub type DIG_512K_COMP_W<'a, const O: u8> =
66 crate::BitWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, bool, O>;
67#[doc = "Field `dig_clk_src_sel` reader - "]
68pub type DIG_CLK_SRC_SEL_R = crate::FieldReader<u8, u8>;
69#[doc = "Field `dig_clk_src_sel` writer - "]
70pub type DIG_CLK_SRC_SEL_W<'a, const O: u8> =
71 crate::FieldWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, u8, u8, 2, O>;
72#[doc = "Field `reg_en_platform_wakeup` reader - "]
73pub type REG_EN_PLATFORM_WAKEUP_R = crate::BitReader<bool>;
74#[doc = "Field `reg_en_platform_wakeup` writer - "]
75pub type REG_EN_PLATFORM_WAKEUP_W<'a, const O: u8> =
76 crate::BitWriter<'a, u32, DIG32K_WAKEUP_CTRL_SPEC, bool, O>;
77impl R {
78 #[doc = "Bits 0:10"]
79 #[inline(always)]
80 pub fn dig_32k_div(&self) -> DIG_32K_DIV_R {
81 DIG_32K_DIV_R::new((self.bits & 0x07ff) as u16)
82 }
83 #[doc = "Bit 12"]
84 #[inline(always)]
85 pub fn dig_32k_en(&self) -> DIG_32K_EN_R {
86 DIG_32K_EN_R::new(((self.bits >> 12) & 1) != 0)
87 }
88 #[doc = "Bit 13"]
89 #[inline(always)]
90 pub fn dig_32k_comp(&self) -> DIG_32K_COMP_R {
91 DIG_32K_COMP_R::new(((self.bits >> 13) & 1) != 0)
92 }
93 #[doc = "Bits 16:22"]
94 #[inline(always)]
95 pub fn dig_512k_div(&self) -> DIG_512K_DIV_R {
96 DIG_512K_DIV_R::new(((self.bits >> 16) & 0x7f) as u8)
97 }
98 #[doc = "Bit 24"]
99 #[inline(always)]
100 pub fn dig_512k_en(&self) -> DIG_512K_EN_R {
101 DIG_512K_EN_R::new(((self.bits >> 24) & 1) != 0)
102 }
103 #[doc = "Bit 25"]
104 #[inline(always)]
105 pub fn dig_512k_comp(&self) -> DIG_512K_COMP_R {
106 DIG_512K_COMP_R::new(((self.bits >> 25) & 1) != 0)
107 }
108 #[doc = "Bits 28:29"]
109 #[inline(always)]
110 pub fn dig_clk_src_sel(&self) -> DIG_CLK_SRC_SEL_R {
111 DIG_CLK_SRC_SEL_R::new(((self.bits >> 28) & 3) as u8)
112 }
113 #[doc = "Bit 31"]
114 #[inline(always)]
115 pub fn reg_en_platform_wakeup(&self) -> REG_EN_PLATFORM_WAKEUP_R {
116 REG_EN_PLATFORM_WAKEUP_R::new(((self.bits >> 31) & 1) != 0)
117 }
118}
119impl W {
120 #[doc = "Bits 0:10"]
121 #[inline(always)]
122 #[must_use]
123 pub fn dig_32k_div(&mut self) -> DIG_32K_DIV_W<0> {
124 DIG_32K_DIV_W::new(self)
125 }
126 #[doc = "Bit 12"]
127 #[inline(always)]
128 #[must_use]
129 pub fn dig_32k_en(&mut self) -> DIG_32K_EN_W<12> {
130 DIG_32K_EN_W::new(self)
131 }
132 #[doc = "Bit 13"]
133 #[inline(always)]
134 #[must_use]
135 pub fn dig_32k_comp(&mut self) -> DIG_32K_COMP_W<13> {
136 DIG_32K_COMP_W::new(self)
137 }
138 #[doc = "Bits 16:22"]
139 #[inline(always)]
140 #[must_use]
141 pub fn dig_512k_div(&mut self) -> DIG_512K_DIV_W<16> {
142 DIG_512K_DIV_W::new(self)
143 }
144 #[doc = "Bit 24"]
145 #[inline(always)]
146 #[must_use]
147 pub fn dig_512k_en(&mut self) -> DIG_512K_EN_W<24> {
148 DIG_512K_EN_W::new(self)
149 }
150 #[doc = "Bit 25"]
151 #[inline(always)]
152 #[must_use]
153 pub fn dig_512k_comp(&mut self) -> DIG_512K_COMP_W<25> {
154 DIG_512K_COMP_W::new(self)
155 }
156 #[doc = "Bits 28:29"]
157 #[inline(always)]
158 #[must_use]
159 pub fn dig_clk_src_sel(&mut self) -> DIG_CLK_SRC_SEL_W<28> {
160 DIG_CLK_SRC_SEL_W::new(self)
161 }
162 #[doc = "Bit 31"]
163 #[inline(always)]
164 #[must_use]
165 pub fn reg_en_platform_wakeup(&mut self) -> REG_EN_PLATFORM_WAKEUP_W<31> {
166 REG_EN_PLATFORM_WAKEUP_W::new(self)
167 }
168 #[doc = "Writes raw bits to the register."]
169 #[inline(always)]
170 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
171 self.0.bits(bits);
172 self
173 }
174}
175#[doc = "DIG32K_WAKEUP_CTRL.\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 [dig32k_wakeup_ctrl](index.html) module"]
176pub struct DIG32K_WAKEUP_CTRL_SPEC;
177impl crate::RegisterSpec for DIG32K_WAKEUP_CTRL_SPEC {
178 type Ux = u32;
179}
180#[doc = "`read()` method returns [dig32k_wakeup_ctrl::R](R) reader structure"]
181impl crate::Readable for DIG32K_WAKEUP_CTRL_SPEC {
182 type Reader = R;
183}
184#[doc = "`write(|w| ..)` method takes [dig32k_wakeup_ctrl::W](W) writer structure"]
185impl crate::Writable for DIG32K_WAKEUP_CTRL_SPEC {
186 type Writer = W;
187 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
188 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
189}
190#[doc = "`reset()` method sets DIG32K_WAKEUP_CTRL to value 0"]
191impl crate::Resettable for DIG32K_WAKEUP_CTRL_SPEC {
192 const RESET_VALUE: Self::Ux = 0;
193}