Skip to content

Commit

Permalink
Rename async driver to Sht4xAsync
Browse files Browse the repository at this point in the history
This way, the naming scheme is more consistent with the async driver
I added to the `sgp30` crate. See:
dbrgn/sgp30-rs@cb769b0
  • Loading branch information
hawkw committed Jul 20, 2024
1 parent 78f3447 commit 8e2519a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ sht4x = { version = "0.2", features = ["embedded-hal-async"] }
```

Once the `embedded-hal-async` feature is enabled, construct an instance of
the `AsyncSht4x` struct, providing types implementing the
the `Sht4xAsync` struct, providing types implementing the
[`embedded_hal_async::i2c::I2c`] and [`embedded_hal_async::delay::DelayNs`]
traits. The `AsyncSht4x` struct is identical to the `Sht4x` struct,
traits. The `Sht4xAsync` struct is identical to the `Sht4x` struct,
except that its methods are `async fn`s.

[`embedded-hal-async`]: https://crates.io/crates/embedded-hal-async
Expand Down
4 changes: 2 additions & 2 deletions src/async_sht4x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ use sensirion_i2c::i2c_async;
/// of the `embedded-hal` traits, and all of its methods are `async fn`s.
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Debug)]
pub struct AsyncSht4x<I, D> {
pub struct Sht4xAsync<I, D> {
i2c: I,
address: Address,
// If we want to globally define the delay type for this struct, we have to consume the type
// parameter.
_delay: PhantomData<D>,
}

impl<I, D> AsyncSht4x<I, D>
impl<I, D> Sht4xAsync<I, D>
where
I: I2c,
D: DelayNs,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod types;
#[cfg(feature = "embedded-hal-async")]
mod async_sht4x;
#[cfg(feature = "embedded-hal-async")]
pub use self::async_sht4x::AsyncSht4x;
pub use self::async_sht4x::Sht4xAsync;

pub use crate::error::*;
pub use crate::sht4x::*;
Expand Down

0 comments on commit 8e2519a

Please sign in to comment.