stm32f0/stm32f0x8/flash/
acr.rs1pub type R = crate::R<ACRrs>;
3pub type W = crate::W<ACRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum LATENCY {
12 Ws0 = 0,
14 Ws1 = 1,
16}
17impl From<LATENCY> for u8 {
18 #[inline(always)]
19 fn from(variant: LATENCY) -> Self {
20 variant as _
21 }
22}
23impl crate::FieldSpec for LATENCY {
24 type Ux = u8;
25}
26impl crate::IsEnum for LATENCY {}
27pub type LATENCY_R = crate::FieldReader<LATENCY>;
29impl LATENCY_R {
30 #[inline(always)]
32 pub const fn variant(&self) -> Option<LATENCY> {
33 match self.bits {
34 0 => Some(LATENCY::Ws0),
35 1 => Some(LATENCY::Ws1),
36 _ => None,
37 }
38 }
39 #[inline(always)]
41 pub fn is_ws0(&self) -> bool {
42 *self == LATENCY::Ws0
43 }
44 #[inline(always)]
46 pub fn is_ws1(&self) -> bool {
47 *self == LATENCY::Ws1
48 }
49}
50pub type LATENCY_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LATENCY>;
52impl<'a, REG> LATENCY_W<'a, REG>
53where
54 REG: crate::Writable + crate::RegisterSpec,
55 REG::Ux: From<u8>,
56{
57 #[inline(always)]
59 pub fn ws0(self) -> &'a mut crate::W<REG> {
60 self.variant(LATENCY::Ws0)
61 }
62 #[inline(always)]
64 pub fn ws1(self) -> &'a mut crate::W<REG> {
65 self.variant(LATENCY::Ws1)
66 }
67}
68#[cfg_attr(feature = "defmt", derive(defmt::Format))]
72#[derive(Clone, Copy, Debug, PartialEq, Eq)]
73pub enum PRFTBE {
74 Disabled = 0,
76 Enabled = 1,
78}
79impl From<PRFTBE> for bool {
80 #[inline(always)]
81 fn from(variant: PRFTBE) -> Self {
82 variant as u8 != 0
83 }
84}
85pub type PRFTBE_R = crate::BitReader<PRFTBE>;
87impl PRFTBE_R {
88 #[inline(always)]
90 pub const fn variant(&self) -> PRFTBE {
91 match self.bits {
92 false => PRFTBE::Disabled,
93 true => PRFTBE::Enabled,
94 }
95 }
96 #[inline(always)]
98 pub fn is_disabled(&self) -> bool {
99 *self == PRFTBE::Disabled
100 }
101 #[inline(always)]
103 pub fn is_enabled(&self) -> bool {
104 *self == PRFTBE::Enabled
105 }
106}
107pub type PRFTBE_W<'a, REG> = crate::BitWriter<'a, REG, PRFTBE>;
109impl<'a, REG> PRFTBE_W<'a, REG>
110where
111 REG: crate::Writable + crate::RegisterSpec,
112{
113 #[inline(always)]
115 pub fn disabled(self) -> &'a mut crate::W<REG> {
116 self.variant(PRFTBE::Disabled)
117 }
118 #[inline(always)]
120 pub fn enabled(self) -> &'a mut crate::W<REG> {
121 self.variant(PRFTBE::Enabled)
122 }
123}
124#[cfg_attr(feature = "defmt", derive(defmt::Format))]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum PRFTBSR {
130 Disabled = 0,
132 Enabled = 1,
134}
135impl From<PRFTBSR> for bool {
136 #[inline(always)]
137 fn from(variant: PRFTBSR) -> Self {
138 variant as u8 != 0
139 }
140}
141pub type PRFTBS_R = crate::BitReader<PRFTBSR>;
143impl PRFTBS_R {
144 #[inline(always)]
146 pub const fn variant(&self) -> PRFTBSR {
147 match self.bits {
148 false => PRFTBSR::Disabled,
149 true => PRFTBSR::Enabled,
150 }
151 }
152 #[inline(always)]
154 pub fn is_disabled(&self) -> bool {
155 *self == PRFTBSR::Disabled
156 }
157 #[inline(always)]
159 pub fn is_enabled(&self) -> bool {
160 *self == PRFTBSR::Enabled
161 }
162}
163impl R {
164 #[inline(always)]
166 pub fn latency(&self) -> LATENCY_R {
167 LATENCY_R::new((self.bits & 7) as u8)
168 }
169 #[inline(always)]
171 pub fn prftbe(&self) -> PRFTBE_R {
172 PRFTBE_R::new(((self.bits >> 4) & 1) != 0)
173 }
174 #[inline(always)]
176 pub fn prftbs(&self) -> PRFTBS_R {
177 PRFTBS_R::new(((self.bits >> 5) & 1) != 0)
178 }
179}
180impl core::fmt::Debug for R {
181 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
182 f.debug_struct("ACR")
183 .field("latency", &self.latency())
184 .field("prftbe", &self.prftbe())
185 .field("prftbs", &self.prftbs())
186 .finish()
187 }
188}
189impl W {
190 #[inline(always)]
192 pub fn latency(&mut self) -> LATENCY_W<ACRrs> {
193 LATENCY_W::new(self, 0)
194 }
195 #[inline(always)]
197 pub fn prftbe(&mut self) -> PRFTBE_W<ACRrs> {
198 PRFTBE_W::new(self, 4)
199 }
200}
201pub struct ACRrs;
207impl crate::RegisterSpec for ACRrs {
208 type Ux = u32;
209}
210impl crate::Readable for ACRrs {}
212impl crate::Writable for ACRrs {
214 type Safety = crate::Unsafe;
215}
216impl crate::Resettable for ACRrs {
218 const RESET_VALUE: u32 = 0x30;
219}