cancel
Showing results for 
Search instead for 
Did you mean: 

emWin works well with MEMDEV, and does not work well without MEMDEV

Electron-M
Associate

Hello,

I am writing to you because I need help to solve my problem.

Here is the situation:

I am learning to use emWin. I use an OLed screen with an SSD1305 controller. it's a monochrome screen.

Currently I communicate by SPI bus.

ST does not provide a driver for this type of screen. So I wrote a driver.

emWin works very well, buttons, animations, keyboard ...

0693W000000W3USQA0.jpg

However, for everything to work well I need to use MEMDEV.

If I don't configure a MEMDEV, emWin does not show me all the elements.

The animation works but when I hide window n°2, only the animated part of window n°1 hides window n°2

The window n ° 2 is of dimension 45x64

0693W000000W3XgQAK.jpg

0693W000000W3Y0QAK.jpg

0693W000000W3Y5QAK.jpg

I would like to know, if I don't want to use a MEMDEV, do I need a specific setting? I have been searching for several days, without results, and I cannot understand why such behavior.

void LCD_X_Config(void) {
	GUI_DEVICE * pDevice={0};
	GUI_PORT_API PortAPI={0};
 
	//
	// Set display driver and color conversion for 1st layer
	//
	pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
 
	//
	// Display driver configuration
	//
	LCD_SetSizeEx    (0, XSIZE_PHYS,   YSIZE_PHYS);
	LCD_SetVSizeEx   (0, VXSIZE_PHYS,  VYSIZE_PHYS);
	LCD_SetVRAMAddrEx(0, (void *)VRAM);
 
	//
	// Set user palette data (only required if no fixed palette is used)
	//
	#if defined(PALETTE)
	LCD_SetLUTEx(0, PALETTE);
	#endif
 
	PortAPI.pfWrite8_A0		= fct_ssd1305_spi_ecr_cmd;
	PortAPI.pfWrite8_A1		= fct_ssd1305_spi_ecr_data;
	PortAPI.pfWriteM8_A0		= fct_ssd1305_spi_ecr_cmd_M;
	PortAPI.pfWriteM8_A1		= fct_ssd1305_spi_ecr_data_M;
 
	GUIDRV_SSD1305_SPI_SetFunc(pDevice, &PortAPI);
}
int init_emwin(void)
{
	int erreur=1;
 
 
	//=============================
	//intialisation du GUI
	WM_SetCreateFlags(WM_CF_MEMDEV);
	GUI_Init();
	GUI_Clear();
	GUI_UC_SetEncodeUTF8();
 
	//=============================
	//création d'un MEMDEV pour
	//le gestionnaire de fenêtres
	GUI_MEMDEV_Handle hMem;
	hMem=GUI_MEMDEV_CreateFixed(0, 0, 128, 64, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_1, GUICC_1);
	if(hMem) erreur=0;
...

If you need more details, I am at your disposal.

0 REPLIES 0