stm32f4_staging/stm32f407/syscfg/
pmc.rs1pub type R = crate::R<PMCrs>;
3pub type W = crate::W<PMCrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum MII_RMII_SEL {
11 Mii = 0,
13 RmiiPhy = 1,
15}
16impl From<MII_RMII_SEL> for bool {
17 #[inline(always)]
18 fn from(variant: MII_RMII_SEL) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type MII_RMII_SEL_R = crate::BitReader<MII_RMII_SEL>;
24impl MII_RMII_SEL_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> MII_RMII_SEL {
28 match self.bits {
29 false => MII_RMII_SEL::Mii,
30 true => MII_RMII_SEL::RmiiPhy,
31 }
32 }
33 #[inline(always)]
35 pub fn is_mii(&self) -> bool {
36 *self == MII_RMII_SEL::Mii
37 }
38 #[inline(always)]
40 pub fn is_rmii_phy(&self) -> bool {
41 *self == MII_RMII_SEL::RmiiPhy
42 }
43}
44pub type MII_RMII_SEL_W<'a, REG> = crate::BitWriter<'a, REG, MII_RMII_SEL>;
46impl<'a, REG> MII_RMII_SEL_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn mii(self) -> &'a mut crate::W<REG> {
53 self.variant(MII_RMII_SEL::Mii)
54 }
55 #[inline(always)]
57 pub fn rmii_phy(self) -> &'a mut crate::W<REG> {
58 self.variant(MII_RMII_SEL::RmiiPhy)
59 }
60}
61impl R {
62 #[inline(always)]
64 pub fn mii_rmii_sel(&self) -> MII_RMII_SEL_R {
65 MII_RMII_SEL_R::new(((self.bits >> 23) & 1) != 0)
66 }
67}
68impl core::fmt::Debug for R {
69 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
70 f.debug_struct("PMC")
71 .field("mii_rmii_sel", &self.mii_rmii_sel())
72 .finish()
73 }
74}
75impl W {
76 #[inline(always)]
78 pub fn mii_rmii_sel(&mut self) -> MII_RMII_SEL_W<PMCrs> {
79 MII_RMII_SEL_W::new(self, 23)
80 }
81}
82pub struct PMCrs;
88impl crate::RegisterSpec for PMCrs {
89 type Ux = u32;
90}
91impl crate::Readable for PMCrs {}
93impl crate::Writable for PMCrs {
95 type Safety = crate::Unsafe;
96}
97impl crate::Resettable for PMCrs {}