Skip to content

Add support to CST816 chips with different register for chip ID #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

Neradoc
Copy link
Contributor

@Neradoc Neradoc commented Mar 31, 2025

I have successfully used the library with a CST816D chips with no other modification than removing the test for the chip_type. For example the Waveshare esp32 s3 touch lcd 2 uses it as well as a generic ESP32-C3 round display board (that is not in CP yet).
When running, the library reports:

fw_version: B600, chip_type: 04

But it's the chip ID that's supposed to be B6.
I was not able to find a datasheet containing that information, but the CST816_TouchLib Arduino library has these constants. Also in zephyr's support.

const uint8_t TOUCH_REGISTER_CHIP_ID			= 0xA7;		//chip ID (/model) (1 byte)
const uint8_t TOUCH_REGISTER_PROJ_ID			= 0xA8;		//project number (1 byte)
const uint8_t TOUCH_REGISTER_FW_VERSION			= 0xA9;		//firmware version

So since the rest of the registers used seem to work the same, this PR just tries to find a chip ID to validate that it's a valid chip.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit eb7979d into adafruit:main Mar 31, 2025
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 8, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_CST8XX to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_CST8XX#2 from Neradoc/add-support-for-cst816-chips

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 2.1.0 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#40 from alexleft/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_WM8960 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_WM8960#6 from relic-se/headphone_power_channel_swap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants