@@ -23,8 +23,6 @@ use tinybmp::Bmp;
2323
2424use mipidsi:: options:: ColorInversion ;
2525
26- // It is important to define display offsets and size so that
27- // the image and the text renders correctly on the display
2826const DISPLAY_OFFSET : ( u16 , u16 ) = ( 52 , 40 ) ;
2927const DISPLAY_SIZE : ( u16 , u16 ) = ( 135 , 240 ) ;
3028
@@ -35,15 +33,10 @@ fn main() -> Result<(), Box<dyn Error>> {
3533 let peripherals = Peripherals :: take ( ) ?;
3634
3735 // Turn on display backlight
38- // GPIO configuration here works simillarly as in C++ coding paradigm
39- // Select the role of the pin (here output)
40- // and then set the pin to the wanted state (here high)
4136 let mut backlight = PinDriver :: output ( peripherals. pins . gpio4 ) ?;
4237 backlight. set_high ( ) ?;
4338
44- // Define SPI configuration
45- // Before the initialization the display,
46- // first define the SPI pin configuration
39+ // Configure SPI
4740 let config = SpiConfig :: new ( ) . baudrate ( 26 . MHz ( ) . into ( ) ) . data_mode ( MODE_3 ) ;
4841 let spi_device = SpiDeviceDriver :: new_single (
4942 peripherals. spi2 ,
@@ -62,8 +55,6 @@ fn main() -> Result<(), Box<dyn Error>> {
6255 ) ;
6356
6457 // Configure display
65- // Here, the display is finally initialized
66- // The device used is ST7789
6758 let mut delay = Ets ;
6859 let mut display = Builder :: new ( ST7789 , spi_interface)
6960 . invert_colors ( ColorInversion :: Inverted )
0 commit comments