stm32f7/stm32f7x9/flash/
acr.rs

1#[doc = "Register `ACR` reader"]
2pub struct R(crate::R<ACR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ACR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ACR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ACR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ACR` writer"]
17pub struct W(crate::W<ACR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<ACR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<ACR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<ACR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Latency\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum LATENCY_A {
41    #[doc = "0: 0 wait states"]
42    Ws0 = 0,
43    #[doc = "1: 1 wait states"]
44    Ws1 = 1,
45    #[doc = "2: 2 wait states"]
46    Ws2 = 2,
47    #[doc = "3: 3 wait states"]
48    Ws3 = 3,
49    #[doc = "4: 4 wait states"]
50    Ws4 = 4,
51    #[doc = "5: 5 wait states"]
52    Ws5 = 5,
53    #[doc = "6: 6 wait states"]
54    Ws6 = 6,
55    #[doc = "7: 7 wait states"]
56    Ws7 = 7,
57    #[doc = "8: 8 wait states"]
58    Ws8 = 8,
59    #[doc = "9: 9 wait states"]
60    Ws9 = 9,
61    #[doc = "10: 10 wait states"]
62    Ws10 = 10,
63    #[doc = "11: 11 wait states"]
64    Ws11 = 11,
65    #[doc = "12: 12 wait states"]
66    Ws12 = 12,
67    #[doc = "13: 13 wait states"]
68    Ws13 = 13,
69    #[doc = "14: 14 wait states"]
70    Ws14 = 14,
71    #[doc = "15: 15 wait states"]
72    Ws15 = 15,
73}
74impl From<LATENCY_A> for u8 {
75    #[inline(always)]
76    fn from(variant: LATENCY_A) -> Self {
77        variant as _
78    }
79}
80#[doc = "Field `LATENCY` reader - Latency"]
81pub type LATENCY_R = crate::FieldReader<u8, LATENCY_A>;
82impl LATENCY_R {
83    #[doc = "Get enumerated values variant"]
84    #[inline(always)]
85    pub fn variant(&self) -> LATENCY_A {
86        match self.bits {
87            0 => LATENCY_A::Ws0,
88            1 => LATENCY_A::Ws1,
89            2 => LATENCY_A::Ws2,
90            3 => LATENCY_A::Ws3,
91            4 => LATENCY_A::Ws4,
92            5 => LATENCY_A::Ws5,
93            6 => LATENCY_A::Ws6,
94            7 => LATENCY_A::Ws7,
95            8 => LATENCY_A::Ws8,
96            9 => LATENCY_A::Ws9,
97            10 => LATENCY_A::Ws10,
98            11 => LATENCY_A::Ws11,
99            12 => LATENCY_A::Ws12,
100            13 => LATENCY_A::Ws13,
101            14 => LATENCY_A::Ws14,
102            15 => LATENCY_A::Ws15,
103            _ => unreachable!(),
104        }
105    }
106    #[doc = "Checks if the value of the field is `Ws0`"]
107    #[inline(always)]
108    pub fn is_ws0(&self) -> bool {
109        *self == LATENCY_A::Ws0
110    }
111    #[doc = "Checks if the value of the field is `Ws1`"]
112    #[inline(always)]
113    pub fn is_ws1(&self) -> bool {
114        *self == LATENCY_A::Ws1
115    }
116    #[doc = "Checks if the value of the field is `Ws2`"]
117    #[inline(always)]
118    pub fn is_ws2(&self) -> bool {
119        *self == LATENCY_A::Ws2
120    }
121    #[doc = "Checks if the value of the field is `Ws3`"]
122    #[inline(always)]
123    pub fn is_ws3(&self) -> bool {
124        *self == LATENCY_A::Ws3
125    }
126    #[doc = "Checks if the value of the field is `Ws4`"]
127    #[inline(always)]
128    pub fn is_ws4(&self) -> bool {
129        *self == LATENCY_A::Ws4
130    }
131    #[doc = "Checks if the value of the field is `Ws5`"]
132    #[inline(always)]
133    pub fn is_ws5(&self) -> bool {
134        *self == LATENCY_A::Ws5
135    }
136    #[doc = "Checks if the value of the field is `Ws6`"]
137    #[inline(always)]
138    pub fn is_ws6(&self) -> bool {
139        *self == LATENCY_A::Ws6
140    }
141    #[doc = "Checks if the value of the field is `Ws7`"]
142    #[inline(always)]
143    pub fn is_ws7(&self) -> bool {
144        *self == LATENCY_A::Ws7
145    }
146    #[doc = "Checks if the value of the field is `Ws8`"]
147    #[inline(always)]
148    pub fn is_ws8(&self) -> bool {
149        *self == LATENCY_A::Ws8
150    }
151    #[doc = "Checks if the value of the field is `Ws9`"]
152    #[inline(always)]
153    pub fn is_ws9(&self) -> bool {
154        *self == LATENCY_A::Ws9
155    }
156    #[doc = "Checks if the value of the field is `Ws10`"]
157    #[inline(always)]
158    pub fn is_ws10(&self) -> bool {
159        *self == LATENCY_A::Ws10
160    }
161    #[doc = "Checks if the value of the field is `Ws11`"]
162    #[inline(always)]
163    pub fn is_ws11(&self) -> bool {
164        *self == LATENCY_A::Ws11
165    }
166    #[doc = "Checks if the value of the field is `Ws12`"]
167    #[inline(always)]
168    pub fn is_ws12(&self) -> bool {
169        *self == LATENCY_A::Ws12
170    }
171    #[doc = "Checks if the value of the field is `Ws13`"]
172    #[inline(always)]
173    pub fn is_ws13(&self) -> bool {
174        *self == LATENCY_A::Ws13
175    }
176    #[doc = "Checks if the value of the field is `Ws14`"]
177    #[inline(always)]
178    pub fn is_ws14(&self) -> bool {
179        *self == LATENCY_A::Ws14
180    }
181    #[doc = "Checks if the value of the field is `Ws15`"]
182    #[inline(always)]
183    pub fn is_ws15(&self) -> bool {
184        *self == LATENCY_A::Ws15
185    }
186}
187#[doc = "Field `LATENCY` writer - Latency"]
188pub type LATENCY_W<'a, const O: u8> =
189    crate::FieldWriterSafe<'a, u32, ACR_SPEC, u8, LATENCY_A, 4, O>;
190impl<'a, const O: u8> LATENCY_W<'a, O> {
191    #[doc = "0 wait states"]
192    #[inline(always)]
193    pub fn ws0(self) -> &'a mut W {
194        self.variant(LATENCY_A::Ws0)
195    }
196    #[doc = "1 wait states"]
197    #[inline(always)]
198    pub fn ws1(self) -> &'a mut W {
199        self.variant(LATENCY_A::Ws1)
200    }
201    #[doc = "2 wait states"]
202    #[inline(always)]
203    pub fn ws2(self) -> &'a mut W {
204        self.variant(LATENCY_A::Ws2)
205    }
206    #[doc = "3 wait states"]
207    #[inline(always)]
208    pub fn ws3(self) -> &'a mut W {
209        self.variant(LATENCY_A::Ws3)
210    }
211    #[doc = "4 wait states"]
212    #[inline(always)]
213    pub fn ws4(self) -> &'a mut W {
214        self.variant(LATENCY_A::Ws4)
215    }
216    #[doc = "5 wait states"]
217    #[inline(always)]
218    pub fn ws5(self) -> &'a mut W {
219        self.variant(LATENCY_A::Ws5)
220    }
221    #[doc = "6 wait states"]
222    #[inline(always)]
223    pub fn ws6(self) -> &'a mut W {
224        self.variant(LATENCY_A::Ws6)
225    }
226    #[doc = "7 wait states"]
227    #[inline(always)]
228    pub fn ws7(self) -> &'a mut W {
229        self.variant(LATENCY_A::Ws7)
230    }
231    #[doc = "8 wait states"]
232    #[inline(always)]
233    pub fn ws8(self) -> &'a mut W {
234        self.variant(LATENCY_A::Ws8)
235    }
236    #[doc = "9 wait states"]
237    #[inline(always)]
238    pub fn ws9(self) -> &'a mut W {
239        self.variant(LATENCY_A::Ws9)
240    }
241    #[doc = "10 wait states"]
242    #[inline(always)]
243    pub fn ws10(self) -> &'a mut W {
244        self.variant(LATENCY_A::Ws10)
245    }
246    #[doc = "11 wait states"]
247    #[inline(always)]
248    pub fn ws11(self) -> &'a mut W {
249        self.variant(LATENCY_A::Ws11)
250    }
251    #[doc = "12 wait states"]
252    #[inline(always)]
253    pub fn ws12(self) -> &'a mut W {
254        self.variant(LATENCY_A::Ws12)
255    }
256    #[doc = "13 wait states"]
257    #[inline(always)]
258    pub fn ws13(self) -> &'a mut W {
259        self.variant(LATENCY_A::Ws13)
260    }
261    #[doc = "14 wait states"]
262    #[inline(always)]
263    pub fn ws14(self) -> &'a mut W {
264        self.variant(LATENCY_A::Ws14)
265    }
266    #[doc = "15 wait states"]
267    #[inline(always)]
268    pub fn ws15(self) -> &'a mut W {
269        self.variant(LATENCY_A::Ws15)
270    }
271}
272#[doc = "Prefetch enable\n\nValue on reset: 0"]
273#[derive(Clone, Copy, Debug, PartialEq)]
274pub enum PRFTEN_A {
275    #[doc = "0: Prefetch is disabled"]
276    Disabled = 0,
277    #[doc = "1: Prefetch is enabled"]
278    Enabled = 1,
279}
280impl From<PRFTEN_A> for bool {
281    #[inline(always)]
282    fn from(variant: PRFTEN_A) -> Self {
283        variant as u8 != 0
284    }
285}
286#[doc = "Field `PRFTEN` reader - Prefetch enable"]
287pub type PRFTEN_R = crate::BitReader<PRFTEN_A>;
288impl PRFTEN_R {
289    #[doc = "Get enumerated values variant"]
290    #[inline(always)]
291    pub fn variant(&self) -> PRFTEN_A {
292        match self.bits {
293            false => PRFTEN_A::Disabled,
294            true => PRFTEN_A::Enabled,
295        }
296    }
297    #[doc = "Checks if the value of the field is `Disabled`"]
298    #[inline(always)]
299    pub fn is_disabled(&self) -> bool {
300        *self == PRFTEN_A::Disabled
301    }
302    #[doc = "Checks if the value of the field is `Enabled`"]
303    #[inline(always)]
304    pub fn is_enabled(&self) -> bool {
305        *self == PRFTEN_A::Enabled
306    }
307}
308#[doc = "Field `PRFTEN` writer - Prefetch enable"]
309pub type PRFTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACR_SPEC, PRFTEN_A, O>;
310impl<'a, const O: u8> PRFTEN_W<'a, O> {
311    #[doc = "Prefetch is disabled"]
312    #[inline(always)]
313    pub fn disabled(self) -> &'a mut W {
314        self.variant(PRFTEN_A::Disabled)
315    }
316    #[doc = "Prefetch is enabled"]
317    #[inline(always)]
318    pub fn enabled(self) -> &'a mut W {
319        self.variant(PRFTEN_A::Enabled)
320    }
321}
322#[doc = "ART Accelerator Enable\n\nValue on reset: 0"]
323#[derive(Clone, Copy, Debug, PartialEq)]
324pub enum ARTEN_A {
325    #[doc = "0: ART Accelerator is disabled"]
326    Disabled = 0,
327    #[doc = "1: ART Accelerator is enabled"]
328    Enabled = 1,
329}
330impl From<ARTEN_A> for bool {
331    #[inline(always)]
332    fn from(variant: ARTEN_A) -> Self {
333        variant as u8 != 0
334    }
335}
336#[doc = "Field `ARTEN` reader - ART Accelerator Enable"]
337pub type ARTEN_R = crate::BitReader<ARTEN_A>;
338impl ARTEN_R {
339    #[doc = "Get enumerated values variant"]
340    #[inline(always)]
341    pub fn variant(&self) -> ARTEN_A {
342        match self.bits {
343            false => ARTEN_A::Disabled,
344            true => ARTEN_A::Enabled,
345        }
346    }
347    #[doc = "Checks if the value of the field is `Disabled`"]
348    #[inline(always)]
349    pub fn is_disabled(&self) -> bool {
350        *self == ARTEN_A::Disabled
351    }
352    #[doc = "Checks if the value of the field is `Enabled`"]
353    #[inline(always)]
354    pub fn is_enabled(&self) -> bool {
355        *self == ARTEN_A::Enabled
356    }
357}
358#[doc = "Field `ARTEN` writer - ART Accelerator Enable"]
359pub type ARTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACR_SPEC, ARTEN_A, O>;
360impl<'a, const O: u8> ARTEN_W<'a, O> {
361    #[doc = "ART Accelerator is disabled"]
362    #[inline(always)]
363    pub fn disabled(self) -> &'a mut W {
364        self.variant(ARTEN_A::Disabled)
365    }
366    #[doc = "ART Accelerator is enabled"]
367    #[inline(always)]
368    pub fn enabled(self) -> &'a mut W {
369        self.variant(ARTEN_A::Enabled)
370    }
371}
372#[doc = "ART Accelerator reset\n\nValue on reset: 0"]
373#[derive(Clone, Copy, Debug, PartialEq)]
374pub enum ARTRST_A {
375    #[doc = "0: Accelerator is not reset"]
376    NotReset = 0,
377    #[doc = "1: Accelerator is reset"]
378    Reset = 1,
379}
380impl From<ARTRST_A> for bool {
381    #[inline(always)]
382    fn from(variant: ARTRST_A) -> Self {
383        variant as u8 != 0
384    }
385}
386#[doc = "Field `ARTRST` reader - ART Accelerator reset"]
387pub type ARTRST_R = crate::BitReader<ARTRST_A>;
388impl ARTRST_R {
389    #[doc = "Get enumerated values variant"]
390    #[inline(always)]
391    pub fn variant(&self) -> ARTRST_A {
392        match self.bits {
393            false => ARTRST_A::NotReset,
394            true => ARTRST_A::Reset,
395        }
396    }
397    #[doc = "Checks if the value of the field is `NotReset`"]
398    #[inline(always)]
399    pub fn is_not_reset(&self) -> bool {
400        *self == ARTRST_A::NotReset
401    }
402    #[doc = "Checks if the value of the field is `Reset`"]
403    #[inline(always)]
404    pub fn is_reset(&self) -> bool {
405        *self == ARTRST_A::Reset
406    }
407}
408#[doc = "Field `ARTRST` writer - ART Accelerator reset"]
409pub type ARTRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACR_SPEC, ARTRST_A, O>;
410impl<'a, const O: u8> ARTRST_W<'a, O> {
411    #[doc = "Accelerator is not reset"]
412    #[inline(always)]
413    pub fn not_reset(self) -> &'a mut W {
414        self.variant(ARTRST_A::NotReset)
415    }
416    #[doc = "Accelerator is reset"]
417    #[inline(always)]
418    pub fn reset(self) -> &'a mut W {
419        self.variant(ARTRST_A::Reset)
420    }
421}
422impl R {
423    #[doc = "Bits 0:3 - Latency"]
424    #[inline(always)]
425    pub fn latency(&self) -> LATENCY_R {
426        LATENCY_R::new((self.bits & 0x0f) as u8)
427    }
428    #[doc = "Bit 8 - Prefetch enable"]
429    #[inline(always)]
430    pub fn prften(&self) -> PRFTEN_R {
431        PRFTEN_R::new(((self.bits >> 8) & 1) != 0)
432    }
433    #[doc = "Bit 9 - ART Accelerator Enable"]
434    #[inline(always)]
435    pub fn arten(&self) -> ARTEN_R {
436        ARTEN_R::new(((self.bits >> 9) & 1) != 0)
437    }
438    #[doc = "Bit 11 - ART Accelerator reset"]
439    #[inline(always)]
440    pub fn artrst(&self) -> ARTRST_R {
441        ARTRST_R::new(((self.bits >> 11) & 1) != 0)
442    }
443}
444impl W {
445    #[doc = "Bits 0:3 - Latency"]
446    #[inline(always)]
447    pub fn latency(&mut self) -> LATENCY_W<0> {
448        LATENCY_W::new(self)
449    }
450    #[doc = "Bit 8 - Prefetch enable"]
451    #[inline(always)]
452    pub fn prften(&mut self) -> PRFTEN_W<8> {
453        PRFTEN_W::new(self)
454    }
455    #[doc = "Bit 9 - ART Accelerator Enable"]
456    #[inline(always)]
457    pub fn arten(&mut self) -> ARTEN_W<9> {
458        ARTEN_W::new(self)
459    }
460    #[doc = "Bit 11 - ART Accelerator reset"]
461    #[inline(always)]
462    pub fn artrst(&mut self) -> ARTRST_W<11> {
463        ARTRST_W::new(self)
464    }
465    #[doc = "Writes raw bits to the register."]
466    #[inline(always)]
467    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
468        self.0.bits(bits);
469        self
470    }
471}
472#[doc = "Flash access control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [acr](index.html) module"]
473pub struct ACR_SPEC;
474impl crate::RegisterSpec for ACR_SPEC {
475    type Ux = u32;
476}
477#[doc = "`read()` method returns [acr::R](R) reader structure"]
478impl crate::Readable for ACR_SPEC {
479    type Reader = R;
480}
481#[doc = "`write(|w| ..)` method takes [acr::W](W) writer structure"]
482impl crate::Writable for ACR_SPEC {
483    type Writer = W;
484}
485#[doc = "`reset()` method sets ACR to value 0"]
486impl crate::Resettable for ACR_SPEC {
487    #[inline(always)]
488    fn reset_value() -> Self::Ux {
489        0
490    }
491}