Skip to content

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
Member

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
Member

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