Skip to main content
MNapi
Senior II
July 8, 2020
Question

Can code generated with TouchGFX work with BSP_LCD_

  • July 8, 2020
  • 3 replies
  • 1263 views

I wonder if there is going to be any code conflict if I generate graphics it TouchGFX and the use

codes like BSP_LCD_DrawLine in While() loop

can those two work together ?

I want to get some of the discovery boards and work on a few projects.

This topic has been closed for replies.

3 replies

Alexandre RENOUX
Visitor II
July 9, 2020

Hello,

Why do you want to use BSP_LCD_Drawline ? TouchGFX takes care of the update of the screen.

If you intend on getting some discovery boards, I suggest you to use the Application Templates for those boards available in TouchGFX Designer.

/Alexandre

MNapi
MNapiAuthor
Senior II
July 9, 2020

I would like to make project in TouchGFX and Cube IDE and use all the codes of drawing objects with BSP_LCD_ when I type my custom C++ code. But the BSP library will not compile with projects generated with TouchGFX and Cube IDE.

TouchGFX and Cube IDE looks like easy way to do things but you still need to add some code to your project.

Martin KJELDSEN
Principal III
July 17, 2020

"But the BSP library will not compile with projects generated with TouchGFX and Cube IDE."

Please be more specific.

Generally, you can use anything you want to draw into the framebuffer if you create a custom widget - TouchGFX is running in a task and event loop of its own, so you can't hijack it with your own while loop and rendering code. But you can use the BSP code to draw a line to some memory if you wish. Check out the Lens example for how to create a custom widget that draws on its own into the framebuffer.

/Martin

MNapi
MNapiAuthor
Senior II
July 18, 2020

Martin I managed to compile it without errors

button is clicked

I have

#include "stm32f4xx_hal.h"

 BSP_LCD_SetTextColor(LCD_COLOR_RED);

 BSP_LCD_SetBackColor(LCD_COLOR_YELLOW);

  BSP_LCD_SetFont(&Font24);

  BSP_LCD_DisplayStringAt(0, 0, (uint8_t*) "Hello world!", CENTER_MODE);

but nothing happens