我的硬件电路是通过LTDC连接SN75LVDS83(RGB转LVDS),驱动天马的一款12寸的屏幕。但是屏幕在显示后,处于花屏的状态。填充了颜 {MOD}后也没有任何改变。
屏幕显示
屏幕资料里面只有提到这些时序的配置。不清楚其他VBP、HBP等的参数。试了一些参数值。但是也没有改善。
时序
求大神解答,这要怎么弄才能正常显示。
代码:
#include "LTDC_init.h"
/* Define -------------------------------------------------------------------------*/
#define MAX_LAYER_NUMBER 1
#define LCD_FRAME_BUFFER ((uint32_t)0xC0000000)
#define LCD_PIXEL_FORMAT LCD_PIXEL_FORMAT_RGB565
#define HSYNC 100
#define HBP 33
#define HFP 100
#define HACT LCD_XSIZE
#define VSYNC 100
#define VBP 50
#define VFP 200
#define VACT LCD_YSIZE
#define LTDC_PLLR 2
#define LTDC_PLLN 142
#define LTDC_PLLQ 7
#if LCD_PIXEL_FORMAT == LCD_PIXEL_FORMAT_RGB888
#define LTDC_PLLDIV RCC_PLLSAIDivR_Div2
#else
#define LTDC_PLLDIV RCC_PLLSAIDivR_Div2
#endif
/* Variable -----------------------------------------------------------------------*/
/* Function -----------------------------------------------------------------------*/
void LCD_L0_FillRect(int x0, int y0, int x1, int y1);
/*******************************************************************************
* Function Name :
static void LTDC_GPIO_Configuration(void)
* Description :
* Input :
* Output :
* Return :
* Record :
*******************************************************************************/
static void LTDC_GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* Enable GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI AHB Clocks */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_GPIOG | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOI, ENABLE);
/* GPIOs Configuration */
/*
RGB888 ******************************************************************************
+------------------------+-----------------------+----------------------------+
+ LCD pins assignment +
+------------------------+-----------------------+----------------------------+
| LCD_TFT R0 <-> PH.02 | LCD_TFT G0 <-> PE.05 | LCD_TFT B0 <-> PE.04 |
| LCD_TFT R1 <-> PH.03 | LCD_TFT G1 <-> PE.06 | LCD_TFT B1 <-> PG.12 |
| LCD_TFT R2 <-> PH.08 | LCD_TFT G2 <-> PH.13 | LCD_TFT B2 <-> PD.06 |
| LCD_TFT R3 <-> PH.09 | LCD_TFT G3 <-> PH.14 | LCD_TFT B3 <-> PG.11 |
| LCD_TFT R4 <-> PH.10 | LCD_TFT G4 <-> PH.15 | LCD_TFT B4 <-> PI.04 |
| LCD_TFT R5 <-> PH.11 | LCD_TFT G5 <-> PI.00 | LCD_TFT B5 <-> PI.05 |
| LCD_TFT R6 <-> PB.01 | LCD_TFT G6 <-> PC.07 | LCD_TFT B6 <-> PB.08 |
| LCD_TFT R7 <-> PG.06 | LCD_TFT G7 <-> PI.02 | LCD_TFT B7 <-> PB.09 |
-------------------------------------------------------------------------------
| LCD_TFT HSYNC <-> PI.10 | LCDTFT VSYNC <-> PI.09 |
| LCD_TFT CLK <-> PG.07 | LCD_TFT DE <-> PF.10 |
-----------------------------------------------------
RGB565 ******************************************************************************
+------------------------+-----------------------+----------------------------+
+ LCD pins assignment +
+------------------------+-----------------------+----------------------------+
| | LCD_TFT G2 <-> PH.13 | |
| LCD_TFT R3 <-> PH.09 | LCD_TFT G3 <-> PH.14 | LCD_TFT B3 <-> PG.11 |
| LCD_TFT R4 <-> PH.10 | LCD_TFT G4 <-> PH.15 | LCD_TFT B4 <-> PI.04 |
| LCD_TFT R5 <-> PH.11 | LCD_TFT G5 <-> PI.00 | LCD_TFT B5 <-> PI.05 |
| LCD_TFT R6 <-> PB.01 | LCD_TFT G6 <-> PC.07 | LCD_TFT B6 <-> PB.08 |
| LCD_TFT R7 <-> PG.06 | LCD_TFT G7 <-> PI.02 | LCD_TFT B7 <-> PB.09 |
-------------------------------------------------------------------------------
| LCD_TFT HSYNC <-> PI.10 | LCDTFT VSYNC <-> PI.09 |
| LCD_TFT CLK <-> PG.07 | LCD_TFT DE <-> PF.10 |
-----------------------------------------------------
BRTC Backlight control I/O PI.03
PWM PWM Dimming PC.06
*/
#if LCD_PIXEL_FORMAT == LCD_PIXEL_FORMAT_RGB888
/* GPIOB configuration */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource1 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource8 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource9 , GPIO_AF_LTDC);
/* GPIOC configuration */
GPIO_PinAFConfig(GPIOC, GPIO_PinSource7 , GPIO_AF_LTDC);
/* GPIOD configuration */
GPIO_PinAFConfig(GPIOD, GPIO_PinSource6 , GPIO_AF_LTDC);
/* GPIOE configuration */
GPIO_PinAFConfig(GPIOE, GPIO_PinSource4 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOE, GPIO_PinSource5 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOE, GPIO_PinSource6 , GPIO_AF_LTDC);
/* GPIOF configuration */
GPIO_PinAFConfig(GPIOF, GPIO_PinSource10 , GPIO_AF_LTDC);
/* GPIOG configuration */
GPIO_PinAFConfig(GPIOG, GPIO_PinSource6 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource7 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource11 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource12 , GPIO_AF_LTDC);
/* GPIOH configuration */
GPIO_PinAFConfig(GPIOH, GPIO_PinSource2 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource3 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource8 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource9 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource10 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource11 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource13 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource14 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource15 , GPIO_AF_LTDC);
/* GPIOI configuration */
GPIO_PinAFConfig(GPIOI, GPIO_PinSource0 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource2 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource4 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource5 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource9 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource10 , GPIO_AF_LTDC);
/* GPIOB configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOB, &GPIO_InitStructure);
/* GPIOC configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* GPIOD configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_Init(GPIOD, &GPIO_InitStructure);
/* GPIOE configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6;
GPIO_Init(GPIOE, &GPIO_InitStructure);
/* GPIOF configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_Init(GPIOF, &GPIO_InitStructure);
/* GPIOG configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_11 | GPIO_Pin_12;
GPIO_Init(GPIOG, &GPIO_InitStructure);
/* GPIOH configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_Init(GPIOH, &GPIO_InitStructure);
/* GPIOI configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_2 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_9 | GPIO_Pin_10;
GPIO_Init(GPIOI, &GPIO_InitStructure);
#else
/* GPIOB configuration */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource1 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource8 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource9 , GPIO_AF_LTDC);
/* GPIOC configuration */
GPIO_PinAFConfig(GPIOC, GPIO_PinSource7 , GPIO_AF_LTDC);
/* GPIOF configuration */
GPIO_PinAFConfig(GPIOF, GPIO_PinSource10 , GPIO_AF_LTDC);
/* GPIOG configuration */
GPIO_PinAFConfig(GPIOG, GPIO_PinSource6 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource7 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource11 , GPIO_AF_LTDC);
/* GPIOH configuration */
GPIO_PinAFConfig(GPIOH, GPIO_PinSource9 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource10 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource11 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource13 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource14 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOH, GPIO_PinSource15 , GPIO_AF_LTDC);
/* GPIOI configuration */
GPIO_PinAFConfig(GPIOI, GPIO_PinSource0 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource2 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource4 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource5 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource9 , GPIO_AF_LTDC);
GPIO_PinAFConfig(GPIOI, GPIO_PinSource10 , GPIO_AF_LTDC);
/* GPIOB configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOB, &GPIO_InitStructure);
/* GPIOC configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* GPIOF configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_Init(GPIOF, &GPIO_InitStructure);
/* GPIOG configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_11;
GPIO_Init(GPIOG, &GPIO_InitStructure);
/* GPIOH configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_Init(GPIOH, &GPIO_InitStructure);
/* GPIOI configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_2 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_9 | GPIO_Pin_10;
GPIO_Init(GPIOI, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOD,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOE,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOH,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOG,&GPIO_InitStructure);
GPIOD->BSRRH = GPIO_Pin_6;
GPIOE->BSRRH = GPIO_Pin_4;
GPIOE->BSRRH = GPIO_Pin_5;
GPIOE->BSRRH = GPIO_Pin_6;
GPIOH->BSRRH = GPIO_Pin_2;
GPIOH->BSRRH = GPIO_Pin_3;
GPIOH->BSRRH = GPIO_Pin_8;
GPIOG->BSRRH = GPIO_Pin_12;
#endif
// //PWM Dimming I/O
// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
// GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
// GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
// GPIO_Init(GPIOC,&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOI,&GPIO_InitStructure);
}
/*******************************************************************************
* Function Name :
void LCD_Layer_Initialization(void)
* Description :
LTDC Layer init
* Input :
none
* Output :
none
* Return :
none
* Record :
none
*******************************************************************************/
void LCD_Layer_Initialization(void)
{
LTDC_Layer_InitTypeDef LTDC_Layer_InitStruct;
/* Windowing configuration */
/*
Horizontal start = horizontal synchronization + Horizontal back porch
Horizontal stop = Horizontal start + LCD_XSIZE -1
Vertical start = vertical synchronization + vertical back porch
Vertical stop = Vertical start + LCD_YSIZE -1
*/
LTDC_Layer_InitStruct.LTDC_HorizontalStart = HSYNC + HBP;
LTDC_Layer_InitStruct.LTDC_HorizontalStop = HSYNC + HBP + LCD_XSIZE - 1;
LTDC_Layer_InitStruct.LTDC_VerticalStart = VSYNC + VBP;
LTDC_Layer_InitStruct.LTDC_VerticalStop = VSYNC + VBP + LCD_YSIZE - 1;
/* Pixel Format configuration*/
LTDC_Layer_InitStruct.LTDC_PixelFormat = LCD_PIXEL_FORMAT;
/* Alpha constant (255 totally opaque) */
LTDC_Layer_InitStruct.LTDC_ConstantAlpha = 255;
/* Default Color configuration (configure A,R,G,B component values) */
LTDC_Layer_InitStruct.LTDC_DefaultColorBlue = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorGreen = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorRed = 0;
LTDC_Layer_InitStruct.LTDC_DefaultColorAlpha = 0;
/* Configure blending factors */
LTDC_Layer_InitStruct.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_CA;
LTDC_Layer_InitStruct.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_CA;
/* Input Address configuration */
LTDC_Layer_InitStruct.LTDC_CFBStartAdress = LCD_FRAME_BUFFER;
/* the length of one line of pixels in bytes + 3 then :
Line Lenth = Active high width x number of bytes per pixel + 3
Active high width = LCD_XSIZE
number of bytes per pixel = 2 (pixel_format : RGB565)
*/
#if LCD_PIXEL_FORMAT == LCD_PIXEL_FORMAT_RGB888
LTDC_Layer_InitStruct.LTDC_CFBLineLength = ((LCD_XSIZE * 3) + 3);
/* the pitch is the increment from the start of one line of pixels to the
start of the next line in bytes, then :
Pitch = Active high width x number of bytes per pixel
*/
LTDC_Layer_InitStruct.LTDC_CFBPitch = (LCD_XSIZE * 3);
#else
LTDC_Layer_InitStruct.LTDC_CFBLineLength = ((LCD_XSIZE * 2) + 3);
/* the pitch is the increment from the start of one line of pixels to the
start of the next line in bytes, then :
Pitch = Active high width x number of bytes per pixel
*/
LTDC_Layer_InitStruct.LTDC_CFBPitch = (LCD_XSIZE * 2);
#endif
/* configure the number of lines */
LTDC_Layer_InitStruct.LTDC_CFBLineNumber = LCD_YSIZE;
LTDC_LayerInit(LTDC_Layer1, <DC_Layer_InitStruct);
/* Enable foreground & background Layers */
LTDC_LayerCmd(LTDC_Layer1, ENABLE);
/* Enable LTDC Reload */
LTDC_ReloadConfig(LTDC_IMReload);
/* Disable the LTDC dither */
LTDC_DitherCmd(DISABLE);
}
/*******************************************************************************
* Function Name :
void LTDC_Initialization(void)
* Description :
* Input :
* Output :
* Return :
* Record :
*******************************************************************************/
void LTDC_Initialization(void)
{
LTDC_InitTypeDef LTDC_InitStruct;
//LTDC_Layer_TypeDef LTDC_Layerx;
/* Configure PLLSAI prescalers for LCD */
/* Enable Pixel Clock */
/* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 25/15 Mhz */
/* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAI_N = 192 Mhz */
/* PLLLCDCLK = PLLSAI_VCO Output/PLLSAI_R = 192/3 = 64 Mhz */
/* LTDC clock frequency = PLLLCDCLK / RCC_PLLSAIDivR = 64/8 = 8 Mhz */
RCC_PLLSAIConfig(LTDC_PLLN, LTDC_PLLQ, LTDC_PLLR);
RCC_LTDCCLKDivConfig(LTDC_PLLDIV);
/* Enable PLLSAI Clock */
RCC_PLLSAICmd(ENABLE);
/* Wait for PLLSAI activation */
while(RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET)
{
}
/* Enable the LTDC Clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_LTDC, ENABLE);
/* Enable the DMA2D Clock */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2D, ENABLE);
/* Configure the LCD Control pins */
LTDC_GPIO_Configuration();
/* Polarity configuration */
/* Initialize the horizontal synchronization polarity as active low */
LTDC_InitStruct.LTDC_HSPolarity = LTDC_HSPolarity_AL;
/* Initialize the vertical synchronization polarity as active low */
LTDC_InitStruct.LTDC_VSPolarity = LTDC_VSPolarity_AL;
/* Initialize the data enable polarity as active low */
LTDC_InitStruct.LTDC_DEPolarity = LTDC_DEPolarity_AL;
/* Initialize the pixel clock polarity as input pixel clock */
LTDC_InitStruct.LTDC_PCPolarity = LTDC_PCPolarity_IPC;
/* Configure R,G,B component values for LCD background color */
LTDC_InitStruct.LTDC_BackgroundRedValue = 0;
LTDC_InitStruct.LTDC_BackgroundGreenValue = 0;
LTDC_InitStruct.LTDC_BackgroundBlueValue = 0;
LTDC_InitStruct.LTDC_HorizontalSync = HSYNC - 1;
LTDC_InitStruct.LTDC_AccumulatedHBP = HSYNC + HBP - 1;
LTDC_InitStruct.LTDC_AccumulatedActiveW = HSYNC + HBP + HACT - 1;
LTDC_InitStruct.LTDC_TotalWidth = HSYNC + HBP + HACT + HFP - 1;
LTDC_InitStruct.LTDC_VerticalSync = VSYNC - 1;
LTDC_InitStruct.LTDC_AccumulatedVBP = VSYNC + VBP - 1;
LTDC_InitStruct.LTDC_AccumulatedActiveH = VSYNC + VBP + VACT - 1;
LTDC_InitStruct.LTDC_TotalWidth = VSYNC + VBP + VACT + VFP - 1;
LTDC_Init(<DC_InitStruct);
/* LTDC Layer configuration ------------------------*/
LCD_Layer_Initialization();
/* Enable The LCD */
LTDC_Cmd(ENABLE);
/* PWM Conrtol enable */
INCH12_LCD_PWM_CONTROL_ON;
LCD_L0_FillRect(0,0,LCD_XSIZE,LCD_YSIZE);
}
数据手册
TM121TDSG02-00 V1.0.pdf
(1.02 MB, 下载次数: 88)
2017-4-26 13:12 上传
点击文件名下载附件
液晶数据手册
1024*768
建议你找一块确定能正常显示的屏,比如原子的屏,先测试你的驱动是正确的,再修改修改成你的目标屏的参数,应该就能行了.
一周热门 更多>