Begin implementing the embedded-hal alpha traits #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not exhaustive, but covers the traits which are analogous to those already implemented. It's possible for the
0.2.x
and1.0.0-alpha.x
releases to co-exist, as the user can control which set of traits are imported via the prelude.This has had some minimal level of testing, but I was not very thorough. Most of the functionality is identical to what we previously had so it should all work in theory. These traits are not currently being used in any examples, just to avoid additional changes. We can decide how we want to handle this at some other point I figure.
Implemented:
embedded_hal::delay::blocking::DelayUs
embedded_hal::digital::blocking::InputPin
embedded_hal::digital::blocking::OutputPin
embedded_hal::digital::blocking::StatefulOutputPin
embedded_hal::digital::blocking::ToggleableOutputPin
embedded_hal::i2c::blocking::I2c
embedded_hal::serial::nb::Read
embedded_hal::serial::nb::Write
embedded_hal::spi::nb::FullDuplex
Not Implemented:
embedded_hal::digital::blocking::IoPin
embedded_hal::serial::blocking::Write
embedded_hal::spi::blocking::SpiBus
embedded_hal::spi::blocking::SpiBusFlush
embedded_hal::spi::blocking::SpiBusRead
embedded_hal::spi::blocking::SpiBusWrite
For compatibility reasons I've created the
esp_hal_common::spi::SpiMode
enum, as we were not actually using the data encoded in the enums provided by the two versions ofembedded-hal
and they are obviously different types. Let me know how you feel about this, I wasn't really sure how else to accomplish this.If you feel anything is missing please let me know and I'll add it in. I'll likely deal with the unimplemented traits in a separate PR at some point.