stm32f0/stm32f0x8/pwr/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type LPDS_R = crate::BitReader;
7pub type LPDS_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14pub enum PDDS {
15 StopMode = 0,
17 StandbyMode = 1,
19}
20impl From<PDDS> for bool {
21 #[inline(always)]
22 fn from(variant: PDDS) -> Self {
23 variant as u8 != 0
24 }
25}
26pub type PDDS_R = crate::BitReader<PDDS>;
28impl PDDS_R {
29 #[inline(always)]
31 pub const fn variant(&self) -> PDDS {
32 match self.bits {
33 false => PDDS::StopMode,
34 true => PDDS::StandbyMode,
35 }
36 }
37 #[inline(always)]
39 pub fn is_stop_mode(&self) -> bool {
40 *self == PDDS::StopMode
41 }
42 #[inline(always)]
44 pub fn is_standby_mode(&self) -> bool {
45 *self == PDDS::StandbyMode
46 }
47}
48pub type PDDS_W<'a, REG> = crate::BitWriter<'a, REG, PDDS>;
50impl<'a, REG> PDDS_W<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53{
54 #[inline(always)]
56 pub fn stop_mode(self) -> &'a mut crate::W<REG> {
57 self.variant(PDDS::StopMode)
58 }
59 #[inline(always)]
61 pub fn standby_mode(self) -> &'a mut crate::W<REG> {
62 self.variant(PDDS::StandbyMode)
63 }
64}
65pub type CWUF_R = crate::BitReader;
67pub type CWUF_W<'a, REG> = crate::BitWriter<'a, REG>;
69pub type CSBF_R = crate::BitReader;
71pub type CSBF_W<'a, REG> = crate::BitWriter<'a, REG>;
73pub type PVDE_R = crate::BitReader;
75pub type PVDE_W<'a, REG> = crate::BitWriter<'a, REG>;
77pub type PLS_R = crate::FieldReader;
79pub type PLS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
81pub type DBP_R = crate::BitReader;
83pub type DBP_W<'a, REG> = crate::BitWriter<'a, REG>;
85impl R {
86 #[inline(always)]
88 pub fn lpds(&self) -> LPDS_R {
89 LPDS_R::new((self.bits & 1) != 0)
90 }
91 #[inline(always)]
93 pub fn pdds(&self) -> PDDS_R {
94 PDDS_R::new(((self.bits >> 1) & 1) != 0)
95 }
96 #[inline(always)]
98 pub fn cwuf(&self) -> CWUF_R {
99 CWUF_R::new(((self.bits >> 2) & 1) != 0)
100 }
101 #[inline(always)]
103 pub fn csbf(&self) -> CSBF_R {
104 CSBF_R::new(((self.bits >> 3) & 1) != 0)
105 }
106 #[inline(always)]
108 pub fn pvde(&self) -> PVDE_R {
109 PVDE_R::new(((self.bits >> 4) & 1) != 0)
110 }
111 #[inline(always)]
113 pub fn pls(&self) -> PLS_R {
114 PLS_R::new(((self.bits >> 5) & 7) as u8)
115 }
116 #[inline(always)]
118 pub fn dbp(&self) -> DBP_R {
119 DBP_R::new(((self.bits >> 8) & 1) != 0)
120 }
121}
122impl core::fmt::Debug for R {
123 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
124 f.debug_struct("CR")
125 .field("dbp", &self.dbp())
126 .field("pls", &self.pls())
127 .field("pvde", &self.pvde())
128 .field("csbf", &self.csbf())
129 .field("cwuf", &self.cwuf())
130 .field("pdds", &self.pdds())
131 .field("lpds", &self.lpds())
132 .finish()
133 }
134}
135impl W {
136 #[inline(always)]
138 pub fn lpds(&mut self) -> LPDS_W<CRrs> {
139 LPDS_W::new(self, 0)
140 }
141 #[inline(always)]
143 pub fn pdds(&mut self) -> PDDS_W<CRrs> {
144 PDDS_W::new(self, 1)
145 }
146 #[inline(always)]
148 pub fn cwuf(&mut self) -> CWUF_W<CRrs> {
149 CWUF_W::new(self, 2)
150 }
151 #[inline(always)]
153 pub fn csbf(&mut self) -> CSBF_W<CRrs> {
154 CSBF_W::new(self, 3)
155 }
156 #[inline(always)]
158 pub fn pvde(&mut self) -> PVDE_W<CRrs> {
159 PVDE_W::new(self, 4)
160 }
161 #[inline(always)]
163 pub fn pls(&mut self) -> PLS_W<CRrs> {
164 PLS_W::new(self, 5)
165 }
166 #[inline(always)]
168 pub fn dbp(&mut self) -> DBP_W<CRrs> {
169 DBP_W::new(self, 8)
170 }
171}
172pub struct CRrs;
178impl crate::RegisterSpec for CRrs {
179 type Ux = u32;
180}
181impl crate::Readable for CRrs {}
183impl crate::Writable for CRrs {
185 type Safety = crate::Unsafe;
186}
187impl crate::Resettable for CRrs {}