efm32gg11b510_pac/rmu/
rstcause.rs

1#[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 `BUMODERST` reader - Backup Mode Reset"]
33pub type BUMODERST_R = crate::BitReader<bool>;
34#[doc = "Field `EM4RST` reader - EM4 Reset"]
35pub type EM4RST_R = crate::BitReader<bool>;
36impl R {
37    #[doc = "Bit 0 - Power on Reset"]
38    #[inline(always)]
39    pub fn porst(&self) -> PORST_R {
40        PORST_R::new((self.bits & 1) != 0)
41    }
42    #[doc = "Bit 2 - Brown Out Detector AVDD Reset"]
43    #[inline(always)]
44    pub fn avddbod(&self) -> AVDDBOD_R {
45        AVDDBOD_R::new(((self.bits >> 2) & 1) != 0)
46    }
47    #[doc = "Bit 3 - Brown Out Detector DVDD Reset"]
48    #[inline(always)]
49    pub fn dvddbod(&self) -> DVDDBOD_R {
50        DVDDBOD_R::new(((self.bits >> 3) & 1) != 0)
51    }
52    #[doc = "Bit 4 - Brown Out Detector Decouple Domain Reset"]
53    #[inline(always)]
54    pub fn decbod(&self) -> DECBOD_R {
55        DECBOD_R::new(((self.bits >> 4) & 1) != 0)
56    }
57    #[doc = "Bit 8 - External Pin Reset"]
58    #[inline(always)]
59    pub fn extrst(&self) -> EXTRST_R {
60        EXTRST_R::new(((self.bits >> 8) & 1) != 0)
61    }
62    #[doc = "Bit 9 - LOCKUP Reset"]
63    #[inline(always)]
64    pub fn lockuprst(&self) -> LOCKUPRST_R {
65        LOCKUPRST_R::new(((self.bits >> 9) & 1) != 0)
66    }
67    #[doc = "Bit 10 - System Request Reset"]
68    #[inline(always)]
69    pub fn sysreqrst(&self) -> SYSREQRST_R {
70        SYSREQRST_R::new(((self.bits >> 10) & 1) != 0)
71    }
72    #[doc = "Bit 11 - Watchdog Reset"]
73    #[inline(always)]
74    pub fn wdogrst(&self) -> WDOGRST_R {
75        WDOGRST_R::new(((self.bits >> 11) & 1) != 0)
76    }
77    #[doc = "Bit 12 - Backup Mode Reset"]
78    #[inline(always)]
79    pub fn bumoderst(&self) -> BUMODERST_R {
80        BUMODERST_R::new(((self.bits >> 12) & 1) != 0)
81    }
82    #[doc = "Bit 16 - EM4 Reset"]
83    #[inline(always)]
84    pub fn em4rst(&self) -> EM4RST_R {
85        EM4RST_R::new(((self.bits >> 16) & 1) != 0)
86    }
87}
88#[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"]
89pub struct RSTCAUSE_SPEC;
90impl crate::RegisterSpec for RSTCAUSE_SPEC {
91    type Ux = u32;
92}
93#[doc = "`read()` method returns [rstcause::R](R) reader structure"]
94impl crate::Readable for RSTCAUSE_SPEC {
95    type Reader = R;
96}
97#[doc = "`reset()` method sets RSTCAUSE to value 0"]
98impl crate::Resettable for RSTCAUSE_SPEC {
99    #[inline(always)]
100    fn reset_value() -> Self::Ux {
101        0
102    }
103}