Skip to content

Commit 32b14bf

Browse files
committed
Add support for stm32f098
1 parent fca4716 commit 32b14bf

File tree

8 files changed

+40
-10
lines changed

8 files changed

+40
-10
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ panic-halt = "0.2.0"
5050
device-selected = []
5151
rt = ["stm32f0/rt"]
5252
stm32f030 = ["stm32f0/stm32f0x0", "device-selected"]
53-
stm32f030x4 = ["stm32f030x6"]
53+
stm32f030x4 = ["stm32f030"]
5454
stm32f030x6 = ["stm32f030"]
5555
stm32f030x8 = ["stm32f030"]
5656
stm32f030xc = ["stm32f030"]
@@ -67,6 +67,7 @@ stm32f071 = ["stm32f0/stm32f0x1", "device-selected"]
6767
stm32f072 = ["stm32f0/stm32f0x2", "device-selected"]
6868
stm32f078 = ["stm32f0/stm32f0x8", "device-selected"]
6969
stm32f091 = ["stm32f0/stm32f0x1", "device-selected"]
70+
stm32f098 = ["stm32f0/stm32f0x8", "device-selected"]
7071

7172
[profile.dev]
7273
debug = true

src/adc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ adc_pins!(
213213
feature = "stm32f072",
214214
feature = "stm32f078",
215215
feature = "stm32f091",
216+
feature = "stm32f098",
216217
))]
217218
adc_pins!(
218219
gpioc::PC0<Analog> => 10_u8,
@@ -365,6 +366,7 @@ impl VRef {
365366
feature = "stm32f072",
366367
feature = "stm32f078",
367368
feature = "stm32f091",
369+
feature = "stm32f098",
368370
))]
369371
#[derive(Debug, Default)]
370372
/// Battery reference voltage (ADC Channel 18)
@@ -381,6 +383,7 @@ pub struct VBat;
381383
feature = "stm32f072",
382384
feature = "stm32f078",
383385
feature = "stm32f091",
386+
feature = "stm32f098",
384387
))]
385388
adc_pins!(
386389
VBat => 18_u8,
@@ -397,6 +400,7 @@ adc_pins!(
397400
feature = "stm32f072",
398401
feature = "stm32f078",
399402
feature = "stm32f091",
403+
feature = "stm32f098",
400404
))]
401405
impl VBat {
402406
/// Init a new VBat

src/gpio.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
576576
feature = "stm32f072",
577577
feature = "stm32f078",
578578
feature = "stm32f091",
579+
feature = "stm32f098",
579580
))]
580581
gpio!(GPIOC, gpioc, iopcen, PC, [
581582
PC0: (pc0, 0, Input<Floating>),
@@ -609,7 +610,8 @@ gpio!(GPIOD, gpiod, iopden, PD, [
609610
feature = "stm32f071",
610611
feature = "stm32f072",
611612
feature = "stm32f078",
612-
feature = "stm32f091"
613+
feature = "stm32f091",
614+
feature = "stm32f098",
613615
))]
614616
gpio!(GPIOD, gpiod, iopden, PD, [
615617
PD0: (pd0, 0, Input<Floating>),
@@ -638,6 +640,7 @@ gpio!(GPIOD, gpiod, iopden, PD, [
638640
// feature = "stm32f072",
639641
// feature = "stm32f078",
640642
// feature = "stm32f091",
643+
// feature = "stm32f098",
641644
// ))]
642645
// gpio!(GPIOE, gpioe, iopeen, PE, [
643646
// PE0: (pe0, 0, Input<Floating>),
@@ -700,6 +703,7 @@ gpio!(GPIOF, gpiof, iopfen, PF, [
700703
feature = "stm32f072",
701704
feature = "stm32f078",
702705
feature = "stm32f091",
706+
feature = "stm32f098",
703707
))]
704708
gpio!(GPIOF, gpiof, iopfen, PF, [
705709
PF0: (pf0, 0, Input<Floating>),

src/i2c.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ macro_rules! i2c_pins {
4646
feature = "stm32f072",
4747
feature = "stm32f078",
4848
feature = "stm32f091",
49+
feature = "stm32f098",
4950
))]
5051
i2c_pins! {
5152
I2C1 => {
@@ -60,6 +61,7 @@ i2c_pins! {
6061
feature = "stm32f042",
6162
feature = "stm32f048",
6263
feature = "stm32f091",
64+
feature = "stm32f098",
6365
))]
6466
i2c_pins! {
6567
I2C1 => {
@@ -94,7 +96,7 @@ i2c_pins! {
9496
sda => [gpiob::PB14<Alternate<AF5>>],
9597
}
9698
}
97-
#[cfg(any(feature = "stm32f042", feature = "stm32f030xc"))]
99+
#[cfg(any(feature = "stm32f042", feature = "stm32f030xc", feature = "stm32f098"))]
98100
i2c_pins! {
99101
I2C1 => {
100102
scl => [gpiof::PF1<Alternate<AF1>>],
@@ -130,14 +132,15 @@ i2c_pins! {
130132
feature = "stm32f072",
131133
feature = "stm32f078",
132134
feature = "stm32f091",
135+
feature = "stm32f098",
133136
))]
134137
i2c_pins! {
135138
I2C2 => {
136139
scl => [gpiob::PB10<Alternate<AF1>>, gpiob::PB13<Alternate<AF5>>],
137140
sda => [gpiob::PB11<Alternate<AF1>>, gpiob::PB14<Alternate<AF5>>],
138141
}
139142
}
140-
#[cfg(feature = "stm32f091")]
143+
#[cfg(any(feature = "stm32f091", feature = "stm32f098"))]
141144
i2c_pins! {
142145
I2C2 => {
143146
scl => [gpioa::PA11<Alternate<AF5>>],
@@ -187,6 +190,7 @@ i2c! {
187190
feature = "stm32f072",
188191
feature = "stm32f078",
189192
feature = "stm32f091",
193+
feature = "stm32f098",
190194
))]
191195
i2c! {
192196
I2C2: (i2c2, i2c2en, i2c2rst, apb1enr, apb1rstr),

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ pub use stm32f0::stm32f0x2 as stm32;
2121
feature = "stm32f038",
2222
feature = "stm32f048",
2323
feature = "stm32f058",
24-
feature = "stm32f078"
24+
feature = "stm32f078",
25+
feature = "stm32f098",
2526
))]
2627
pub use stm32f0::stm32f0x8 as stm32;
2728

src/serial.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ macro_rules! usart_pins {
122122
feature = "stm32f058",
123123
feature = "stm32f071",
124124
feature = "stm32f078",
125+
feature = "stm32f098",
125126
))]
126127
usart_pins! {
127128
USART1 => {
@@ -162,6 +163,7 @@ usart_pins! {
162163
feature = "stm32f072",
163164
feature = "stm32f078",
164165
feature = "stm32f091",
166+
feature = "stm32f098",
165167
))]
166168
usart_pins! {
167169
USART2 => {
@@ -173,7 +175,8 @@ usart_pins! {
173175
feature = "stm32f072",
174176
feature = "stm32f071",
175177
feature = "stm32f078",
176-
feature = "stm32f091"
178+
feature = "stm32f091",
179+
feature = "stm32f098",
177180
))]
178181
usart_pins! {
179182
USART2 => {
@@ -189,6 +192,7 @@ usart_pins! {
189192
feature = "stm32f072",
190193
feature = "stm32f078",
191194
feature = "stm32f091",
195+
feature = "stm32f098",
192196
))]
193197
usart_pins! {
194198
USART3 => {
@@ -206,6 +210,7 @@ usart_pins! {
206210
feature = "stm32f072",
207211
feature = "stm32f078",
208212
feature = "stm32f091",
213+
feature = "stm32f098",
209214
))]
210215
usart_pins! {
211216
USART3 => {
@@ -224,7 +229,7 @@ usart_pins! {
224229
// }
225230
// }
226231

227-
#[cfg(any(feature = "stm32f030xc", feature = "stm32f091"))]
232+
#[cfg(any(feature = "stm32f030xc", feature = "stm32f091", feature = "stm32f098"))]
228233
usart_pins! {
229234
USART5 => {
230235
tx => [gpiob::PB3<Alternate<AF4>>, gpioc::PC12<Alternate<AF2>>],
@@ -237,7 +242,7 @@ usart_pins! {
237242
}
238243
// TODO: The ST SVD files are missing the entire PE enable register.
239244
// Re-enable as soon as this gets fixed.
240-
#[cfg(feature = "stm32f091")]
245+
#[cfg(any(feature = "stm32f091", feature = "stm32f098"))]
241246
usart_pins! {
242247
// USART5 => {
243248
// tx => [gpioe::PE10<Alternate<AF1>>],
@@ -391,6 +396,7 @@ usart! {
391396
feature = "stm32f072",
392397
feature = "stm32f078",
393398
feature = "stm32f091",
399+
feature = "stm32f098",
394400
))]
395401
usart! {
396402
USART2: (usart2, usart2tx, usart2rx,usart2en, apb1enr),
@@ -402,12 +408,13 @@ usart! {
402408
feature = "stm32f072",
403409
feature = "stm32f078",
404410
feature = "stm32f091",
411+
feature = "stm32f098",
405412
))]
406413
usart! {
407414
USART3: (usart3, usart3tx, usart3rx,usart3en, apb1enr),
408415
USART4: (usart4, usart4tx, usart4rx,usart4en, apb1enr),
409416
}
410-
#[cfg(any(feature = "stm32f030xc", feature = "stm32f091"))]
417+
#[cfg(any(feature = "stm32f030xc", feature = "stm32f091", feature = "stm32f098"))]
411418
usart! {
412419
USART5: (usart5, usart5tx, usart5rx,usart5en, apb1enr),
413420
USART6: (usart6, usart6tx, usart6rx,usart6en, apb2enr),

src/spi.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ use crate::stm32::SPI1;
5656
feature = "stm32f071",
5757
feature = "stm32f078",
5858
feature = "stm32f091",
59+
feature = "stm32f098",
5960
))]
6061
use crate::stm32::SPI2;
6162

@@ -130,7 +131,8 @@ spi_pins! {
130131
// feature = "stm32f071",
131132
// feature = "stm32f072",
132133
// feature = "stm32f078",
133-
// feature = "stm32f091"
134+
// feature = "stm32f091",
135+
// feature = "stm32f098",
134136
// ))]
135137
// spi_pins! {
136138
// SPI1 => {
@@ -151,6 +153,7 @@ spi_pins! {
151153
feature = "stm32f072",
152154
feature = "stm32f078",
153155
feature = "stm32f091",
156+
feature = "stm32f098",
154157
))]
155158
spi_pins! {
156159
SPI2 => {
@@ -166,6 +169,7 @@ spi_pins! {
166169
feature = "stm32f072",
167170
feature = "stm32f078",
168171
feature = "stm32f091",
172+
feature = "stm32f098",
169173
))]
170174
spi_pins! {
171175
SPI2 => {
@@ -179,6 +183,7 @@ spi_pins! {
179183
feature = "stm32f072",
180184
feature = "stm32f078",
181185
feature = "stm32f091",
186+
feature = "stm32f098",
182187
))]
183188
spi_pins! {
184189
SPI2 => {
@@ -233,6 +238,7 @@ spi! {
233238
feature = "stm32f071",
234239
feature = "stm32f078",
235240
feature = "stm32f091",
241+
feature = "stm32f098",
236242
))]
237243
spi! {
238244
SPI2: (spi2, spi2en, spi2rst, apb1enr, apb1rstr),

src/timers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ timers! {
233233
feature = "stm32f072",
234234
feature = "stm32f078",
235235
feature = "stm32f091",
236+
feature = "stm32f098",
236237
))]
237238
timers! {
238239
TIM2: (tim2, tim2en, tim2rst, apb1enr, apb1rstr),
@@ -248,6 +249,7 @@ timers! {
248249
feature = "stm32f072",
249250
feature = "stm32f078",
250251
feature = "stm32f091",
252+
feature = "stm32f098",
251253
))]
252254
timers! {
253255
TIM6: (tim6, tim6en, tim6rst, apb1enr, apb1rstr),
@@ -260,6 +262,7 @@ timers! {
260262
feature = "stm32f072",
261263
feature = "stm32f078",
262264
feature = "stm32f091",
265+
feature = "stm32f098",
263266
))]
264267
timers! {
265268
TIM7: (tim7, tim7en, tim7rst, apb1enr, apb1rstr),

0 commit comments

Comments
 (0)