Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. vova5049

    Numeric keypad

    and in general I have a problem with understanding, for example how to make the keyboard appear when I press on the input field and hide when I press "enter"
  3. vova5049

    Numeric keypad

    Hello. I created my own keyboard layout in gwin_keyboard_layout.c. : static const GVSpecialKey Num1SKeys [] = { {"\ 001", 0, GVKEY_SINGLESET, 1}, // \ 001 (1) = Shift Lower to Upper {"\ 001", 0, GVKEY_INVERT | GVKEY_LOCKSET, 2}, // \ 002 (2) = Shift Upper to Upper Lock {"\ 002", 0, GVKEY_INVERT | GVKEY_LOCKSET, 0}, // \ 003 (3) = Shift Upper Lock to Lower {"123", 0, GVKEY_LOCKSET, 3}, // \ 004 (4) = Change to Numbers {"Delete", "\ b", 0, 0}, // \ 005 (5) = Backspace {"\ 015", "\ r", 0, 0}, // \ 006 (6) = Enter 1 {"\ 015", "\ r", 0, 0}, // \ 007 (7) = Enter 2 (Short keycap) {"Sym", 0, GVKEY_LOCKSET, 4}, // \ 010 (8) = Change to Symbols {"aA", 0, GVKEY_LOCKSET, 0}, // \ 011 (9) = Change to Lower Alpha }; static const char * NumSet0 [] = {"\ 005 \ 005 \ 005", "789", "456", "123", "00 \ 006", 0}; static const GVKeySet NumSets [] = {NumSet0, 0}; const GVKeyTable VirtualKeyboard_Num1 = {Num1SKeys, NumSets}; I am trying to call in my program gwinKeyboardSetLayout(& ghKeyboard, VirtualKeyboard_English1); but I'm getting an error when compiling: 'VirtualKeyboard_English1' undeclared (first use in this function) main.c But if in gfxconf.h I define: #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_Num1 it works. What is the correct way to use gwinKeyboardSetLayout ()?
  4. If both black and red are turning out yellow then the problem is more likely in the controller initialization sequence for your panel. If you have any code that can initialize the panel copy that into the gdisp driver and see if that solves your problem.
  5. Thanks for letting us know of the website problems. We will look into them. Glad to hear you found your problem.
  6. Last week
  7. Hi, I guess I can close this issue. I wrongly suspected the uGFX lib to be part of the problem. The root cause was that I modified the code of by RAW_32 implementation for using FreeRtos. Since I used CubeMx for HAL generation, I just had to remove HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0) in the HAL_MspInit() routine of the corresponding MCU support package file. By the way. I''m not able to use link, code and file upload tools of this homepage anymore. Apparently, something has changed since it perfectly worked a couple of months ago.
  8. Earlier
  9. Hi folks, I face problems to get ugfx and freertos running. Essentially, I followed the demo CPU20 has made for a STM32F7 bord. The code of my main.c is at the bottom of this post. I'm sorry for the unprofessional appearance. Unfortunatly, wehter code insertion nor file upload works with the tested browsers (chrome, firefox, edge). I first checked if the FreeRtos works before I imported the ugfx lib. Since everthing seemed to be OK I tired ugfx in RAW_32 mode by setting #define GFX_USE_OS_RAW32 GFXON #define GFX_USE_GDISP GFXON #define GDISP_NEED_TEXT GFXON #define GDISP_INCLUDE_FONT_DEJAVUSANS16 GFXON in gfxconf.h. Conclusio: Everything is ok. Then I changed in gfxconf.h: #define GFX_USE_OS_RAW32 GFXOFF #define GFX_USE_OS_FREERTOS GFXON #define GFX_OS_HEAP_SIZE 4096 #define GFX_OS_NO_INIT GFXON Now the problem is that the system gets stuck as soon vTaskStartScheduler() is called. I tried to debug it but it never reaches one of the tasks. Any help is kindly apprechiated! /** ****************************************************************************** * @file main.c * @author Ac6 * @version V1.0 * @date 01-December-2013 * @brief Default main function. ****************************************************************************** */ #include <board_ILI9225.h> #include "stm32l1xx_hal.h" #include "FreeRTOS.h" #include "task.h" #include "gfx.h" void SystemClock_Config(void); static void GPIO_Init(void); static void I2C_Init(void); static void SPI_Init(void); void Error_Handler(void); TaskHandle_t uGFXInitTask; I2C_HandleTypeDef hi2c1; SPI_HandleTypeDef hspi2; //----------------------------------------------------------------------------- void uGFXUpdate(void* pvParameters) { (void)pvParameters; font_t font = gdispOpenFont("DejaVuSans16"); while (1) { gdispFillString(10, 10, "uGFX FreeRTOS", font, White, Black); HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); vTaskDelay(500/portTICK_PERIOD_MS); } } //----------------------------------------------------------------------------- void uGFXInit(void* pvParameters) { (void)pvParameters; while (1) { gfxInit(); xTaskCreate(uGFXUpdate,"uGFXUpdate", 200, NULL, 0, NULL); vTaskDelete(uGFXInitTask); } } //----------------------------------------------------------------------------- int main(void) { HAL_Init(); SystemClock_Config(); GPIO_Init(); SPI_Init(); I2C_Init(); #if GFX_USE_OS_FREERTOS == GFXON xTaskCreate(uGFXInit, "uGFXInit", 200, NULL, 0, &uGFXInitTask); vTaskStartScheduler(); #elif GFX_USE_OS_RAW32 == GFXON font_t font = gdispOpenFont("DejaVuSans16"); gfxInit(); while(1){ gdispFillString(10, 10, "GFX_RAW_32", font, White, Black); HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); gfxSleepMilliseconds(200); } #endif for (;;); } //----------------------------------------------------------------------------- void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /**Configure the main internal regulator output voltage */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /**Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /**Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { Error_Handler(); } } //----------------------------------------------------------------------------- static void I2C_Init(void) { /* USER CODE BEGIN I2C1_Init 0 */ /* USER CODE END I2C1_Init 0 */ /* USER CODE BEGIN I2C1_Init 1 */ /* USER CODE END I2C1_Init 1 */ hi2c1.Instance = I2C1; hi2c1.Init.ClockSpeed = 100000; hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; hi2c1.Init.OwnAddress1 = 0; hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; hi2c1.Init.OwnAddress2 = 0; hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; if (HAL_I2C_Init(&hi2c1) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN I2C1_Init 2 */ /* USER CODE END I2C1_Init 2 */ } //----------------------------------------------------------------------------- static void SPI_Init(void) { /* SPI2 parameter configuration*/ hspi2.Instance = SPI2; hspi2.Init.Mode = SPI_MODE_MASTER; hspi2.Init.Direction = SPI_DIRECTION_2LINES; hspi2.Init.DataSize = SPI_DATASIZE_8BIT; hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH; hspi2.Init.CLKPhase = SPI_PHASE_2EDGE; hspi2.Init.NSS = SPI_NSS_SOFT; hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi2.Init.TIMode = SPI_TIMODE_DISABLE; hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi2.Init.CRCPolynomial = 10; if (HAL_SPI_Init(&hspi2) != HAL_OK) { Error_Handler(); } } //----------------------------------------------------------------------------- static void GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, LCD_RS_Pin|LCD_RST_Pin|LCD_CS_Pin, GPIO_PIN_RESET); /*Configure GPIO pin : B1_Pin */ GPIO_InitStruct.Pin = B1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pin : LD2_Pin */ GPIO_InitStruct.Pin = LD2_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pins : LCD_RS_Pin LCD_CS_Pin */ GPIO_InitStruct.Pin = LCD_RS_Pin|LCD_CS_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); /*Configure GPIO pin : LCD_RST_Pin */ GPIO_InitStruct.Pin = LCD_RST_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(LCD_RST_GPIO_Port, &GPIO_InitStruct); } //----------------------------------------------------------------------------- void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ /* USER CODE END Error_Handler_Debug */ }
  10. Hi Joel Thanks for your answer. I checked this more than one time and it's set to RGB565 what i think actually is the color format of the controller. Or am I wrong?
  11. This is most likely a mismatch of the color formats. Check the color format configuration of your GDISP driver (eg. /drivers/gdisp/RA8875/gdisp_lld_conf.h). It defaults to RGB565. You have to ensure that the display controller on the other end is using the same color format as specified in the GDISP driver configuration.
  12. Hi all I use a Nucleo-F767ZI board and a 4.3" touch display (ER-TFTM043-3) with RA8875 display controller (connected via SPI). So the initialization is working but the colors are wrong (black and red are yellow). Can anyone help me with this problem? Thanks in advance Kind regards
  13. I think you need to read the first few basic articles of our documentation such as this [1] and this [2] to understand things like what a module is and how to enable or disable modules. [1] https://wiki.ugfx.io/index.php/Architecture [2] https://wiki.ugfx.io/index.php/Configuration
  14. Thanks for your response Inmarket but I do not understand your response ? If I want to try the minimum set of modules (I assume uGFX) "to turn on is GDISP using the RAW32 or Arduino version of GOS" not sure what you mean ? and assume the gfxconf.h file contains all the necessary features available to be enabled or disabled ? Thanks HBer
  15. If you are extremely memory constrained, only want to do a couple of boxes and some text with no OS, ugfx may not be the best choice for you. There are a number of Arduino libraries that directly drive the display that may be better. uGFX is intended as a full graphics library and windowing system but one that can run on embedded systems. As a graphics library it is probably heavier than you might want. If however you want to try, the minimum set of modules to turn on is GDISP using the RAW32 or Arduino version of GOS. If you look in the gfxconf.h file you will see all the options that can be turned off and on.
  16. Hello - I am wanting to evaluate uGFX library with the least amount of effort as this is a afterthought for a project. All I have is a 128 x 64 monochrome LCD display that I would like to write some text and maybe draw a simple box or two. What is the least I need to add to the project in files ( I am very limited on memory already) to get a simple display up and running and what function would I need to write or is called that would write the pixels. There is NO OS but have access to timers etc on micro controller. Any help would be appreciated. Thanks HBer
  17. Hi, Unfortunately, we never worked with CubeMX enerated Makefiles ourselves. However, there are plenty of community members that did this successfully. As it's Makefile based you should definitely be able to just follow the official Makefile guide that you quoted in your post. Maybe someone like @cpu20 could help here (he's this community's IDE expert).
  18. That sounds an awful lot like an issue in / related to the GDISP driver that you're using. You can use the GDISP TestStub driver to compile & run with that. It's an empty driver that doesn't do anything but allows to pass compilation of the GDISP module. This way you can ensure that the rest of the system is running properly.
  19. Thank you @inmarket for these explanations, i've seen the ED060SC4 driver as buffer size drop example. But this type of displays (sharp MiP) have limitation on memory writes frequency (max 20 Hz) and i suppose flushing the reduced buffer to display memory on driver side when it's full may bring to not respect that requirement, using gdisp side timer flush seems more suitable. At this time, with my limited understanding of how gdisp drawing operations works, i don't see how to achive this driver with a reduced buffer. It's not a problem since my application can survive (for now) with this heavy buffer. Looking on these interresting (from a power consumption point of view) displays from "Japan Displays" https://www.j-display.com/english/product/reflective.html it would be nice to find a solution.
  20. uGFX can work with no buffer at all provided pixels are individually addressable when talking to the controller and the controller itself maintains an internal framebuffer. When that is not the case the driver needs to maintain enough of the screen image that it can merge pixel drawing operations into the existing screen image before sending the merged data to the controller. In practice it is typically controllers driving displays of less than 1 byte per pixel that fall into this category. As the buffer is managed by the driver, the buffer can be in any format that works for the controller, be that expanded to one pixel per byte, packed into a byte stream (like most uGFX monochrome drivers), or compressed in some other way.
  21. Hi, the buffer used for this driver (whole screen 400*240 pix) weighs a lot (12482 bytes). Is it possible with µGFX to work with a reduced screen area for the buffer ? thanks
  22. Hi, the buffer used for this driver (whole screen 400*240 pix) weighs a lot (12482 bytes). Is it possible with µGFX to work with a reduced screen area for the buffer ? thanks
  23. I want to give uGFX a try and integrate it into my existing cubeMX Makefile Project. (Bare Metal, no OS, no special tool-chain). As I understand, I have to do following steps: 1) Download the GFX Library - done 2) Edit the gfxconf.h: #define GFX_USE_OS_RAW32 GFXON - done 3) Edit the Makefile which cubeMX generated. Correct? Set the GFXLIB variable to the path pointing to the µGFX library root directory Include the main µGFX Makefile (/ugfx/gfx.mk) Add GFXSRC to the sources variable/list Add GFXINC to the include paths variable/list Include additional Makefiles of the µGFX library to include board files, drivers, ... How do I do this and where in the cubemx generated Makefile? Is there an example somewhere? This would be awesome and save lots of time 🙂
  24. That is a better question to be asking in the ChibiOS forums as it does not really relate to ugfx. Try some of the pure ChibiOS test programs for threads. Similarly ugfx has a demos/modules/gos/threads test program to test ugfx's api abstraction of the underlying operating system.
  25. I have problem with more than one thread in system witch uGFX and ChibiOS. If one thread is running all is ok, but if I start another thread I get error SV#4 from ChibiOS. Threads are very simple, first thread drive blinking led and second only realize delay in while() loop 100ms. Have anyone any ideas what might be wrong?
  26. kpapr1

    Compilation error

    No logo at power on... I start the debugger and take it step by step, the program goes through the "gfxInit();" command and then goes to the "gdispDrawPixel(10, 10, White);" command. I step into this command which finally leads me to the "drawpixel_clip(g);" command and then I get the hard fault error. I'll have a look again tomorrow. Thanks.
  27. inmarket

    Compilation error

    When you first power on do you see the logo? I would suggest that you start your debugger and follow the chain of execution. It is not expeced or common to see the problem you describe.
  28. kpapr1

    Compilation error

    Hello again! So, I upgraded to version 2.9 but I still didn't find the "GFX_NEED_GDISP" definition anywhere, so I set the "GFX_USE_GDISP" to "GFXON". Anyway, the problem now is that any draw command causes a hard fault. The function call that generates the hard fault is in "gdisp.c" and it's "drawpixel_clip(g);". I don't know why this happens or how to fix it, so any help would be greatly appreciated!
  1. Load more activity
×
×
  • Create New...