Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

SPI ST7789 Example#

Overview#

This sample shows the full flow for driving an ST7789 LCD panel through the RT-Smart HAL.

Source Location#

src/rtsmart/examples/peripheral/spi_st7789

Current Demo Behavior#

The main() function performs these steps:

  1. configure FPIOA and SPI pins

  2. create the LCD instance with SPI plus DC/RST/BL GPIO control

  3. initialize the ST7789 panel

  4. clear the screen and draw three colored strings

  5. show the frame for 5 seconds, then exit

Main APIs (following the current source)#

  • lcd_create()

  • lcd_configure()

  • lcd_init()

  • lcd_fill()

  • lcd_draw_string()

  • lcd_show()

  • lcd_destroy()

Default Pins and Parameters (hard-coded in the source)#

Use the default pin mapping and SPI-related parameters defined in the sample source unless your board requires changes.

Build Method#

cd src/rtsmart/examples/peripheral/spi_st7789
make

Run Example#

Run the built executable on the target board after copying it to the device.

Notes#

If your board uses a different panel connection or pin mapping, update the source before building.

Comments list
Comments
Log in