|
10 | 10 |
|
11 | 11 | - `SPI1` can use `(PA5, PA6, PA7)` or `(PB3, PB4, PB5)`.
|
12 | 12 | - `SPI2` can use `(PB13, PB14, PB15)`
|
13 |
| - - `SPI3` can use `(PB3, PB4, PB5)` or `(PC10, PC11, PC12)` |
| 13 | + - `SPI3` can use `(PB3, PB4, PB5)` or only in connectivity line devices `(PC10, PC11, PC12)` |
14 | 14 |
|
15 | 15 |
|
16 | 16 | ## Initialisation example
|
@@ -156,7 +156,7 @@ macro_rules! remap {
|
156 | 156 | remap!(Spi1NoRemap, SPI1, false, PA5, PA6, PA7);
|
157 | 157 | remap!(Spi1Remap, SPI1, true, PB3, PB4, PB5);
|
158 | 158 | remap!(Spi2NoRemap, SPI2, false, PB13, PB14, PB15);
|
159 |
| -#[cfg(feature = "high")] |
| 159 | +#[cfg(any(feature = "high", feature = "connectivity"))] |
160 | 160 | remap!(Spi3NoRemap, SPI3, false, PB3, PB4, PB5);
|
161 | 161 | #[cfg(feature = "connectivity")]
|
162 | 162 | remap!(Spi3Remap, SPI3, true, PC10, PC11, PC12);
|
@@ -215,13 +215,38 @@ impl<REMAP, PINS> Spi<SPI2, REMAP, PINS, u8> {
|
215 | 215 |
|
216 | 216 | #[cfg(any(feature = "high", feature = "connectivity"))]
|
217 | 217 | impl<REMAP, PINS> Spi<SPI3, REMAP, PINS, u8> {
|
| 218 | + /** |
| 219 | + Constructs an SPI instance using SPI3 in 8bit dataframe mode. |
| 220 | +
|
| 221 | + The pin parameter tuple (sck, miso, mosi) should be `(PB3, PB4, PB5)` configured as `(Alternate<PushPull>, Input<Floating>, Alternate<PushPull>)`. |
| 222 | +
|
| 223 | + You can also use `NoSck`, `NoMiso` or `NoMosi` if you don't want to use the pins |
| 224 | + */ |
| 225 | + #[cfg(not(feature = "connectivity"))] |
| 226 | + pub fn spi3<F, POS>( |
| 227 | + spi: SPI3, |
| 228 | + pins: PINS, |
| 229 | + mode: Mode, |
| 230 | + freq: F, |
| 231 | + clocks: Clocks, |
| 232 | + apb: &mut APB1, |
| 233 | + ) -> Self |
| 234 | + where |
| 235 | + F: Into<Hertz>, |
| 236 | + REMAP: Remap<Periph = SPI3>, |
| 237 | + PINS: Pins<REMAP, POS>, |
| 238 | + { |
| 239 | + Spi::<SPI3, _, _, u8>::_spi(spi, pins, mode, freq.into(), clocks, apb) |
| 240 | + } |
| 241 | + |
218 | 242 | /**
|
219 | 243 | Constructs an SPI instance using SPI3 in 8bit dataframe mode.
|
220 | 244 |
|
221 | 245 | The pin parameter tuple (sck, miso, mosi) should be `(PB3, PB4, PB5)` or `(PC10, PC11, PC12)` configured as `(Alternate<PushPull>, Input<Floating>, Alternate<PushPull>)`.
|
222 | 246 |
|
223 | 247 | You can also use `NoSck`, `NoMiso` or `NoMosi` if you don't want to use the pins
|
224 | 248 | */
|
| 249 | + #[cfg(feature = "connectivity")] |
225 | 250 | pub fn spi3<F, POS>(
|
226 | 251 | spi: SPI3,
|
227 | 252 | pins: PINS,
|
|
0 commit comments