pub struct Builder { /* private fields */ }
Expand description
Builder struct. Driver options and interface are set using its methods.
Implementations§
source§impl Builder
impl Builder
sourcepub fn new() -> Self
pub fn new() -> Self
Create new builder with a default size of 128 x 64 pixels and no rotation.
sourcepub fn with_size(&self, display_size: DisplaySize) -> Self
pub fn with_size(&self, display_size: DisplaySize) -> Self
Set the size of the display. Supported sizes are defined by DisplaySize.
sourcepub fn with_i2c_addr(&self, i2c_addr: u8) -> Self
pub fn with_i2c_addr(&self, i2c_addr: u8) -> Self
Set the I2C address to use. Defaults to 0x3C which is the most common address. The other address specified in the datasheet is 0x3D. Ignored when using SPI interface.
sourcepub fn with_rotation(&self, rotation: DisplayRotation) -> Self
pub fn with_rotation(&self, rotation: DisplayRotation) -> Self
Set the rotation of the display to one of four values. Defaults to no rotation. Note that
90º and 270º rotations are not supported by
TerminalMode
.
sourcepub fn connect_i2c<I2C>(
&self,
i2c: I2C
) -> DisplayMode<RawMode<I2cInterface<I2C>>>where
I2C: Write,
pub fn connect_i2c<I2C>(
&self,
i2c: I2C
) -> DisplayMode<RawMode<I2cInterface<I2C>>>where
I2C: Write,
Finish the builder and use I2C to communicate with the display
sourcepub fn connect_spi<SPI, DC>(
&self,
spi: SPI,
dc: DC
) -> DisplayMode<RawMode<SpiInterface<SPI, DC>>>where
SPI: Transfer<u8> + Write<u8>,
DC: OutputPin,
pub fn connect_spi<SPI, DC>(
&self,
spi: SPI,
dc: DC
) -> DisplayMode<RawMode<SpiInterface<SPI, DC>>>where
SPI: Transfer<u8> + Write<u8>,
DC: OutputPin,
Finish the builder and use SPI to communicate with the display