Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

v0.4.0 is missing embedded_hal_0_2::blocking::i2c traits?

Aperta
#113 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
linux, rust
Ambito
embedded-iot

Direzione di ricerca

Inizia confrontando le implementazioni di embedded-hal in v0.3.2 e v0.4.0-alpha.1, quindi esamina examples/basic.rs e i trait bounds riportati nel codice consumer. Il lavoro è completato quando il tipo I2cdev soddisfa gli embedded_hal_0_2 blocking I2C traits richiesti oppure la modifica di compatibilità è documentata chiaramente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This breaks when moving from 0.3.2 to [0.4.0-alpha.1](https://github.com/rust-embedded/linux-embedded-hal/compare/v0.3.0...v0.4.0-alpha.1) -- but the changelog does not mention this?

error[E0277]: the trait bound `I2cdev: _embedded_hal_blocking_i2c_Write` is not satisfied
  --> examples/basic.rs:12:26
   |
12 |         Rv8803::from_i2c(i2c, rv8803::bus::Address::Default).expect("Failed to initialize RV8803");
   |         ---------------- ^^^ the trait `_embedded_hal_blocking_i2c_Write` is not implemented for `I2cdev`
   |         |
   |         required by a bound introduced by this call
   |
note: required by a bound in `rv8803::<impl Rv8803<Bus<'a, I2C>>>::from_i2c`
  --> /home/mike/esp/rv8803/src/lib.rs:29:11
   |
29 |         + embedded_hal_0_2::blocking::i2c::Write<Error = E>,
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `rv8803::<impl Rv8803<Bus<'a, I2C>>>::from_i2c`
...
39 |     pub fn from_i2c(i2c: I2C, address: crate::bus::Address) -> Result<Self, E> {
   |            -------- required by a bound in this associated function

error[E0277]: the trait bound `I2cdev: WriteRead` is not satisfied
  --> examples/basic.rs:12:26
   |
12 |         Rv8803::from_i2c(i2c, rv8803::bus::Address::Default).expect("Failed to initialize RV8803");
   |         ---------------- ^^^ the trait `WriteRead` is not implemented for `I2cdev`
   |         |
   |         required by a bound introduced by this call
   |
note: required by a bound in `rv8803::<impl Rv8803<Bus<'a, I2C>>>::from_i2c`
  --> /home/mike/esp/rv8803/src/lib.rs:28:10
   |
28 |     I2C: embedded_hal_0_2::blocking::i2c::WriteRead<Error = E>
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `rv8803::<impl Rv8803<Bus<'a, I2C>>>::from_i2c`
...
39 |     pub fn from_i2c(i2c: I2C, address: crate::bus::Address) -> Result<Self, E> {
   |            -------- required by a bound in this associated function
Lingua principale
Rust
Stelle
319
Fork
60
Merge medio
12h 31m
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-embedded/linux-embedded-hal

Tutte le issue di rust-embedded/linux-embedded-hal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.