cancel
Showing results for 
Search instead for 
Did you mean: 

Can code generated with TouchGFX work with BSP_LCD_

MNapi
Senior III

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.

7 REPLIES 7
Alexandre RENOUX
Principal

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
Senior III

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
Chief III

"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

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

here is the whole code

void Screen1ViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)

{

   if (&src == &button1)

   {

       //Interaction1

       //When button1 clicked change screen to Screen2

       //Go to Screen2 with no screen transition

       application().gotoScreen2ScreenNoTransition();

   }

   else if (&src == &button2)

   {

       //Interaction2

       //When button2 clicked execute C++ code

       //Execute C++ code

       HAL_GPIO_TogglePin(GPIOK, GPIO_PIN_3);

           HAL_Delay(500);

       //Interaction3

       //When button2 clicked execute C++ code

       //Execute C++ code

       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);

   }

}

is this something you can fix for me

Back from vacation, what's your status on this?

I never got it working. I assume I am missing something.

So I use BSP files to do graphics directly, skipping for now TouchGFX

I start in CubeMX and finish the code in Keil. I got all I need ADC and the graph. Something I cannot do in TouchGFX