stm32f7/stm32f779/rcc/
ahb2lpenr.rs1pub type R = crate::R<AHB2LPENRrs>;
3pub type W = crate::W<AHB2LPENRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum DCMILPEN {
11 DisabledInSleep = 0,
13 EnabledInSleep = 1,
15}
16impl From<DCMILPEN> for bool {
17 #[inline(always)]
18 fn from(variant: DCMILPEN) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type DCMILPEN_R = crate::BitReader<DCMILPEN>;
24impl DCMILPEN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> DCMILPEN {
28 match self.bits {
29 false => DCMILPEN::DisabledInSleep,
30 true => DCMILPEN::EnabledInSleep,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled_in_sleep(&self) -> bool {
36 *self == DCMILPEN::DisabledInSleep
37 }
38 #[inline(always)]
40 pub fn is_enabled_in_sleep(&self) -> bool {
41 *self == DCMILPEN::EnabledInSleep
42 }
43}
44pub type DCMILPEN_W<'a, REG> = crate::BitWriter<'a, REG, DCMILPEN>;
46impl<'a, REG> DCMILPEN_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled_in_sleep(self) -> &'a mut crate::W<REG> {
53 self.variant(DCMILPEN::DisabledInSleep)
54 }
55 #[inline(always)]
57 pub fn enabled_in_sleep(self) -> &'a mut crate::W<REG> {
58 self.variant(DCMILPEN::EnabledInSleep)
59 }
60}
61pub use DCMILPEN_R as JPEGLPEN_R;
63pub use DCMILPEN_R as CRYPLPEN_R;
65pub use DCMILPEN_R as HASHLPEN_R;
67pub use DCMILPEN_R as RNGLPEN_R;
69pub use DCMILPEN_R as OTGFSLPEN_R;
71pub use DCMILPEN_W as JPEGLPEN_W;
73pub use DCMILPEN_W as CRYPLPEN_W;
75pub use DCMILPEN_W as HASHLPEN_W;
77pub use DCMILPEN_W as RNGLPEN_W;
79pub use DCMILPEN_W as OTGFSLPEN_W;
81impl R {
82 #[inline(always)]
84 pub fn dcmilpen(&self) -> DCMILPEN_R {
85 DCMILPEN_R::new((self.bits & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn jpeglpen(&self) -> JPEGLPEN_R {
90 JPEGLPEN_R::new(((self.bits >> 1) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn cryplpen(&self) -> CRYPLPEN_R {
95 CRYPLPEN_R::new(((self.bits >> 4) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn hashlpen(&self) -> HASHLPEN_R {
100 HASHLPEN_R::new(((self.bits >> 5) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn rnglpen(&self) -> RNGLPEN_R {
105 RNGLPEN_R::new(((self.bits >> 6) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn otgfslpen(&self) -> OTGFSLPEN_R {
110 OTGFSLPEN_R::new(((self.bits >> 7) & 1) != 0)
111 }
112}
113impl core::fmt::Debug for R {
114 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
115 f.debug_struct("AHB2LPENR")
116 .field("dcmilpen", &self.dcmilpen())
117 .field("otgfslpen", &self.otgfslpen())
118 .field("rnglpen", &self.rnglpen())
119 .field("hashlpen", &self.hashlpen())
120 .field("cryplpen", &self.cryplpen())
121 .field("jpeglpen", &self.jpeglpen())
122 .finish()
123 }
124}
125impl W {
126 #[inline(always)]
128 pub fn dcmilpen(&mut self) -> DCMILPEN_W<AHB2LPENRrs> {
129 DCMILPEN_W::new(self, 0)
130 }
131 #[inline(always)]
133 pub fn jpeglpen(&mut self) -> JPEGLPEN_W<AHB2LPENRrs> {
134 JPEGLPEN_W::new(self, 1)
135 }
136 #[inline(always)]
138 pub fn cryplpen(&mut self) -> CRYPLPEN_W<AHB2LPENRrs> {
139 CRYPLPEN_W::new(self, 4)
140 }
141 #[inline(always)]
143 pub fn hashlpen(&mut self) -> HASHLPEN_W<AHB2LPENRrs> {
144 HASHLPEN_W::new(self, 5)
145 }
146 #[inline(always)]
148 pub fn rnglpen(&mut self) -> RNGLPEN_W<AHB2LPENRrs> {
149 RNGLPEN_W::new(self, 6)
150 }
151 #[inline(always)]
153 pub fn otgfslpen(&mut self) -> OTGFSLPEN_W<AHB2LPENRrs> {
154 OTGFSLPEN_W::new(self, 7)
155 }
156}
157pub struct AHB2LPENRrs;
163impl crate::RegisterSpec for AHB2LPENRrs {
164 type Ux = u32;
165}
166impl crate::Readable for AHB2LPENRrs {}
168impl crate::Writable for AHB2LPENRrs {
170 type Safety = crate::Unsafe;
171}
172impl crate::Resettable for AHB2LPENRrs {
174 const RESET_VALUE: u32 = 0xf1;
175}