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

Transactional I2C #542

Merged
merged 3 commits into from
Oct 18, 2022
Merged

Transactional I2C #542

merged 3 commits into from
Oct 18, 2022

Conversation

SpeedCrash100
Copy link
Contributor

A transactional HAL API implementation for I2C. Closes #445.

I have to rework i2c code to implement this:

  • prepare_read, prepare_write - methods to send start and address only
  • write_wo_prepare, read_wo_prepare - methods like old read, write but they do not send start and address.
  • read_bytes, write_bytes - this methods now only for send/receive. The do not send start, stop or address.
  • All public api's behaviour is untouched so there are no breaking changes for users.

Note: I have to create duplicate methods transaction_slice and transaction because Operation doesn't implement Clone to send slice as iterator.

@burrbull
Copy link
Contributor

LGTM. Is it tested?

@SpeedCrash100
Copy link
Contributor Author

LGTM. Is it tested?

I have tested on operations sequences Write-Write and Write-Read, and single Write. No problems detected in these cases.

@burrbull
Copy link
Contributor

bors r+

@bors bors bot merged commit 6d0c292 into stm32-rs:master Oct 18, 2022
@SpeedCrash100 SpeedCrash100 deleted the transaction-i2c branch October 18, 2022 16:02
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.

transactional i2c
2 participants