Closed Sciancisco closed 1 month ago
You are probably confused because we interface with two versions of embedded-hal
:
embedded_hal
is the new v1.0 version that was released a few months backembedded_hal_v0
is the older v0.# version that was used by everyone before that. we still support it because there are many drivers that still target the older version only.The relevant dependency definitions are here:
You probably need to import the older version of embedded-hal
to access the traits that you need.
It worked! Thank you! I didn't know this cargo trick.
And thank you a lot for this library! First timer in embedded and with its documentation and examples, it is relatively easy to use.
I have a problem importing
SetDutyCycle
.Here are my imports:
Here is my error:
I built the documentation and I can find
embedded_hal::pwm
. I looked at the source ofembedded_hal
linked in the doc and it does declarepub mod pwm
.embedded_hal
is in the dependencies of myCargo.toml
. Therefore, rustc should find the pwm module.But it gets weirder (to me at least) because looking at this same source code, it shouldn't be able to find the
serial
module because it is not declared inembedded_hal
. In fact, search through all the doc, there is no moduleserial
at all !..I've managed to trace back the
Read
andWrite
traits toarduino_hal::prelude::{_embedded_hal_serial_Read, _embedded_hal_serial_Write}
, but their source code link is broken as it tries to getembedded_hal/serial.rs.html
, the non existentembedded_hal::serial
...And what's with
embedded_hal
andembedded_hal_v0
? Because inavr_hal_generic
it imports theRead
andWrite
traits from v0 but v0 doesn't appear to exist anyway, not even in theCargo.lock
...I am stumped that it finds a module that it shouldn't and cannot find a module that it should :laughing: :thinking: