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.
blocking::St7305: blocking driver onembedded-hal.asynch::St7305(featureasync): the same API onembedded-hal-async.framebuffer(featureframebuffer): 1 bpp frame buffer in the GRAM layout of the panel with runtimeRotationand anembedded-graphicsDrawTarget, andWindowfor partial updates (write_window).cmd: typed commands forwrite_command, andpresets: ready-made initialization tables forinit_with.
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 dataModules§
- asynch
async - Async driver on
embedded-hal-async. - blocking
- Blocking driver on
embedded-hal. - cmd
- Typed ST7305 commands, one module per group of registers.
- framebuffer
framebuffer - 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.
Sis the SPI error type,Pis the error type of theDCandRSTpins. - Init
Step - One step of an initialization table, see
init_withof the drivers andpresets. - Power
Mode - Power mode of the panel, selected with
set_power_mode.
Traits§
- Write
Command - A command that can be sent with
write_command: an opcode and its parameter bytes.