Skip to main content

Crate st7305_lcd

Crate st7305_lcd 

Source
Expand description

Platform-independent no_std driver for the Sitronix ST7305 reflective LCD controller.

The driver talks 4-wire SPI through embedded_hal::spi::SpiDevice (chip select belongs to the device, not to the driver) and drives the DC and RST pins itself. It never configures the bus.

Both drivers can send a frame in two steps, begin_write_ram (the RAMWR command) and write_ram_data (the pixel bytes). With the async driver the transfer can then be overlapped with rendering of the next frame.

§Where is St7305?

The driver type is not re-exported at the crate root, because the blocking and the async driver share its name. Import it from the module you need: st7305_lcd::blocking::St7305 or st7305_lcd::asynch::St7305.

§Example

ⓘ
use st7305_lcd::{blocking::St7305, presets::WAVESHARE_RLCD_42};

// `spi` is an `embedded_hal::spi::SpiDevice`, `dc` and `rst` are
// `OutputPin`s, `delay` is a `DelayNs`.
let mut display = St7305::new(spi, dc, rst);
display.init_with(WAVESHARE_RLCD_42, &mut delay)?;
display.write_ram(&frame_bytes)?; // 15 000 bytes of GRAM data

Modules§

asynchasync
Async driver on embedded-hal-async.
blocking
Blocking driver on embedded-hal.
cmd
Typed ST7305 commands, one module per group of registers.
framebufferframebuffer
1 bpp frame buffer in the native GRAM layout of the panel.
instr
Command opcode table.
presets
Initialization tables for init_with.

Enums§

Error
Driver error. S is the SPI error type, P is the error type of the DC and RST pins.
InitStep
One step of an initialization table, see init_with of the drivers and presets.
PowerMode
Power mode of the panel, selected with set_power_mode.

Traits§

WriteCommand
A command that can be sent with write_command: an opcode and its parameter bytes.