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

Support async in i2c Driver by using new ESP-IDF V5.2 driver impl #388

Open
1 task done
teamplayer3 opened this issue Mar 6, 2024 · 1 comment · May be fixed by #397
Open
1 task done

Support async in i2c Driver by using new ESP-IDF V5.2 driver impl #388

teamplayer3 opened this issue Mar 6, 2024 · 1 comment · May be fixed by #397
Labels
enhancement New feature or request

Comments

@teamplayer3
Copy link
Contributor

teamplayer3 commented Mar 6, 2024

i2c Driver Docs

The driver APIs have been clearly divided into master and slave, with all calls now separated into i2c_master_* and i2c_slave_*. This provides a higher-level interface for the i2c driver. To support async operations in master mode, callbacks can be set in transmit, transmit_receive, and receive to signal when the operation is complete. An event callback can also be registered with register_event_callbacks to receive events such as I2C_EVENT_ALIVE, I2C_EVENT_DONE, and I2C_EVENT_NACK. To initiate a receive job call slave_receive while in slave mode and to wait for any receive data a callback can be registered with register_event_callbacks.

Changes to current i2c impl

  • Add AsyncI2cSlaveDriver
  • Add I2cBusDriver: allows adding I2cDevice
  • Add I2cDevice: exposes read, write, read_write
  • Add AsyncI2cBusDriver: allows adding AsyncI2cDevice (adds a guard that only one device can use the bus at once), cannot depend on I2cBusDriver because config of bus requires config of cmd queue depth for async operations
  • Add AsyncI2cDevice: exposes async read, async write, async read_write
  • add cfg guards for current esp calls major == 4 || version == 5.1
  • add cfg guards to new calls major != 4 && version != 5.1

Challenges

  • new i2c API does not expose transactional operations

Tasks

Preview Give feedback
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Mar 6, 2024
@teamplayer3 teamplayer3 linked a pull request Mar 21, 2024 that will close this issue
6 tasks
@Vollbrecht Vollbrecht added the enhancement New feature or request label Jun 21, 2024
@kaaax0815
Copy link

Whats the status on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants