2021-05-30 01:51 PM
STemWin v5.44 do not support NT35510 based TFTs. But it possible to rewrite LCDConf_FlexColor.c and TFT working good. But problem found with text output by GUI_ functions. This pcs of code from STemWin manual working wrong and produce the result like in the pic. On the pic left is right output, on the right - from my TFT. What is wrong here?
// UM03001_v6.18.pdf page215 text output snippet
GUI_SetFont(&GUI_Font8x16);
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
GUI_SetPenSize(10);
GUI_SetColor(GUI_RED);
GUI_DrawLine(80, 10, 240, 90);
GUI_DrawLine(80, 90, 240, 10);
GUI_SetBkColor(GUI_BLACK);
GUI_SetColor(GUI_WHITE);
GUI_SetTextMode(GUI_TM_NORMAL);
GUI_DispStringHCenterAt("GUI_TM_NORMAL", 160, 20);
GUI_SetTextMode(GUI_TM_REV);
GUI_DispStringHCenterAt("GUI_TM_REV", 160, 36);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DispStringHCenterAt("GUI_TM_TRANS", 160, 52);
GUI_SetTextMode(GUI_TM_XOR);
GUI_DispStringHCenterAt("GUI_TM_XOR", 160, 68);
GUI_SetTextMode(GUI_TM_TRANS | GUI_TM_REV);
GUI_DispStringHCenterAt("GUI_TM_TRANS | GUI_TM_REV", 160, 84);
2021-05-31 07:41 AM
Hello @Community member ,
Are you enabled clock for CRC module ?
The CRC must be enabled before calling GUI_Init, if not STemWin will be not function.
Note that GUI_Init must be called before any STemWin function is used.
This is mentioned in the AN4323 to call GUI_Init function prior to use any STemWin function or GUI routines:
"
To initialize the STemWin internal data structures and variables, GUI_Init() should be used.
Note that before initializing the GUI, the CRC module (in RCC peripheral clock enable register) should be enabled.
"
Hope this helps you, and please keep me informed about the progress on your issue.
-When your question is answered, please close this topic by choosing "Select as Best". This will help other users find that answer faster-
Imen
2021-05-31 09:12 AM
Hi!
As you can see some text output functions is work OK, therefore CRC is enabled.
I test most of the STemWin v5.44 functionality (windows, buttons, text vidgets...) and found it's all working good.
There are only TWO things do not work: text output with GUI_TM_NORMAL and GUI_TM_REV modes.
It can be subject of NT35510 low level init, but I not so awesome to find a point of this problem....
2021-05-31 09:48 AM
My TFT: http://www.lcdwiki.com/3.97inch_16BIT_Module_NT35510_SKU:MRB3973
TFT connection: STM32F103VET6, FSMC 16bit.
This is only what we need to "support" NT35510 in LCDConf_FlexColor.c file:
/********************************************************************
*
* LcdWriteReg
*
* Function description:
* Sets display register
*/
uint16_t cmd; // current cmd
uint8_t i; // current cmd parameter
static void LcdWriteReg(U16 Data) {
// ... TBD by user
Data <<= 8;cmd = Data;i=0;
*(uint16_t *)ADR_CMD = Data;
}
/********************************************************************
*
* LcdWriteData
*
* Function description:
* Writes a value to a display register
*/
static void LcdWriteData(U16 Data) {
// ... TBD by user
if (i == 0){// first cmd parameter for output
*(uint16_t *)ADR_DAT = Data;
}else{// cmd and it next parameter for output in NT35510 format
*(uint16_t *)ADR_CMD = cmd+i;*(uint16_t *)ADR_DAT = Data;
}
i++;
}
/********************************************************************
Also I use this version of LCD_X_Config func:
void LCD_X_Config(void) {
GUI_DEVICE * pDevice;
CONFIG_FLEXCOLOR Config = {0};
GUI_PORT_API PortAPI = {0};
// Set display driver and color conversion
pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR,GUICC_M565,0,0);
// Display driver configuration
LCD_SetSizeEx(0,YSIZE_PHYS,XSIZE_PHYS);
LCD_SetVSizeEx(0,VYSIZE_PHYS,VXSIZE_PHYS);
// Orientation
Config.Orientation = GUI_ROTATION_CW;// STemWin v5.44 only
//Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_X;// STemWin v5.32 only
//Config.Orientation = GUI_SWAP_XY;
GUIDRV_FlexColor_Config(pDevice,&Config);
// Set controller and operation mode
PortAPI.pfWrite16_A0 = LcdWriteReg;
PortAPI.pfWrite16_A1 = LcdWriteData;
PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
GUIDRV_FlexColor_SetFunc(pDevice,&PortAPI,GUIDRV_FLEXCOLOR_F66709,GUIDRV_FLEXCOLOR_M16C0B16);
}
And this working OK for all, except the text output in two modes, mentioned above.
Some suggestions to fix this problem are welcome...
2021-05-31 09:55 AM
2021-06-01 02:00 AM