Skip to content

Commit

Permalink
Update to embedded-hal v1.0 (#4)
Browse files Browse the repository at this point in the history
* Update embedded-hal v1.0, update all other dependencies. WIP does not build

* Updated code and tests to embedded-hal v1, replaced lazy-static with once_cell, replaced shared-bus with embedded-hal-bus, test doc examples and fixed doc typos

* Add migration guide

* Update to rppal v1.17.1 to resolve is_low bug
  • Loading branch information
TeyKey1 authored Jan 21, 2024
1 parent e2a426f commit 0f5c4a4
Show file tree
Hide file tree
Showing 14 changed files with 603 additions and 293 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
# Unreleased

**Breaking changes!**
- Update to embedded-hal v1.0.0 rc2

- Updated to embedded-hal v1.0
- Added `destroy()` functions to expander impls which allows driver users to retrieve the I2C bus and interrupt pin
- Fixed some documentation examples + typos

## Migration

As a general migration guideline to embedded-hal v1 consult the [migration guide](https://github.com/rust-embedded/embedded-hal/blob/master/docs/migrating-from-0.2-to-1.0.md)

For users of PCA9535 most things should work out of the box. Only change required is that due to the `InputPin` trait now taking `&mut self` you need to modify the interrupt pin provided to the cached expander struct to be mutable.
In cases you have previously used [shared-bus](https://crates.io/crates/shared-bus) for I2C bus sharing it is now recommended to switch to [embedded-hal-bus](https://crates.io/crates/embedded-hal-bus) instead.

# 1.2.0

**Breaking changes!**

- Updated to embedded hal 1.0.0-alpha.9 (@MajorArkwolf)
- Removed IOPin (currently not supported in embedded hal 1.0.0-alpha.9, will be readded once it is supported again) (@MajorArkwolf)

Thanks to @MajorArkwolf :)

# 1.1.0

- Added `Debug` trait implementation for all types which are accessible by the library user
- Added `Clone` and `Copy` trait implementation for `Polarity` enum
- Internal code cleanup

# 1.0.0

**Breaking changes!**

- Refactored error types and generics. The whole error handling is now simpler and should make more sense in general, as underlying embedded-hal errors are directly passed to the `ExpanderError` enum. Due to those changes certain types need an additional generic for I2C interface. Generics have been refactored as well so some generics are not on the same position like they used to be. Migrating to 1.0 should be relatively simple by adding those missing generics or rearranging them.
- Added `std::error::Error` trait implementation for `ExpanderError`. This is automatically enabled by using the crates `std` feature. The change should allow for easier error handling with existing std solutions and libraries.
- Updated crate to rust 2021 edition

# 0.1.0

- moved the special implementation of writes to any polarity register to the Expander Trait implementation instead of overwriting StandardExpanderInterface Trait functions
Loading

0 comments on commit 0f5c4a4

Please sign in to comment.