1#[doc = "Register `CSR` reader"]
2pub type R = crate::R<CsrSpec>;
3#[doc = "Register `CSR` writer"]
4pub type W = crate::W<CsrSpec>;
5#[doc = "Field `LSION` reader - LSI oscillator enable"]
6pub type LsionR = crate::BitReader;
7#[doc = "Field `LSION` writer - LSI oscillator enable"]
8pub type LsionW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `LSIRDY` reader - LSI oscillator ready"]
10pub type LsirdyR = crate::BitReader;
11#[doc = "Field `MSISRANGE` reader - SI range after Standby mode"]
12pub type MsisrangeR = crate::FieldReader;
13#[doc = "Field `MSISRANGE` writer - SI range after Standby mode"]
14pub type MsisrangeW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
15#[doc = "Field `RMVF` reader - Remove reset flag"]
16pub type RmvfR = crate::BitReader;
17#[doc = "Field `RMVF` writer - Remove reset flag"]
18pub type RmvfW<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `FIREWALLRSTF` reader - Firewall reset flag"]
20pub type FirewallrstfR = crate::BitReader;
21#[doc = "Field `OBLRSTF` reader - Option byte loader reset flag"]
22pub type OblrstfR = crate::BitReader;
23#[doc = "Field `PINRSTF` reader - Pin reset flag"]
24pub type PinrstfR = crate::BitReader;
25#[doc = "Field `BORRSTF` reader - BOR flag"]
26pub type BorrstfR = crate::BitReader;
27#[doc = "Field `SFTRSTF` reader - Software reset flag"]
28pub type SftrstfR = crate::BitReader;
29#[doc = "Field `IWDGRSTF` reader - Independent window watchdog reset flag"]
30pub type IwdgrstfR = crate::BitReader;
31#[doc = "Field `WWDGRSTF` reader - Window watchdog reset flag"]
32pub type WwdgrstfR = crate::BitReader;
33#[doc = "Field `LPWRSTF` reader - Low-power reset flag"]
34pub type LpwrstfR = crate::BitReader;
35impl R {
36 #[doc = "Bit 0 - LSI oscillator enable"]
37 #[inline(always)]
38 pub fn lsion(&self) -> LsionR {
39 LsionR::new((self.bits & 1) != 0)
40 }
41 #[doc = "Bit 1 - LSI oscillator ready"]
42 #[inline(always)]
43 pub fn lsirdy(&self) -> LsirdyR {
44 LsirdyR::new(((self.bits >> 1) & 1) != 0)
45 }
46 #[doc = "Bits 8:11 - SI range after Standby mode"]
47 #[inline(always)]
48 pub fn msisrange(&self) -> MsisrangeR {
49 MsisrangeR::new(((self.bits >> 8) & 0x0f) as u8)
50 }
51 #[doc = "Bit 23 - Remove reset flag"]
52 #[inline(always)]
53 pub fn rmvf(&self) -> RmvfR {
54 RmvfR::new(((self.bits >> 23) & 1) != 0)
55 }
56 #[doc = "Bit 24 - Firewall reset flag"]
57 #[inline(always)]
58 pub fn firewallrstf(&self) -> FirewallrstfR {
59 FirewallrstfR::new(((self.bits >> 24) & 1) != 0)
60 }
61 #[doc = "Bit 25 - Option byte loader reset flag"]
62 #[inline(always)]
63 pub fn oblrstf(&self) -> OblrstfR {
64 OblrstfR::new(((self.bits >> 25) & 1) != 0)
65 }
66 #[doc = "Bit 26 - Pin reset flag"]
67 #[inline(always)]
68 pub fn pinrstf(&self) -> PinrstfR {
69 PinrstfR::new(((self.bits >> 26) & 1) != 0)
70 }
71 #[doc = "Bit 27 - BOR flag"]
72 #[inline(always)]
73 pub fn borrstf(&self) -> BorrstfR {
74 BorrstfR::new(((self.bits >> 27) & 1) != 0)
75 }
76 #[doc = "Bit 28 - Software reset flag"]
77 #[inline(always)]
78 pub fn sftrstf(&self) -> SftrstfR {
79 SftrstfR::new(((self.bits >> 28) & 1) != 0)
80 }
81 #[doc = "Bit 29 - Independent window watchdog reset flag"]
82 #[inline(always)]
83 pub fn iwdgrstf(&self) -> IwdgrstfR {
84 IwdgrstfR::new(((self.bits >> 29) & 1) != 0)
85 }
86 #[doc = "Bit 30 - Window watchdog reset flag"]
87 #[inline(always)]
88 pub fn wwdgrstf(&self) -> WwdgrstfR {
89 WwdgrstfR::new(((self.bits >> 30) & 1) != 0)
90 }
91 #[doc = "Bit 31 - Low-power reset flag"]
92 #[inline(always)]
93 pub fn lpwrstf(&self) -> LpwrstfR {
94 LpwrstfR::new(((self.bits >> 31) & 1) != 0)
95 }
96}
97impl W {
98 #[doc = "Bit 0 - LSI oscillator enable"]
99 #[inline(always)]
100 pub fn lsion(&mut self) -> LsionW<CsrSpec> {
101 LsionW::new(self, 0)
102 }
103 #[doc = "Bits 8:11 - SI range after Standby mode"]
104 #[inline(always)]
105 pub fn msisrange(&mut self) -> MsisrangeW<CsrSpec> {
106 MsisrangeW::new(self, 8)
107 }
108 #[doc = "Bit 23 - Remove reset flag"]
109 #[inline(always)]
110 pub fn rmvf(&mut self) -> RmvfW<CsrSpec> {
111 RmvfW::new(self, 23)
112 }
113}
114#[doc = "CSR\n\nYou can [`read`](crate::Reg::read) this register and get [`csr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
115pub struct CsrSpec;
116impl crate::RegisterSpec for CsrSpec {
117 type Ux = u32;
118}
119#[doc = "`read()` method returns [`csr::R`](R) reader structure"]
120impl crate::Readable for CsrSpec {}
121#[doc = "`write(|w| ..)` method takes [`csr::W`](W) writer structure"]
122impl crate::Writable for CsrSpec {
123 type Safety = crate::Unsafe;
124}
125#[doc = "`reset()` method sets CSR to value 0x0c00_0600"]
126impl crate::Resettable for CsrSpec {
127 const RESET_VALUE: u32 = 0x0c00_0600;
128}