55 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
e4b8c77942 bus: expand docs for AtomicDevice a bit. 2024-04-23 22:03:46 +02:00
Dario Nieuwenhuis
7dbaf6d479 bus: make AtomicDevice use a per-bus "busy" flag, not per-device.
Needed for soundness.
2024-04-23 22:03:46 +02:00
Ryan Summers
e00ffa01c2 Adding AtomicDevice for I2C bus sharing 2024-04-23 21:57:35 +02:00
Andrew Walbran
aebcf0f785 Implement Display and std::error::Error for DeviceError if possible. 2024-02-04 20:44:47 +00: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
Dario Nieuwenhuis
bf488dfb20 docs: update readmes for v1.0 2024-01-09 21:35:40 +01:00
Dario Nieuwenhuis
101c6f9225 bus/spi: add semver risk warning to new_no_delay.
Fixes #552.
2023-12-27 14:53:50 +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
493dfd82cb bus: use shared fn transaction for exclusive bus too. 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
9e939bb3e7
Merge pull request #534 from Dirbaio/feature-nightly-only
Use `feature()` on nightly toolchains only.
2023-11-28 19:32:49 +00:00
Dario Nieuwenhuis
c10ddaec5a
Merge pull request #490 from Sh3Rm4n/chore/rust-version
Use rust-version field
2023-11-28 19:18:30 +00: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
Dario Nieuwenhuis
03578fea0e
Merge pull request #529 from nyurik/dedup
Consolidate identical SPI transaction impl
2023-11-25 12:24:04 +00:00
Yuri Astrakhan
b39aaed103 Consolidate identical SPI transaction impl
Consolidate three identical implementations of the `SpiDevice::transaction`. Fewer lines of code, faster compilation, fewer bugs...
2023-11-25 00:03:34 -05:00
Yuri Astrakhan
a7eb603bc4 A few minor clippy nits
* semicolons
* doc links
* unused Error namespace
2023-11-25 00:03:26 -05:00
Fabian Viöl
7414e2129b Use rust-version field 2023-10-21 09:49:53 +02: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
Yuri Astrakhan
b0b4f4668d A few more doc cleanups 2023-09-01 01:25:34 -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
d81f7b8142
e-h-bus: document fixes and inline hints.
Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
2023-08-23 10:20:19 +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
Dániel Buga
ff94c7d109 Implement async DelayUs for NoDelay 2023-07-18 23:12:28 +02:00
Dániel Buga
8d03c73d8e Merge spi ExclusiveDevice implementations 2023-07-18 22:48:44 +02:00
Dario Nieuwenhuis
b2c2971592 spi: move async ExclusiveDevice to embedded-hal-bus. 2023-07-17 12:28:17 +02:00
Dario Nieuwenhuis
1567dee785 bus: add doc(cfg). 2023-07-17 12:28:17 +02:00
Dario Nieuwenhuis
7d975f025d Bump MSRV to 1.60
Needed for namespaced features (`dep:` in Cargo.toml)
2023-07-15 16:04:24 +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
Thomas Gilligan
6a0c442fc9 Actually commit doc test fix 🥲 2023-05-04 01:49:06 +10:00
Thomas Gilligan
baefcf241b Put i2c bus example on struct, fix doc test 2023-05-03 20:52:23 +10:00
Thomas Gilligan
d187dc0fcb Add a doc example for i2c::RefCellDevice 2023-05-03 19:31:29 +10: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
76541e0766 bus/spi: add RefCell, CriticalSection and Mutex shared bus implementations. 2023-04-01 10:50:42 +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
Dario Nieuwenhuis
16ac2e68df bus: update docs, document features. 2023-03-28 13:31:11 +02:00
Dario Nieuwenhuis
37a8e614f0 bus/i2c: add RefCell, CriticalSection and Mutex shared bus implementations. 2023-03-28 13:13:42 +02:00
Dario Nieuwenhuis
d36ddc2009 Bump MSRV to 1.59, switch to Edition 2021. 2023-02-28 21:09:10 +01:00
Diego Barrios Romero
f14c3fb998 Prepare embedded-hal-bus 0.1.0-alpha.1 release 2022-09-28 22:08:32 +02:00
Diego Barrios Romero
03c43a139f Fix link 2022-09-28 22:06:16 +02:00
Diego Barrios Romero
db47d29558 Prepare e-h 1.0.0-alpha.9 release 2022-09-28 20:53:37 +02:00
Dario Nieuwenhuis
bc3fc45bb9 Reorganize READMEs
- Move "project-wide" stuff (CoC, legal boilerplate) to the main README.
- List crates in main README.
2022-09-26 13:29:34 +02:00
Dario Nieuwenhuis
6d22f986f1 Move embedded-hal to a subdir, add workspace, simplify CI. 2022-09-26 13:29:34 +02:00