As discussed previously and in today's meeting (chatlog, minutes), we've decided to not have serial traits, in favor of a more general "io" abstraction.
This PR moves the embedded-io crate to the embedded-hal repo. The crate currently living at https://github.com/embassy-rs/embedded-io, that repo will be archived once the move is complete.
Changes from the embassy repo:
Removed defmt impls, needed for 1.0.
Split embedded-io and embedded-io-async. Needed for 1.0, so we don't have to wait for AFIT to be stable.
Removed async adapters for tokio and futures. I'm not sure if we want them here or it's better to leave them to community crates. If we do, I'll add them in a future PR.
Added embedded-io::{ReadReady, WriteReady}. They're separate from the Read/Write traits since they can't be trivially implemented on top of std::io traits, so this would present a problem for the adapters. (It's likely implementable with e.g. some weird poll()/select() contraption, but that's OS-specific and I'm sure has other tradeoffs, so I'd rather not make the adapters do that by default.)
The crate has been added by parts in several commits to make review easier.
The embedded-io crate has been around for more than 1 year, so it's somewhat "proven". The design is the same as std::io, which is more than proven. Highlights of uses of embedded-io in the field (see more)
As discussed previously and in today's meeting (chatlog, minutes), we've decided to not have serial traits, in favor of a more general "io" abstraction.
This PR moves the embedded-io crate to the embedded-hal repo. The crate currently living at https://github.com/embassy-rs/embedded-io, that repo will be archived once the move is complete.
Changes from the embassy repo:
defmt
impls, needed for 1.0.embedded-io
andembedded-io-async
. Needed for 1.0, so we don't have to wait for AFIT to be stable.tokio
andfutures
. I'm not sure if we want them here or it's better to leave them to community crates. If we do, I'll add them in a future PR.embedded-io::{ReadReady, WriteReady}
. They're separate from theRead
/Write
traits since they can't be trivially implemented on top ofstd::io
traits, so this would present a problem for the adapters. (It's likely implementable with e.g. some weirdpoll()/select()
contraption, but that's OS-specific and I'm sure has other tradeoffs, so I'd rather not make the adapters do that by default.)The crate has been added by parts in several commits to make review easier.
The
embedded-io
crate has been around for more than 1 year, so it's somewhat "proven". The design is the same asstd::io
, which is more than proven. Highlights of uses ofembedded-io
in the field (see more)embassy-nrf
DMA-powered UART implembassy-stm32
irq-driven UARTembassy-stm32
DMA-powered UARTembassy-rp
irq-driven UARTembassy-sync
Pipeembassy-net
TcpSocketembedded-tls
TLS client, uses embedded-io to work on top of any TCP socket.reqwless
HTTP client, uses embedded-io to work on top of any TCP socket or on top ofembedded-tls
.rust-mqtt
, same.embedded-svc
abstractions, widely used in the ESP32 ecosystem.embedded-nal-async
models TCP sockets asRead+Write
.es-wifi-driver
, AT commands over uartesp8266-at-driver
, AT commands over uart