stm32f3_staging/stm32f373/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 Ws2 = 2,
18}
19impl From<LATENCY> for u8 {
20 #[inline(always)]
21 fn from(variant: LATENCY) -> Self {
22 variant as _
23 }
24}
25impl crate::FieldSpec for LATENCY {
26 type Ux = u8;
27}
28impl crate::IsEnum for LATENCY {}
29pub type LATENCY_R = crate::FieldReader<LATENCY>;
31impl LATENCY_R {
32 #[inline(always)]
34 pub const fn variant(&self) -> Option<LATENCY> {
35 match self.bits {
36 0 => Some(LATENCY::Ws0),
37 1 => Some(LATENCY::Ws1),
38 2 => Some(LATENCY::Ws2),
39 _ => None,
40 }
41 }
42 #[inline(always)]
44 pub fn is_ws0(&self) -> bool {
45 *self == LATENCY::Ws0
46 }
47 #[inline(always)]
49 pub fn is_ws1(&self) -> bool {
50 *self == LATENCY::Ws1
51 }
52 #[inline(always)]
54 pub fn is_ws2(&self) -> bool {
55 *self == LATENCY::Ws2
56 }
57}
58pub type LATENCY_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LATENCY>;
60impl<'a, REG> LATENCY_W<'a, REG>
61where
62 REG: crate::Writable + crate::RegisterSpec,
63 REG::Ux: From<u8>,
64{
65 #[inline(always)]
67 pub fn ws0(self) -> &'a mut crate::W<REG> {
68 self.variant(LATENCY::Ws0)
69 }
70 #[inline(always)]
72 pub fn ws1(self) -> &'a mut crate::W<REG> {
73 self.variant(LATENCY::Ws1)
74 }
75 #[inline(always)]
77 pub fn ws2(self) -> &'a mut crate::W<REG> {
78 self.variant(LATENCY::Ws2)
79 }
80}
81#[cfg_attr(feature = "defmt", derive(defmt::Format))]
85#[derive(Clone, Copy, Debug, PartialEq, Eq)]
86pub enum PRFTBE {
87 Disabled = 0,
89 Enabled = 1,
91}
92impl From<PRFTBE> for bool {
93 #[inline(always)]
94 fn from(variant: PRFTBE) -> Self {
95 variant as u8 != 0
96 }
97}
98pub type PRFTBE_R = crate::BitReader<PRFTBE>;
100impl PRFTBE_R {
101 #[inline(always)]
103 pub const fn variant(&self) -> PRFTBE {
104 match self.bits {
105 false => PRFTBE::Disabled,
106 true => PRFTBE::Enabled,
107 }
108 }
109 #[inline(always)]
111 pub fn is_disabled(&self) -> bool {
112 *self == PRFTBE::Disabled
113 }
114 #[inline(always)]
116 pub fn is_enabled(&self) -> bool {
117 *self == PRFTBE::Enabled
118 }
119}
120pub type PRFTBE_W<'a, REG> = crate::BitWriter<'a, REG, PRFTBE>;
122impl<'a, REG> PRFTBE_W<'a, REG>
123where
124 REG: crate::Writable + crate::RegisterSpec,
125{
126 #[inline(always)]
128 pub fn disabled(self) -> &'a mut crate::W<REG> {
129 self.variant(PRFTBE::Disabled)
130 }
131 #[inline(always)]
133 pub fn enabled(self) -> &'a mut crate::W<REG> {
134 self.variant(PRFTBE::Enabled)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum PRFTBS {
143 Disabled = 0,
145 Enabled = 1,
147}
148impl From<PRFTBS> for bool {
149 #[inline(always)]
150 fn from(variant: PRFTBS) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type PRFTBS_R = crate::BitReader<PRFTBS>;
156impl PRFTBS_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> PRFTBS {
160 match self.bits {
161 false => PRFTBS::Disabled,
162 true => PRFTBS::Enabled,
163 }
164 }
165 #[inline(always)]
167 pub fn is_disabled(&self) -> bool {
168 *self == PRFTBS::Disabled
169 }
170 #[inline(always)]
172 pub fn is_enabled(&self) -> bool {
173 *self == PRFTBS::Enabled
174 }
175}
176impl R {
177 #[inline(always)]
179 pub fn latency(&self) -> LATENCY_R {
180 LATENCY_R::new((self.bits & 7) as u8)
181 }
182 #[inline(always)]
184 pub fn prftbe(&self) -> PRFTBE_R {
185 PRFTBE_R::new(((self.bits >> 4) & 1) != 0)
186 }
187 #[inline(always)]
189 pub fn prftbs(&self) -> PRFTBS_R {
190 PRFTBS_R::new(((self.bits >> 5) & 1) != 0)
191 }
192}
193impl core::fmt::Debug for R {
194 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
195 f.debug_struct("ACR")
196 .field("latency", &self.latency())
197 .field("prftbe", &self.prftbe())
198 .field("prftbs", &self.prftbs())
199 .finish()
200 }
201}
202impl W {
203 #[inline(always)]
205 pub fn latency(&mut self) -> LATENCY_W<ACRrs> {
206 LATENCY_W::new(self, 0)
207 }
208 #[inline(always)]
210 pub fn prftbe(&mut self) -> PRFTBE_W<ACRrs> {
211 PRFTBE_W::new(self, 4)
212 }
213}
214pub struct ACRrs;
220impl crate::RegisterSpec for ACRrs {
221 type Ux = u32;
222}
223impl crate::Readable for ACRrs {}
225impl crate::Writable for ACRrs {
227 type Safety = crate::Unsafe;
228 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
229 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
230}
231impl crate::Resettable for ACRrs {
233 const RESET_VALUE: u32 = 0x30;
234}