Bug in Chip_LCD_Init() in lcd_17xx_40xx.c?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug in Chip_LCD_Init() in lcd_17xx_40xx.c?

862 Views
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.

Labels (5)
Tags (3)
0 Kudos
1 Reply

403 Views
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 Kudos