|
@@ -231,27 +231,6 @@ static void SetLayout( struct GDS_Device* Device, bool HFlip, bool VFlip, bool R
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- Private->MADCtl = 0x80;
|
|
|
- if (HFlip) {
|
|
|
- Private->MADCtl = 0x20;
|
|
|
- int a = Device->Height;
|
|
|
- int b = Device->Width;
|
|
|
- Device->Height = b;
|
|
|
- Device->Width = a;
|
|
|
- }
|
|
|
- if (Rotate) {
|
|
|
- Private->MADCtl = 0x40;
|
|
|
- }
|
|
|
- if (VFlip) {
|
|
|
- Private->MADCtl = 0xE0;
|
|
|
- int a = Device->Height;
|
|
|
- int b = Device->Width;
|
|
|
- Device->Height = b;
|
|
|
- Device->Width = a;
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
ESP_LOGI(TAG, "SetLayout 255 Private->MADCtl=%hhu", Private->MADCtl);
|
|
|
|
|
|
Device->WriteCommand( Device, 0x36 );
|
|
@@ -293,13 +272,7 @@ static bool Init( struct GDS_Device* Device ) {
|
|
|
|
|
|
|
|
|
Device->WriteCommand( Device, 0x11 );
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
GDS_SetContrast( Device, 0x7f );
|
|
|
Device->SetLayout( Device, false, false, false );
|
|
@@ -319,45 +292,14 @@ static bool Init( struct GDS_Device* Device ) {
|
|
|
Device->WriteCommand( Device, 0x26 ); WriteByte( Device, 0x01 );
|
|
|
|
|
|
Device->WriteCommand( Device, 0xE0 );
|
|
|
- WriteByte( Device, 0x0F ); WriteByte( Device, 0x31 ); WriteByte( Device, 0x2B ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x0E );
|
|
|
- WriteByte( Device, 0x08 ); WriteByte( Device, 0x4E ); WriteByte( Device, 0xF1 ); WriteByte( Device, 0x37 ); WriteByte( Device, 0x07 );
|
|
|
- WriteByte( Device, 0x10 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x0E ); WriteByte( Device, 0x09 ); WriteByte( Device, 0x00 );
|
|
|
+ WriteByte( Device, 0x0F ); WriteByte( Device, 0x31 ); WriteByte( Device, 0x2B ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x0E );
|
|
|
+ WriteByte( Device, 0x08 ); WriteByte( Device, 0x4E ); WriteByte( Device, 0xF1 ); WriteByte( Device, 0x37 ); WriteByte( Device, 0x07 );
|
|
|
+ WriteByte( Device, 0x10 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x0E ); WriteByte( Device, 0x09 ); WriteByte( Device, 0x00 );
|
|
|
Device->WriteCommand( Device, 0xE1 );
|
|
|
- WriteByte( Device, 0x00 ); WriteByte( Device, 0x0E ); WriteByte( Device, 0x14 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x11 );
|
|
|
- WriteByte( Device, 0x07 ); WriteByte( Device, 0x31 ); WriteByte( Device, 0xC1 ); WriteByte( Device, 0x48 ); WriteByte( Device, 0x08 );
|
|
|
- WriteByte( Device, 0x0F ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x31 ); WriteByte( Device, 0x36 ); WriteByte( Device, 0x0F );
|
|
|
+ WriteByte( Device, 0x00 ); WriteByte( Device, 0x0E ); WriteByte( Device, 0x14 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x11 );
|
|
|
+ WriteByte( Device, 0x07 ); WriteByte( Device, 0x31 ); WriteByte( Device, 0xC1 ); WriteByte( Device, 0x48 ); WriteByte( Device, 0x08 );
|
|
|
+ WriteByte( Device, 0x0F ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x31 ); WriteByte( Device, 0x36 ); WriteByte( Device, 0x0F );
|
|
|
|
|
|
-
|
|
|
- Device->WriteCommand( Device, 0xE0 );
|
|
|
- WriteByte( Device, 0x1F ); WriteByte( Device, 0x1A ); WriteByte( Device, 0x18 ); WriteByte( Device, 0x0A ); WriteByte( Device, 0x0F );
|
|
|
- WriteByte( Device, 0x06 ); WriteByte( Device, 0x45 ); WriteByte( Device, 0x87 ); WriteByte( Device, 0x32 ); WriteByte( Device, 0x0a );
|
|
|
- WriteByte( Device, 0x07 ); WriteByte( Device, 0x02 ); WriteByte( Device, 0x07 ); WriteByte( Device, 0x05 ); WriteByte( Device, 0x00 );
|
|
|
- Device->WriteCommand( Device, 0xE1 );
|
|
|
- WriteByte( Device, 0x00 ); WriteByte( Device, 0x25 ); WriteByte( Device, 0x27 ); WriteByte( Device, 0x05 ); WriteByte( Device, 0x10 );
|
|
|
- WriteByte( Device, 0x09 ); WriteByte( Device, 0x3a ); WriteByte( Device, 0x78 ); WriteByte( Device, 0x4d ); WriteByte( Device, 0x05 );
|
|
|
- WriteByte( Device, 0x18 ); WriteByte( Device, 0x0d ); WriteByte( Device, 0x38 ); WriteByte( Device, 0x3a ); WriteByte( Device, 0x1F );
|
|
|
- */
|
|
|
-
|
|
|
- Device->WriteCommand( Device, 0xE0 );
|
|
|
- WriteByte( Device, 0x0F ); WriteByte( Device, 0x3F ); WriteByte( Device, 0x2F ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x10 );
|
|
|
- WriteByte( Device, 0x0A ); WriteByte( Device, 0x53 ); WriteByte( Device, 0xD5 ); WriteByte( Device, 0x40 ); WriteByte( Device, 0x0A );
|
|
|
- WriteByte( Device, 0x13 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x08 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x00 );
|
|
|
- Device->WriteCommand( Device, 0xE1 );
|
|
|
- WriteByte( Device, 0x00 ); WriteByte( Device, 0x00 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x03 ); WriteByte( Device, 0x0F );
|
|
|
- WriteByte( Device, 0x05 ); WriteByte( Device, 0x2C ); WriteByte( Device, 0xA2 ); WriteByte( Device, 0x3F ); WriteByte( Device, 0x05 );
|
|
|
- WriteByte( Device, 0x0E ); WriteByte( Device, 0x0C ); WriteByte( Device, 0x37 ); WriteByte( Device, 0x3c ); WriteByte( Device, 0x0F );
|
|
|
- */
|
|
|
-
|
|
|
- Device->WriteCommand( Device, 0xE0 );
|
|
|
- WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 );
|
|
|
- WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 );
|
|
|
- WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 ); WriteByte( Device, 0x22 );
|
|
|
- Device->WriteCommand( Device, 0xE1 );
|
|
|
- WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 );
|
|
|
- WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 );
|
|
|
- WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 ); WriteByte( Device, 0x10 );
|
|
|
- */
|
|
|
-
|
|
|
|
|
|
Device->DisplayOn( Device );
|
|
|
Device->Update( Device );
|
|
@@ -374,13 +316,11 @@ static const struct GDS_Device ILI9341_X = {
|
|
|
|
|
|
struct GDS_Device* ILI9341_Detect(char *Driver, struct GDS_Device* Device) {
|
|
|
uint8_t Model;
|
|
|
-
|
|
|
int Depth=16;
|
|
|
|
|
|
if (strcasestr(Driver, "ILI9341")) Model = ILI9341;
|
|
|
else if (strcasestr(Driver, "ILI9341_24")) Model = ILI9341_24;
|
|
|
else return NULL;
|
|
|
-
|
|
|
|
|
|
if (!Device) Device = calloc(1, sizeof(struct GDS_Device));
|
|
|
|