atsam4lc8a_pac/pm/
rcause.rs

1#[doc = "Register `RCAUSE` reader"]
2pub struct R(crate::R<RCAUSE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RCAUSE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RCAUSE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RCAUSE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `POR` reader - Power-on Reset"]
17pub type POR_R = crate::BitReader<bool>;
18#[doc = "Field `BOD` reader - Brown-out Reset"]
19pub type BOD_R = crate::BitReader<bool>;
20#[doc = "Field `EXT` reader - External Reset Pin"]
21pub type EXT_R = crate::BitReader<bool>;
22#[doc = "Field `WDT` reader - Watchdog Reset"]
23pub type WDT_R = crate::BitReader<bool>;
24#[doc = "Field `OCDRST` reader - OCD Reset"]
25pub type OCDRST_R = crate::BitReader<bool>;
26#[doc = "Field `POR33` reader - Power-on Reset"]
27pub type POR33_R = crate::BitReader<bool>;
28#[doc = "Field `BOD33` reader - Brown-out 3.3V Reset"]
29pub type BOD33_R = crate::BitReader<bool>;
30impl R {
31    #[doc = "Bit 0 - Power-on Reset"]
32    #[inline(always)]
33    pub fn por(&self) -> POR_R {
34        POR_R::new((self.bits & 1) != 0)
35    }
36    #[doc = "Bit 1 - Brown-out Reset"]
37    #[inline(always)]
38    pub fn bod(&self) -> BOD_R {
39        BOD_R::new(((self.bits >> 1) & 1) != 0)
40    }
41    #[doc = "Bit 2 - External Reset Pin"]
42    #[inline(always)]
43    pub fn ext(&self) -> EXT_R {
44        EXT_R::new(((self.bits >> 2) & 1) != 0)
45    }
46    #[doc = "Bit 3 - Watchdog Reset"]
47    #[inline(always)]
48    pub fn wdt(&self) -> WDT_R {
49        WDT_R::new(((self.bits >> 3) & 1) != 0)
50    }
51    #[doc = "Bit 8 - OCD Reset"]
52    #[inline(always)]
53    pub fn ocdrst(&self) -> OCDRST_R {
54        OCDRST_R::new(((self.bits >> 8) & 1) != 0)
55    }
56    #[doc = "Bit 10 - Power-on Reset"]
57    #[inline(always)]
58    pub fn por33(&self) -> POR33_R {
59        POR33_R::new(((self.bits >> 10) & 1) != 0)
60    }
61    #[doc = "Bit 13 - Brown-out 3.3V Reset"]
62    #[inline(always)]
63    pub fn bod33(&self) -> BOD33_R {
64        BOD33_R::new(((self.bits >> 13) & 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 [rcause](index.html) module"]
68pub struct RCAUSE_SPEC;
69impl crate::RegisterSpec for RCAUSE_SPEC {
70    type Ux = u32;
71}
72#[doc = "`read()` method returns [rcause::R](R) reader structure"]
73impl crate::Readable for RCAUSE_SPEC {
74    type Reader = R;
75}
76#[doc = "`reset()` method sets RCAUSE to value 0"]
77impl crate::Resettable for RCAUSE_SPEC {
78    const RESET_VALUE: Self::Ux = 0;
79}