atsamd51n/rstc/
rcause.rs

1#[doc = "Register `RCAUSE` reader"]
2pub type R = crate::R<RcauseSpec>;
3#[doc = "Field `POR` reader - Power On Reset"]
4pub type PorR = crate::BitReader;
5#[doc = "Field `BODCORE` reader - Brown Out CORE Detector Reset"]
6pub type BodcoreR = crate::BitReader;
7#[doc = "Field `BODVDD` reader - Brown Out VDD Detector Reset"]
8pub type BodvddR = crate::BitReader;
9#[doc = "Field `NVM` reader - NVM Reset"]
10pub type NvmR = crate::BitReader;
11#[doc = "Field `EXT` reader - External Reset"]
12pub type ExtR = crate::BitReader;
13#[doc = "Field `WDT` reader - Watchdog Reset"]
14pub type WdtR = crate::BitReader;
15#[doc = "Field `SYST` reader - System Reset Request"]
16pub type SystR = crate::BitReader;
17#[doc = "Field `BACKUP` reader - Backup Reset"]
18pub type BackupR = crate::BitReader;
19impl R {
20    #[doc = "Bit 0 - Power On Reset"]
21    #[inline(always)]
22    pub fn por(&self) -> PorR {
23        PorR::new((self.bits & 1) != 0)
24    }
25    #[doc = "Bit 1 - Brown Out CORE Detector Reset"]
26    #[inline(always)]
27    pub fn bodcore(&self) -> BodcoreR {
28        BodcoreR::new(((self.bits >> 1) & 1) != 0)
29    }
30    #[doc = "Bit 2 - Brown Out VDD Detector Reset"]
31    #[inline(always)]
32    pub fn bodvdd(&self) -> BodvddR {
33        BodvddR::new(((self.bits >> 2) & 1) != 0)
34    }
35    #[doc = "Bit 3 - NVM Reset"]
36    #[inline(always)]
37    pub fn nvm(&self) -> NvmR {
38        NvmR::new(((self.bits >> 3) & 1) != 0)
39    }
40    #[doc = "Bit 4 - External Reset"]
41    #[inline(always)]
42    pub fn ext(&self) -> ExtR {
43        ExtR::new(((self.bits >> 4) & 1) != 0)
44    }
45    #[doc = "Bit 5 - Watchdog Reset"]
46    #[inline(always)]
47    pub fn wdt(&self) -> WdtR {
48        WdtR::new(((self.bits >> 5) & 1) != 0)
49    }
50    #[doc = "Bit 6 - System Reset Request"]
51    #[inline(always)]
52    pub fn syst(&self) -> SystR {
53        SystR::new(((self.bits >> 6) & 1) != 0)
54    }
55    #[doc = "Bit 7 - Backup Reset"]
56    #[inline(always)]
57    pub fn backup(&self) -> BackupR {
58        BackupR::new(((self.bits >> 7) & 1) != 0)
59    }
60}
61#[doc = "Reset Cause\n\nYou can [`read`](crate::Reg::read) this register and get [`rcause::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct RcauseSpec;
63impl crate::RegisterSpec for RcauseSpec {
64    type Ux = u8;
65}
66#[doc = "`read()` method returns [`rcause::R`](R) reader structure"]
67impl crate::Readable for RcauseSpec {}
68#[doc = "`reset()` method sets RCAUSE to value 0"]
69impl crate::Resettable for RcauseSpec {
70    const RESET_VALUE: u8 = 0;
71}