Client for LTC681X battery stack monitors
Abstraction for LTC681X family. Supports all devices of LTC681X family: LTC6813, LTC6812, LTC6811 and LTC6810.
Currently, the following features are implemented:
- Cell and GPIO conversion
- Reading cell and GPIO voltage registers
- Multiple devices in daisy chain
- ADC status polling (SDO line method)
- Mapping voltages to GPIO and cell groups
- Abstracted device configuration
- Overlapping ADC measurement
- Internal device parameters measurement
Example
For all details see monitor module.
use ;
use ;
use ;
let spi_bus = default;
let cs_pin = ExampleCSPin;
// LTC6813 device
let mut client: = LTC681X ltc6813
.enable_sdo_polling;
// Starts conversion for cell group 1
client.start_conv_cells;
// Poll ADC status
while !client.adc_ready.unwrap
// Returns the value of cell group A. In case of LTC613: cell 1, 7 and 13
let voltages = client.read_voltages.unwrap;
assert_eq!;
assert_eq!;
State
:warning: The crate is still incomplete, but is under active development.
:warning: The crate has only been tested for the LTC6813 variant. Although the protocol of the LTC681X family is essentially the same, inconsistencies are still conceivable for some variants. Practical tests + feedback with other variants are therefore welcome.
Development
Any form of support is greatly appreciated. Feel free to create issues and PRs. See DEVELOPMENT for more details.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Each contributor agrees that his/her contribution covers both licenses.