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
59
60
61
62
63
64
//! # Generic client for LTC681X battery stack monitors
//!
//! Supports all devices of LTC681X family: [LTC6813](crate::ltc6813::LTC6813), [LTC6812](crate::ltc6812::LTC6812), [LTC6811](crate::ltc6811::LTC6811) and [LTC6810](crate::ltc6810::LTC6810).
//!
//! Currently the following features are implemented:
//! * [Cell and GPIO conversion](crate::monitor#conversion)
//! * [Reading cell and GPIO voltage registers](crate::monitor#reading-registers)
//! * [Multiple devices in daisy chain](crate::monitor#multiple-devices-in-daisy-chain)
//! * [ADC status polling (SDO line method)](crate::monitor#polling)
//! * [Mapping voltages to GPIO and cell groups](crate::monitor#mapping-voltages)
//! * [Abstracted device configuration](crate::config)
//! * [Overlapping ADC measurement](crate::monitor#overlap-measurement-adol-command)
//! * [Internal device parameters measurement](crate::monitor#internal-device-parameters-adstat-command)
//!
//! # Example
//!
//! For all details see [monitor] module.
//!
//! ````
//!use ltc681x::example::ExampleSPIDevice;
//!use ltc681x::ltc6813::{CellSelection, Channel, GPIOSelection, LTC6813};
//!use ltc681x::monitor::{ADCMode, LTC681X, LTC681XClient, PollClient};
//!
//!let spi_bus = ExampleSPIDevice::default();
//!
//! // LTC6813 device
//! let mut client: LTC681X<_, _, LTC6813, 1> = LTC681X::ltc6813(spi_bus);
//!
//! // Starts conversion for cell group 1
//! client.start_conv_cells(ADCMode::Normal, CellSelection::Group1, true);
//!
//! // Wait until ADC conversion is finished or poll the status
//! // (s. 'Conversion time' and 'Polling' section(s) of monitor module)
//!
//! // Returns the value of cell group A. In case of LTC613: cell 1, 7 and 13
//! let voltages = client.read_voltages(CellSelection::Group1).unwrap();
//! assert_eq!(Channel::Cell1, voltages[0][0].channel);
//! assert_eq!(24979, voltages[0][0].voltage);
//! ````
extern crate alloc;
pub use heapless;
pub
pub