Skip to content

Commit c79c69c

Browse files
committed
Add support for stm32f058
1 parent e225bc0 commit c79c69c

File tree

8 files changed

+25
-6
lines changed

8 files changed

+25
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ stm32f038 = ["stm32f0/stm32f0x8", "device-selected"]
5959
stm32f042 = ["stm32f0/stm32f0x2", "device-selected"]
6060
stm32f048 = ["stm32f0/stm32f0x8", "device-selected"]
6161
stm32f051 = ["stm32f0/stm32f0x1", "device-selected"]
62+
stm32f058 = ["stm32f0/stm32f0x8", "device-selected"]
6263
stm32f070 = ["stm32f0/stm32f0x0", "device-selected"]
6364
stm32f070x6 = ["stm32f070"]
6465
stm32f070xb = ["stm32f070"]

src/adc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ adc_pins!(
207207
#[cfg(any(
208208
feature = "stm32f030",
209209
feature = "stm32f051",
210+
feature = "stm32f058",
210211
feature = "stm32f070",
211212
feature = "stm32f071",
212213
feature = "stm32f072",
@@ -358,6 +359,7 @@ impl VRef {
358359
feature = "stm32f042",
359360
feature = "stm32f048",
360361
feature = "stm32f051",
362+
feature = "stm32f058",
361363
feature = "stm32f071",
362364
feature = "stm32f072",
363365
feature = "stm32f091",
@@ -372,6 +374,7 @@ pub struct VBat;
372374
feature = "stm32f042",
373375
feature = "stm32f048",
374376
feature = "stm32f051",
377+
feature = "stm32f058",
375378
feature = "stm32f071",
376379
feature = "stm32f072",
377380
feature = "stm32f091",
@@ -386,6 +389,7 @@ adc_pins!(
386389
feature = "stm32f042",
387390
feature = "stm32f048",
388391
feature = "stm32f051",
392+
feature = "stm32f058",
389393
feature = "stm32f071",
390394
feature = "stm32f072",
391395
feature = "stm32f091",

src/gpio.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,10 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
567567
PC14: (pc14, 14, Input<Floating>),
568568
PC15: (pc15, 15, Input<Floating>),
569569
]);
570-
571570
#[cfg(any(
572571
feature = "stm32f030",
573572
feature = "stm32f051",
573+
feature = "stm32f058",
574574
feature = "stm32f070",
575575
feature = "stm32f071",
576576
feature = "stm32f072",
@@ -595,11 +595,15 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
595595
PC15: (pc15, 15, Input<Floating>),
596596
]);
597597

598-
#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f070"))]
598+
#[cfg(any(
599+
feature = "stm32f030",
600+
feature = "stm32f051",
601+
feature = "stm32f058",
602+
feature = "stm32f070",
603+
))]
599604
gpio!(GPIOD, gpiod, iopden, PD, [
600605
PD2: (pd2, 2, Input<Floating>),
601606
]);
602-
603607
#[cfg(any(feature = "stm32f071", feature = "stm32f072", feature = "stm32f091"))]
604608
gpio!(GPIOD, gpiod, iopden, PD, [
605609
PD0: (pd0, 0, Input<Floating>),
@@ -643,7 +647,7 @@ gpio!(GPIOD, gpiod, iopden, PD, [
643647
// PE15: (pe15, 15, Input<Floating>),
644648
// ]);
645649

646-
#[cfg(any(feature = "stm32f030", feature = "stm32f051"))]
650+
#[cfg(any(feature = "stm32f030", feature = "stm32f051", feature = "stm32f058"))]
647651
gpio!(GPIOF, gpiof, iopfen, PF, [
648652
PF0: (pf0, 0, Input<Floating>),
649653
PF1: (pf1, 1, Input<Floating>),

src/i2c.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ macro_rules! i2c_pins {
4040
feature = "stm32f042",
4141
feature = "stm32f048",
4242
feature = "stm32f051",
43+
feature = "stm32f058",
4344
feature = "stm32f070",
4445
feature = "stm32f071",
4546
feature = "stm32f072",
@@ -114,7 +115,7 @@ i2c_pins! {
114115
}
115116
}
116117

117-
#[cfg(any(feature = "stm32f030x8", feature = "stm32f051"))]
118+
#[cfg(any(feature = "stm32f030x8", feature = "stm32f051", feature = "stm32f058"))]
118119
i2c_pins! {
119120
I2C2 => {
120121
scl => [gpiob::PB10<Alternate<AF1>>],
@@ -178,6 +179,7 @@ i2c! {
178179
#[cfg(any(
179180
feature = "stm32f030xc",
180181
feature = "stm32f051",
182+
feature = "stm32f058",
181183
feature = "stm32f070xb",
182184
feature = "stm32f071",
183185
feature = "stm32f072",

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use stm32f0::stm32f0x1 as stm32;
1717
#[cfg(any(feature = "stm32f042", feature = "stm32f072"))]
1818
pub use stm32f0::stm32f0x2 as stm32;
1919

20-
#[cfg(any(feature = "stm32f038", feature = "stm32f048"))]
20+
#[cfg(any(feature = "stm32f038", feature = "stm32f048", feature = "stm32f058"))]
2121
pub use stm32f0::stm32f0x8 as stm32;
2222

2323
#[cfg(feature = "device-selected")]

src/serial.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ macro_rules! usart_pins {
119119
feature = "stm32f042",
120120
feature = "stm32f048",
121121
feature = "stm32f051",
122+
feature = "stm32f058",
122123
feature = "stm32f071",
123124
))]
124125
usart_pins! {
@@ -154,6 +155,7 @@ usart_pins! {
154155
feature = "stm32f042",
155156
feature = "stm32f048",
156157
feature = "stm32f051",
158+
feature = "stm32f058",
157159
feature = "stm32f070",
158160
feature = "stm32f071",
159161
feature = "stm32f072",
@@ -370,6 +372,7 @@ usart! {
370372
feature = "stm32f042",
371373
feature = "stm32f048",
372374
feature = "stm32f051",
375+
feature = "stm32f058",
373376
feature = "stm32f070",
374377
feature = "stm32f071",
375378
feature = "stm32f072",

src/spi.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ use crate::stm32::SPI1;
5151
feature = "stm32f030xc",
5252
feature = "stm32f048",
5353
feature = "stm32f051",
54+
feature = "stm32f058",
5455
feature = "stm32f070xb",
5556
feature = "stm32f071",
5657
feature = "stm32f091",
@@ -138,6 +139,7 @@ spi_pins! {
138139
feature = "stm32f030xc",
139140
feature = "stm32f048",
140141
feature = "stm32f051",
142+
feature = "stm32f058",
141143
feature = "stm32f070xb",
142144
feature = "stm32f071",
143145
feature = "stm32f072",
@@ -213,6 +215,7 @@ spi! {
213215
feature = "stm32f030xc",
214216
feature = "stm32f048",
215217
feature = "stm32f051",
218+
feature = "stm32f058",
216219
feature = "stm32f070xb",
217220
feature = "stm32f071",
218221
feature = "stm32f091",

src/timers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ timers! {
228228
feature = "stm32f042",
229229
feature = "stm32f048",
230230
feature = "stm32f051",
231+
feature = "stm32f058",
231232
feature = "stm32f071",
232233
feature = "stm32f072",
233234
feature = "stm32f091",
@@ -240,6 +241,7 @@ timers! {
240241
feature = "stm32f030x8",
241242
feature = "stm32f030xc",
242243
feature = "stm32f051",
244+
feature = "stm32f058",
243245
feature = "stm32f070xb",
244246
feature = "stm32f071",
245247
feature = "stm32f072",

0 commit comments

Comments
 (0)