Skip to content

Commit

Permalink
Added CST816T HomeKey function
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Sep 11, 2023
1 parent 92e1b6a commit ec6958f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/TouchDrvCSTXXX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,20 @@ class TouchDrvCSTXXX :
return 0;
}

// Only suitable for AMOLED 1.91 inch
// RAW:00,00,01,80,78,02,58,00,00,FF,FF,FF,FF,
if (buffer[2] == 0x01 && buffer[3] == 0x80 && buffer[4] == 0x78 && buffer[5] == 0x02 && buffer[6] == 0x58) {
if (__homeButtonCb) {
__homeButtonCb(this->user_data);
}
return 0;
}

uint8_t point = buffer[2] & 0x0F;
#ifdef LOG_PORT
LOG_PORT.print("RAW:");
for (int i = 0; i < 13; ++i) {
LOG_PORT.print(buffer[i], HEX); LOG_PORT.print(",");
LOG_PORT.printf("%02X,", buffer[i]);
}
LOG_PORT.println();
#endif
Expand Down Expand Up @@ -396,7 +405,7 @@ class TouchDrvCSTXXX :
checksum <<= 8;
checksum |= buffer[4];


#if 0 //Skip firmware detection
log_i("Chip ic version:0x%X, checksum:0x%X\n",
fwVersion, checksum);

Expand All @@ -408,6 +417,8 @@ class TouchDrvCSTXXX :
log_i("firmware info read error .\n");
return false;
}
#endif


// Exit Command mode
writeRegister(0xD1, 0x09);
Expand Down

0 comments on commit ec6958f

Please sign in to comment.