Skip to content

Commit d46d510

Browse files
committed
Extrapolate USB support to other chips
based on the AN4879 appnote and corresponding reference manuals.
1 parent d0a3417 commit d46d510

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,18 @@ pub mod i2c;
100100
feature = "stm32f405",
101101
feature = "stm32f407",
102102
feature = "stm32f411",
103+
feature = "stm32f412",
104+
feature = "stm32f413",
103105
feature = "stm32f415",
104106
feature = "stm32f417",
107+
feature = "stm32f423",
105108
feature = "stm32f427",
106109
feature = "stm32f429",
107110
feature = "stm32f437",
108111
feature = "stm32f439",
109112
feature = "stm32f446",
113+
feature = "stm32f469",
114+
feature = "stm32f479",
110115
)
111116
))]
112117
pub mod otg_fs;
@@ -122,6 +127,8 @@ pub mod otg_fs;
122127
feature = "stm32f437",
123128
feature = "stm32f439",
124129
feature = "stm32f446",
130+
feature = "stm32f469",
131+
feature = "stm32f479",
125132
)
126133
))]
127134
pub mod otg_hs;

src/otg_fs.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ unsafe impl UsbPeripheral for USB {
4444
feature = "stm32f439",
4545
))]
4646
const ENDPOINT_COUNT: usize = 4;
47-
#[cfg(feature = "stm32f446")]
47+
#[cfg(any(
48+
feature = "stm32f412",
49+
feature = "stm32f413",
50+
feature = "stm32f423",
51+
feature = "stm32f446",
52+
feature = "stm32f469",
53+
feature = "stm32f479",
54+
))]
4855
const ENDPOINT_COUNT: usize = 6;
4956

5057
fn enable() {

src/otg_hs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ unsafe impl UsbPeripheral for USB {
4545
feature = "stm32f439",
4646
))]
4747
const ENDPOINT_COUNT: usize = 6;
48-
#[cfg(feature = "stm32f446")]
48+
#[cfg(any(
49+
feature = "stm32f446",
50+
feature = "stm32f469",
51+
feature = "stm32f479",
52+
))]
4953
const ENDPOINT_COUNT: usize = 9;
5054

5155
fn enable() {

0 commit comments

Comments
 (0)