🇺🇸Adafruit will not be shipping orders on Independence Day Monday 7/4/2022. Please allow extra time for your order to ship and plan accordingly.🇺🇸
0

How to code LCDTFT on STM32F103RB Nucleo
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to code LCDTFT on STM32F103RB Nucleo

by coints111 on Mon May 23, 2022 7:08 am

I have bought a 2.8 TFT (ID:1651) and I want to connect the TFT to STM32F103RB Nucleo. Please help to tell me how to migrate the open source code to run STM32F1?
Thanks!

coints111
 
Posts: 3
Joined: Wed Dec 29, 2021 1:52 am

Re: How to code LCDTFT on STM32F103RB Nucleo

by adafruit_support_mike on Thu May 26, 2022 7:22 pm

It depends on how much of the code you want to use.

Our display libraries are based on a SPITFT class that's part of the GFX library. At minimum, display-specific libraries implement a .drawPixel() function that the GFX functions use to draw graphics primitives. Most display libraries also implement 'fast' functions that draw simple shapes like vertical and horizontal lines using code specifically for the display, and not going through the GFX primitive functions.

The GFX library also inherits the Print interface from the Arduino environment for handling text.

Porting the code to a new microcontroller is usually simple. At most, you should only need to modify the low-level functions that handle SPI communication between the microcontroller and the display. All of the other code is built on top of that, and should run on another microcontroller without needing any changes.

adafruit_support_mike
 
Posts: 64851
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.