Skip to content

Commit

Permalink
otg_hs::Dm/Dp
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Jul 1, 2023
1 parent ecdc24b commit 57453b1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/fmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 19 additions & 1 deletion src/gpio/alt/h7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,11 @@ pub mod eth {
<TxClk, PushPull> for [
PC3<11>,
],
}

// TODO: check
//#[cfg(feature = "gpio-h747")]
pin! {
<Txd2, PushPull> for [
PC2<11>,
],
Expand Down Expand Up @@ -5317,6 +5321,18 @@ pub mod otg_hs {
],
}

// TODO: check this, absent in Cube-MX
#[cfg(any(feature = "gpio-h72", feature = "gpio-h7a2"))]
pin! {
<Dm, PushPull> for [
PA11<10>,
],

<Dp, PushPull> for [
PA12<10>,
],
}

pin! {
<Id, PushPull> for [
#[cfg(any(feature = "gpio-h72", feature = "gpio-h7a2"))]
Expand Down Expand Up @@ -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! {
<UlpiDir, PushPull> for [
// TODO: check
PC2<10, Speed::VeryHigh>,

#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
PI11<10, Speed::VeryHigh>,
],
}
Expand Down
15 changes: 0 additions & 15 deletions src/usb_hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<gpio::alt::otg_fs::Dm>,
pin_dp: impl Into<gpio::alt::otg_fs::Dp>,
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,
Expand Down

0 comments on commit 57453b1

Please sign in to comment.