Skip to content

Commit ab5d441

Browse files
committed
优化fsmc刷屏速度
1 parent d3f672a commit ab5d441

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

407ZG_TFT/407ZG_TFT.ioc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#MicroXplorer Configuration settings - do not modify
2-
FSMC.AddressSetupTime1=15
3-
FSMC.IPParameters=AddressSetupTime1
2+
FSMC.AddressSetupTime1=5
3+
FSMC.BusTurnAroundDuration1=5
4+
FSMC.DataSetupTime1=5
5+
FSMC.IPParameters=AddressSetupTime1,DataSetupTime1,BusTurnAroundDuration1
46
File.Version=6
57
KeepUserPlacement=false
68
Mcu.Family=STM32F4

407ZG_TFT/Drivers/LCD/lcd_ili9327.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
#define LCD_RS_HIGH HAL_GPIO_WritePin(GPIOA, LCD_DC_Pin, GPIO_PIN_SET)
88
#define LCD_RES_LOW HAL_GPIO_WritePin(GPIOA, LCD_RST_Pin, GPIO_PIN_RESET)
99
#define LCD_RES_HIGH HAL_GPIO_WritePin(GPIOA, LCD_RST_Pin, GPIO_PIN_SET)
10-
#define LCD_WIDTH 160
11-
#define LCD_HIGH 128
10+
#define LCD_WIDTH 400
11+
#define LCD_HIGH 240
1212

13-
//数据缓存区定义,根据ram的大小,可以自行调节
1413

1514

1615
#define TFTLCD_BASE ((uint32_t)(0x6C000000 | 0x0000007E))
@@ -175,10 +174,10 @@ void LCD_Init(void)
175174
LCD_writeData(0x00);
176175

177176
LCD_writeCmd(0x36);
178-
LCD_writeData(0x48);
177+
LCD_writeData(0x28);//28 横屏 48竖屏 e8横屏颠倒
179178

180179
LCD_writeCmd(0x29); //display on
181180

182-
LCD_fillRect(0,0,239,399,BLACK);
181+
//LCD_fillRect(0,0,239,399,BLACK);
183182
}
184183

407ZG_TFT/Src/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ static void MX_FSMC_Init(void)
226226
hsram1.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
227227
hsram1.Init.PageSize = FSMC_PAGE_SIZE_NONE;
228228
/* Timing */
229-
Timing.AddressSetupTime = 15;
230-
Timing.AddressHoldTime = 15;
231-
Timing.DataSetupTime = 255;
232-
Timing.BusTurnAroundDuration = 15;
233-
Timing.CLKDivision = 16;
234-
Timing.DataLatency = 17;
229+
Timing.AddressSetupTime = 5;
230+
Timing.AddressHoldTime = 5;
231+
Timing.DataSetupTime = 5;
232+
Timing.BusTurnAroundDuration = 0;
233+
Timing.CLKDivision = 0;
234+
Timing.DataLatency = 0;
235235
Timing.AccessMode = FSMC_ACCESS_MODE_A;
236236
/* ExtTiming */
237237

407ZG_TFT/ThirdPartyLib/lvgl/lv_conf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*====================*/
2121

2222
/* Maximal horizontal and vertical resolution to support by the library.*/
23-
#define LV_HOR_RES_MAX (240)
24-
#define LV_VER_RES_MAX (400)
23+
#define LV_HOR_RES_MAX (400)
24+
#define LV_VER_RES_MAX (240)
2525

2626
/* Color depth:
2727
* - 1: 1 byte per pixel

0 commit comments

Comments
 (0)