stm32f4/stm32f469/rcc/
ahb3enr.rs1pub type R = crate::R<AHB3ENRrs>;
3pub type W = crate::W<AHB3ENRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum FMCEN {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<FMCEN> for bool {
17 #[inline(always)]
18 fn from(variant: FMCEN) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type FMCEN_R = crate::BitReader<FMCEN>;
24impl FMCEN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> FMCEN {
28 match self.bits {
29 false => FMCEN::Disabled,
30 true => FMCEN::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == FMCEN::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == FMCEN::Enabled
42 }
43}
44pub type FMCEN_W<'a, REG> = crate::BitWriter<'a, REG, FMCEN>;
46impl<'a, REG> FMCEN_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(FMCEN::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(FMCEN::Enabled)
59 }
60}
61pub use FMCEN_R as QSPIEN_R;
63pub use FMCEN_W as QSPIEN_W;
65impl R {
66 #[inline(always)]
68 pub fn fmcen(&self) -> FMCEN_R {
69 FMCEN_R::new((self.bits & 1) != 0)
70 }
71 #[inline(always)]
73 pub fn qspien(&self) -> QSPIEN_R {
74 QSPIEN_R::new(((self.bits >> 1) & 1) != 0)
75 }
76}
77impl core::fmt::Debug for R {
78 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
79 f.debug_struct("AHB3ENR")
80 .field("fmcen", &self.fmcen())
81 .field("qspien", &self.qspien())
82 .finish()
83 }
84}
85impl W {
86 #[inline(always)]
88 pub fn fmcen(&mut self) -> FMCEN_W<AHB3ENRrs> {
89 FMCEN_W::new(self, 0)
90 }
91 #[inline(always)]
93 pub fn qspien(&mut self) -> QSPIEN_W<AHB3ENRrs> {
94 QSPIEN_W::new(self, 1)
95 }
96}
97pub struct AHB3ENRrs;
103impl crate::RegisterSpec for AHB3ENRrs {
104 type Ux = u32;
105}
106impl crate::Readable for AHB3ENRrs {}
108impl crate::Writable for AHB3ENRrs {
110 type Safety = crate::Unsafe;
111}
112impl crate::Resettable for AHB3ENRrs {}