diff options
Diffstat (limited to 'embassy-embedded-hal/src/shared_bus/blocking/spi.rs')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/blocking/spi.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs index a61326594..a48d9183c 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs | |||
| @@ -6,11 +6,11 @@ | |||
| 6 | //! use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; | 6 | //! use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; |
| 7 | //! use embassy_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; | 7 | //! use embassy_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; |
| 8 | //! | 8 | //! |
| 9 | //! static SPI_BUS: Forever<NoopMutex<RefCell<Spim<SPI3>>>> = Forever::new(); | 9 | //! static SPI_BUS: StaticCell<NoopMutex<RefCell<Spim<SPI3>>>> = StaticCell::new(); |
| 10 | //! let irq = interrupt::take!(SPIM3); | 10 | //! let irq = interrupt::take!(SPIM3); |
| 11 | //! let spi = Spim::new_txonly(p.SPI3, irq, p.P0_15, p.P0_18, Config::default()); | 11 | //! let spi = Spim::new_txonly(p.SPI3, irq, p.P0_15, p.P0_18, Config::default()); |
| 12 | //! let spi_bus = NoopMutex::new(RefCell::new(spi)); | 12 | //! let spi_bus = NoopMutex::new(RefCell::new(spi)); |
| 13 | //! let spi_bus = SPI_BUS.put(spi_bus); | 13 | //! let spi_bus = SPI_BUS.init(spi_bus); |
| 14 | //! | 14 | //! |
| 15 | //! // Device 1, using embedded-hal compatible driver for ST7735 LCD display | 15 | //! // Device 1, using embedded-hal compatible driver for ST7735 LCD display |
| 16 | //! let cs_pin1 = Output::new(p.P0_24, Level::Low, OutputDrive::Standard); | 16 | //! let cs_pin1 = Output::new(p.P0_24, Level::Low, OutputDrive::Standard); |
