Skip to content

Commit

Permalink
GT911 add getConfigVersion method
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Sep 5, 2024
1 parent 0a4c65f commit a181ceb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/TouchDrvGT911.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ class TouchDrvGT911 :
return fw_ver[0] | (fw_ver[1] << 8);
}

uint8_t getConfigVersion()
{
return readGT911(GT911_CONFIG_VERSION);
}


bool getResolution(int16_t *x, int16_t *y)
{
uint8_t x_resolution[2] = {0}, y_resolution[2] = {0};
Expand Down Expand Up @@ -386,6 +392,7 @@ class TouchDrvGT911 :
__userData = user_data;
}


private:

uint8_t readGT911(uint16_t cmd)
Expand Down Expand Up @@ -478,7 +485,7 @@ class TouchDrvGT911 :
delay(18);
this->setGpioMode(__irq, INPUT);

}
}

// For variants where the GPIO is controlled by I2C, a delay is required here
delay(20);
Expand All @@ -495,7 +502,7 @@ class TouchDrvGT911 :
log_i("Resolution : X = %d Y = %d", x, y);
log_i("Vendor id:%d", getVendorID());
log_i("Refresh Rate:%d ms", getRefreshRate());

return true;
}

Expand Down

0 comments on commit a181ceb

Please sign in to comment.