【GigaDevice GD32H759I-EVAL】 External 5-inch LCD display test
[Copy link]
This post was last edited by TL-LED on 2024-6-1 14:20
Test driver's 5-inch display with a resolution of 800x480.
1. Hardware Circuit
1.1、Development board LCD circuit interface part
1.2 Design of adapter board
1.2.1 Schematic diagram
1.2.2 PCB effect diagram
1.2.3、Physical picture
2. Driver
2.1. Display screen timing parameters
The driver mainly modifies the iLCD timing configuration part
Look at the display manual, the following parameters are modified in the driver
2.2. Program part
2.2.1、gd32h759i_lcd_eval.c
#include "gd32h759i_lcd_eval.h"
#include "gd32h759i_eval_exmc_sdram.h"
#include <string.h>
#define LCD_FRAME_BUFFER ((uint32_t)0xC0000000)
#define BUFFER_OFFSET ((uint32_t)0x7F800)
static font_struct *current_font;
static uint16_t current_textcolor = 0x0000;
static uint16_t current_backcolor = 0xFFFF;
static uint32_t current_framebuffer = LCD_FRAME_BUFFER;
static uint32_t current_layer = LCD_LAYER_BACKGROUND;
static void lcd_char_draw(uint16_t xpos, uint16_t ypos, const uint16_t *c);
static void lcd_vertical_char_draw(uint16_t xpos, uint16_t ypos, const uint16_t *c);
static void pixel_set(int16_t x, int16_t y);
#define HORIZONTAL_SYNCHRONOUS_PULSE 48
#define HORIZONTAL_BACK_PORCH 88
#define ACTIVE_WIDTH 800
#define HORIZONTAL_FRONT_PORCH 40
#define VERTICAL_SYNCHRONOUS_PULSE 3
#define VERTICAL_BACK_PORCH 32
#define ACTIVE_HEIGHT 480
#define VERTICAL_FRONT_PORCH 13
2.2.2, main.c
#include "main.h"
void cache_enable(void);
int main(void)
{
uint8_t x=0;
uint32_t sd=0;
uint32_t yd=0;
cache_enable();
systick_config();
init_usart(115200);
init_led();
gd_eval_lcd_init();
while(1)
{
switch(x)
{
case 0: lcd_clear(LCD_COLOR_WHITE); break;
case 1: lcd_clear(LCD_COLOR_RED ); break;
case 2: lcd_clear(LCD_COLOR_GREEN); break;
case 3: lcd_clear(LCD_COLOR_BLUE); break;
case 4: lcd_clear(LCD_COLOR_YELLOW); break;
case 5: lcd_clear(LCD_COLOR_MAGENTA); break;
case 6: lcd_clear(LCD_COLOR_BLACK); break;
}
x++;
if(x>6)
{
x=0;
}
lcd_string_display(1, "GD32H759 TLI LCD TEST!");
delay_1ms(1000);
}
}
void cache_enable(void)
{
/* enable i-cache */
SCB_EnableICache();
/* enable d-cache */
SCB_EnableDCache();
}
3. Operation
Run the video:
5lcd
4. Test source code
|