Still got an issue, even after handling the rgb888 to rgb565 conversion!! The contrast is way off as though the colours are getting saturated somehow (I've even tried converting all logic to 32 bit to ensure I don't get any overflows with the shifts!!).
This is with the 9486
and with the 9488
The code that is used to read from the LCD is:
// assumes read pointers already set with LCD_setAddrWindowRead()
void
LCD_readImageRGB565 (uint8_t *p_buff, uint32_t pixelNum)
{
volatile uint16_t* p_lcdAddr = (volatile uint16_t*) (getDrawAddress ());
for (uint32_t x = 0; x < pixelNum; x++)
{
#if defined (ILI9486)
uint16_t data = *p_lcdAddr;
p_buff[x * 2 + 1] = data >> 8;
p_buff[x * 2 + 0] = data & 0x00ff;
#else
uint16_t f = *p_lcdAddr;
uint16_t s = *p_lcdAddr;
uint16_t t = *p_lcdAddr;
uint16_t data = LCD_color565 (f >> 8, f & 0xff, s >> 8);
p_buff[x * 2 + 1] = data >> 8;
p_buff[x * 2 + 0] = data & 0x00ff;
data = LCD_color565 (s & 0xff, t >> 8, t & 0xff);
p_buff[x * 2 + 3] = data >> 8;
p_buff[x * 2 + 2] = data & 0x00ff;
x++;
#endif
}
}
Clearing the screen down to a single colour and reading back, I get sensible values but in a more complex example (i.e. with a picture) you can see it ain't right!!
I feel I must be missing something obvious but it's not obvious to me at the moment!!