2022-11-16 11:51 AM
I'm trying to set up TouchGFX on an ILI9341 screen. Board is NUCLEO-L476RG. The screen is connected in parallel in 8-bit mode
For example if I draw a white box over the entire screen in TouchGFX designer, ILI9341 displays a white screen, If I draw a black box over the entire screen in TouchGFX designer, ILI9341 displays a black screen, But if i draw button or some similar, ILI9341 showing only black screen. I'm not sure if my code is wrong (I'm a beginner) or if TouchGFX has a some bug.
TouchGFXDataTransfer.c
#include "ili.h"
#include "TouchGFX_DataTransfer.h"
extern void DisplayDriver_TransferCompleteCallback();
static uint8_t isTransmittingData = 0;
uint32_t touchgfxDisplayDriverTransmitActive(void)
{
return isTransmittingData;
}
void touchgfxDisplayDriverTransmitBlock(uint8_t* pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h)
{
isTransmittingData = 1;
ILI9341_SetWindow(x, y, x+w-1, y+h-1);
ILI9341_DrawBitmap(w, h, pixels);
isTransmittingData = 0;
DisplayDriver_TransferCompleteCallback();
}
ILI9341.c
void ILI9341_DrawBitmap(uint16_t w, uint16_t h, uint8_t *s)
{
for(uint16_t broj=0;broj<w*h*2;broj++)
{
LCD_WR_DATA(*(s));
}
}
main.c
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_SPI3_Init();
MX_SPI2_Init();
MX_CRC_Init();
MX_TIM2_Init();
MX_TouchGFX_Init();
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim2);
ILI9341_Init();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_TouchGFX_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
/* USER CODE BEGIN 4 */
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
extern void touchgfxSignalVSync(void);
if (htim->Instance == TIM2) {
touchgfxSignalVSync();
}
}
/* USER CODE END 4 */
The hardware and the ILI9341 library are fine because I successfully launched LVGL on the same configuration.
2022-11-17 01:04 AM
Compare your code with FMC and SPI Display Interface | TouchGFX Documentation
2022-11-17 06:06 AM
I solved the problem. Everything is fine now. I made a mistake in the function to transfer the framebuffer to the screen.
I wrote
LCD_WR_DATA(*(s));
I forgot to add a variable to increment the framebuffer pointer.
LCD_WR_DATA(*(s+number));
Thanks for your help..