Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Hello & welcome to the µGFX-Community! The Linux framebuffer driver is meant to directly operate on the framebuffer memory provided by the Linux kernel (if this feature is enabled). It's a device such as /dev/fb0 (or similar) that the Linux kernel provides as a framebuffer. If you do not want to use this framebuffer but render to a different display you'll have to provide a GDISP driver for this. As you mention SPI I assume that you have a dedicated display controller. In that case, check whether your display controller is already supported by the µGFX library. Otherwise you'll have to write your own driver.
  3. How do you do? I actually want to run the graphics library under Linux via the framebuffer interface, which unfortunately doesn't work yet. What I have is a self-written program that uses a memory area and then talks to my controller via SPI. How do I make the graphics library use this memory instead of a framebuffer? Greetings Lukas
  4. Yesterday
  5. Last week
  6. Earlier
  7. While the bdf format is a bitmap font format, it is not the same as the mcufont format. Some of the parameters (obviously including the spacing) is calculated from the font data itself. I am not sure of the details of what is calculated and what is accepted verbatim from the source font. It will also change depending on the type of source font. Mcufont was generously donated to ugfx, along with a compatible license, in the early days of ugfx. We have maintained it, fixed bugs, and updated portions over time but I wouldn't go so far as to say we understand as well as the rest of ugfx. Good font drawing is an incredibly difficult process particularly on low powered cpu's hence making the value of the mcufont contribution very significant.
  8. Your comment caused me to do some more investigation which resulted in success. I originally used mcufont to convert from .bdf to .dat and then from .dat to .c format. I used the following 2 commands: mcufont import_bdf fixed_10x20.bdf mcufont bwfont_export fixed_10x20.dat fixed_10x20_all.c This resulted in a .c file with all the characters but my line spacing was no longer the same. After reading your response, I added this filter step before creating the .c file: mcufont filter fixed_10x20.dat 32-127 176 This filter used the original range and just added the degree character that I needed. Creating the .c file from that filtered .dat file worked properly. What I don't understand is why when all the characters are added, the spacing values would change. I would have thought that those values would remain stable within a font.
  9. As you are using a different filter range (hence the availability of the degree symbol), and possibly because of other parameter changes, it has converted the font differently.
  10. As uGFX initializes the external RAM in the stm32746-discovery board file (and uses that for the framebuffer), any excess external RAM can be used by the application. You simply need to calculate the last address used by the framebuffer and use anything after that. There is however one really big problem with this. Depending on the size of the display, whether you use both front and back display surfaces, the color depth you are using, and the refresh rate of the display, you may find that there is no available bus bandwidth available. Any reads/writes to the external RAM may cause display problems simply because the memory access prevents the display getting the data it needs.
  11. hai friend... i need big data buffer for processing in stm32f746... i know it has 320kB sram... in discovery it has sdram external, and it use for framebuffer for lcd, how i can use it as memory data buffer? thankz
  12. I am using the Fixed_10x20 font and would like to use the degree symbol. It doesn't seem to be available in the .c file that comes in the distribution. It is in the .bdf file, so I thought I would would convert the .bdf file to a .c using the online font converter. The online font converter does not work with the file and always gives a "Could not move file" error message. So I used the mcufont.exe program in the tools directory. I converted the .bdf file to a .dat file first. Than I converted the .dat file to a .c file. Using the .c font file, I was able to use the degree symbol as expected. The problem that I have is the font characteristics for my converted .c file is not the same as the fixed_10x20.c file that comes with the distribution. The code below is from the distribution copy of the fixed_10x20.c file: static const struct mf_bwfont_char_range_s mf_bwfont_fixed_10x20_char_ranges[] = { { 32, /* first char */ 95, /* char count */ 0, /* offset x */ 0, /* offset y */ 3, /* height in bytes */ 17, /* height in pixels */ 0, /* width */ mf_bwfont_fixed_10x20_glyph_widths_0, /* glyph widths */ mf_bwfont_fixed_10x20_glyph_offsets_0, /* glyph offsets */ mf_bwfont_fixed_10x20_glyph_data_0, /* glyph data */ }, }; const struct mf_bwfont_s mf_bwfont_fixed_10x20 = { { "-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-15", "fixed_10x20", 9, /* width */ 17, /* height */ 10, /* min x advance */ 10, /* max x advance */ -1, /* baseline x */ 13, /* baseline y */ 20, /* line height */ 3, /* flags */ 63, /* fallback character */ &mf_bwfont_character_width, &mf_bwfont_render_character, }, 4, /* version */ 1, /* char range count */ mf_bwfont_fixed_10x20_char_ranges, }; This code is from the .c file that mcufont created: static const struct mf_bwfont_char_range_s mf_bwfont_fixed_10x20_all_char_ranges[] = { { 0, /* first char */ 127, /* char count */ 0, /* offset x */ 0, /* offset y */ 3, /* height in bytes */ 20, /* height in pixels */ 10, /* width */ 0, /* glyph widths */ 0, /* glyph offsets */ mf_bwfont_fixed_10x20_all_glyph_data_0, /* glyph data */ }, { 160, /* first char */ 96, /* char count */ 0, /* offset x */ 0, /* offset y */ 3, /* height in bytes */ 20, /* height in pixels */ 10, /* width */ 0, /* glyph widths */ 0, /* glyph offsets */ mf_bwfont_fixed_10x20_all_glyph_data_1, /* glyph data */ }, }; const struct mf_bwfont_s mf_bwfont_fixed_10x20_all = { { "-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-15", "fixed_10x20_all", 10, /* width */ 20, /* height */ 10, /* min x advance */ 10, /* max x advance */ -1, /* baseline x */ 13, /* baseline y */ 17, /* line height */ 3, /* flags */ 0, /* fallback character */ &mf_bwfont_character_width, &mf_bwfont_render_character, }, 4, /* version */ 2, /* char range count */ mf_bwfont_fixed_10x20_all_char_ranges, }; Notice the differences in the height, width and baseline values. When I use this converted font my line spacing is different from the distributed copy of the font. I would assume that that the .bdf file converted to a .c file using mcufont should create an identical .c file with the addition of the special characters. What could I be doing wrong? Thanks
  13. The upload issue is fixed - Please excuse that this took so long.
  14. I have ported the SSD1963 driver for ugfx-arduino, targeting Teensy 3.2. I'm using the same structure as the SSD1351 driver by crteensy. It's more or less working but colors are wrong. See this thread:
  15. I have ported the SSD1963 driver to ugfx-arduino. So far it's only targeted at Teensy, but it could probably be made to work with other boards by changing the board file. I made it work with a Teensy 3.2 with one problem. I can draw using GDISP and the pixels end up in the right position, however, the colors are wrong: apparently only 2 bits of the red and green channels and none of the red channel is used. I did not change the pixel format of the original driver (GDISP_PIXELFORMAT_RGB565). I assume it could have something to do with using 8 vs. 16 data ports, but I'm not sure. I also don't know how to change it. Any ideas how to fix this? The code can be found here: https://github.com/pastaclub/ugfx-arduino-gdisp-ssd1963 An example configuration can be found here: https://github.com/pastaclub/ugfx-ssd1963-config To install, copy both above repositories as sub-folders into your Arduino library folder. For an example application, just copy the one from ugfx-arduino and change the driver. This configuration assumes the following wiring for TFT->Teensy 3.2: Backlight=3V3, Reset=23, RS=28, WR=27, RD=33, CS=15, DB_0=15, DB_1=22, DB_2=23, DB_3=9, DB_4=10, DB_5=13, DB_6=11, DB_7=12, DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6, DB_13=20, DB_14=21, DB_15=5
  16. It seems that SSD1963 does not use the RD port. I had a look at board_ssd1963_gpio.h. It defines two macros for setting and clearing this pin (Set_RD, Clr_RD), however Clr_RD is never called. Can RD simply be wired to VDD? (by the way, the UTFT library suggests wiring RD to VDD for SSD1963). And another question: am I right to assume that palSetPad sets any pin to low and palClearPad sets it to high? I am trying to convert the driver to Teensy and I am a bit confused because the naming seems to be inverse to what it supposedly does.
  17. 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"
  18. 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 ()?
  19. 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.
  20. Thanks for letting us know of the website problems. We will look into them. Glad to hear you found your problem.
  21. 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.
  22. 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 */ }
  23. 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?
  24. 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.
  25. 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
  26. 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
  27. 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
  28. 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.
  29. 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
  1. Load more activity
  • Create New...