efm32g230_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 `BODUNREGRST` reader - Brown Out Detector Unregulated Domain Reset"]
19pub type BODUNREGRST_R = crate::BitReader<bool>;
20#[doc = "Field `BODREGRST` reader - Brown Out Detector Regulated Domain Reset"]
21pub type BODREGRST_R = crate::BitReader<bool>;
22#[doc = "Field `EXTRST` reader - External Pin Reset"]
23pub type EXTRST_R = crate::BitReader<bool>;
24#[doc = "Field `WDOGRST` reader - Watchdog Reset"]
25pub type WDOGRST_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>;
30impl R {
31    #[doc = "Bit 0 - Power On Reset"]
32    #[inline(always)]
33    pub fn porst(&self) -> PORST_R {
34        PORST_R::new((self.bits & 1) != 0)
35    }
36    #[doc = "Bit 1 - Brown Out Detector Unregulated Domain Reset"]
37    #[inline(always)]
38    pub fn bodunregrst(&self) -> BODUNREGRST_R {
39        BODUNREGRST_R::new(((self.bits >> 1) & 1) != 0)
40    }
41    #[doc = "Bit 2 - Brown Out Detector Regulated Domain Reset"]
42    #[inline(always)]
43    pub fn bodregrst(&self) -> BODREGRST_R {
44        BODREGRST_R::new(((self.bits >> 2) & 1) != 0)
45    }
46    #[doc = "Bit 3 - External Pin Reset"]
47    #[inline(always)]
48    pub fn extrst(&self) -> EXTRST_R {
49        EXTRST_R::new(((self.bits >> 3) & 1) != 0)
50    }
51    #[doc = "Bit 4 - Watchdog Reset"]
52    #[inline(always)]
53    pub fn wdogrst(&self) -> WDOGRST_R {
54        WDOGRST_R::new(((self.bits >> 4) & 1) != 0)
55    }
56    #[doc = "Bit 5 - LOCKUP Reset"]
57    #[inline(always)]
58    pub fn lockuprst(&self) -> LOCKUPRST_R {
59        LOCKUPRST_R::new(((self.bits >> 5) & 1) != 0)
60    }
61    #[doc = "Bit 6 - System Request Reset"]
62    #[inline(always)]
63    pub fn sysreqrst(&self) -> SYSREQRST_R {
64        SYSREQRST_R::new(((self.bits >> 6) & 1) != 0)
65    }
66}
67#[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"]
68pub struct RSTCAUSE_SPEC;
69impl crate::RegisterSpec for RSTCAUSE_SPEC {
70    type Ux = u32;
71}
72#[doc = "`read()` method returns [rstcause::R](R) reader structure"]
73impl crate::Readable for RSTCAUSE_SPEC {
74    type Reader = R;
75}
76#[doc = "`reset()` method sets RSTCAUSE to value 0"]
77impl crate::Resettable for RSTCAUSE_SPEC {
78    #[inline(always)]
79    fn reset_value() -> Self::Ux {
80        0
81    }
82}