1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//!
//! This crate provides an async Rust driver for the MCP342[2/3/4] ADC, based on the
//! [`embedded-hal`](https://github.com/rust-embedded/embedded-hal) traits.
//!
//! # Modes
//!
//! | Mode | Description |
//! | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
//! | [OneShot](`crate::mode::OneShotMode`) | Instructs the device to do a single conversion and awaits the result. |
//! | [Continuous](`crate::mode::ContinuousMode`) | Instructs the device to do conversions continuously. Every subsequent call will read the last available value only. |
//! | [MultiShot](`crate::mode::MultiShotMode`) | A variation of the [`OneShotMode`]. The measure functions execute a series of one-shot conversions and return all values at once. |
//!
//! # MCP3422 and MCP3423
//! In contrast to the MCP3424, the MCP3422 and MCP3423 provide only two channels instead of four.
//! But these device offer the same I2C interface. Therefor this crate can also be used for MCP3422
//! and MCP3423 devices with the exception that these devices treat [`Channel::Channel3`] as
//! [`Channel::Channel1`] and [`Channel::Channel4`] as [`Channel::Channel2`].
//!
//! # Crate Features
//!
//! Enable or disable features according to your needs and in order to optimize for compile time and space.
//!
//! | Feature | Default | Description |
//! | --------- |:--------:| ------------------------------------------------------------------------------------------------------------------------------ |
//! | defmt | ✗ | When enabled, certain types will provide an implementation for the [`defmt::Format`] trait. |
//! | fmt | ✔ | When enabled, certain types will provide an implementation for [`core::fmt::Debug`] and [`core::fmt::Display`] traits. |
//! | stream | ✗ | When enabled, the driver offers additional measure functions which return a [`futures::stream::Stream`]. |
//! | uom | ✗ | When enabled, all measure functions return the measured value as [`uom::si::f32::ElectricPotential`] instead of a plain `f32`. |
//!
//! <sup>✔ enabled, ✗ disabled</sup>
//!
//! # UOM
//!
//! This driver integrates with the [uom](https://docs.rs/uom) crate which provides units of
//! measurement. After activating the corresponding `uom` feature all measure functions return the
//! measured value as [`uom::si::f32::ElectricPotential`] instead of a plain `f32`.
//!
//! [Read more](crate::doc::uom)
//!
extern crate alloc;
pub use crate;
pub use crate;
pub use crateMCP3424;
pub use crateError;
pub use crate;