[][src]Module ssd1306::interface

SSD1306 Communication Interface (I2C/SPI)

These are the two supported interfaces for communicating with the display. They're used by the builder methods connect_i2c and connect_spi.

The types that these interfaces define are quite lengthy, so it is recommended that you create a type alias. Here's an example for the I2C1 on an STM32F103xx:

use ssd1306::{interface::I2cInterface, prelude::*};
type OledDisplay =
  GraphicsMode<I2cInterface<I2c<I2C1, (PB8<Alternate<OpenDrain>>, PB9<Alternate<OpenDrain>>)>>>;

Example

Here's one for SPI1 on an STM32F103xx:

use ssd1306::{interface::SpiInterface, prelude::*};
pub type OledDisplay = GraphicsMode<
    SpiInterface<
        Spi<
            SPI1,
            (
                PA5<Alternate<PushPull>>,
                PA6<Input<Floating>>,
                PA7<Alternate<PushPull>>,
            ),
        >,
        PB1<Output<PushPull>>,
    >,
>;

Example

Re-exports

pub use self::i2c::I2cInterface;
pub use self::spi::SpiInterface;

Modules

i2c

SSD1306 I2C Interface

spi

SSD1306 SPI interface

Traits

DisplayInterface

A method of communicating with SSD1306