求助大陆使馆破案原子哥,某rgb屏的LTDC几个参数的设置问题

查看: 1692|回复: 6
原子哥,菜鸟求助。从OV2640出来的图像数组数据是RGB565的颜色信息吗?我想将它显示在LCD屏上,应该有什么样的流程啊?用的战舰板,多谢原子哥了
主题帖子精华
初级会员, 积分 88, 距离下一级还需 112 积分
在线时间6 小时
如题,从OV2640出来的图像数组数据是RGB565的颜色信息吗?我想将它显示在LCD屏上,应该有什么样的流程啊?是不是需要图片的解码啊,该怎么办,没有思路啊
这个要配置的。
可以输出RGB565。
主题帖子精华
金钱106261
在线时间679 小时
这个要配置的。
可以输出RGB565。
我是开源电子网站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺:
微信公众平台:正点原子
主题帖子精华
初级会员, 积分 88, 距离下一级还需 112 积分
在线时间6 小时
回复【2楼】正点原子:
---------------------------------
哦哦,我知道了&&多谢原子哥
主题帖子精华
初级会员, 积分 88, 距离下一级还需 112 积分
在线时间6 小时
回复【2楼】正点原子:
---------------------------------
原子哥,我想要在OV2640输出的JPEG图片中加一个十字中心线,这个能做到吗?如何分析JPEG的数据流呢?多谢原子哥了
主题帖子精华
金钱106261
在线时间679 小时
回复【4楼】征伐:
---------------------------------
加十字不好做。
jpeg数据流一般要解码再分析,直接分析,没法做的。
我是开源电子网站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺:
微信公众平台:正点原子
主题帖子精华
初级会员, 积分 88, 距离下一级还需 112 积分
在线时间6 小时
回复【5楼】正点原子:
---------------------------------
嗯嗯,多谢,我知道了。只能在想别的方法了
主题帖子精华
初级会员, 积分 194, 距离下一级还需 6 积分
在线时间37 小时
这个要配置的。
可以输出RGB565。
原子哥,可以提示下,在哪个位置更改吗,想把图像存在数组中,多谢了
Powered byLTDC驱动遇到问题,求助 - STM32 - 意法半导体STM32/STM8技术社区
后使用快捷导航没有帐号?
查看: 949|回复: 3
LTDC驱动遇到问题,求助
ST金币1721
在线时间203 小时
主题帖子精华
LTDC的层初始化代码void f_LTDC_LayerInit(uint8_t LayerIndex)
{
& & LTDC_Layer_InitTypeDef LTDC_Layer_I
//& & LTDC_CLUT_InitTypeDef&&LTDC_CLUT_InitS
& &&&
& & LTDC_Layer_Init.LTDC_HorizontalStart = TFT_HBP ;
& & LTDC_Layer_Init.LTDC_HorizontalStop = TFT_PHYW + TFT_HBP -1;
& & LTDC_Layer_Init.LTDC_VerticalStart = TFT_VBP ;
& & LTDC_Layer_Init.LTDC_VerticalStop = TFT_PHYH + TFT_VBP -1;
& & LTDC_Layer_Init.LTDC_PixelFormat = LTDC_Pixelformat_RGB565;
& & LTDC_Layer_Init.LTDC_ConstantAlpha = 255;
& & LTDC_Layer_Init.LTDC_DefaultColorBlue = 0;& && &&&
& & LTDC_Layer_Init.LTDC_DefaultColorGreen = 0;& && &
& & LTDC_Layer_Init.LTDC_DefaultColorRed = 0;& && && &
& & LTDC_Layer_Init.LTDC_DefaultColorAlpha = 0;
& & LTDC_Layer_Init.LTDC_BlendingFactor_1 = LTDC_BlendingFactor1_CA;& &
& & LTDC_Layer_Init.LTDC_BlendingFactor_2 = LTDC_BlendingFactor2_CA;
& &
& & /* the length of one line of pixels in bytes + 3 then :
& & 5.Line Lenth = Active high width x number of bytes per pixel + 3&&
& & 6.Active high width& && && &= 240&&
& & 7.number of bytes per pixel = 2& & (pixel_format : RGB565)&&
& & 8.*/
& & LTDC_Layer_Init.LTDC_CFBLineLength = (TFT_PHYW*2) +3;//old=3 //1224
& & /*&&the pitch is the increment from the start of one line of pixels to the&&
& & 12.start of the next line in bytes, then :
& & 13.Pitch = Active high width x number of bytes per pixel& && &
& & 14.*/
& & LTDC_Layer_Init.LTDC_CFBPitch = TFT_PHYW*2;
& & /* configure the number of lines */
& & LTDC_Layer_Init.LTDC_CFBLineNumber = TFT_PHYH;
& & /* Input Address configuration */
& & LTDC_Layer_Init.LTDC_CFBStartAdress = SDRAM_BASE;
&&
& & LTDC_LayerInit((LayerIndex == 0 ? LTDC_Layer1 : LTDC_Layer2), &DC_Layer_Init);
&&
//&&/*&&Enable LUT on demand */
//&&BitsPerPixel = LCD_GetBitsPerPixelEx(LayerIndex);
//&&if (BitsPerPixel &= 8)
//&&{
//& & /* Enable usage of LUT for all modes with &= 8bpp */
//& & LTDC_CLUTCmd((LayerIndex == 0 ? LTDC_Layer1 : LTDC_Layer2), ENABLE);
//&&}
//&&{
//& & /*&&Optional CLUT initialization for AL88 mode (16bpp) */
//& & if (apColorConvAPI[LayerIndex] == GUICC_88666I)
//& & {
//& && &LTDC_CLUTCmd((LayerIndex == 0 ? LTDC_Layer1 : LTDC_Layer2), ENABLE);
//& && &for (i = 0; i & 256; i++)
//& && &{
//& && &&&Color = LCD_API_ColorConv_8666.pfIndex2Color(i);
//& && &&&LTDC_CLUT_InitStruct.LTDC_BlueValue& &=&&((Color && 16) & 0xff);
//& && &&&LTDC_CLUT_InitStruct.LTDC_GreenValue&&=&&((Color &&&&8) & 0xff);
//& && &&&LTDC_CLUT_InitStruct.LTDC_RedValue& & =& &(Color& && &&&& 0xff);
//& && &&&LTDC_CLUT_InitStruct.LTDC_CLUTAdress&&=&&i && 24;
//& && &&&LTDC_CLUTInit((LayerIndex == 0 ? LTDC_Layer1 : LTDC_Layer2), &DC_CLUT_InitStruct);
//& && &}
//& & }
//&&}
&&
&&/*&&Enable layer */
&&LTDC_LayerCmd((LayerIndex == 0 ? LTDC_Layer1 : LTDC_Layer2), ENABLE);
&&
&&/* Reload configuration */
&&LTDC_ReloadConfig(LTDC_VBReload);
&&
&&/* dithering activation */
&&//LTDC_DitherCmd(ENABLE);
&&//LTDC_ReloadConfig(LTDC_IMReload);
&&LTDC_Cmd(ENABLE);
}复制代码
12:08 上传
点击文件名下载附件
下载积分: 威望 1
1.24 MB, 下载次数: 4, 下载积分: 威望 1
液晶屏数据手册
欢迎加入STM32/STM8社区技术交流群:& & &STM32Lxx开发群:
ST金币1721
在线时间203 小时
主题帖子精华
static void LCD_AF_GPIOConfig(void)
{
&&GPIO_InitTypeDef GPIO_InitS
&&
&&/* Enable GPIOI, GPIOJ, GPIOK AHB Clocks */
&&RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE | RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_GPIOG | \
& && && && && && && && & RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_GPIOI ,&&ENABLE);
/* GPIOs Configuration */
/*
+------------------------+-----------------------+----------------------------+
+& && && && && && && &&&LCD pins assignment& && && && && && && && && && && &&&+
+------------------------+-----------------------+----------------------------+
|& && && && && && && && &|& && && && && && && &&&|& && && && && && && && && & |
|& && && && && && && && &|& && && && && && && &&&|& && && && && && && && && & |
|& && && && && && && && &|&&LCD_TFT G2 &-& PA.06 |& && && && && && && && && & |
|&&LCD_TFT R3 &-& PB.00&&|&&LCD_TFT G3 &-& PG.10 |&&LCD_TFT B3 &-& PG.11& && &|
|&&LCD_TFT R4 &-& PA.11&&|&&LCD_TFT G4 &-& PB.10 |&&LCD_TFT B4 &-& PG.12& && &|
|&&LCD_TFT R5 &-& PA.12&&|&&LCD_TFT G5 &-& PB.11 |&&LCD_TFT B5 &-& PA.03& && &|
|&&LCD_TFT R6 &-& PB.01&&|&&LCD_TFT G6 &-& PC.07 |&&LCD_TFT B6 &-& PB.08& && &|
|&&LCD_TFT R7 &-& PG.06&&|&&LCD_TFT G7 &-& PD.03 |&&LCD_TFT B7 &-& PB.09& && &|
-------------------------------------------------------------------------------
& && && & |&&LCD_TFT HSYNC &-& PC.06&&| LCDTFT VSYNC &-&&&PA.04 |
& && && & |&&LCD_TFT CLK& &&-& PG.07&&| LCD_TFT DE& &&-&&&PF.10 |
& && && &&&-----------------------------------------------------
*/
/* GPIOI configuration */
&&//GPIO A
& & GPIO_PinAFConfig(GPIOA, GPIO_PinSource4, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOA, GPIO_PinSource6, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_LTDC);
& &
& & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_3 | GPIO_Pin_6 | GPIO_Pin_11 | GPIO_Pin_12;
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOA, &GPIO_InitStruct);
& & //GPIO C
& & GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_LTDC);
& &
& & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOC, &GPIO_InitStruct);
& &
& & //GPIO F
& & GPIO_PinAFConfig(GPIOF, GPIO_PinSource10, GPIO_AF_LTDC);
& & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOF, &GPIO_InitStruct);
& & //GPIO G
& & GPIO_PinAFConfig(GPIOG, GPIO_PinSource6, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOG, GPIO_PinSource7, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOG, GPIO_PinSource10, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOG, GPIO_PinSource11, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOG, GPIO_PinSource12, GPIO_AF_LTDC);
& & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOG, &GPIO_InitStruct);
& & & &
& & & & //GPIO B
& & & & GPIO_PinAFConfig(GPIOB, GPIO_PinSource0, GPIO_AF_LTDC);
& & & & GPIO_PinAFConfig(GPIOB, GPIO_PinSource1, GPIO_AF_LTDC);
& & GPIO_PinAFConfig(GPIOB, GPIO_PinSource10, GPIO_AF_LTDC);
& & & & GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_LTDC);
& & & & GPIO_PinAFConfig(GPIOB, GPIO_PinSource8, GPIO_AF_LTDC);
& & & & GPIO_PinAFConfig(GPIOB, GPIO_PinSource9, GPIO_AF_LTDC);
& & & & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11;
& & & &
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOB, &GPIO_InitStruct);
& & & &
& & //GPIO D
& & GPIO_PinAFConfig(GPIOD, GPIO_PinSource3, GPIO_AF_LTDC);
& & GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3 ;
& && && && && && && && && &&&
& & GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
& & GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
& & GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
& & GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
& & GPIO_Init(GPIOD, &GPIO_InitStruct);
ST金币1721
在线时间203 小时
主题帖子精华
void f_LTDC_Init(void)
{
& & LTDC_InitTypeDef& && & LTDC_InitS
& &
& &&&/* Enable the LTDC Clock */
& & RCC_APB2PeriphClockCmd(RCC_APB2Periph_LTDC, ENABLE);
& &
& & /* Configure PLLSAI prescalers for LCD */& & & & & & & & & & & &
//& & RCC_PLLSAIConfig(200, 4, 3);& & & & //OK pclk run in 23MHz
//& & RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div4);//0127,old=2分频
& & //以下两行是野火的程序中的配置
& & RCC_PLLSAIConfig(200, 4, 3);
& & RCC_LTDCCLKDivConfig(RCC_PLLSAIDivR_Div2);
& &
& & /* Enable PLLSAI Clock */
& & RCC_PLLSAICmd(ENABLE);
& & /* Wait for PLLSAI activation */
& & while(RCC_GetFlagStatus(RCC_FLAG_PLLSAIRDY) == RESET)
& & {
& & }
& &
& & /* Enable the DMA2D Clock */
& & RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2D, ENABLE);
& & /* Configure the LCD Control pins */
& & LCD_AF_GPIOConfig();&&
& & & & & & & &
& & /* 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 = 255;& && && && &
& & LTDC_InitStruct.LTDC_BackgroundGreenValue = 0;& && && &
& & LTDC_InitStruct.LTDC_BackgroundBlueValue = 0;&&
& &&&
& & LTDC_InitStruct.LTDC_HorizontalSync = TFT_HSW-1;
& & /* Configure vertical synchronization height */
& & LTDC_InitStruct.LTDC_VerticalSync = TFT_VSW-1;
& & /* Configure accumulated horizontal back porch */
& & LTDC_InitStruct.LTDC_AccumulatedHBP = TFT_HBP-1;
& & /* Configure accumulated vertical back porch */
& & LTDC_InitStruct.LTDC_AccumulatedVBP = TFT_VBP-1;&&
& & /* Configure accumulated active width */&&
& & LTDC_InitStruct.LTDC_AccumulatedActiveW = TFT_PHYW + TFT_HBP -1;&&//old后-1,845
& & /* Configure accumulated active height */& && && && && && && &
& & LTDC_InitStruct.LTDC_AccumulatedActiveH = TFT_PHYH + TFT_VBP -1;&&//old后-1
& & /* Configure total width */
& & LTDC_InitStruct.LTDC_TotalWidth = TFT_PHYW + TFT_HBP + TFT_HFP -1;
& & /* Configure total height */
& & LTDC_InitStruct.LTDC_TotalHeigh = TFT_PHYH + TFT_VBP + TFT_VFP -1;
& &
& & LTDC_Init(&LTDC_InitStruct);
& &
//& & LTDC_ITConfig(LTDC_IT_LI, ENABLE);
//& & NVIC_SetPriority(LTDC_IRQn, 0);
//& & NVIC_EnableIRQ(LTDC_IRQn);
欢迎加入STM32/STM8社区技术交流群:& & &STM32Lxx开发群:
ST金币1387
在线时间218 小时
主题帖子精华
金牌会员, 积分 1478, 距离下一级还需 3522 积分
金牌会员, 积分 1478, 距离下一级还需 3522 积分
除了代码还是代码
站长推荐 /1
Tel: 3-8064
备案号: 苏ICP备号-2
|||意法半导体STM32/STM8技术社区
Powered by查看: 1443|回复: 5
关于7寸屏AT070TN92时序配置的一些问题
主题帖子精华
初级会员, 积分 63, 距离下一级还需 137 积分
在线时间3 小时
&/* Timing configuration */ &
& /* Configure horizontal synchronization width */ & &&
& LTDC_InitStruct.LTDC_HorizontalSync = 210;//210;//9;
& /* Configure vertical synchronization height */
& LTDC_InitStruct.LTDC_VerticalSync = 22; //22;
& /* Configure accumulated horizontal back porch */
& LTDC_InitStruct.LTDC_AccumulatedHBP = 45;//46;&
& /* Configure accumulated vertical back porch */
& LTDC_InitStruct.LTDC_AccumulatedVBP = 22;//23; &
& /* Configure accumulated active width */ &
& LTDC_InitStruct.LTDC_AccumulatedActiveW = 845;//(LCD_PIXEL_WIDTH+46);
& /* Configure accumulated active height */
& LTDC_InitStruct.LTDC_AccumulatedActiveH =502;//(LCD_PIXEL_HEIGHT+23);
& /* Configure total width */
& LTDC_InitStruct.LTDC_TotalWidth =1055;//(LCD_PIXEL_WIDTH+46+210);&
& /* Configure total height */
& LTDC_InitStruct.LTDC_TotalHeigh = 524;//(LCD_PIXEL_HEIGHT+23+22);
试了网上关于时序配置的几个版本,都不对,想请假下原子哥,你家的7寸屏时序是如何配置的。LTDC_HorizontalSync和LTDC_VerticalSync 等参数该写多少?
10:11 上传
点击文件名下载附件
744.63 KB, 下载次数: 555
回复【3楼】remind87:
---------------------------------
请看我们SSD1963版本的7寸屏模块的驱动代码。在驱动代码里面有详细参数。
主题帖子精华
金钱106261
在线时间679 小时
回复【3楼】remind87:
---------------------------------
请看我们SSD1963版本的7寸屏模块的驱动代码。在驱动代码里面有详细参数。
我是开源电子网站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺:
微信公众平台:正点原子
主题帖子精华
在线时间833 小时
我家的7寸屏没有用RGB接口,所以也就不需要配置这些参数。
开往春天的手扶拖拉机
主题帖子精华
初级会员, 积分 63, 距离下一级还需 137 积分
在线时间3 小时
回复【2楼】zuozhongkai:
---------------------------------
回复【2楼】zuozhongkai:
---------------------------------
屏幕模块上的芯片有用到的。。
主题帖子精华
初级会员, 积分 63, 距离下一级还需 137 积分
在线时间3 小时
回复【4楼】正点原子:
---------------------------------
谢谢原子哥~我改成&/*&Timing&configuration&*/&&
&&/*&Configure&horizontal&synchronization&width&*/&&&&&
&&LTDC_InitStruct.LTDC_HorizontalSync&=&39;//210;//9;
&&/*&Configure&vertical&synchronization&height&*/
&&LTDC_InitStruct.LTDC_VerticalSync&=&19;&//22;
&&/*&Configure&accumulated&horizontal&back&porch&*/
&&LTDC_InitStruct.LTDC_AccumulatedHBP&=&45;//46;&
&&/*&Configure&accumulated&vertical&back&porch&*/
&&LTDC_InitStruct.LTDC_AccumulatedVBP&=&22;//23;&&
&&/*&Configure&accumulated&active&width&*/&&
&&LTDC_InitStruct.LTDC_AccumulatedActiveW&=&845;//(LCD_PIXEL_WIDTH+46);
&&/*&Configure&accumulated&active&height&*/
&&LTDC_InitStruct.LTDC_AccumulatedActiveH&=502;//(LCD_PIXEL_HEIGHT+23);
&&/*&Configure&total&width&*/
&&LTDC_InitStruct.LTDC_TotalWidth&=1055;//(LCD_PIXEL_WIDTH+46+210);&
&&/*&Configure&total&height&*/
&&LTDC_InitStruct.LTDC_TotalHeigh&=&524;//(LCD_PIXEL_HEIGHT+23+22);
后能正常显示了
主题帖子精华
初级会员, 积分 63, 距离下一级还需 137 积分
在线时间3 小时
屏幕失真还挺严重的,也不知是什么问题。
Powered by

我要回帖

更多关于 文献求助 的文章

 

随机推荐