monjiemegoo
Newbie level 6
hellow guys
i have a JHD-TFT1.8 inch lcd with st7735 driver in it. and also i have a stm32f103ve microcntroller. i want to run emwin on my lcd and i dont want use external ram. i use keil and range of internal ram in keil is started at 0x20000000 and the size of ram is 0x10000.
first of all i wanna know is is possible to run emwin without external ram in this system.
second if it is possible how i can do it ?
emwin for config have to file : lcdconfig.c and guiconfig.c. i config emwin in past for lpc1788. back there i have external ram for graphical memory but now i wanna use internal ram Addresses. here is my code. but i code crash in gui_init functin. what shoud i do?
//guiconfig.c
//lcdconfig.c
//main.c
i have a JHD-TFT1.8 inch lcd with st7735 driver in it. and also i have a stm32f103ve microcntroller. i want to run emwin on my lcd and i dont want use external ram. i use keil and range of internal ram in keil is started at 0x20000000 and the size of ram is 0x10000.
first of all i wanna know is is possible to run emwin without external ram in this system.
second if it is possible how i can do it ?
emwin for config have to file : lcdconfig.c and guiconfig.c. i config emwin in past for lpc1788. back there i have external ram for graphical memory but now i wanna use internal ram Addresses. here is my code. but i code crash in gui_init functin. what shoud i do?
//guiconfig.c
Code C - [expand] 1 2 3 4 5 6 7 8 #include "GUI.h" #define EXTERNAL_RAM_BASE_ADDRESS 0x20005000 volatile unsigned long *emwin_memory_pointer = (unsigned long *)(EXTERNAL_RAM_BASE_ADDRESS + 20 * 1024); #define EMWIN_MEMORY_SIZE (20 * 1024 ) void GUI_X_Config(void) { GUI_ALLOC_AssignMemory(emwin_memory_pointer, EMWIN_MEMORY_SIZE); }
//lcdconfig.c
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 #include "GUI.h" #include "GUIDRV_Lin.h" #include "GUIDRV_FlexColor.H" #include "st7735.h" #define XSIZE_PHYS 160 #define YSIZE_PHYS 128 #define EXTERNAL_RAM_BASE_ADDRESS 0x20005000 #define VRAM_ADDR EXTERNAL_RAM_BASE_ADDRESS #define COLOR_CONVERSION GUICC_8 #define DISPLAY_DRIVER GUIDRV_LIN_4 #ifndef VRAM_ADDR #define VRAM_ADDR 0 #endif #ifndef XSIZE_PHYS #error Physical X size of display is not defined! #endif #ifndef YSIZE_PHYS #error Physical Y size of display is not defined! #endif #ifndef COLOR_CONVERSION #error Color conversion not defined! #endif #ifndef DISPLAY_DRIVER #error No display driver defined! #endif static void _InitController(void) { ST7735_Init(); } void LCD_X_Config(void) { GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); if (LCD_GetSwapXY()) { LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS); LCD_SetVSizeEx(0, YSIZE_PHYS, XSIZE_PHYS); } else { LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS); LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS); } LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR); } int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) { switch (Cmd) { case LCD_X_INITCONTROLLER: _InitController(); break; } GUI_USE_PARA(LayerIndex); GUI_USE_PARA(Cmd); GUI_USE_PARA(pData); return 0; }
//main.c
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include "stm32f10x.h" #include "GUI.h" #include "st7735.h" uint32_t TimingDelay = 0; void SysTick_Handler1(void); void Delay_US(__IO uint32_t nTime); int main() { GUI_Init(); GUI_SetBkColor(GUI_BLACK); GUI_SetColor(GUI_BLACK); GUI_Clear(); GUI_DispStringAt("aaa",10,10); while(1) { } }