An easy test is to XOR bits in the MADCTL register (0x36)
Different controllers implement bit 0 and bit 1 as Vertical and Horizontal Flip.
This shows up quite well. But there are specific Manufacture registers that behave differently.
Here is a UTFT sketch:
#include <UTFT.h>
// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
//UTFT myGLCD(model,RS,WR,CS,RST,[ALE]); //assumes that nRD is tied high
//UTFT myGLCD(ILI9481, 38, 39, 40, 41);
//UTFT myGLCD(ILI9486, 38, 39, 40, 41);
UTFT myGLCD(R61581, 38, 39, 40, 41);
void setup()
{
myGLCD.InitLCD(PORTRAIT);
myGLCD.clrScr();
myGLCD.setFont(BigFont);
}
void WriteCmdParamN(uint16_t cmd, int8_t N, uint8_t *block)
{
cbi(myGLCD.P_CS, myGLCD.B_CS);
myGLCD.LCD_Write_COM(cmd);
while (N-- > 0) {
myGLCD.LCD_Write_DATA(*block++);
}
sbi(myGLCD.P_CS, myGLCD.B_CS);
}
char *msgs[] = {
"0: Flip Vert",
"1: Flip Horiz",
"2: Horiz refresh",
"3: RGB-BGR order",
"4: Vert refresh",
"5: Row Col Xchange",
"6: Column Order",
"7: Row Order",
};
void loop()
{
uint8_t initval = 0x0A; //what is in your initlcd.h for 0x36
int w = myGLCD.getDisplayXSize(), h = myGLCD.getDisplayYSize();
uint8_t i = 0, madctl;
for (i = 0; i < 8; i++) if (initval & (1 << i)) msgs[i][2] = '!';
for (i = 0; i < 2; i++) {
WriteCmdParamN(0x36, 1, &initval);
myGLCD.clrScr();
myGLCD.setColor(255, 255, 255); //WHITE
myGLCD.setFont(SevenSegNumFont);
myGLCD.print("4", 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print(msgs[i], 0, h / 2);
delay(2000);
myGLCD.clrScr();
madctl = (1 << i) ^ initval;
WriteCmdParamN(0x36, 1, &madctl);
myGLCD.setColor(0, 0, 255);
myGLCD.setFont(SevenSegNumFont);
myGLCD.print("4", 0, 0);
myGLCD.setFont(BigFont);
myGLCD.print(msgs[i], 0, h / 2);
delay(5000);
}
}
David.