efm32pg1b200_pac/rmu/
rstcause.rs1#[doc = "Register `RSTCAUSE` reader"]
2pub struct R(crate::R<RSTCAUSE_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RSTCAUSE_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RSTCAUSE_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RSTCAUSE_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `PORST` reader - Power on Reset"]
17pub type PORST_R = crate::BitReader<bool>;
18#[doc = "Field `AVDDBOD` reader - Brown Out Detector AVDD Reset"]
19pub type AVDDBOD_R = crate::BitReader<bool>;
20#[doc = "Field `DVDDBOD` reader - Brown Out Detector DVDD Reset"]
21pub type DVDDBOD_R = crate::BitReader<bool>;
22#[doc = "Field `DECBOD` reader - Brown Out Detector Decouple Domain Reset"]
23pub type DECBOD_R = crate::BitReader<bool>;
24#[doc = "Field `EXTRST` reader - External Pin Reset"]
25pub type EXTRST_R = crate::BitReader<bool>;
26#[doc = "Field `LOCKUPRST` reader - LOCKUP Reset"]
27pub type LOCKUPRST_R = crate::BitReader<bool>;
28#[doc = "Field `SYSREQRST` reader - System Request Reset"]
29pub type SYSREQRST_R = crate::BitReader<bool>;
30#[doc = "Field `WDOGRST` reader - Watchdog Reset"]
31pub type WDOGRST_R = crate::BitReader<bool>;
32#[doc = "Field `EM4RST` reader - EM4 Reset"]
33pub type EM4RST_R = crate::BitReader<bool>;
34impl R {
35 #[doc = "Bit 0 - Power on Reset"]
36 #[inline(always)]
37 pub fn porst(&self) -> PORST_R {
38 PORST_R::new((self.bits & 1) != 0)
39 }
40 #[doc = "Bit 2 - Brown Out Detector AVDD Reset"]
41 #[inline(always)]
42 pub fn avddbod(&self) -> AVDDBOD_R {
43 AVDDBOD_R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[doc = "Bit 3 - Brown Out Detector DVDD Reset"]
46 #[inline(always)]
47 pub fn dvddbod(&self) -> DVDDBOD_R {
48 DVDDBOD_R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[doc = "Bit 4 - Brown Out Detector Decouple Domain Reset"]
51 #[inline(always)]
52 pub fn decbod(&self) -> DECBOD_R {
53 DECBOD_R::new(((self.bits >> 4) & 1) != 0)
54 }
55 #[doc = "Bit 8 - External Pin Reset"]
56 #[inline(always)]
57 pub fn extrst(&self) -> EXTRST_R {
58 EXTRST_R::new(((self.bits >> 8) & 1) != 0)
59 }
60 #[doc = "Bit 9 - LOCKUP Reset"]
61 #[inline(always)]
62 pub fn lockuprst(&self) -> LOCKUPRST_R {
63 LOCKUPRST_R::new(((self.bits >> 9) & 1) != 0)
64 }
65 #[doc = "Bit 10 - System Request Reset"]
66 #[inline(always)]
67 pub fn sysreqrst(&self) -> SYSREQRST_R {
68 SYSREQRST_R::new(((self.bits >> 10) & 1) != 0)
69 }
70 #[doc = "Bit 11 - Watchdog Reset"]
71 #[inline(always)]
72 pub fn wdogrst(&self) -> WDOGRST_R {
73 WDOGRST_R::new(((self.bits >> 11) & 1) != 0)
74 }
75 #[doc = "Bit 16 - EM4 Reset"]
76 #[inline(always)]
77 pub fn em4rst(&self) -> EM4RST_R {
78 EM4RST_R::new(((self.bits >> 16) & 1) != 0)
79 }
80}
81#[doc = "Reset Cause Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rstcause](index.html) module"]
82pub struct RSTCAUSE_SPEC;
83impl crate::RegisterSpec for RSTCAUSE_SPEC {
84 type Ux = u32;
85}
86#[doc = "`read()` method returns [rstcause::R](R) reader structure"]
87impl crate::Readable for RSTCAUSE_SPEC {
88 type Reader = R;
89}
90#[doc = "`reset()` method sets RSTCAUSE to value 0"]
91impl crate::Resettable for RSTCAUSE_SPEC {
92 #[inline(always)]
93 fn reset_value() -> Self::Ux {
94 0
95 }
96}