4
4
5
5
pub use embedded_hal:: spi:: { Mode , Phase , Polarity } ;
6
6
7
- #[ cfg( feature = "stm32f042" ) ]
7
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
8
8
use crate :: stm32:: { RCC , SPI1 } ;
9
9
10
10
use crate :: gpio:: * ;
@@ -32,15 +32,15 @@ pub struct Spi<SPI, PINS> {
32
32
33
33
pub trait Pins < Spi > { }
34
34
35
- #[ cfg( feature = "stm32f042" ) ]
35
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
36
36
impl Pins < SPI1 >
37
37
for (
38
38
gpioa:: PA5 < Alternate < AF0 > > ,
39
39
gpioa:: PA6 < Alternate < AF0 > > ,
40
40
gpioa:: PA7 < Alternate < AF0 > > ,
41
41
)
42
42
{ }
43
- #[ cfg( feature = "stm32f042" ) ]
43
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
44
44
impl Pins < SPI1 >
45
45
for (
46
46
gpiob:: PB3 < Alternate < AF0 > > ,
@@ -49,7 +49,17 @@ impl Pins<SPI1>
49
49
)
50
50
{ }
51
51
52
- #[ cfg( feature = "stm32f042" ) ]
52
+ #[ cfg( feature = "stm32f030x6" ) ]
53
+ impl Pins < SPI1 >
54
+ for (
55
+ gpiob:: PB13 < Alternate < AF0 > > ,
56
+ gpiob:: PB14 < Alternate < AF0 > > ,
57
+ gpiob:: PB15 < Alternate < AF0 > > ,
58
+ )
59
+ {
60
+ }
61
+
62
+ #[ cfg( any( feature = "stm32f042" , feature = "stm32f030" ) ) ]
53
63
impl < PINS > Spi < SPI1 , PINS > {
54
64
pub fn spi1 < F > ( spi : SPI1 , pins : PINS , mode : Mode , speed : F , clocks : Clocks ) -> Self
55
65
where
@@ -128,7 +138,7 @@ impl<PINS> Spi<SPI1, PINS> {
128
138
}
129
139
}
130
140
131
- #[ cfg( feature = "stm32f042" ) ]
141
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
132
142
impl < PINS > :: embedded_hal:: spi:: FullDuplex < u8 > for Spi < SPI1 , PINS > {
133
143
type Error = Error ;
134
144
@@ -169,7 +179,7 @@ impl<PINS> ::embedded_hal::spi::FullDuplex<u8> for Spi<SPI1, PINS> {
169
179
}
170
180
}
171
181
172
- #[ cfg( feature = "stm32f042" ) ]
182
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
173
183
impl < PINS > :: embedded_hal:: blocking:: spi:: transfer:: Default < u8 > for Spi < SPI1 , PINS > { }
174
- #[ cfg( feature = "stm32f042" ) ]
184
+ #[ cfg( any ( feature = "stm32f042" , feature = "stm32f030" ) ) ]
175
185
impl < PINS > :: embedded_hal:: blocking:: spi:: write:: Default < u8 > for Spi < SPI1 , PINS > { }
0 commit comments