Thursday, November 23rd 2017, 11:58am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

mastupristi

Beginner

Date of registration: Feb 18th 2016

Posts: 13

1

Monday, October 2nd 2017, 3:16pm

GUIDRV_Lin examples

Where can I find some example of how to use GUIDRV_Lin driver?

I use STM32F412 with STemWin. I want to make STemWin handle only one framebuffer in ram. then I will transfer the contents of the framebuffer to the LCD.

I have this:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define XSIZE_PHYS  128
#define YSIZE_PHYS  160


uint16_t frameBuffer[XSIZE_PHYS*YSIZE_PHYS] __attribute__ ((aligned (16)));

void LCD_X_Config(void) 
{
  //
  // Set display driver and color conversion
  //
  GUI_DEVICE_CreateAndLink(GUIDRV_LIN_16, // Display driver
		  	  GUICC_M565, // Color conversion
			  0, 0);
  //
  // Display driver configuration
  //
  LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); // Physical display size in pixels
  LCD_SetVSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); // Virtual display size in pixels
  LCD_SetVRAMAddrEx(0, (void *)frameBuffer); // Video RAM start address
}


C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
void main(void)
{
	GUI_Init();
	GUI_SetColor(GUI_RED);
	const GUI_POINT aPoints[] = {
		{ 0, 0},
		{ 0, 159},
		{ 127, 159},
		{ 127, 0},
	};
	GUI_DrawPolygon(aPoints, 4, 0,0);
}



after call to GUI_DrawPolygon() I check framebuffer conetent with debugger, and all is 0x00. It seems that the library has not modified the contents of the framebuffer.

Where am I wrong? what is missing in initialization? Should I set some functions for LCD_DEVFUNCBUFFER and/or LCD_DEVFUNCRECT and/or LCD_DEVFUNC_FILLRECT?

best regards
Max

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 414

2

Wednesday, October 4th 2017, 1:55pm

Hi,

You might use the LCDConf.c coming from ST or the one attached as a reference.

The ones of ST can be found in the STM32Cube packages in the project folder of a specific board. Like this one for the STM32F746-Discovery board:
\Projects\STM32746G-Discovery\Applications\STemWin\STemWin_HelloWorld\Src\LCDConf.c

Attached are two, one for a STM32F7xx and one for an STM32F4xx.

Regards
Sven
SEGGER - Schoenen has attached the following file:
  • LCDConf.zip (40.86 kB - 47 times downloaded - Last download: Yesterday, 6:29am)