1#[doc = "Register `PDRUNCFG` reader"]
2pub struct R(crate::R<PDRUNCFG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PDRUNCFG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PDRUNCFG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PDRUNCFG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PDRUNCFG` writer"]
17pub struct W(crate::W<PDRUNCFG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PDRUNCFG_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<PDRUNCFG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PDRUNCFG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "IRC oscillator output wake-up configuration\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum IRCOUT_PD_A {
40 #[doc = "0: powered"]
41 POWERED = 0,
42 #[doc = "1: powered down"]
43 POWERED_DOWN = 1,
44}
45impl From<IRCOUT_PD_A> for bool {
46 #[inline(always)]
47 fn from(variant: IRCOUT_PD_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `IRCOUT_PD` reader - IRC oscillator output wake-up configuration"]
52pub struct IRCOUT_PD_R(crate::FieldReader<bool, IRCOUT_PD_A>);
53impl IRCOUT_PD_R {
54 pub(crate) fn new(bits: bool) -> Self {
55 IRCOUT_PD_R(crate::FieldReader::new(bits))
56 }
57 #[doc = r"Get enumerated values variant"]
58 #[inline(always)]
59 pub fn variant(&self) -> IRCOUT_PD_A {
60 match self.bits {
61 false => IRCOUT_PD_A::POWERED,
62 true => IRCOUT_PD_A::POWERED_DOWN,
63 }
64 }
65 #[doc = "Checks if the value of the field is `POWERED`"]
66 #[inline(always)]
67 pub fn is_powered(&self) -> bool {
68 **self == IRCOUT_PD_A::POWERED
69 }
70 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
71 #[inline(always)]
72 pub fn is_powered_down(&self) -> bool {
73 **self == IRCOUT_PD_A::POWERED_DOWN
74 }
75}
76impl core::ops::Deref for IRCOUT_PD_R {
77 type Target = crate::FieldReader<bool, IRCOUT_PD_A>;
78 #[inline(always)]
79 fn deref(&self) -> &Self::Target {
80 &self.0
81 }
82}
83#[doc = "Field `IRCOUT_PD` writer - IRC oscillator output wake-up configuration"]
84pub struct IRCOUT_PD_W<'a> {
85 w: &'a mut W,
86}
87impl<'a> IRCOUT_PD_W<'a> {
88 #[doc = r"Writes `variant` to the field"]
89 #[inline(always)]
90 pub fn variant(self, variant: IRCOUT_PD_A) -> &'a mut W {
91 self.bit(variant.into())
92 }
93 #[doc = "powered"]
94 #[inline(always)]
95 pub fn powered(self) -> &'a mut W {
96 self.variant(IRCOUT_PD_A::POWERED)
97 }
98 #[doc = "powered down"]
99 #[inline(always)]
100 pub fn powered_down(self) -> &'a mut W {
101 self.variant(IRCOUT_PD_A::POWERED_DOWN)
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 = "IRC oscillator power-down wake-up configuration\n\nValue on reset: 0"]
121#[derive(Clone, Copy, Debug, PartialEq)]
122pub enum IRC_PD_A {
123 #[doc = "0: powered"]
124 POWERED = 0,
125 #[doc = "1: powered down"]
126 POWERED_DOWN = 1,
127}
128impl From<IRC_PD_A> for bool {
129 #[inline(always)]
130 fn from(variant: IRC_PD_A) -> Self {
131 variant as u8 != 0
132 }
133}
134#[doc = "Field `IRC_PD` reader - IRC oscillator power-down wake-up configuration"]
135pub struct IRC_PD_R(crate::FieldReader<bool, IRC_PD_A>);
136impl IRC_PD_R {
137 pub(crate) fn new(bits: bool) -> Self {
138 IRC_PD_R(crate::FieldReader::new(bits))
139 }
140 #[doc = r"Get enumerated values variant"]
141 #[inline(always)]
142 pub fn variant(&self) -> IRC_PD_A {
143 match self.bits {
144 false => IRC_PD_A::POWERED,
145 true => IRC_PD_A::POWERED_DOWN,
146 }
147 }
148 #[doc = "Checks if the value of the field is `POWERED`"]
149 #[inline(always)]
150 pub fn is_powered(&self) -> bool {
151 **self == IRC_PD_A::POWERED
152 }
153 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
154 #[inline(always)]
155 pub fn is_powered_down(&self) -> bool {
156 **self == IRC_PD_A::POWERED_DOWN
157 }
158}
159impl core::ops::Deref for IRC_PD_R {
160 type Target = crate::FieldReader<bool, IRC_PD_A>;
161 #[inline(always)]
162 fn deref(&self) -> &Self::Target {
163 &self.0
164 }
165}
166#[doc = "Field `IRC_PD` writer - IRC oscillator power-down wake-up configuration"]
167pub struct IRC_PD_W<'a> {
168 w: &'a mut W,
169}
170impl<'a> IRC_PD_W<'a> {
171 #[doc = r"Writes `variant` to the field"]
172 #[inline(always)]
173 pub fn variant(self, variant: IRC_PD_A) -> &'a mut W {
174 self.bit(variant.into())
175 }
176 #[doc = "powered"]
177 #[inline(always)]
178 pub fn powered(self) -> &'a mut W {
179 self.variant(IRC_PD_A::POWERED)
180 }
181 #[doc = "powered down"]
182 #[inline(always)]
183 pub fn powered_down(self) -> &'a mut W {
184 self.variant(IRC_PD_A::POWERED_DOWN)
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 = "Flash wake-up configuration\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq)]
205pub enum FLASH_PD_A {
206 #[doc = "0: powered"]
207 POWERED = 0,
208 #[doc = "1: powered down"]
209 POWERED_DOWN = 1,
210}
211impl From<FLASH_PD_A> for bool {
212 #[inline(always)]
213 fn from(variant: FLASH_PD_A) -> Self {
214 variant as u8 != 0
215 }
216}
217#[doc = "Field `FLASH_PD` reader - Flash wake-up configuration"]
218pub struct FLASH_PD_R(crate::FieldReader<bool, FLASH_PD_A>);
219impl FLASH_PD_R {
220 pub(crate) fn new(bits: bool) -> Self {
221 FLASH_PD_R(crate::FieldReader::new(bits))
222 }
223 #[doc = r"Get enumerated values variant"]
224 #[inline(always)]
225 pub fn variant(&self) -> FLASH_PD_A {
226 match self.bits {
227 false => FLASH_PD_A::POWERED,
228 true => FLASH_PD_A::POWERED_DOWN,
229 }
230 }
231 #[doc = "Checks if the value of the field is `POWERED`"]
232 #[inline(always)]
233 pub fn is_powered(&self) -> bool {
234 **self == FLASH_PD_A::POWERED
235 }
236 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
237 #[inline(always)]
238 pub fn is_powered_down(&self) -> bool {
239 **self == FLASH_PD_A::POWERED_DOWN
240 }
241}
242impl core::ops::Deref for FLASH_PD_R {
243 type Target = crate::FieldReader<bool, FLASH_PD_A>;
244 #[inline(always)]
245 fn deref(&self) -> &Self::Target {
246 &self.0
247 }
248}
249#[doc = "Field `FLASH_PD` writer - Flash wake-up configuration"]
250pub struct FLASH_PD_W<'a> {
251 w: &'a mut W,
252}
253impl<'a> FLASH_PD_W<'a> {
254 #[doc = r"Writes `variant` to the field"]
255 #[inline(always)]
256 pub fn variant(self, variant: FLASH_PD_A) -> &'a mut W {
257 self.bit(variant.into())
258 }
259 #[doc = "powered"]
260 #[inline(always)]
261 pub fn powered(self) -> &'a mut W {
262 self.variant(FLASH_PD_A::POWERED)
263 }
264 #[doc = "powered down"]
265 #[inline(always)]
266 pub fn powered_down(self) -> &'a mut W {
267 self.variant(FLASH_PD_A::POWERED_DOWN)
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 = "BOD wake-up configuration\n\nValue on reset: 0"]
287#[derive(Clone, Copy, Debug, PartialEq)]
288pub enum BOD_PD_A {
289 #[doc = "0: powered"]
290 POWERED = 0,
291 #[doc = "1: powered down"]
292 POWERED_DOWN = 1,
293}
294impl From<BOD_PD_A> for bool {
295 #[inline(always)]
296 fn from(variant: BOD_PD_A) -> Self {
297 variant as u8 != 0
298 }
299}
300#[doc = "Field `BOD_PD` reader - BOD wake-up configuration"]
301pub struct BOD_PD_R(crate::FieldReader<bool, BOD_PD_A>);
302impl BOD_PD_R {
303 pub(crate) fn new(bits: bool) -> Self {
304 BOD_PD_R(crate::FieldReader::new(bits))
305 }
306 #[doc = r"Get enumerated values variant"]
307 #[inline(always)]
308 pub fn variant(&self) -> BOD_PD_A {
309 match self.bits {
310 false => BOD_PD_A::POWERED,
311 true => BOD_PD_A::POWERED_DOWN,
312 }
313 }
314 #[doc = "Checks if the value of the field is `POWERED`"]
315 #[inline(always)]
316 pub fn is_powered(&self) -> bool {
317 **self == BOD_PD_A::POWERED
318 }
319 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
320 #[inline(always)]
321 pub fn is_powered_down(&self) -> bool {
322 **self == BOD_PD_A::POWERED_DOWN
323 }
324}
325impl core::ops::Deref for BOD_PD_R {
326 type Target = crate::FieldReader<bool, BOD_PD_A>;
327 #[inline(always)]
328 fn deref(&self) -> &Self::Target {
329 &self.0
330 }
331}
332#[doc = "Field `BOD_PD` writer - BOD wake-up configuration"]
333pub struct BOD_PD_W<'a> {
334 w: &'a mut W,
335}
336impl<'a> BOD_PD_W<'a> {
337 #[doc = r"Writes `variant` to the field"]
338 #[inline(always)]
339 pub fn variant(self, variant: BOD_PD_A) -> &'a mut W {
340 self.bit(variant.into())
341 }
342 #[doc = "powered"]
343 #[inline(always)]
344 pub fn powered(self) -> &'a mut W {
345 self.variant(BOD_PD_A::POWERED)
346 }
347 #[doc = "powered down"]
348 #[inline(always)]
349 pub fn powered_down(self) -> &'a mut W {
350 self.variant(BOD_PD_A::POWERED_DOWN)
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 = "ADC wake-up configuration\n\nValue on reset: 1"]
370#[derive(Clone, Copy, Debug, PartialEq)]
371pub enum ADC_PD_A {
372 #[doc = "0: powered"]
373 POWERED = 0,
374 #[doc = "1: powered down"]
375 POWERED_DOWN = 1,
376}
377impl From<ADC_PD_A> for bool {
378 #[inline(always)]
379 fn from(variant: ADC_PD_A) -> Self {
380 variant as u8 != 0
381 }
382}
383#[doc = "Field `ADC_PD` reader - ADC wake-up configuration"]
384pub struct ADC_PD_R(crate::FieldReader<bool, ADC_PD_A>);
385impl ADC_PD_R {
386 pub(crate) fn new(bits: bool) -> Self {
387 ADC_PD_R(crate::FieldReader::new(bits))
388 }
389 #[doc = r"Get enumerated values variant"]
390 #[inline(always)]
391 pub fn variant(&self) -> ADC_PD_A {
392 match self.bits {
393 false => ADC_PD_A::POWERED,
394 true => ADC_PD_A::POWERED_DOWN,
395 }
396 }
397 #[doc = "Checks if the value of the field is `POWERED`"]
398 #[inline(always)]
399 pub fn is_powered(&self) -> bool {
400 **self == ADC_PD_A::POWERED
401 }
402 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
403 #[inline(always)]
404 pub fn is_powered_down(&self) -> bool {
405 **self == ADC_PD_A::POWERED_DOWN
406 }
407}
408impl core::ops::Deref for ADC_PD_R {
409 type Target = crate::FieldReader<bool, ADC_PD_A>;
410 #[inline(always)]
411 fn deref(&self) -> &Self::Target {
412 &self.0
413 }
414}
415#[doc = "Field `ADC_PD` writer - ADC wake-up configuration"]
416pub struct ADC_PD_W<'a> {
417 w: &'a mut W,
418}
419impl<'a> ADC_PD_W<'a> {
420 #[doc = r"Writes `variant` to the field"]
421 #[inline(always)]
422 pub fn variant(self, variant: ADC_PD_A) -> &'a mut W {
423 self.bit(variant.into())
424 }
425 #[doc = "powered"]
426 #[inline(always)]
427 pub fn powered(self) -> &'a mut W {
428 self.variant(ADC_PD_A::POWERED)
429 }
430 #[doc = "powered down"]
431 #[inline(always)]
432 pub fn powered_down(self) -> &'a mut W {
433 self.variant(ADC_PD_A::POWERED_DOWN)
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 = "Crystal oscillator wake-up configuration\n\nValue on reset: 1"]
453#[derive(Clone, Copy, Debug, PartialEq)]
454pub enum SYSOSC_PD_A {
455 #[doc = "0: powered"]
456 POWERED = 0,
457 #[doc = "1: powered down"]
458 POWERED_DOWN = 1,
459}
460impl From<SYSOSC_PD_A> for bool {
461 #[inline(always)]
462 fn from(variant: SYSOSC_PD_A) -> Self {
463 variant as u8 != 0
464 }
465}
466#[doc = "Field `SYSOSC_PD` reader - Crystal oscillator wake-up configuration"]
467pub struct SYSOSC_PD_R(crate::FieldReader<bool, SYSOSC_PD_A>);
468impl SYSOSC_PD_R {
469 pub(crate) fn new(bits: bool) -> Self {
470 SYSOSC_PD_R(crate::FieldReader::new(bits))
471 }
472 #[doc = r"Get enumerated values variant"]
473 #[inline(always)]
474 pub fn variant(&self) -> SYSOSC_PD_A {
475 match self.bits {
476 false => SYSOSC_PD_A::POWERED,
477 true => SYSOSC_PD_A::POWERED_DOWN,
478 }
479 }
480 #[doc = "Checks if the value of the field is `POWERED`"]
481 #[inline(always)]
482 pub fn is_powered(&self) -> bool {
483 **self == SYSOSC_PD_A::POWERED
484 }
485 #[doc = "Checks if the value of the field is `POWERED_DOWN`"]
486 #[inline(always)]
487 pub fn is_powered_down(&self) -> bool {
488 **self == SYSOSC_PD_A::POWERED_DOWN
489 }
490}
491impl core::ops::Deref for SYSOSC_PD_R {
492 type Target = crate::FieldReader<bool, SYSOSC_PD_A>;
493 #[inline(always)]
494 fn deref(&self) -> &Self::Target {
495 &self.0
496 }
497}
498#[doc = "Field `SYSOSC_PD` writer - Crystal oscillator wake-up configuration"]
499pub struct SYSOSC_PD_W<'a> {
500 w: &'a mut W,
501}
502impl<'a> SYSOSC_PD_W<'a> {
503 #[doc = r"Writes `variant` to the field"]
504 #[inline(always)]
505 pub fn variant(self, variant: SYSOSC_PD_A) -> &'a mut W {
506 self.bit(variant.into())
507 }
508 #[doc = "powered"]
509 #[inline(always)]
510 pub fn powered(self) -> &'a mut W {
511 self.variant(SYSOSC_PD_A::POWERED)
512 }
513 #[doc = "powered down"]
514 #[inline(always)]
515 pub fn powered_down(self) -> &'a mut W {
516 self.variant(SYSOSC_PD_A::POWERED_DOWN)
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 = "Watchdog oscillator wake-up configuration. Changing this bit to powered-down has no effect when the LOCK bit in the WWDT MOD register is set. In this case, the watchdog oscillator is always running\n\nValue on reset: 1"]
536#[derive(Clone, Copy, Debug, PartialEq)]
537pub enum WDTOSC_PD_A {
538 #[doc = "0: Disabled"]
539 DISABLED = 0,
540 #[doc = "1: Enabled"]
541 ENABLED = 1,
542}
543impl From<WDTOSC_PD_A> for bool {
544 #[inline(always)]
545 fn from(variant: WDTOSC_PD_A) -> Self {
546 variant as u8 != 0
547 }
548}
549#[doc = "Field `WDTOSC_PD` reader - Watchdog oscillator wake-up configuration. Changing this bit to powered-down has no effect when the LOCK bit in the WWDT MOD register is set. In this case, the watchdog oscillator is always running"]
550pub struct WDTOSC_PD_R(crate::FieldReader<bool, WDTOSC_PD_A>);
551impl WDTOSC_PD_R {
552 pub(crate) fn new(bits: bool) -> Self {
553 WDTOSC_PD_R(crate::FieldReader::new(bits))
554 }
555 #[doc = r"Get enumerated values variant"]
556 #[inline(always)]
557 pub fn variant(&self) -> WDTOSC_PD_A {
558 match self.bits {
559 false => WDTOSC_PD_A::DISABLED,
560 true => WDTOSC_PD_A::ENABLED,
561 }
562 }
563 #[doc = "Checks if the value of the field is `DISABLED`"]
564 #[inline(always)]
565 pub fn is_disabled(&self) -> bool {
566 **self == WDTOSC_PD_A::DISABLED
567 }
568 #[doc = "Checks if the value of the field is `ENABLED`"]
569 #[inline(always)]
570 pub fn is_enabled(&self) -> bool {
571 **self == WDTOSC_PD_A::ENABLED
572 }
573}
574impl core::ops::Deref for WDTOSC_PD_R {
575 type Target = crate::FieldReader<bool, WDTOSC_PD_A>;
576 #[inline(always)]
577 fn deref(&self) -> &Self::Target {
578 &self.0
579 }
580}
581#[doc = "Field `WDTOSC_PD` writer - Watchdog oscillator wake-up configuration. Changing this bit to powered-down has no effect when the LOCK bit in the WWDT MOD register is set. In this case, the watchdog oscillator is always running"]
582pub struct WDTOSC_PD_W<'a> {
583 w: &'a mut W,
584}
585impl<'a> WDTOSC_PD_W<'a> {
586 #[doc = r"Writes `variant` to the field"]
587 #[inline(always)]
588 pub fn variant(self, variant: WDTOSC_PD_A) -> &'a mut W {
589 self.bit(variant.into())
590 }
591 #[doc = "Disabled"]
592 #[inline(always)]
593 pub fn disabled(self) -> &'a mut W {
594 self.variant(WDTOSC_PD_A::DISABLED)
595 }
596 #[doc = "Enabled"]
597 #[inline(always)]
598 pub fn enabled(self) -> &'a mut W {
599 self.variant(WDTOSC_PD_A::ENABLED)
600 }
601 #[doc = r"Sets the field bit"]
602 #[inline(always)]
603 pub fn set_bit(self) -> &'a mut W {
604 self.bit(true)
605 }
606 #[doc = r"Clears the field bit"]
607 #[inline(always)]
608 pub fn clear_bit(self) -> &'a mut W {
609 self.bit(false)
610 }
611 #[doc = r"Writes raw bits to the field"]
612 #[inline(always)]
613 pub fn bit(self, value: bool) -> &'a mut W {
614 self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
615 self.w
616 }
617}
618#[doc = "System PLL wake-up configuration\n\nValue on reset: 1"]
619#[derive(Clone, Copy, Debug, PartialEq)]
620pub enum SYSPLL_PD_A {
621 #[doc = "0: Disabled"]
622 DISABLED = 0,
623 #[doc = "1: Enabled"]
624 ENABLED = 1,
625}
626impl From<SYSPLL_PD_A> for bool {
627 #[inline(always)]
628 fn from(variant: SYSPLL_PD_A) -> Self {
629 variant as u8 != 0
630 }
631}
632#[doc = "Field `SYSPLL_PD` reader - System PLL wake-up configuration"]
633pub struct SYSPLL_PD_R(crate::FieldReader<bool, SYSPLL_PD_A>);
634impl SYSPLL_PD_R {
635 pub(crate) fn new(bits: bool) -> Self {
636 SYSPLL_PD_R(crate::FieldReader::new(bits))
637 }
638 #[doc = r"Get enumerated values variant"]
639 #[inline(always)]
640 pub fn variant(&self) -> SYSPLL_PD_A {
641 match self.bits {
642 false => SYSPLL_PD_A::DISABLED,
643 true => SYSPLL_PD_A::ENABLED,
644 }
645 }
646 #[doc = "Checks if the value of the field is `DISABLED`"]
647 #[inline(always)]
648 pub fn is_disabled(&self) -> bool {
649 **self == SYSPLL_PD_A::DISABLED
650 }
651 #[doc = "Checks if the value of the field is `ENABLED`"]
652 #[inline(always)]
653 pub fn is_enabled(&self) -> bool {
654 **self == SYSPLL_PD_A::ENABLED
655 }
656}
657impl core::ops::Deref for SYSPLL_PD_R {
658 type Target = crate::FieldReader<bool, SYSPLL_PD_A>;
659 #[inline(always)]
660 fn deref(&self) -> &Self::Target {
661 &self.0
662 }
663}
664#[doc = "Field `SYSPLL_PD` writer - System PLL wake-up configuration"]
665pub struct SYSPLL_PD_W<'a> {
666 w: &'a mut W,
667}
668impl<'a> SYSPLL_PD_W<'a> {
669 #[doc = r"Writes `variant` to the field"]
670 #[inline(always)]
671 pub fn variant(self, variant: SYSPLL_PD_A) -> &'a mut W {
672 self.bit(variant.into())
673 }
674 #[doc = "Disabled"]
675 #[inline(always)]
676 pub fn disabled(self) -> &'a mut W {
677 self.variant(SYSPLL_PD_A::DISABLED)
678 }
679 #[doc = "Enabled"]
680 #[inline(always)]
681 pub fn enabled(self) -> &'a mut W {
682 self.variant(SYSPLL_PD_A::ENABLED)
683 }
684 #[doc = r"Sets the field bit"]
685 #[inline(always)]
686 pub fn set_bit(self) -> &'a mut W {
687 self.bit(true)
688 }
689 #[doc = r"Clears the field bit"]
690 #[inline(always)]
691 pub fn clear_bit(self) -> &'a mut W {
692 self.bit(false)
693 }
694 #[doc = r"Writes raw bits to the field"]
695 #[inline(always)]
696 pub fn bit(self, value: bool) -> &'a mut W {
697 self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
698 self.w
699 }
700}
701#[doc = "Analog comparator wake-up configuration\n\nValue on reset: 1"]
702#[derive(Clone, Copy, Debug, PartialEq)]
703pub enum ACMP_A {
704 #[doc = "0: Disabled"]
705 DISABLED = 0,
706 #[doc = "1: Enabled"]
707 ENABLED = 1,
708}
709impl From<ACMP_A> for bool {
710 #[inline(always)]
711 fn from(variant: ACMP_A) -> Self {
712 variant as u8 != 0
713 }
714}
715#[doc = "Field `ACMP` reader - Analog comparator wake-up configuration"]
716pub struct ACMP_R(crate::FieldReader<bool, ACMP_A>);
717impl ACMP_R {
718 pub(crate) fn new(bits: bool) -> Self {
719 ACMP_R(crate::FieldReader::new(bits))
720 }
721 #[doc = r"Get enumerated values variant"]
722 #[inline(always)]
723 pub fn variant(&self) -> ACMP_A {
724 match self.bits {
725 false => ACMP_A::DISABLED,
726 true => ACMP_A::ENABLED,
727 }
728 }
729 #[doc = "Checks if the value of the field is `DISABLED`"]
730 #[inline(always)]
731 pub fn is_disabled(&self) -> bool {
732 **self == ACMP_A::DISABLED
733 }
734 #[doc = "Checks if the value of the field is `ENABLED`"]
735 #[inline(always)]
736 pub fn is_enabled(&self) -> bool {
737 **self == ACMP_A::ENABLED
738 }
739}
740impl core::ops::Deref for ACMP_R {
741 type Target = crate::FieldReader<bool, ACMP_A>;
742 #[inline(always)]
743 fn deref(&self) -> &Self::Target {
744 &self.0
745 }
746}
747#[doc = "Field `ACMP` writer - Analog comparator wake-up configuration"]
748pub struct ACMP_W<'a> {
749 w: &'a mut W,
750}
751impl<'a> ACMP_W<'a> {
752 #[doc = r"Writes `variant` to the field"]
753 #[inline(always)]
754 pub fn variant(self, variant: ACMP_A) -> &'a mut W {
755 self.bit(variant.into())
756 }
757 #[doc = "Disabled"]
758 #[inline(always)]
759 pub fn disabled(self) -> &'a mut W {
760 self.variant(ACMP_A::DISABLED)
761 }
762 #[doc = "Enabled"]
763 #[inline(always)]
764 pub fn enabled(self) -> &'a mut W {
765 self.variant(ACMP_A::ENABLED)
766 }
767 #[doc = r"Sets the field bit"]
768 #[inline(always)]
769 pub fn set_bit(self) -> &'a mut W {
770 self.bit(true)
771 }
772 #[doc = r"Clears the field bit"]
773 #[inline(always)]
774 pub fn clear_bit(self) -> &'a mut W {
775 self.bit(false)
776 }
777 #[doc = r"Writes raw bits to the field"]
778 #[inline(always)]
779 pub fn bit(self, value: bool) -> &'a mut W {
780 self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15);
781 self.w
782 }
783}
784impl R {
785 #[doc = "Bit 0 - IRC oscillator output wake-up configuration"]
786 #[inline(always)]
787 pub fn ircout_pd(&self) -> IRCOUT_PD_R {
788 IRCOUT_PD_R::new((self.bits & 0x01) != 0)
789 }
790 #[doc = "Bit 1 - IRC oscillator power-down wake-up configuration"]
791 #[inline(always)]
792 pub fn irc_pd(&self) -> IRC_PD_R {
793 IRC_PD_R::new(((self.bits >> 1) & 0x01) != 0)
794 }
795 #[doc = "Bit 2 - Flash wake-up configuration"]
796 #[inline(always)]
797 pub fn flash_pd(&self) -> FLASH_PD_R {
798 FLASH_PD_R::new(((self.bits >> 2) & 0x01) != 0)
799 }
800 #[doc = "Bit 3 - BOD wake-up configuration"]
801 #[inline(always)]
802 pub fn bod_pd(&self) -> BOD_PD_R {
803 BOD_PD_R::new(((self.bits >> 3) & 0x01) != 0)
804 }
805 #[doc = "Bit 4 - ADC wake-up configuration"]
806 #[inline(always)]
807 pub fn adc_pd(&self) -> ADC_PD_R {
808 ADC_PD_R::new(((self.bits >> 4) & 0x01) != 0)
809 }
810 #[doc = "Bit 5 - Crystal oscillator wake-up configuration"]
811 #[inline(always)]
812 pub fn sysosc_pd(&self) -> SYSOSC_PD_R {
813 SYSOSC_PD_R::new(((self.bits >> 5) & 0x01) != 0)
814 }
815 #[doc = "Bit 6 - Watchdog oscillator wake-up configuration. Changing this bit to powered-down has no effect when the LOCK bit in the WWDT MOD register is set. In this case, the watchdog oscillator is always running"]
816 #[inline(always)]
817 pub fn wdtosc_pd(&self) -> WDTOSC_PD_R {
818 WDTOSC_PD_R::new(((self.bits >> 6) & 0x01) != 0)
819 }
820 #[doc = "Bit 7 - System PLL wake-up configuration"]
821 #[inline(always)]
822 pub fn syspll_pd(&self) -> SYSPLL_PD_R {
823 SYSPLL_PD_R::new(((self.bits >> 7) & 0x01) != 0)
824 }
825 #[doc = "Bit 15 - Analog comparator wake-up configuration"]
826 #[inline(always)]
827 pub fn acmp(&self) -> ACMP_R {
828 ACMP_R::new(((self.bits >> 15) & 0x01) != 0)
829 }
830}
831impl W {
832 #[doc = "Bit 0 - IRC oscillator output wake-up configuration"]
833 #[inline(always)]
834 pub fn ircout_pd(&mut self) -> IRCOUT_PD_W {
835 IRCOUT_PD_W { w: self }
836 }
837 #[doc = "Bit 1 - IRC oscillator power-down wake-up configuration"]
838 #[inline(always)]
839 pub fn irc_pd(&mut self) -> IRC_PD_W {
840 IRC_PD_W { w: self }
841 }
842 #[doc = "Bit 2 - Flash wake-up configuration"]
843 #[inline(always)]
844 pub fn flash_pd(&mut self) -> FLASH_PD_W {
845 FLASH_PD_W { w: self }
846 }
847 #[doc = "Bit 3 - BOD wake-up configuration"]
848 #[inline(always)]
849 pub fn bod_pd(&mut self) -> BOD_PD_W {
850 BOD_PD_W { w: self }
851 }
852 #[doc = "Bit 4 - ADC wake-up configuration"]
853 #[inline(always)]
854 pub fn adc_pd(&mut self) -> ADC_PD_W {
855 ADC_PD_W { w: self }
856 }
857 #[doc = "Bit 5 - Crystal oscillator wake-up configuration"]
858 #[inline(always)]
859 pub fn sysosc_pd(&mut self) -> SYSOSC_PD_W {
860 SYSOSC_PD_W { w: self }
861 }
862 #[doc = "Bit 6 - Watchdog oscillator wake-up configuration. Changing this bit to powered-down has no effect when the LOCK bit in the WWDT MOD register is set. In this case, the watchdog oscillator is always running"]
863 #[inline(always)]
864 pub fn wdtosc_pd(&mut self) -> WDTOSC_PD_W {
865 WDTOSC_PD_W { w: self }
866 }
867 #[doc = "Bit 7 - System PLL wake-up configuration"]
868 #[inline(always)]
869 pub fn syspll_pd(&mut self) -> SYSPLL_PD_W {
870 SYSPLL_PD_W { w: self }
871 }
872 #[doc = "Bit 15 - Analog comparator wake-up configuration"]
873 #[inline(always)]
874 pub fn acmp(&mut self) -> ACMP_W {
875 ACMP_W { w: self }
876 }
877 #[doc = "Writes raw bits to the register."]
878 #[inline(always)]
879 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
880 self.0.bits(bits);
881 self
882 }
883}
884#[doc = "Power configuration register\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 [pdruncfg](index.html) module"]
885pub struct PDRUNCFG_SPEC;
886impl crate::RegisterSpec for PDRUNCFG_SPEC {
887 type Ux = u32;
888}
889#[doc = "`read()` method returns [pdruncfg::R](R) reader structure"]
890impl crate::Readable for PDRUNCFG_SPEC {
891 type Reader = R;
892}
893#[doc = "`write(|w| ..)` method takes [pdruncfg::W](W) writer structure"]
894impl crate::Writable for PDRUNCFG_SPEC {
895 type Writer = W;
896}
897#[doc = "`reset()` method sets PDRUNCFG to value 0xedf0"]
898impl crate::Resettable for PDRUNCFG_SPEC {
899 #[inline(always)]
900 fn reset_value() -> Self::Ux {
901 0xedf0
902 }
903}