Commit Graph

97 Commits

Author SHA1 Message Date
Markus Reiter
db179e98fa Merge i2c re-exports. 2024-01-17 02:02:57 +01:00
Markus Reiter
a5ad7bf4f1 Re-export digital error types in embedded-hal-async. 2024-01-17 02:00:18 +01:00
Dario Nieuwenhuis
983a60bc8e Link to announcement blog post and migration guide in changelogs. 2024-01-09 23:50:13 +01:00
Dario Nieuwenhuis
11c8b9e23f Release embedded-hal{,-async,-nb} v1.0.0, embedded-hal-bus v0.1.0 2024-01-09 22:12:03 +01:00
Ralf
74ca5ae008 Commit b6764ecd replaced closures by operations. Update documentation accordingly. 2023-12-30 20:05:43 +01:00
Dario Nieuwenhuis
38f6070118 Release v1.0.0-rc.3 2023-12-14 14:29:52 +01:00
Dario Nieuwenhuis
4857fefc90 ci: simplify, test MSRV.
- Use separate jobs instead of `matrix`. The Github Actions matrix is very cursed, especially if you use `include`. We don't have that many combinations, IMO doing separate jobs is way more straightforward and only slightly more verbose.
- `embedded-hal` needs `rust-version = 1.60` because it uses `dep:`.

Fixes #538
2023-12-13 01:30:40 +01:00
Dario Nieuwenhuis
2767cbdce1 release embedded-hal-* v1.0.0-rc.2, embedded-io-{async,adapters} v0.6.1 2023-11-29 14:48:23 +01:00
Dario Nieuwenhuis
c2eab4d4bc spi: make Operation::DelayNs with nanosecond granularity. 2023-11-28 22:53:01 +01:00
Dario Nieuwenhuis
4ec58c85d8 Rename DelayUs to DelayNs, add delay_ns. 2023-11-28 22:53:01 +01:00
Dario Nieuwenhuis
c9fbac0d80 Use feature() on nightly toolchains only.
`feature()` is only allowed on Nightly, it's completely disallowed on stable and beta
even for already-stabilized features. So, we autodetect whether the user is using nightly
and conditionally use `feature()`. This allows the crates to Just Work on current 1.75 beta
and will also Just Work when 1.75 stable is out.

Keeping `feature()` is desirable to keep support for:

- Espressif's xtensa rustc fork. (they build from the stable branch but enable use of `feature()`, so latest xtensa rustc still requires `feature()`)
- Users of older nightlies

Once xtensa rust 1.75 is out, we can remove this (upstream nightlies that require `feature()` will be quite old by then, so dropping support for them should be OK).

I decided to not use already-made crates like `rustversion` to do this because they're quite big and do way more than what we need, so I felt badd adding another dep. The code is inspired from `rustversion`'s build.rs.
2023-11-28 19:59:32 +01:00
Anton Patrushev
3471d21ca7 fix embedded-io-async link in readme 2023-11-26 23:55:15 +04:00
rmsyn
739fa02ebe async: disable Send lint in async traits
Adds `#[allow(async_fn_in_trait)]` to disable the lint in `async` trait
functions recommending `Send` in the return type.

Adding the type annotation is currently unstable, has little-to-no
utility in current crates using `embedded-hal`, and will break those users.

See
<https://github.com/rust-embedded/embedded-hal/pull/515#issuecomment-1763525962>
for details and discussion.
2023-10-15 23:40:15 +00:00
Dario Nieuwenhuis
a4dcba4cde Add allow(stable_features).
Needed to pass deny-warnings on CI without breaking older nightlies.
2023-10-03 20:32:56 +02:00
Dario Nieuwenhuis
8480a33ee5 Merge pull request #495 from nyurik/clippy
A few clippy lint fixes
2023-09-01 11:32:56 +00:00
Yuri Astrakhan
3005247c9b A few clippy lint fixes
* added `[must_use]`
* added a few semicolons
2023-09-01 00:03:36 -04:00
Yuri Astrakhan
7bcaa871d6 Fix doc links and one incorrect type name 2023-08-31 23:59:18 -04:00
Zhouqi Jiang
d2f099e54f e-h, e-h-async, e-h-bus, e-h-nb: add changelog entries
Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
2023-08-23 10:26:47 +08:00
Zhouqi Jiang
41a61cb001 e-h-async: document fixes and inline hints.
Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
2023-08-23 10:16:09 +08:00
Dario Nieuwenhuis
575cee3343 Release embedded-hal{,-async,-nb} v1.0.0-rc.1, embedded-hal-bus v0.1.0-rc.1 2023-08-15 21:11:14 +02:00
Dario Nieuwenhuis
9fd6ebcfb0 hal: add optional defmt support. 2023-08-06 20:51:04 +02:00
Diego Barrios Romero
3d069faca5 Merge pull request #474 from Dirbaio/bus-stuff
spi: move async ExclusiveDevice to embedded-hal-bus.
2023-07-17 10:52:45 +00:00
Dario Nieuwenhuis
b2c2971592 spi: move async ExclusiveDevice to embedded-hal-bus. 2023-07-17 12:28:17 +02:00
Dario Nieuwenhuis
994c6c92be readme: document that serial should use embedded-io. 2023-07-17 12:27:58 +02:00
Dániel Buga
93a5011431 Add bus access methods to ExclusiveDevice 2023-07-12 22:03:00 +02:00
Dario Nieuwenhuis
9ac61a73d7 Add + ?Sized to all blanket impls. 2023-07-12 17:44:09 +02:00
Dario Nieuwenhuis
5df51e56da ci: test io with std and alloc features, update nightly. 2023-07-05 00:19:27 +02:00
Dario Nieuwenhuis
931dd37ad6 Remove serial traits (blocking and async). 2023-07-05 00:19:25 +02:00
Dario Nieuwenhuis
851dae5ec7 Release e-h 1.0-alpha.11, e-h-async 0.2-alpha.2, e-h-bus 0.1-alpha.3, e-h-nb v1.0-alpha.3 2023-07-04 18:00:15 +02:00
Dario Nieuwenhuis
d07d39e359 spi: add Operation::DelayUs(u32). 2023-05-24 13:59:38 +02:00
Dario Nieuwenhuis
1567f258bf spi: remove write-only and read-only traits. 2023-05-10 22:43:52 +02:00
Dario Nieuwenhuis
76c66f3799 Release e-h v1.0.0-alpha.10, e-h-async v0.2.0-alpha.1, e-h-bus v0.1.0-alpha.2, e-h-nb v1.0.0-alpha.2. 2023-04-04 22:09:17 +02:00
Dario Nieuwenhuis
756b05519e spi: Add changelog for transaction changes. 2023-04-01 10:52:48 +02:00
Dario Nieuwenhuis
b6764ecd57 spi: SpiDevice transactiontake an operation slice instead of a closure. 2023-03-28 14:41:54 +02:00
Dario Nieuwenhuis
0584ebe8fb Misc doc fixes. 2023-03-28 13:57:56 +02:00
bors[bot]
1d74e8927d Merge #440
440: I2c: simplify, expand docs, document shared bus usage. r=eldruin a=Dirbaio

~Depends on #441 -- check that one out first.~

This does some simplifications to the trait that I think we should do:

- Implement all methods in terms of `transaction`. This way HALs have to implement just that.
- Removed byte-wise-iteration methods: `write_iter` and `write_iter_read`. The reason is that they're quite inefficient, especially with DMA implementations. We've already removed these on other traits, so I think we should do as well here.
- Removed `transaction_iter`. I don't think it's much useful in practice, because the way iterators work all the yielded `Operation`s must have the same lifetime. This means that, even if the user can generate the `Operation`s on the fly, they can't allocate buffers for these on the fly, all buffers must be pre-allocated. So it's not useful for, say, streaming a large transfer by reusing some small buffer repeatedly. See #367 
- Removed useless lifetimes
- Standardized buffer names on `read` and `write`, I think they're clearer.

It also specifies how i2c bus sharing is supposed to work. This is an alternative to #392 . After the discussions there, I don't think we should split I2C into Bus and Device anymore. For SPI it makes sense, because drivers want to enforce that there's a CS pin (`SpiDevice`) or not (`SpiBus`). This is not the case with I2C, the API is exactly the same in the shared and non-shared case. Drivers shouldn't care which case it is.

So all we have to do to "support" bus sharing is docs, This PR does:

- Document that it's allowed for implementations to be either shared or not.
- Document some guidelines for drivers and HALs on how to best use the traits, expand the examples.


Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-03-28 06:59:51 +00:00
Dario Nieuwenhuis
7b42f2430f i2c: changelog. 2023-03-15 12:08:28 +01:00
Dario Nieuwenhuis
8b984d299a i2c: implement all operations in terms of transaction. 2023-03-15 12:07:17 +01:00
Dario Nieuwenhuis
f644e8225f i2c: rename args to write/read. 2023-03-15 12:07:17 +01:00
Dario Nieuwenhuis
6236f2baf1 i2c: remove useless lifetimes. 2023-03-15 12:07:17 +01:00
Diego Barrios Romero
336eb5aaa6 Update changelog after #442 2023-03-15 09:18:58 +01:00
Dario Nieuwenhuis
002786df37 asyn/serial: add Write. 2023-03-08 00:33:14 +01:00
Dario Nieuwenhuis
d3f8fe6b2f delay: make infallible. 2023-02-28 21:41:14 +01:00
Dario Nieuwenhuis
d36ddc2009 Bump MSRV to 1.59, switch to Edition 2021. 2023-02-28 21:09:10 +01:00
Dario Nieuwenhuis
f41a73a94e update required nightly version in EHA readme. 2022-12-20 22:44:28 +01:00
Martin
83dfca59b3 Raise MSRV for embedded-hal-async to Rust 1.65.0
Gives a hint for what is needed for generic_associated_types to build
without errors without specifing it as a feature. Nightly is still
required.
2022-12-20 22:44:27 +01:00
Dario Nieuwenhuis
ad0b9f2136 Release embedded-hal-async v0.2.0-alpha.0 2022-11-23 17:17:04 +01:00
Dario Nieuwenhuis
44f01ea73f async: switch to async-fn-in-traits 2022-11-23 17:02:55 +01:00
Dario Nieuwenhuis
f2033d3817 Release embedded-hal-async v0.1.0-alpha.3 2022-10-26 15:40:47 +02:00
Alex Martens
a1dee3e47a embedded-hal-async: fix compilation on latest nightly 2022-10-21 20:22:09 -07:00