Skip to content
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

Feature/i2c probe #122

Merged
merged 4 commits into from
Nov 8, 2023
Merged

Feature/i2c probe #122

merged 4 commits into from
Nov 8, 2023

Conversation

finger563
Copy link
Contributor

Description

  • Add bool I2c::probe_device(uint8_t dev_addr) which allows sends start/address/stop and checks the ACK to return bool of whether the device was found or not
  • Add mutex to i2c class and protect all calls to i2c functions now that the probe_device function uses lower-level (unprotected) idf functions, bypassing the idf i2c mutex
  • feat(tt21100): update() now returns bool of whether there is new data or not, to match the gt911 api.

Motivation and Context

  • Allows i2c configuration to test which addresses properly respond before setting addresses or progressing further in the program
  • Allows more easy reuse of downstream functions for both the gt911 and tt21100 touch controllers.

How has this been tested?

Building and running with these new changes in the https://github.com/esp-cpp/wireless-debug-display project

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Add bool I2c::probe_device(uint8_t dev_addr) which allows sends start/address/stop and checks the ACK to return bool of whether the device was found or not
* Add mutex to i2c class and protect all calls to i2c functions now that the probe_device function uses lower-level (unprotected) idf functions, bypassing the idf i2c mutex
@finger563 finger563 merged commit 44f0d43 into main Nov 8, 2023
46 checks passed
@finger563 finger563 deleted the feature/i2c-probe branch November 8, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant