Skip to main content

Crate embassy_st7789v

Crate embassy_st7789v 

Source
Expand description

§embassy-st7789v

Pilote async no_std pour l’écran TFT LCD ST7789V 240×320 via SPI, basé sur Embassy.

§Fonctionnalités

  • Couleurs RGB565 avec constantes nommées
  • fill_screen, fill_rect, draw_rect
  • draw_pixel, draw_hline, draw_vline
  • Police bitmap 5×7 intégrée : ASCII, chiffres, symboles
  • draw_str, draw_i16, draw_u32, draw_f32
  • Texte mis à l’échelle avec draw_char_scaled et draw_str_scaled
  • Rendu de bitmap 1 bit via draw_bitmap
  • Réinitialisation matérielle et logicielle
  • Contrôle de l’orientation (MADCTL) et de l’inversion
  • Zéro allocation : forbid(unsafe_code)

§Câblage (exemple RP2350)

ÉcranGPIOPin physique
VDD3.3V
GNDGND
SCLGP18Pin 24
SDAGP19Pin 25
DCGP16Pin 21
CSGP20Pin 26
RESETGP17Pin 22

§Démarrage rapide

use embassy_st7789v::{Color, St7789v};

let mut ecran = St7789v::new(spi_device, broche_dc, broche_rst);
ecran.init().await.unwrap();
ecran.fill_screen(Color::BLACK).await.unwrap();
ecran.draw_str(8, 10, b"BONJOUR MONDE", Color::WHITE, Color::BLACK).await.unwrap();

Structs§

Color
Valeur de couleur RGB565 pour l’écran ST7789V.
NoPin
Broche fictive utilisée quand aucune broche de réinitialisation matérielle n’est disponible.
St7789v
Pilote async pour l’écran TFT LCD ST7789V 240×320.

Constants§

SCREEN_H
Hauteur de l’écran en pixels.
SCREEN_W
Largeur de l’écran en pixels.