From 57453b1e4f2c96342563457ece30522a3e8bb19e Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Sun, 14 May 2023 05:48:18 +0300 Subject: [PATCH] otg_hs::Dm/Dp --- examples/fmc.rs | 2 +- src/gpio/alt/h7.rs | 20 +++++++++++++++++++- src/usb_hs.rs | 15 --------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/examples/fmc.rs b/examples/fmc.rs index 872b475b..478963a4 100644 --- a/examples/fmc.rs +++ b/examples/fmc.rs @@ -15,7 +15,7 @@ mod utilities; extern crate cortex_m; use cortex_m_rt::entry; -use stm32h7xx_hal::gpio::{alt::fmc as alt, Speed}; +use stm32h7xx_hal::gpio::alt::fmc as alt; use stm32h7xx_hal::{pac, prelude::*}; use stm32_fmc::devices::is42s32800g_6; diff --git a/src/gpio/alt/h7.rs b/src/gpio/alt/h7.rs index ce7c3292..c1f4bc5a 100644 --- a/src/gpio/alt/h7.rs +++ b/src/gpio/alt/h7.rs @@ -608,7 +608,11 @@ pub mod eth { for [ PC3<11>, ], + } + // TODO: check + //#[cfg(feature = "gpio-h747")] + pin! { for [ PC2<11>, ], @@ -5317,6 +5321,18 @@ pub mod otg_hs { ], } + // TODO: check this, absent in Cube-MX + #[cfg(any(feature = "gpio-h72", feature = "gpio-h7a2"))] + pin! { + for [ + PA11<10>, + ], + + for [ + PA12<10>, + ], + } + pin! { for [ #[cfg(any(feature = "gpio-h72", feature = "gpio-h7a2"))] @@ -5382,11 +5398,13 @@ pub mod otg_hs { ], } - #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] + //#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] pin! { for [ + // TODO: check PC2<10, Speed::VeryHigh>, + #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] PI11<10, Speed::VeryHigh>, ], } diff --git a/src/usb_hs.rs b/src/usb_hs.rs index 728b8a37..e5d9b283 100644 --- a/src/usb_hs.rs +++ b/src/usb_hs.rs @@ -33,7 +33,6 @@ pub struct USB1 { pub hclk: Hertz, } impl USB1 { - #[cfg(any(feature = "rm0433", feature = "rm0399"))] pub fn new( usb_global: stm32::OTG1_HS_GLOBAL, usb_device: stm32::OTG1_HS_DEVICE, @@ -47,20 +46,6 @@ impl USB1 { let _ = pin_dp.into(); Self::new_unchecked(usb_global, usb_device, usb_pwrclk, prec, clocks) } - #[cfg(any(feature = "rm0455", feature = "rm0468"))] - pub fn new( - usb_global: stm32::OTG1_HS_GLOBAL, - usb_device: stm32::OTG1_HS_DEVICE, - usb_pwrclk: stm32::OTG1_HS_PWRCLK, - pin_dm: impl Into, - pin_dp: impl Into, - prec: rcc::rec::Usb1Otg, - clocks: &rcc::CoreClocks, - ) -> Self { - let _ = pin_dm.into(); - let _ = pin_dp.into(); - Self::new_unchecked(usb_global, usb_device, usb_pwrclk, prec, clocks) - } pub fn new_unchecked( usb_global: stm32::OTG1_HS_GLOBAL, usb_device: stm32::OTG1_HS_DEVICE,