Bug in Chip_LCD_Init() in lcd_17xx_40xx.c?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug in Chip_LCD_Init() in lcd_17xx_40xx.c?

1,282 次查看
giusloq
Contributor III

void Chip_LCD_Init(LPC_LCD_T *pLCD, LCD_CONFIG_T *LCD_ConfigStruct)
{

   /* ... */

   /* set bits per pixel */
   regValue = LCD_ConfigStruct->BPP << 1;

   /* set color format RGB */
   regValue |= LCD_ConfigStruct->color_format << 8;
   regValue |= LCD_ConfigStruct->LCD << 4;
   if (LCD_ConfigStruct->Dual == 1) {
      regValue |= 1 << 7;
   }
   pLCD->CTRL = regValue;

   /* ... */

}

The field BPP (CTRL[3:1]) is: 0=1bpp, 1=2bpp, 2=4bpp, 3=8bpp, 4=16bpp, 5=24bpp, 6=16bpp, 7=12bpp. So you need to assign the value 5 (if you need 24bpp) to the BPP field of LCD_CONFIG_T struct. However this is not clear and it seems you can assign directly 24 to BPP. Maybe an enumeration is better in this case.

标签 (5)
标记 (3)
0 项奖励
回复
1 回复

823 次查看
soledad
NXP Employee
NXP Employee

Hi,

Thank you for your feedback, we will check this issue.

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复