#embedded-graphics #lcd-display #tft #driver #connect #st7789

st7789-lcd

ST7789 TFT LCD driver with embedded-graphics support

2 releases

0.1.1 Oct 5, 2024
0.1.0 Aug 19, 2024

#402 in Hardware support

Download history 98/week @ 2024-08-13 48/week @ 2024-08-20 8/week @ 2024-09-10 6/week @ 2024-09-17 10/week @ 2024-09-24 161/week @ 2024-10-01 31/week @ 2024-10-08 3/week @ 2024-10-15

198 downloads per month

MIT license

19KB
461 lines

ST7789 LCD

ST7789 driver to connect to TFT displays, with embedded-graphics support

Usage

let mut nss = Pin::new(PortNum::PA, PinNum::Pin15).into_output(PinModeOutput::OutPP);
nss.set_high().ok();

let dc = Pin::new(PortNum::PB, PinNum::Pin6).into_output(PinModeOutput::OutPP);
let rst = Pin::new(PortNum::PF, PinNum::Pin7).into_output(PinModeOutput::OutPP);
let _sck = Pin::new(PortNum::PB, PinNum::Pin3).into_alternate(PinModeAlternate::AF(0));
let _mosi = Pin::new(PortNum::PB, PinNum::Pin5).into_alternate(PinModeAlternate::AF(0));

let spi_cfg = spi::Config::default();
let _spi_bus = SpiBus::new(SpiBusId::Bus1, &spi_cfg);
let lcd_spi = _spi_bus.to_device(nss);

let mut disp = ST7789::<_, _, _, 280, 240, 20, 0>::new(lcd_spi, dc, rst);

let mut disp_delay = Delay::new();
disp.init(&mut disp_delay, Orientation::Portrait, true, true).ok();
disp.clear(Rgb565::BLACK).ok();

Text::new("Hello world!", POS, ch_style).draw(&mut disp).ok();

lib.rs:

This crate provides a ST7789 driver to connect to TFT displays.

Dependencies

~550KB