@@ -94,18 +94,26 @@ usart_pins! {
94
94
rx => [ gpioa:: PA3 <Alternate <AF1 >>, gpioa:: PA15 <Alternate <AF1 >>] ,
95
95
}
96
96
}
97
+ #[ cfg( feature = "stm32f070" ) ]
98
+ usart_pins ! {
99
+ USART1 => {
100
+ tx => [ gpioa:: PA9 <Alternate <AF1 >>, gpiob:: PB6 <Alternate <AF0 >>] ,
101
+ rx => [ gpioa:: PA10 <Alternate <AF1 >>, gpiob:: PB7 <Alternate <AF0 >>] ,
102
+ }
103
+ }
97
104
#[ cfg( any(
98
105
feature = "stm32f042" ,
99
106
feature = "stm32f030x8" ,
100
107
feature = "stm32f030xc" ,
108
+ feature = "stm32f070" ,
101
109
) ) ]
102
110
usart_pins ! {
103
111
USART2 => {
104
112
tx => [ gpioa:: PA2 <Alternate <AF1 >>, gpioa:: PA14 <Alternate <AF1 >>] ,
105
113
rx => [ gpioa:: PA3 <Alternate <AF1 >>, gpioa:: PA15 <Alternate <AF1 >>] ,
106
114
}
107
115
}
108
- #[ cfg( feature = "stm32f030xc" ) ]
116
+ #[ cfg( any ( feature = "stm32f030xc" , feature = "stm32f070xb" ) ) ]
109
117
usart_pins ! {
110
118
USART3 => {
111
119
// According to the datasheet PB10 is both tx and rx, but in stm32cubemx it's only tx
@@ -116,6 +124,9 @@ usart_pins! {
116
124
tx => [ gpioa:: PA0 <Alternate <AF4 >>, gpioc:: PC10 <Alternate <AF0 >>] ,
117
125
rx => [ gpioa:: PA1 <Alternate <AF4 >>, gpioc:: PC11 <Alternate <AF0 >>] ,
118
126
}
127
+ }
128
+ #[ cfg( feature = "stm32f030xc" ) ]
129
+ usart_pins ! {
119
130
USART5 => {
120
131
tx => [ gpiob:: PB3 <Alternate <AF4 >>, gpioc:: PC12 <Alternate <AF2 >>] ,
121
132
rx => [ gpiob:: PB4 <Alternate <AF4 >>, gpiod:: PD2 <Alternate <AF2 >>] ,
@@ -179,22 +190,26 @@ macro_rules! usart {
179
190
}
180
191
}
181
192
182
- #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" ) ) ]
193
+ #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" , feature = "stm32f070" ) ) ]
183
194
usart ! {
184
195
USART1 : ( usart1, usart1en, apb2enr) ,
185
196
}
186
197
#[ cfg( any(
187
198
feature = "stm32f042" ,
188
199
feature = "stm32f030x8" ,
189
- feature = "stm32f030xc"
200
+ feature = "stm32f030xc" ,
201
+ feature = "stm32f070" ,
190
202
) ) ]
191
203
usart ! {
192
204
USART2 : ( usart2, usart2en, apb1enr) ,
193
205
}
194
- #[ cfg( any( feature = "stm32f030xc" ) ) ]
206
+ #[ cfg( any( feature = "stm32f030xc" , feature = "stm32f070xb" ) ) ]
195
207
usart ! {
196
208
USART3 : ( usart3, usart3en, apb1enr) ,
197
209
USART4 : ( usart4, usart4en, apb1enr) ,
210
+ }
211
+ #[ cfg( feature = "stm32f030xc" ) ]
212
+ usart ! {
198
213
USART5 : ( usart5, usart5en, apb1enr) ,
199
214
USART6 : ( usart6, usart6en, apb2enr) ,
200
215
}
0 commit comments