|
3 | 3 | To construct the SPI instances, use the `Spi::spiX` functions.
|
4 | 4 |
|
5 | 5 | The pin parameter is a tuple containing `(sck, miso, mosi)` which should be configured as `(Alternate<PushPull>, Input<Floating>, Alternate<PushPull>)`.
|
| 6 | + As some STM32F1xx chips have 5V tolerant SPI pins, it is also possible to configure Sck and Mosi outputs as `Alternate<PushPull>`. Then |
| 7 | + a simple Pull-Up to 5V can be used to use SPI on a 5V bus without a level shifter. |
6 | 8 |
|
7 | 9 | You can also use `NoSck`, `NoMiso` or `NoMosi` if you don't want to use the pins
|
8 | 10 |
|
@@ -48,7 +50,7 @@ use crate::gpio::gpioa::{PA5, PA6, PA7};
|
48 | 50 | use crate::gpio::gpiob::{PB13, PB14, PB15, PB3, PB4, PB5};
|
49 | 51 | #[cfg(feature = "connectivity")]
|
50 | 52 | use crate::gpio::gpioc::{PC10, PC11, PC12};
|
51 |
| -use crate::gpio::{Alternate, Floating, Input, PushPull}; |
| 53 | +use crate::gpio::{Alternate, Floating, Input, OpenDrain, PushPull}; |
52 | 54 | use crate::rcc::{Clocks, Enable, GetBusFreq, Reset, APB1, APB2};
|
53 | 55 | use crate::time::Hertz;
|
54 | 56 |
|
@@ -144,8 +146,10 @@ macro_rules! remap {
|
144 | 146 | const REMAP: bool = $state;
|
145 | 147 | }
|
146 | 148 | impl Sck<$name> for $SCK<Alternate<PushPull>> {}
|
| 149 | + impl Sck<$name> for $SCK<Alternate<OpenDrain>> {} |
147 | 150 | impl Miso<$name> for $MISO<Input<Floating>> {}
|
148 | 151 | impl Mosi<$name> for $MOSI<Alternate<PushPull>> {}
|
| 152 | + impl Mosi<$name> for $MOSI<Alternate<OpenDrain>> {} |
149 | 153 | };
|
150 | 154 | }
|
151 | 155 |
|
|
0 commit comments