1#[doc = "Register `DPDCTRL` reader"]
2pub struct R(crate::R<DPDCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DPDCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DPDCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DPDCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `DPDCTRL` writer"]
17pub struct W(crate::W<DPDCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DPDCTRL_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<DPDCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DPDCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "WAKEUP pin hysteresis enable\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum WAKEUPHYS_A {
40 #[doc = "0: Disabled. Hysteresis for WAKEUP pin disabled."]
41 DISABLED = 0,
42 #[doc = "1: Enabled. Hysteresis for WAKEUP pin enabled."]
43 ENABLED = 1,
44}
45impl From<WAKEUPHYS_A> for bool {
46 #[inline(always)]
47 fn from(variant: WAKEUPHYS_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `WAKEUPHYS` reader - WAKEUP pin hysteresis enable"]
52pub struct WAKEUPHYS_R(crate::FieldReader<bool, WAKEUPHYS_A>);
53impl WAKEUPHYS_R {
54 pub(crate) fn new(bits: bool) -> Self {
55 WAKEUPHYS_R(crate::FieldReader::new(bits))
56 }
57 #[doc = r"Get enumerated values variant"]
58 #[inline(always)]
59 pub fn variant(&self) -> WAKEUPHYS_A {
60 match self.bits {
61 false => WAKEUPHYS_A::DISABLED,
62 true => WAKEUPHYS_A::ENABLED,
63 }
64 }
65 #[doc = "Checks if the value of the field is `DISABLED`"]
66 #[inline(always)]
67 pub fn is_disabled(&self) -> bool {
68 **self == WAKEUPHYS_A::DISABLED
69 }
70 #[doc = "Checks if the value of the field is `ENABLED`"]
71 #[inline(always)]
72 pub fn is_enabled(&self) -> bool {
73 **self == WAKEUPHYS_A::ENABLED
74 }
75}
76impl core::ops::Deref for WAKEUPHYS_R {
77 type Target = crate::FieldReader<bool, WAKEUPHYS_A>;
78 #[inline(always)]
79 fn deref(&self) -> &Self::Target {
80 &self.0
81 }
82}
83#[doc = "Field `WAKEUPHYS` writer - WAKEUP pin hysteresis enable"]
84pub struct WAKEUPHYS_W<'a> {
85 w: &'a mut W,
86}
87impl<'a> WAKEUPHYS_W<'a> {
88 #[doc = r"Writes `variant` to the field"]
89 #[inline(always)]
90 pub fn variant(self, variant: WAKEUPHYS_A) -> &'a mut W {
91 self.bit(variant.into())
92 }
93 #[doc = "Disabled. Hysteresis for WAKEUP pin disabled."]
94 #[inline(always)]
95 pub fn disabled(self) -> &'a mut W {
96 self.variant(WAKEUPHYS_A::DISABLED)
97 }
98 #[doc = "Enabled. Hysteresis for WAKEUP pin enabled."]
99 #[inline(always)]
100 pub fn enabled(self) -> &'a mut W {
101 self.variant(WAKEUPHYS_A::ENABLED)
102 }
103 #[doc = r"Sets the field bit"]
104 #[inline(always)]
105 pub fn set_bit(self) -> &'a mut W {
106 self.bit(true)
107 }
108 #[doc = r"Clears the field bit"]
109 #[inline(always)]
110 pub fn clear_bit(self) -> &'a mut W {
111 self.bit(false)
112 }
113 #[doc = r"Writes raw bits to the field"]
114 #[inline(always)]
115 pub fn bit(self, value: bool) -> &'a mut W {
116 self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
117 self.w
118 }
119}
120#[doc = "WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be used for other purposes. Remark: Never set this bit if you intend to use a pin to wake up the part from Deep power-down mode. You can only disable the wake-up pin if the self wake-up timer is enabled and configured. Remark: Setting this bit is not necessary if Deep power-down mode is not used.\n\nValue on reset: 0"]
121#[derive(Clone, Copy, Debug, PartialEq)]
122pub enum WAKEPAD_DISABLE_A {
123 #[doc = "0: Enabled. The wake-up function is enabled on pin PIO0_4."]
124 ENABLED = 0,
125 #[doc = "1: Disabled. Setting this bit disables the wake-up function on pin PIO0_4."]
126 DISABLED = 1,
127}
128impl From<WAKEPAD_DISABLE_A> for bool {
129 #[inline(always)]
130 fn from(variant: WAKEPAD_DISABLE_A) -> Self {
131 variant as u8 != 0
132 }
133}
134#[doc = "Field `WAKEPAD_DISABLE` reader - WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be used for other purposes. Remark: Never set this bit if you intend to use a pin to wake up the part from Deep power-down mode. You can only disable the wake-up pin if the self wake-up timer is enabled and configured. Remark: Setting this bit is not necessary if Deep power-down mode is not used."]
135pub struct WAKEPAD_DISABLE_R(crate::FieldReader<bool, WAKEPAD_DISABLE_A>);
136impl WAKEPAD_DISABLE_R {
137 pub(crate) fn new(bits: bool) -> Self {
138 WAKEPAD_DISABLE_R(crate::FieldReader::new(bits))
139 }
140 #[doc = r"Get enumerated values variant"]
141 #[inline(always)]
142 pub fn variant(&self) -> WAKEPAD_DISABLE_A {
143 match self.bits {
144 false => WAKEPAD_DISABLE_A::ENABLED,
145 true => WAKEPAD_DISABLE_A::DISABLED,
146 }
147 }
148 #[doc = "Checks if the value of the field is `ENABLED`"]
149 #[inline(always)]
150 pub fn is_enabled(&self) -> bool {
151 **self == WAKEPAD_DISABLE_A::ENABLED
152 }
153 #[doc = "Checks if the value of the field is `DISABLED`"]
154 #[inline(always)]
155 pub fn is_disabled(&self) -> bool {
156 **self == WAKEPAD_DISABLE_A::DISABLED
157 }
158}
159impl core::ops::Deref for WAKEPAD_DISABLE_R {
160 type Target = crate::FieldReader<bool, WAKEPAD_DISABLE_A>;
161 #[inline(always)]
162 fn deref(&self) -> &Self::Target {
163 &self.0
164 }
165}
166#[doc = "Field `WAKEPAD_DISABLE` writer - WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be used for other purposes. Remark: Never set this bit if you intend to use a pin to wake up the part from Deep power-down mode. You can only disable the wake-up pin if the self wake-up timer is enabled and configured. Remark: Setting this bit is not necessary if Deep power-down mode is not used."]
167pub struct WAKEPAD_DISABLE_W<'a> {
168 w: &'a mut W,
169}
170impl<'a> WAKEPAD_DISABLE_W<'a> {
171 #[doc = r"Writes `variant` to the field"]
172 #[inline(always)]
173 pub fn variant(self, variant: WAKEPAD_DISABLE_A) -> &'a mut W {
174 self.bit(variant.into())
175 }
176 #[doc = "Enabled. The wake-up function is enabled on pin PIO0_4."]
177 #[inline(always)]
178 pub fn enabled(self) -> &'a mut W {
179 self.variant(WAKEPAD_DISABLE_A::ENABLED)
180 }
181 #[doc = "Disabled. Setting this bit disables the wake-up function on pin PIO0_4."]
182 #[inline(always)]
183 pub fn disabled(self) -> &'a mut W {
184 self.variant(WAKEPAD_DISABLE_A::DISABLED)
185 }
186 #[doc = r"Sets the field bit"]
187 #[inline(always)]
188 pub fn set_bit(self) -> &'a mut W {
189 self.bit(true)
190 }
191 #[doc = r"Clears the field bit"]
192 #[inline(always)]
193 pub fn clear_bit(self) -> &'a mut W {
194 self.bit(false)
195 }
196 #[doc = r"Writes raw bits to the field"]
197 #[inline(always)]
198 pub fn bit(self, value: bool) -> &'a mut W {
199 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
200 self.w
201 }
202}
203#[doc = "Enable the low-power oscillator for use with the 10 kHz self wake-up timer clock. You must set this bit if the CLKSEL bit in the self wake-up timer CTRL bit is set. Do not enable the low-power oscillator if the self wake-up timer is clocked by the divided IRC or the external clock input.\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq)]
205pub enum LPOSCEN_A {
206 #[doc = "0: Disabled."]
207 DISABLED = 0,
208 #[doc = "1: Enabled."]
209 ENABLED = 1,
210}
211impl From<LPOSCEN_A> for bool {
212 #[inline(always)]
213 fn from(variant: LPOSCEN_A) -> Self {
214 variant as u8 != 0
215 }
216}
217#[doc = "Field `LPOSCEN` reader - Enable the low-power oscillator for use with the 10 kHz self wake-up timer clock. You must set this bit if the CLKSEL bit in the self wake-up timer CTRL bit is set. Do not enable the low-power oscillator if the self wake-up timer is clocked by the divided IRC or the external clock input."]
218pub struct LPOSCEN_R(crate::FieldReader<bool, LPOSCEN_A>);
219impl LPOSCEN_R {
220 pub(crate) fn new(bits: bool) -> Self {
221 LPOSCEN_R(crate::FieldReader::new(bits))
222 }
223 #[doc = r"Get enumerated values variant"]
224 #[inline(always)]
225 pub fn variant(&self) -> LPOSCEN_A {
226 match self.bits {
227 false => LPOSCEN_A::DISABLED,
228 true => LPOSCEN_A::ENABLED,
229 }
230 }
231 #[doc = "Checks if the value of the field is `DISABLED`"]
232 #[inline(always)]
233 pub fn is_disabled(&self) -> bool {
234 **self == LPOSCEN_A::DISABLED
235 }
236 #[doc = "Checks if the value of the field is `ENABLED`"]
237 #[inline(always)]
238 pub fn is_enabled(&self) -> bool {
239 **self == LPOSCEN_A::ENABLED
240 }
241}
242impl core::ops::Deref for LPOSCEN_R {
243 type Target = crate::FieldReader<bool, LPOSCEN_A>;
244 #[inline(always)]
245 fn deref(&self) -> &Self::Target {
246 &self.0
247 }
248}
249#[doc = "Field `LPOSCEN` writer - Enable the low-power oscillator for use with the 10 kHz self wake-up timer clock. You must set this bit if the CLKSEL bit in the self wake-up timer CTRL bit is set. Do not enable the low-power oscillator if the self wake-up timer is clocked by the divided IRC or the external clock input."]
250pub struct LPOSCEN_W<'a> {
251 w: &'a mut W,
252}
253impl<'a> LPOSCEN_W<'a> {
254 #[doc = r"Writes `variant` to the field"]
255 #[inline(always)]
256 pub fn variant(self, variant: LPOSCEN_A) -> &'a mut W {
257 self.bit(variant.into())
258 }
259 #[doc = "Disabled."]
260 #[inline(always)]
261 pub fn disabled(self) -> &'a mut W {
262 self.variant(LPOSCEN_A::DISABLED)
263 }
264 #[doc = "Enabled."]
265 #[inline(always)]
266 pub fn enabled(self) -> &'a mut W {
267 self.variant(LPOSCEN_A::ENABLED)
268 }
269 #[doc = r"Sets the field bit"]
270 #[inline(always)]
271 pub fn set_bit(self) -> &'a mut W {
272 self.bit(true)
273 }
274 #[doc = r"Clears the field bit"]
275 #[inline(always)]
276 pub fn clear_bit(self) -> &'a mut W {
277 self.bit(false)
278 }
279 #[doc = r"Writes raw bits to the field"]
280 #[inline(always)]
281 pub fn bit(self, value: bool) -> &'a mut W {
282 self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
283 self.w
284 }
285}
286#[doc = "causes the low-power oscillator to remain running during Deep power-down mode provided that bit 2 in this register is set as well. You must set this bit for the self wake-up timer to be able to wake up the part from Deep power-down mode. Remark: Do not set this bit unless you use the self wake-up timer with the low-power oscillator clock source to wake up from Deep power-down mode.\n\nValue on reset: 0"]
287#[derive(Clone, Copy, Debug, PartialEq)]
288pub enum LPOSCDPDEN_A {
289 #[doc = "0: Disabled."]
290 DISABLED = 0,
291 #[doc = "1: Enabled."]
292 ENABLED = 1,
293}
294impl From<LPOSCDPDEN_A> for bool {
295 #[inline(always)]
296 fn from(variant: LPOSCDPDEN_A) -> Self {
297 variant as u8 != 0
298 }
299}
300#[doc = "Field `LPOSCDPDEN` reader - causes the low-power oscillator to remain running during Deep power-down mode provided that bit 2 in this register is set as well. You must set this bit for the self wake-up timer to be able to wake up the part from Deep power-down mode. Remark: Do not set this bit unless you use the self wake-up timer with the low-power oscillator clock source to wake up from Deep power-down mode."]
301pub struct LPOSCDPDEN_R(crate::FieldReader<bool, LPOSCDPDEN_A>);
302impl LPOSCDPDEN_R {
303 pub(crate) fn new(bits: bool) -> Self {
304 LPOSCDPDEN_R(crate::FieldReader::new(bits))
305 }
306 #[doc = r"Get enumerated values variant"]
307 #[inline(always)]
308 pub fn variant(&self) -> LPOSCDPDEN_A {
309 match self.bits {
310 false => LPOSCDPDEN_A::DISABLED,
311 true => LPOSCDPDEN_A::ENABLED,
312 }
313 }
314 #[doc = "Checks if the value of the field is `DISABLED`"]
315 #[inline(always)]
316 pub fn is_disabled(&self) -> bool {
317 **self == LPOSCDPDEN_A::DISABLED
318 }
319 #[doc = "Checks if the value of the field is `ENABLED`"]
320 #[inline(always)]
321 pub fn is_enabled(&self) -> bool {
322 **self == LPOSCDPDEN_A::ENABLED
323 }
324}
325impl core::ops::Deref for LPOSCDPDEN_R {
326 type Target = crate::FieldReader<bool, LPOSCDPDEN_A>;
327 #[inline(always)]
328 fn deref(&self) -> &Self::Target {
329 &self.0
330 }
331}
332#[doc = "Field `LPOSCDPDEN` writer - causes the low-power oscillator to remain running during Deep power-down mode provided that bit 2 in this register is set as well. You must set this bit for the self wake-up timer to be able to wake up the part from Deep power-down mode. Remark: Do not set this bit unless you use the self wake-up timer with the low-power oscillator clock source to wake up from Deep power-down mode."]
333pub struct LPOSCDPDEN_W<'a> {
334 w: &'a mut W,
335}
336impl<'a> LPOSCDPDEN_W<'a> {
337 #[doc = r"Writes `variant` to the field"]
338 #[inline(always)]
339 pub fn variant(self, variant: LPOSCDPDEN_A) -> &'a mut W {
340 self.bit(variant.into())
341 }
342 #[doc = "Disabled."]
343 #[inline(always)]
344 pub fn disabled(self) -> &'a mut W {
345 self.variant(LPOSCDPDEN_A::DISABLED)
346 }
347 #[doc = "Enabled."]
348 #[inline(always)]
349 pub fn enabled(self) -> &'a mut W {
350 self.variant(LPOSCDPDEN_A::ENABLED)
351 }
352 #[doc = r"Sets the field bit"]
353 #[inline(always)]
354 pub fn set_bit(self) -> &'a mut W {
355 self.bit(true)
356 }
357 #[doc = r"Clears the field bit"]
358 #[inline(always)]
359 pub fn clear_bit(self) -> &'a mut W {
360 self.bit(false)
361 }
362 #[doc = r"Writes raw bits to the field"]
363 #[inline(always)]
364 pub fn bit(self, value: bool) -> &'a mut W {
365 self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
366 self.w
367 }
368}
369#[doc = "External clock input for the self wake-up timer WKTCLKIN hysteresis enable.\n\nValue on reset: 0"]
370#[derive(Clone, Copy, Debug, PartialEq)]
371pub enum WAKEUPCLKHYS_A {
372 #[doc = "0: Disabled. Hysteresis for WAKEUP clock pin disabled."]
373 DISABLED = 0,
374 #[doc = "1: Enabled. Hysteresis for WAKEUP clock pin enabled."]
375 ENABLED = 1,
376}
377impl From<WAKEUPCLKHYS_A> for bool {
378 #[inline(always)]
379 fn from(variant: WAKEUPCLKHYS_A) -> Self {
380 variant as u8 != 0
381 }
382}
383#[doc = "Field `WAKEUPCLKHYS` reader - External clock input for the self wake-up timer WKTCLKIN hysteresis enable."]
384pub struct WAKEUPCLKHYS_R(crate::FieldReader<bool, WAKEUPCLKHYS_A>);
385impl WAKEUPCLKHYS_R {
386 pub(crate) fn new(bits: bool) -> Self {
387 WAKEUPCLKHYS_R(crate::FieldReader::new(bits))
388 }
389 #[doc = r"Get enumerated values variant"]
390 #[inline(always)]
391 pub fn variant(&self) -> WAKEUPCLKHYS_A {
392 match self.bits {
393 false => WAKEUPCLKHYS_A::DISABLED,
394 true => WAKEUPCLKHYS_A::ENABLED,
395 }
396 }
397 #[doc = "Checks if the value of the field is `DISABLED`"]
398 #[inline(always)]
399 pub fn is_disabled(&self) -> bool {
400 **self == WAKEUPCLKHYS_A::DISABLED
401 }
402 #[doc = "Checks if the value of the field is `ENABLED`"]
403 #[inline(always)]
404 pub fn is_enabled(&self) -> bool {
405 **self == WAKEUPCLKHYS_A::ENABLED
406 }
407}
408impl core::ops::Deref for WAKEUPCLKHYS_R {
409 type Target = crate::FieldReader<bool, WAKEUPCLKHYS_A>;
410 #[inline(always)]
411 fn deref(&self) -> &Self::Target {
412 &self.0
413 }
414}
415#[doc = "Field `WAKEUPCLKHYS` writer - External clock input for the self wake-up timer WKTCLKIN hysteresis enable."]
416pub struct WAKEUPCLKHYS_W<'a> {
417 w: &'a mut W,
418}
419impl<'a> WAKEUPCLKHYS_W<'a> {
420 #[doc = r"Writes `variant` to the field"]
421 #[inline(always)]
422 pub fn variant(self, variant: WAKEUPCLKHYS_A) -> &'a mut W {
423 self.bit(variant.into())
424 }
425 #[doc = "Disabled. Hysteresis for WAKEUP clock pin disabled."]
426 #[inline(always)]
427 pub fn disabled(self) -> &'a mut W {
428 self.variant(WAKEUPCLKHYS_A::DISABLED)
429 }
430 #[doc = "Enabled. Hysteresis for WAKEUP clock pin enabled."]
431 #[inline(always)]
432 pub fn enabled(self) -> &'a mut W {
433 self.variant(WAKEUPCLKHYS_A::ENABLED)
434 }
435 #[doc = r"Sets the field bit"]
436 #[inline(always)]
437 pub fn set_bit(self) -> &'a mut W {
438 self.bit(true)
439 }
440 #[doc = r"Clears the field bit"]
441 #[inline(always)]
442 pub fn clear_bit(self) -> &'a mut W {
443 self.bit(false)
444 }
445 #[doc = r"Writes raw bits to the field"]
446 #[inline(always)]
447 pub fn bit(self, value: bool) -> &'a mut W {
448 self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
449 self.w
450 }
451}
452#[doc = "Disable the external clock input for the self wake-up timer. Setting this bit enables the self wake-up timer clock pin WKTCLKLIN. To minimize power consumption, especially in deep power-down mode, disable this clock input when not using the external clock option for the self wake-up timer.\n\nValue on reset: 0"]
453#[derive(Clone, Copy, Debug, PartialEq)]
454pub enum WAKECLKPAD_DISABLE_A {
455 #[doc = "0: Disabled. Setting this bit disables external clock input on pin PIO0_28."]
456 DISABLED = 0,
457 #[doc = "1: Enabled. The external clock input for the self wake-up timer is enabled on pin PIO0_28."]
458 ENABLED = 1,
459}
460impl From<WAKECLKPAD_DISABLE_A> for bool {
461 #[inline(always)]
462 fn from(variant: WAKECLKPAD_DISABLE_A) -> Self {
463 variant as u8 != 0
464 }
465}
466#[doc = "Field `WAKECLKPAD_DISABLE` reader - Disable the external clock input for the self wake-up timer. Setting this bit enables the self wake-up timer clock pin WKTCLKLIN. To minimize power consumption, especially in deep power-down mode, disable this clock input when not using the external clock option for the self wake-up timer."]
467pub struct WAKECLKPAD_DISABLE_R(crate::FieldReader<bool, WAKECLKPAD_DISABLE_A>);
468impl WAKECLKPAD_DISABLE_R {
469 pub(crate) fn new(bits: bool) -> Self {
470 WAKECLKPAD_DISABLE_R(crate::FieldReader::new(bits))
471 }
472 #[doc = r"Get enumerated values variant"]
473 #[inline(always)]
474 pub fn variant(&self) -> WAKECLKPAD_DISABLE_A {
475 match self.bits {
476 false => WAKECLKPAD_DISABLE_A::DISABLED,
477 true => WAKECLKPAD_DISABLE_A::ENABLED,
478 }
479 }
480 #[doc = "Checks if the value of the field is `DISABLED`"]
481 #[inline(always)]
482 pub fn is_disabled(&self) -> bool {
483 **self == WAKECLKPAD_DISABLE_A::DISABLED
484 }
485 #[doc = "Checks if the value of the field is `ENABLED`"]
486 #[inline(always)]
487 pub fn is_enabled(&self) -> bool {
488 **self == WAKECLKPAD_DISABLE_A::ENABLED
489 }
490}
491impl core::ops::Deref for WAKECLKPAD_DISABLE_R {
492 type Target = crate::FieldReader<bool, WAKECLKPAD_DISABLE_A>;
493 #[inline(always)]
494 fn deref(&self) -> &Self::Target {
495 &self.0
496 }
497}
498#[doc = "Field `WAKECLKPAD_DISABLE` writer - Disable the external clock input for the self wake-up timer. Setting this bit enables the self wake-up timer clock pin WKTCLKLIN. To minimize power consumption, especially in deep power-down mode, disable this clock input when not using the external clock option for the self wake-up timer."]
499pub struct WAKECLKPAD_DISABLE_W<'a> {
500 w: &'a mut W,
501}
502impl<'a> WAKECLKPAD_DISABLE_W<'a> {
503 #[doc = r"Writes `variant` to the field"]
504 #[inline(always)]
505 pub fn variant(self, variant: WAKECLKPAD_DISABLE_A) -> &'a mut W {
506 self.bit(variant.into())
507 }
508 #[doc = "Disabled. Setting this bit disables external clock input on pin PIO0_28."]
509 #[inline(always)]
510 pub fn disabled(self) -> &'a mut W {
511 self.variant(WAKECLKPAD_DISABLE_A::DISABLED)
512 }
513 #[doc = "Enabled. The external clock input for the self wake-up timer is enabled on pin PIO0_28."]
514 #[inline(always)]
515 pub fn enabled(self) -> &'a mut W {
516 self.variant(WAKECLKPAD_DISABLE_A::ENABLED)
517 }
518 #[doc = r"Sets the field bit"]
519 #[inline(always)]
520 pub fn set_bit(self) -> &'a mut W {
521 self.bit(true)
522 }
523 #[doc = r"Clears the field bit"]
524 #[inline(always)]
525 pub fn clear_bit(self) -> &'a mut W {
526 self.bit(false)
527 }
528 #[doc = r"Writes raw bits to the field"]
529 #[inline(always)]
530 pub fn bit(self, value: bool) -> &'a mut W {
531 self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
532 self.w
533 }
534}
535#[doc = "Field `GPDATA` reader - Data retained during Deep power-down mode."]
536pub struct GPDATA_R(crate::FieldReader<u32, u32>);
537impl GPDATA_R {
538 pub(crate) fn new(bits: u32) -> Self {
539 GPDATA_R(crate::FieldReader::new(bits))
540 }
541}
542impl core::ops::Deref for GPDATA_R {
543 type Target = crate::FieldReader<u32, u32>;
544 #[inline(always)]
545 fn deref(&self) -> &Self::Target {
546 &self.0
547 }
548}
549#[doc = "Field `GPDATA` writer - Data retained during Deep power-down mode."]
550pub struct GPDATA_W<'a> {
551 w: &'a mut W,
552}
553impl<'a> GPDATA_W<'a> {
554 #[doc = r"Writes raw bits to the field"]
555 #[inline(always)]
556 pub unsafe fn bits(self, value: u32) -> &'a mut W {
557 self.w.bits = (self.w.bits & !(0x03ff_ffff << 6)) | ((value as u32 & 0x03ff_ffff) << 6);
558 self.w
559 }
560}
561impl R {
562 #[doc = "Bit 0 - WAKEUP pin hysteresis enable"]
563 #[inline(always)]
564 pub fn wakeuphys(&self) -> WAKEUPHYS_R {
565 WAKEUPHYS_R::new((self.bits & 0x01) != 0)
566 }
567 #[doc = "Bit 1 - WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be used for other purposes. Remark: Never set this bit if you intend to use a pin to wake up the part from Deep power-down mode. You can only disable the wake-up pin if the self wake-up timer is enabled and configured. Remark: Setting this bit is not necessary if Deep power-down mode is not used."]
568 #[inline(always)]
569 pub fn wakepad_disable(&self) -> WAKEPAD_DISABLE_R {
570 WAKEPAD_DISABLE_R::new(((self.bits >> 1) & 0x01) != 0)
571 }
572 #[doc = "Bit 2 - Enable the low-power oscillator for use with the 10 kHz self wake-up timer clock. You must set this bit if the CLKSEL bit in the self wake-up timer CTRL bit is set. Do not enable the low-power oscillator if the self wake-up timer is clocked by the divided IRC or the external clock input."]
573 #[inline(always)]
574 pub fn lposcen(&self) -> LPOSCEN_R {
575 LPOSCEN_R::new(((self.bits >> 2) & 0x01) != 0)
576 }
577 #[doc = "Bit 3 - causes the low-power oscillator to remain running during Deep power-down mode provided that bit 2 in this register is set as well. You must set this bit for the self wake-up timer to be able to wake up the part from Deep power-down mode. Remark: Do not set this bit unless you use the self wake-up timer with the low-power oscillator clock source to wake up from Deep power-down mode."]
578 #[inline(always)]
579 pub fn lposcdpden(&self) -> LPOSCDPDEN_R {
580 LPOSCDPDEN_R::new(((self.bits >> 3) & 0x01) != 0)
581 }
582 #[doc = "Bit 4 - External clock input for the self wake-up timer WKTCLKIN hysteresis enable."]
583 #[inline(always)]
584 pub fn wakeupclkhys(&self) -> WAKEUPCLKHYS_R {
585 WAKEUPCLKHYS_R::new(((self.bits >> 4) & 0x01) != 0)
586 }
587 #[doc = "Bit 5 - Disable the external clock input for the self wake-up timer. Setting this bit enables the self wake-up timer clock pin WKTCLKLIN. To minimize power consumption, especially in deep power-down mode, disable this clock input when not using the external clock option for the self wake-up timer."]
588 #[inline(always)]
589 pub fn wakeclkpad_disable(&self) -> WAKECLKPAD_DISABLE_R {
590 WAKECLKPAD_DISABLE_R::new(((self.bits >> 5) & 0x01) != 0)
591 }
592 #[doc = "Bits 6:31 - Data retained during Deep power-down mode."]
593 #[inline(always)]
594 pub fn gpdata(&self) -> GPDATA_R {
595 GPDATA_R::new(((self.bits >> 6) & 0x03ff_ffff) as u32)
596 }
597}
598impl W {
599 #[doc = "Bit 0 - WAKEUP pin hysteresis enable"]
600 #[inline(always)]
601 pub fn wakeuphys(&mut self) -> WAKEUPHYS_W {
602 WAKEUPHYS_W { w: self }
603 }
604 #[doc = "Bit 1 - WAKEUP pin disable. Setting this bit disables the wake-up pin, so it can be used for other purposes. Remark: Never set this bit if you intend to use a pin to wake up the part from Deep power-down mode. You can only disable the wake-up pin if the self wake-up timer is enabled and configured. Remark: Setting this bit is not necessary if Deep power-down mode is not used."]
605 #[inline(always)]
606 pub fn wakepad_disable(&mut self) -> WAKEPAD_DISABLE_W {
607 WAKEPAD_DISABLE_W { w: self }
608 }
609 #[doc = "Bit 2 - Enable the low-power oscillator for use with the 10 kHz self wake-up timer clock. You must set this bit if the CLKSEL bit in the self wake-up timer CTRL bit is set. Do not enable the low-power oscillator if the self wake-up timer is clocked by the divided IRC or the external clock input."]
610 #[inline(always)]
611 pub fn lposcen(&mut self) -> LPOSCEN_W {
612 LPOSCEN_W { w: self }
613 }
614 #[doc = "Bit 3 - causes the low-power oscillator to remain running during Deep power-down mode provided that bit 2 in this register is set as well. You must set this bit for the self wake-up timer to be able to wake up the part from Deep power-down mode. Remark: Do not set this bit unless you use the self wake-up timer with the low-power oscillator clock source to wake up from Deep power-down mode."]
615 #[inline(always)]
616 pub fn lposcdpden(&mut self) -> LPOSCDPDEN_W {
617 LPOSCDPDEN_W { w: self }
618 }
619 #[doc = "Bit 4 - External clock input for the self wake-up timer WKTCLKIN hysteresis enable."]
620 #[inline(always)]
621 pub fn wakeupclkhys(&mut self) -> WAKEUPCLKHYS_W {
622 WAKEUPCLKHYS_W { w: self }
623 }
624 #[doc = "Bit 5 - Disable the external clock input for the self wake-up timer. Setting this bit enables the self wake-up timer clock pin WKTCLKLIN. To minimize power consumption, especially in deep power-down mode, disable this clock input when not using the external clock option for the self wake-up timer."]
625 #[inline(always)]
626 pub fn wakeclkpad_disable(&mut self) -> WAKECLKPAD_DISABLE_W {
627 WAKECLKPAD_DISABLE_W { w: self }
628 }
629 #[doc = "Bits 6:31 - Data retained during Deep power-down mode."]
630 #[inline(always)]
631 pub fn gpdata(&mut self) -> GPDATA_W {
632 GPDATA_W { w: self }
633 }
634 #[doc = "Writes raw bits to the register."]
635 #[inline(always)]
636 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
637 self.0.bits(bits);
638 self
639 }
640}
641#[doc = "Deep power-down control register. Also includes bits for general purpose storage.\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 [dpdctrl](index.html) module"]
642pub struct DPDCTRL_SPEC;
643impl crate::RegisterSpec for DPDCTRL_SPEC {
644 type Ux = u32;
645}
646#[doc = "`read()` method returns [dpdctrl::R](R) reader structure"]
647impl crate::Readable for DPDCTRL_SPEC {
648 type Reader = R;
649}
650#[doc = "`write(|w| ..)` method takes [dpdctrl::W](W) writer structure"]
651impl crate::Writable for DPDCTRL_SPEC {
652 type Writer = W;
653}
654#[doc = "`reset()` method sets DPDCTRL to value 0"]
655impl crate::Resettable for DPDCTRL_SPEC {
656 #[inline(always)]
657 fn reset_value() -> Self::Ux {
658 0
659 }
660}