Skip to content

Commit aca0d52

Browse files
committed
All H7s support ULPI
1 parent f7eaf49 commit aca0d52

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ authors = ["Andrew Straw <[email protected]>",
88
"Robert Jördens <[email protected]>",
99
"Ryan Summers <[email protected]>",
1010
"Matthew Meyer <[email protected]>",
11-
"Florian Jung <[email protected]>"]
11+
"Florian Jung <[email protected]>",
12+
"Matt Ickstadt <[email protected]>"]
1213
edition = "2018"
1314
categories = ["embedded", "hardware-support", "no-std"]
1415
description = "Hardware Abstraction Layer implementation for STM32H7 series microcontrollers"

src/usb_hs.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ use crate::rcc;
66
use crate::stm32;
77

88
use crate::gpio::{
9-
gpioa::{PA11, PA12},
9+
gpioa::{PA11, PA12, PA3, PA5},
10+
gpiob::{PB0, PB1, PB10, PB11, PB12, PB13, PB5},
11+
gpioc::{PC0, PC2, PC3},
12+
gpioh::PH4,
13+
gpioi::PI11,
1014
Alternate, AF10,
1115
};
1216

1317
#[cfg(not(feature = "rm0455"))]
1418
use crate::gpio::{
15-
gpioa::{PA3, PA5},
16-
gpiob::{PB0, PB1, PB10, PB11, PB12, PB13, PB14, PB15, PB5},
17-
gpioc::PC0,
18-
gpioc::{PC2, PC3},
19-
gpioh::PH4,
20-
gpioi::PI11,
19+
gpiob::{PB14, PB15},
2120
AF12,
2221
};
2322

@@ -110,7 +109,6 @@ usb_peripheral! {
110109
#[cfg(not(feature = "rm0455"))]
111110
pub type Usb2BusType = UsbBus<USB2>;
112111

113-
#[cfg(not(feature = "rm0455"))]
114112
pub struct USB1_ULPI {
115113
pub usb_global: stm32::OTG1_HS_GLOBAL,
116114
pub usb_device: stm32::OTG1_HS_DEVICE,
@@ -131,50 +129,42 @@ pub struct USB1_ULPI {
131129
pub ulpi_d7: PB5<Alternate<AF10>>,
132130
}
133131

134-
#[cfg(not(feature = "rm0455"))]
135132
pub enum Usb1UlpiDirPin {
136133
PC2(PC2<Alternate<AF10>>),
137134
PI11(PI11<Alternate<AF10>>),
138135
}
139136

140-
#[cfg(not(feature = "rm0455"))]
141137
impl From<PI11<Alternate<AF10>>> for Usb1UlpiDirPin {
142138
fn from(v: PI11<Alternate<AF10>>) -> Self {
143139
Usb1UlpiDirPin::PI11(v)
144140
}
145141
}
146142

147-
#[cfg(not(feature = "rm0455"))]
148143
impl From<PC2<Alternate<AF10>>> for Usb1UlpiDirPin {
149144
fn from(v: PC2<Alternate<AF10>>) -> Self {
150145
Usb1UlpiDirPin::PC2(v)
151146
}
152147
}
153148

154-
#[cfg(not(feature = "rm0455"))]
155149
pub enum Usb1UlpiNxtPin {
156150
PC3(PC3<Alternate<AF10>>),
157151
PH4(PH4<Alternate<AF10>>),
158152
}
159153

160-
#[cfg(not(feature = "rm0455"))]
161154
impl From<PH4<Alternate<AF10>>> for Usb1UlpiNxtPin {
162155
fn from(v: PH4<Alternate<AF10>>) -> Self {
163156
Usb1UlpiNxtPin::PH4(v)
164157
}
165158
}
166159

167-
#[cfg(not(feature = "rm0455"))]
168160
impl From<PC3<Alternate<AF10>>> for Usb1UlpiNxtPin {
169161
fn from(v: PC3<Alternate<AF10>>) -> Self {
170162
Usb1UlpiNxtPin::PC3(v)
171163
}
172164
}
173165

174-
#[cfg(not(feature = "rm0455"))]
175166
unsafe impl Sync for USB1_ULPI {}
176167

177-
#[cfg(not(feature = "rm0455"))]
178168
unsafe impl UsbPeripheral for USB1_ULPI {
179169
const REGISTERS: *const () = stm32::OTG1_HS_GLOBAL::ptr() as *const ();
180170

@@ -206,5 +196,4 @@ unsafe impl UsbPeripheral for USB1_ULPI {
206196
synopsys_usb_otg::PhyType::ExternalHighSpeed
207197
}
208198
}
209-
#[cfg(not(feature = "rm0455"))]
210199
pub type Usb1UlpiBusType = UsbBus<USB1_ULPI>;

0 commit comments

Comments
 (0)