Skip to content

Commit

Permalink
Upgrade to embedded-hal@1.0.0 (#13)
Browse files Browse the repository at this point in the history
* Update to `embedded-hal@1.0.0`

* Bump MSRV to 1.60.0
  • Loading branch information
jessebraham authored Apr 2, 2024
1 parent 9711aca commit 68f39aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: ["1.56.1", stable, nightly]
toolchain: ["1.60.0", stable, nightly]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "icm42670"
version = "0.1.1"
authors = ["Jesse Braham <jesse@beta7.io>"]
edition = "2021"
rust-version = "1.56"
rust-version = "1.60"
description = "An embedded-hal driver for the ICM-42670 6-axis IMU"
repository = "https://github.com/jessebraham/icm42670"
license = "MIT OR Apache-2.0"
Expand All @@ -12,4 +12,4 @@ categories = ["aerospace", "embedded", "hardware-support", "no-std"]

[dependencies]
accelerometer = "0.12.0"
embedded-hal = "0.2.7"
embedded-hal = "1.0.0"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jessebraham/icm42670/ci.yaml?label=CI&logo=github&style=flat-square)
[![Crates.io](https://img.shields.io/crates/v/icm42670?color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/icm42670)
[![docs.rs](https://img.shields.io/docsrs/icm42670?color=C96329&logo=rust&style=flat-square)](https://docs.rs/icm42670)
![MSRV](https://img.shields.io/badge/MSRV-1.56-blue?style=flat-square)
![MSRV](https://img.shields.io/badge/MSRV-1.60-blue?style=flat-square)
![Crates.io](https://img.shields.io/crates/l/icm42670?style=flat-square)

An `embedded-hal` driver for the ICM-42670 6-axis IMU.
Expand Down
15 changes: 6 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ use accelerometer::{
RawAccelerometer,
};
use config::{AccLpAvg, AccelDlpfBw, GyroLpFiltBw, SoftReset, TempDlpfBw};
use embedded_hal::blocking::{
delay::DelayUs,
i2c::{Write, WriteRead},
};
use embedded_hal::{delay::DelayNs, i2c::I2c};

use crate::{
config::Bitfield,
Expand Down Expand Up @@ -61,7 +58,7 @@ pub struct Icm42670<I2C> {

impl<I2C, E> Icm42670<I2C>
where
I2C: Write<Error = E> + WriteRead<Error = E>,
I2C: I2c<Error = E>,
E: Debug,
{
/// Unique device identifiers for the ICM-42607 and ICM-42670
Expand Down Expand Up @@ -257,7 +254,7 @@ where
#[allow(unused)]
fn read_mreg(
&mut self,
delay: &mut dyn DelayUs<u8>,
delay: &mut dyn DelayNs,
bank: RegisterBank,
reg: &dyn Register,
) -> Result<u8, Error<E>> {
Expand Down Expand Up @@ -287,7 +284,7 @@ where
#[allow(unused)]
fn write_mreg(
&mut self,
delay: &mut dyn DelayUs<u8>,
delay: &mut dyn DelayNs,
bank: RegisterBank,
reg: &dyn Register,
value: u8,
Expand Down Expand Up @@ -362,7 +359,7 @@ where

impl<I2C, E> Accelerometer for Icm42670<I2C>
where
I2C: Write<Error = E> + WriteRead<Error = E>,
I2C: I2c<Error = E>,
E: Debug,
{
type Error = Error<E>;
Expand Down Expand Up @@ -391,7 +388,7 @@ where

impl<I2C, E> RawAccelerometer<I16x3> for Icm42670<I2C>
where
I2C: Write<Error = E> + WriteRead<Error = E>,
I2C: I2c<Error = E>,
E: Debug,
{
type Error = Error<E>;
Expand Down

0 comments on commit 68f39aa

Please sign in to comment.