Implement transactional I2C interface and add example#44
Conversation
|
r? @nastevens (rust_highfive has picked a reviewer for you, use r? to override) |
|
Sorry, I haven't really been involved in these changes. Adding @ryankurte and @posborne instead as I believe they have. |
7512dbc to
45d4873
Compare
b95b792 to
468b21a
Compare
|
@ryankurte Do you know why |
|
ahh, yeah whoops i should have caught that over on you should be able to fix this in lmk how that goes / if you get stuck lmk and i can provide more guidance. |
4fe086e to
23fa418
Compare
|
Ah, thank you! I added address mode support to the transactional traits over at rust-embedded/embedded-hal#260. |
|
ohh right, went back and looked and you've also gotta drop the sorry i missed that from the last advice, the following patch to diff --git a/src/blocking/i2c.rs b/src/blocking/i2c.rs
index 087d208..27b2092 100644
--- a/src/blocking/i2c.rs
+++ b/src/blocking/i2c.rs
@@ -334,12 +334,12 @@ pub mod transactional {
/// Default implementation of `blocking::i2c::Write`, `blocking::i2c::Read` and
/// `blocking::i2c::WriteRead` traits for `blocking::i2c::Transactional` implementers.
- pub trait Default<A: AddressMode, E>: Transactional<A, Error = E> {}
+ pub trait Default<A: AddressMode>: Transactional<A> {}
- impl<A, E, S> Write<A> for S
+ impl<A: 'static , E, S> Write<A> for S
where
A: AddressMode,
- S: self::Default<A, E> + Transactional<A, Error = E>,
+ S: self::Default<A> + Transactional<A, Error = E>,
{
type Error = E;
@@ -351,7 +351,7 @@ pub mod transactional {
impl<A, E, S> Read<A> for S
where
A: AddressMode,
- S: self::Default<A, E> + Transactional<A, Error = E>,
+ S: self::Default<A> + Transactional<A, Error = E>,
{
type Error = E;
@@ -363,7 +363,7 @@ pub mod transactional {
impl<A, E, S> WriteRead<A> for S
where
A: AddressMode,
- S: self::Default<A, E> + Transactional<A, Error = E>,
+ S: self::Default<A> + Transactional<A, Error = E>,
{
type Error = E; |
23fa418 to
d4ee09b
Compare
|
@ryankurte Interesting. That works, thank you!
Could you elaborate or refer me to some docs about this? |
260: Transactional I2C address modes r=ryankurte a=eldruin The transactional I2C traits did not support multiple address modes. Thanks to @ryankurte for noticing this at rust-embedded/linux-embedded-hal#44 Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
my thinking was that are we happy with / ready to land this then? |
|
Yes, I am happy with the code itself as-is. However, to merge this we would need to make a new alpha release of |
261: Embedded-hal 1.0.0-alpha.4 release r=ryankurte a=eldruin Once we have a new alpha release we can move forward with merging rust-embedded/linux-embedded-hal#44 I also added the `html_root_url`, which is annoying but necessary according to the Rust API guidelines. Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
d4ee09b to
f4d528b
Compare
|
I have updated this to use |
44: Implement transactional I2C interface and add example r=ryankurte a=eldruin I implemented the transactional I2C interface from rust-embedded/embedded-hal#223 and added an example with a driver which does a combined Write/Read transaction. This is based on previous work from #33 by @ryankurte, rust-embedded/rust-i2cdev#51 and is similar to #35. Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
|
Timed out. |
|
Bors timed out again. |
|
yeeeah, we really need to do #51 like all the other |
|
Hmm, but in this case Travis is not the problem. It is bors the one that timed out. Or am I missing something else? |
|
i might be misunderstanding but i thought the bors timeouts were usually because travis doesn't schedule / execute the job quickly enough (because the bors retry |
|
Build succeeded: |
|
Ah, I see. That sounds possible. Thanks! |
I implemented the transactional I2C interface from rust-embedded/embedded-hal#223 and added an example with a driver which does a combined Write/Read transaction.
This is based on previous work from #33 by @ryankurte, rust-embedded/rust-i2cdev#51 and is similar to #35.