@@ -8,9 +8,13 @@ pub use embedded_hal::spi::{Mode, Phase, Polarity};
8
8
use crate :: stm32;
9
9
// TODO Put this inside the macro
10
10
// Currently that causes a compiler panic
11
- #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" ) ) ]
11
+ #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" , feature = "stm32f070" ) ) ]
12
12
use crate :: stm32:: SPI1 ;
13
- #[ cfg( any( feature = "stm32f030x8" , feature = "stm32f030xc" ) ) ]
13
+ #[ cfg( any(
14
+ feature = "stm32f030x8" ,
15
+ feature = "stm32f030xc" ,
16
+ feature = "stm32f070xb"
17
+ ) ) ]
14
18
use crate :: stm32:: SPI2 ;
15
19
16
20
use crate :: gpio:: * ;
@@ -60,7 +64,7 @@ macro_rules! spi_pins {
60
64
}
61
65
}
62
66
63
- #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" ) ) ]
67
+ #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" , feature = "stm32f070" ) ) ]
64
68
spi_pins ! {
65
69
SPI1 => {
66
70
sck => [ gpioa:: PA5 <Alternate <AF0 >>, gpiob:: PB3 <Alternate <AF0 >>] ,
@@ -76,15 +80,19 @@ spi_pins! {
76
80
mosi => [ gpiob:: PB15 <Alternate <AF0 >>] ,
77
81
}
78
82
}
79
- #[ cfg( any( feature = "stm32f030x8" , feature = "stm32f030xc" ) ) ]
83
+ #[ cfg( any(
84
+ feature = "stm32f030x8" ,
85
+ feature = "stm32f030xc" ,
86
+ feature = "stm32f070xb"
87
+ ) ) ]
80
88
spi_pins ! {
81
89
SPI2 => {
82
90
sck => [ gpiob:: PB13 <Alternate <AF0 >>] ,
83
91
miso => [ gpiob:: PB14 <Alternate <AF0 >>] ,
84
92
mosi => [ gpiob:: PB15 <Alternate <AF0 >>] ,
85
93
}
86
94
}
87
- #[ cfg( feature = "stm32f030xc" ) ]
95
+ #[ cfg( any ( feature = "stm32f030xc" , feature = "stm32f070xb" ) ) ]
88
96
spi_pins ! {
89
97
SPI2 => {
90
98
sck => [ gpiob:: PB10 <Alternate <AF5 >>] ,
@@ -126,11 +134,15 @@ macro_rules! spi {
126
134
}
127
135
}
128
136
129
- #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" ) ) ]
137
+ #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" , feature = "stm32f070" ) ) ]
130
138
spi ! {
131
139
SPI1 : ( spi1, spi1en, spi1rst, apb2enr, apb2rstr) ,
132
140
}
133
- #[ cfg( any( feature = "stm32f030x8" , feature = "stm32f030xc" ) ) ]
141
+ #[ cfg( any(
142
+ feature = "stm32f030x8" ,
143
+ feature = "stm32f030xc" ,
144
+ feature = "stm32f070xb"
145
+ ) ) ]
134
146
spi ! {
135
147
SPI2 : ( spi2, spi2en, spi2rst, apb1enr, apb1rstr) ,
136
148
}
0 commit comments