Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6811.h
Go to the documentation of this file.
1 /*! LTC6811: Multicell Battery Monitors
2 *
3 *@verbatim
4 *The LTC6811 is multi-cell battery stack monitor that measures up to 12 series
5 *connected battery cells with a total measurement error of less than 1.2mV.
6 *The cell measurement range of 0V to 5V makes the LTC6811 suitable for most
7 *battery chemistries. All 12 cell voltages can be captured in 290uS, and lower
8 *data acquisition rates can be selected for high noise reduction.
9 *Using the LTC6811-1, multiple devices are connected in a daisy-chain with one
10 *host processor connection for all devices.
11 *@endverbatim
12 *
13 * https://www.analog.com/en/products/ltc6811-1.html
14 * https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/dc2259a.html
15 *
16 ********************************************************************************
17 * Copyright 2019(c) Analog Devices, Inc.
18 *
19 * All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * - Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * - Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in
27 * the documentation and/or other materials provided with the
28 * distribution.
29 * - Neither the name of Analog Devices, Inc. nor the names of its
30 * contributors may be used to endorse or promote products derived
31 * from this software without specific prior written permission.
32 * - The use of this software may or may not infringe the patent rights
33 * of one or more patent holders. This license does not release you
34 * from the requirement that you obtain separate licenses from these
35 * patent holders to use this software.
36 * - Use of the software either in source or binary form, must be run
37 * on or directly connected to an Analog Devices Inc. component.
38 *
39 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
40 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
41 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
42 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
43 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
45 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
46 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *******************************************************************************/
50 
51 /*! @file
52  @ingroup LTC6811-1
53  Library Header for LTC6811-1 Multicell Battery Monitor
54 */
55 
56 #ifndef LTC6811_H
57 #define LTC6811_H
58 
59 #include "stdint.h"
60 #include "LTC681x.h"
61 
62 #define CELL 1
63 #define AUX 2
64 #define STAT 3
65 
66 /*!
67  Initialize the Register limits
68  @return void
69  */
70 void LTC6811_init_reg_limits(uint8_t total_ic, //!< Number of ICs in the system
71  cell_asic *ic //!< A two dimensional array that will store the data
72  );
73 
74 /*!
75  Write the LTC6811 configuration register
76  @return void
77  */
78 void LTC6811_wrcfg(uint8_t total_ic, //!< The number of ICs being written
79  cell_asic *ic //!< A two dimensional array of the configuration data that will be written
80  );
81 
82 /*!
83  Reads configuration registers of a LTC6811
84  @return int8_t, PEC Status.
85  0: Data read back has matching PEC
86  -1: Data read back has incorrect PEC
87  */
88 int8_t LTC6811_rdcfg(uint8_t total_ic, //!< Number of ICs
89  cell_asic *ic //!< A two dimensional array that the function stores the read configuration data
90  );
91 
92 /*!
93  Starts cell voltage conversion
94  @return void
95  */
96 void LTC6811_adcv(uint8_t MD, //!< ADC Conversion Mode
97  uint8_t DCP, //!< Controls if Discharge is permitted during conversion
98  uint8_t CH //!< Sets which Cell channels are converted
99  );
100 
101 /*!
102  Start a GPIO and Vref2 Conversion
103  @return void
104  */
105 void LTC6811_adax(uint8_t MD, //!< ADC Conversion Mode
106  uint8_t CHG //!< Sets which GPIO channels are converted
107  );
108 
109 /*!
110  Start a Status ADC Conversion
111  @return void
112  */
113 void LTC6811_adstat(uint8_t MD, //!< ADC Conversion Mode
114  uint8_t CHST //!< Sets which Stat channels are converted
115  );
116 
117 /*!
118  Starts cell voltage and GPIO 1&2 conversion
119  @return void
120  */
121 void LTC6811_adcvax(uint8_t MD, //!< ADC Conversion Mode
122  uint8_t DCP //!< Controls if Discharge is permitted during conversion
123  );
124 
125 /*!
126  Starts cell voltage and SOC conversion
127  @return void
128  */
129 void LTC6811_adcvsc(uint8_t MD, //!< ADC Conversion Mode
130  uint8_t DCP //!< Controls if Discharge is permitted during conversion
131  );
132 
133 /*!
134  Reads and parses the LTC6811 cell voltage registers.
135  @return uint8_t, PEC Status.
136  0: No PEC error detected
137  -1: PEC error detected, retry read
138  */
139 uint8_t LTC6811_rdcv(uint8_t reg, //!< Controls which cell voltage register is read back.
140  uint8_t total_ic, //!< The number of ICs in the daisy chain
141  cell_asic *ic //!< Array of the parsed cell codes from lowest to highest.
142  );
143 
144 /*!
145  Reads and parses the LTC6811 auxiliary registers.
146  @return int8_t, PEC Status
147  0: No PEC error detected
148  -1: PEC error detected, retry read
149  */
150 int8_t LTC6811_rdaux(uint8_t reg, //!< Controls which GPIO voltage register is read back
151  uint8_t nIC, //!< The number of ICs in the daisy chain
152  cell_asic *ic //!< A two dimensional array of the parsed gpio voltage codes
153  );
154 
155 /*!
156  Reads and parses the LTC6811 stat registers.
157  @return int8_t, PEC Status
158  0: No PEC error detected
159  -1: PEC error detected, retry read
160  */
161 int8_t LTC6811_rdstat(uint8_t reg, //!< Determines which Stat register is read back.
162  uint8_t total_ic,//!< The number of ICs in the system
163  cell_asic *ic//!< Array of the parsed Stat codes
164  );
165 
166 /*!
167  Sends the poll ADC command
168  @returns uint8_t, 1 byte read back after a pladc command. If the byte is not 0xFF ADC conversion has completed
169 */
170 uint8_t LTC6811_pladc();
171 
172 /*!
173  This function will block operation until the ADC has finished it's conversion
174  @returns uint32_t, the approximate time it took for the ADC function to complete.
175  */
176 uint32_t LTC6811_pollAdc();
177 
178 /*!
179  Clears the LTC6811 cell voltage registers
180  @return void
181  */
182 void LTC6811_clrcell();
183 
184 /*!
185  Clears the LTC6811 Auxiliary registers
186  @return void
187  */
188 void LTC6811_clraux();
189 
190 /*!
191  Clears the LTC6811 Stat registers
192  @return void
193  */
194 void LTC6811_clrstat();
195 
196 /*!
197  Starts the Mux Decoder diagnostic self test
198  Running this command will start the Mux Decoder Diagnostic Self Test.
199  This test takes roughly 1ms to complete. The MUXFAIL bit will be updated.
200  The bit will be set to 1 for a failure and 0 if the test has been passed.
201  @return void
202  */
203 void LTC6811_diagn();
204 
205 /*!
206  Starts cell voltage self test conversion
207  @return void
208  */
209 void LTC6811_cvst( uint8_t MD, //!< ADC Conversion Mode
210  uint8_t ST //!< Sets if self test 1 or 2 is run
211  );
212 
213 /*!
214  Start an Auxiliary Register Self Test Conversion
215  @return void
216  */
217 void LTC6811_axst(uint8_t MD, //!< ADC Conversion Mode
218  uint8_t ST //!< Sets if self test 1 or 2 is run
219  );
220 
221 /*!
222  Start a Status Register Self Test Conversion
223  @return void
224  */
225 void LTC6811_statst(uint8_t MD, //!< ADC Conversion Mode
226  uint8_t ST //!< Sets if self test 1 or 2 is run
227  );
228 
229 
230 /*!
231  Starts cell voltage overlap conversion
232  @return void
233  */
234 void LTC6811_adol( uint8_t MD, //!< ADC Conversion Mode
235  uint8_t DCP //!< Discharge permitted during conversion
236  );
237 
238 /*!
239  Start an GPIO Redundancy test
240  @return void
241  */
242 void LTC6811_adaxd(uint8_t MD, //!< ADC Conversion Mode
243  uint8_t CHG //!< Sets which GPIO channels are converted
244  );
245 
246 /*!
247  Start a Status register redundancy test Conversion
248  @return void
249  */
250 void LTC6811_adstatd(uint8_t MD, //!< ADC Conversion Mode
251  uint8_t CHST //!< Sets which Status channels are converted
252  );
253 
254 /*!
255  Helper function that runs the ADC Self Tests
256  @return int16_t, error
257  Number of errors detected
258  */
259 int16_t LTC6811_run_cell_adc_st(uint8_t adc_reg, //!< Type of register
260  uint8_t total_ic, //!< Number of ICs in the system
261  cell_asic *ic, //!< A two dimensional array that will store the data
262  uint8_t md, //!< ADC Mode
263  bool adcopt //!< The adcopt bit in the configuration register
264  );
265 
266 /*!
267  Helper Function that runs the ADC Overlap test
268  @return uint16_t, error
269  0: Pass
270  -1: False, Error detected
271  */
272 uint16_t LTC6811_run_adc_overlap(uint8_t total_ic,//!< Number of ICs in the system
273  cell_asic *ic //!< A two dimensional array that will store the data
274  );
275 
276 /*!
277  Helper function that runs the ADC Digital Redundancy commands and checks output for errors
278  @return int16_t, error
279  */
280 int16_t LTC6811_run_adc_redundancy_st(uint8_t adc_mode, //!< ADC Mode
281  uint8_t adc_reg, //!< Type of register
282  uint8_t total_ic, //!< Number of ICs in the system
283  cell_asic *ic //!< A two dimensional array that will store the data
284  );
285 
286 /*!
287  Start an open wire Conversion
288  @return void
289  */
290 void LTC6811_adow(uint8_t MD, //!< ADC Mode
291  uint8_t PUP, //!< Discharge Permit
292  uint8_t CH, //!< Cell selection
293  uint8_t DCP //!< Discharge Permit
294  );
295 
296 /*!
297  Helper function that runs the data sheet open wire algorithm for single cell detection
298  @return void
299  */
300 void LTC6811_run_openwire_single(uint8_t total_ic,//!< Number of ICs in the system
301  cell_asic *ic //!< A two dimensional array that will store the data
302  );
303 
304 /*!
305  Helper function that runs open wire for multiple cell and two consecutive cells detection
306  @return void
307  */
308 void LTC6811_run_openwire_multi(uint8_t total_ic,//!< Number of ICs in the system
309  cell_asic *ic //!< A two dimensional array that will store the data
310  );
311 
312 /*!
313  Helper function to set discharge bit in CFG register
314  @return void */
315 void LTC6811_set_discharge(int Cell, //!< The cell to be discharged
316  uint8_t total_ic, //!< Number of ICs in the system
317  cell_asic *ic //!< A two dimensional array that will store the data
318  );
319 
320 /*!
321  Clears all of the DCC bits in the configuration registers
322  @return void
323  */
324 void LTC6811_clear_discharge(uint8_t total_ic, //!< Number of ICs in the daisy chain
325  cell_asic *ic //!< A two dimensional array that will store the data
326  );
327 
328 /*!
329  Write the LTC6811 PWM register
330  @return void
331  */
332 void LTC6811_wrpwm(uint8_t total_ic, //!< Number of ICs
333  uint8_t pwmReg, //!< Select register
334  cell_asic *ic//!< A two dimensional array that the function stores the data in.
335  );
336 
337 /*!
338  Reads pwm registers of a LTC6811 daisy chain
339  @return int8_t, PEC Status.
340  0: Data read back has matching PEC
341  -1: Data read back has incorrect PEC
342  */
343 int8_t LTC6811_rdpwm(uint8_t total_ic, //!< Number of ICs
344  uint8_t pwmReg, //!< Select register
345  cell_asic *ic //!< A two dimensional array that the function stores the read pwm data
346  );
347 
348 /*!
349  Write the LTC6811 Sctrl register
350  @return void
351  */
352 void LTC6811_wrsctrl(uint8_t total_ic, //!< Number of ICs in the daisy chain
353  uint8_t sctrl_reg, //!< Select register
354  cell_asic *ic //!< A two dimensional array of the data that will be written
355  );
356 
357 /*!
358  Reads sctrl registers of a LTC6811 daisy chain
359  @return int8_t, PEC Status.
360  0: Data read back has matching PEC
361  -1: Data read back has incorrect PEC
362  */
363 int8_t LTC6811_rdsctrl(uint8_t total_ic, //!< Number of ICs in the daisy chain
364  uint8_t sctrl_reg, //!< Select register
365  cell_asic *ic //!< A two dimensional array that the function stores the read data
366  );
367 
368 /*!
369  Start Sctrl data communication
370  This command will start the sctrl pulse communication over the spins
371  @return void
372  */
373 void LTC6811_stsctrl();
374 
375 /*!
376  Clears the LTC6811 Sctrl registers
377  @return void
378  */
379 void LTC6811_clrsctrl();
380 
381 /*!
382  Writes to the LTC6811 COMM register
383  @return void
384  */
385 void LTC6811_wrcomm(uint8_t total_ic, //!< Number of ICs in the daisy chain
386  cell_asic *ic //!< A two dimensional array of the comm data that will be written
387  );
388 
389 /*!
390  Reads comm registers of a LTC6811 daisy chain
391  @return int8_t, PEC Status.
392  0: Data read back has matching PEC
393  -1: Data read back has incorrect PEC
394  */
395 int8_t LTC6811_rdcomm(uint8_t total_ic, //!< Number of ICs in the daisy chain
396  cell_asic *ic //!< Two dimensional array that the function stores the read comm data.
397  );
398 
399 /*!
400  Issues a stcomm command and clocks data out of the COMM register
401  @return void
402  */
403 void LTC6811_stcomm(uint8_t len //!< Length of data to be transmitted
404  );
405 
406 /*!
407  Helper Function that counts overall PEC errors and register/IC PEC errors
408  @return void
409  */
410 void LTC6811_check_pec(uint8_t total_ic,//!< Number of ICs in the system
411  uint8_t reg, //!< Type of register
412  cell_asic *ic //!< A two dimensional array that will store the data
413  );
414 
415 /*!
416  Helper Function that resets the PEC error counters
417  @return void
418  */
419 void LTC6811_reset_crc_count(uint8_t total_ic, //!< Number of ICs in the system
420  cell_asic *ic //!< A two dimensional array that will store the data
421  );
422 
423 /*!
424  Helper Function to initialize the CFGR data structures
425  @return void
426  */
427 void LTC6811_init_cfg(uint8_t total_ic, //!< Number of ICs in the system
428  cell_asic *ic //!< A two dimensional array that will store the data
429  );
430 
431 /*!
432  Helper function to set appropriate bits in CFGR register based on bit function
433  @return void
434  */
435 void LTC6811_set_cfgr(uint8_t nIC, //!< Current IC
436  cell_asic *ic,//!< A two dimensional array that will store the data
437  bool refon, //!< The REFON bit
438  bool adcopt, //!< The ADCOPT bit
439  bool gpio[5],//!< The GPIO bits
440  bool dcc[12],//!< The DCC bits
441  bool dcto[4],//!< The Dcto bits
442  uint16_t uv, //!< The UV value
443  uint16_t ov //!< The OV value
444  );
445 
446 /*!
447  Helper function to turn the refon bit HIGH or LOW
448  @return void
449  */
450 void LTC6811_set_cfgr_refon(uint8_t nIC, //!< Current IC
451  cell_asic *ic, //!< A two dimensional array that will store the data
452  bool refon //!< The REFON bit
453  );
454 
455 /*!
456  Helper function to turn the ADCOPT bit HIGH or LOW
457  @return void
458  */
459 void LTC6811_set_cfgr_adcopt(uint8_t nIC, //!< Current IC
460  cell_asic *ic, //!< A two dimensional array that will store the data
461  bool adcopt //!< The ADCOPT bit
462  );
463 
464 /*!
465  Helper function to turn the GPIO bits HIGH or LOW
466  @return void
467  */
468 void LTC6811_set_cfgr_gpio(uint8_t nIC, //!< Current IC
469  cell_asic *ic, //!< A two dimensional array that will store the data
470  bool gpio[] //!< The GPIO bits
471  );
472 
473 /*!
474  Helper function to turn the DCC bits HIGH or LOW
475  @return void
476  */
477 void LTC6811_set_cfgr_dis(uint8_t nIC, //!< Current IC
478  cell_asic *ic, //!< A two dimensional array that will store the data
479  bool dcc[] //!< The DCC bits
480  );
481 
482 /*!
483  Helper function to set uv field in CFGRA register
484  @return void
485  */
486 void LTC6811_set_cfgr_uv(uint8_t nIC, //!< Current IC
487  cell_asic *ic, //!< A two dimensional array that will store the data
488  uint16_t uv //!< The UV value
489  );
490 /*!
491  Helper function to set ov field in CFGRA register
492  @return void
493  */
494 void LTC6811_set_cfgr_ov(uint8_t nIC, //!< Current IC
495  cell_asic *ic, //!< A two dimensional array that will store the data
496  uint16_t ov //!< The OV value
497  );
498 
499 #endif
int8_t LTC6811_rdcomm(uint8_t total_ic, cell_asic *ic)
Reads comm registers of a LTC6811 daisy chain.
Definition: LTC6811.cpp:442
General BMS Library.
void LTC6811_set_cfgr_gpio(uint8_t nIC, cell_asic *ic, bool gpio[])
Helper function to turn the GPIO bits HIGH or LOW.
int8_t LTC6811_rdstat(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6811 stat registers.
Definition: LTC6811.cpp:180
void LTC6811_adcvax(uint8_t MD, uint8_t DCP)
Starts cell voltage and GPIO 1&2 conversion.
Definition: LTC6811.cpp:129
void LTC6811_set_cfgr(uint8_t nIC, cell_asic *ic, bool refon, bool adcopt, bool gpio[5], bool dcc[12], bool dcto[4], uint16_t uv, uint16_t ov)
Helper function to set appropriate bits in CFGR register based on bit function.
Definition: LTC6811.cpp:483
void LTC6811_adax(uint8_t MD, uint8_t CHG)
Start a GPIO and Vref2 Conversion.
Definition: LTC6811.cpp:113
void LTC6811_clrstat()
Clears the LTC6811 Stat registers.
Definition: LTC6811.cpp:224
void LTC6811_reset_crc_count(uint8_t total_ic, cell_asic *ic)
Helper Function that resets the PEC error counters.
Definition: LTC6811.cpp:467
void LTC6811_set_cfgr_uv(uint8_t nIC, cell_asic *ic, uint16_t uv)
Helper function to set uv field in CFGRA register.
Definition: LTC6811.cpp:528
int8_t LTC6811_rdcfg(uint8_t total_ic, cell_asic *ic)
Reads configuration registers of a LTC6811.
Definition: LTC6811.cpp:94
Cell variable structure.
Definition: LTC681x.h:170
void LTC6811_clrsctrl()
Clears the LTC6811 Sctrl registers.
Definition: LTC6811.cpp:428
void LTC6811_diagn()
Starts the Mux Decoder diagnostic self test Running this command will start the Mux Decoder Diagnosti...
Definition: LTC6811.cpp:230
void LTC6811_adol(uint8_t MD, uint8_t DCP)
Starts cell voltage overlap conversion.
Definition: LTC6811.cpp:260
uint16_t LTC6811_run_adc_overlap(uint8_t total_ic, cell_asic *ic)
Helper Function that runs the ADC Overlap test.
Definition: LTC6811.cpp:297
void LTC6811_wrcomm(uint8_t total_ic, cell_asic *ic)
Writes to the LTC6811 COMM register.
Definition: LTC6811.cpp:434
void LTC6811_statst(uint8_t MD, uint8_t ST)
Start a Status Register Self Test Conversion.
Definition: LTC6811.cpp:252
void LTC6811_set_cfgr_refon(uint8_t nIC, cell_asic *ic, bool refon)
Helper function to turn the refon bit HIGH or LOW.
Definition: LTC6811.cpp:498
int8_t LTC6811_rdpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Reads pwm registers of a LTC6811 daisy chain.
Definition: LTC6811.cpp:384
void LTC6811_adow(uint8_t MD, uint8_t PUP, uint8_t CH, uint8_t DCP)
Start an open wire Conversion.
Definition: LTC6811.cpp:319
uint8_t LTC6811_rdcv(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6811 cell voltage registers.
Definition: LTC6811.cpp:149
int16_t LTC6811_run_cell_adc_st(uint8_t adc_reg, uint8_t total_ic, cell_asic *ic, uint8_t md, bool adcopt)
Helper function that runs the ADC Self Tests.
Definition: LTC6811.cpp:284
void LTC6811_clear_discharge(uint8_t total_ic, cell_asic *ic)
Clears all of the DCC bits in the configuration registers.
Definition: LTC6811.cpp:368
void LTC6811_set_cfgr_dis(uint8_t nIC, cell_asic *ic, bool dcc[])
Helper function to turn the DCC bits HIGH or LOW.
void LTC6811_adstatd(uint8_t MD, uint8_t CHST)
Start a Status register redundancy test Conversion.
Definition: LTC6811.cpp:276
void LTC6811_wrcfg(uint8_t total_ic, cell_asic *ic)
Write the LTC6811 configuration register.
Definition: LTC6811.cpp:86
void LTC6811_run_openwire_multi(uint8_t total_ic, cell_asic *ic)
Helper function that runs open wire for multiple cell and two consecutive cells detection.
Definition: LTC6811.cpp:337
int8_t LTC6811_rdaux(uint8_t reg, uint8_t nIC, cell_asic *ic)
Reads and parses the LTC6811 auxiliary registers.
Definition: LTC6811.cpp:164
void LTC6811_adstat(uint8_t MD, uint8_t CHST)
Start a Status ADC Conversion.
Definition: LTC6811.cpp:121
int8_t LTC6811_rdsctrl(uint8_t total_ic, uint8_t sctrl_reg, cell_asic *ic)
Reads sctrl registers of a LTC6811 daisy chain.
Definition: LTC6811.cpp:404
void LTC6811_wrpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Write the LTC6811 PWM register.
Definition: LTC6811.cpp:374
void LTC6811_adaxd(uint8_t MD, uint8_t CHG)
Start an GPIO Redundancy test.
Definition: LTC6811.cpp:268
void LTC6811_run_openwire_single(uint8_t total_ic, cell_asic *ic)
Helper function that runs the data sheet open wire algorithm for single cell detection.
Definition: LTC6811.cpp:329
void LTC6811_clraux()
Clears the LTC6811 Auxiliary registers.
Definition: LTC6811.cpp:215
void LTC6811_set_discharge(int Cell, uint8_t total_ic, cell_asic *ic)
Helper function to set discharge bit in CFG register.
Definition: LTC6811.cpp:345
void LTC6811_adcvsc(uint8_t MD, uint8_t DCP)
Starts cell voltage and SOC conversion.
Definition: LTC6811.cpp:137
void LTC6811_adcv(uint8_t MD, uint8_t DCP, uint8_t CH)
Starts cell voltage conversion.
Definition: LTC6811.cpp:104
void LTC6811_check_pec(uint8_t total_ic, uint8_t reg, cell_asic *ic)
Helper Function that counts overall PEC errors and register/IC PEC errors.
Definition: LTC6811.cpp:458
void LTC6811_stsctrl()
Start Sctrl data communication This command will start the sctrl pulse communication over the spins...
Definition: LTC6811.cpp:418
void LTC6811_stcomm(uint8_t len)
Issues a stcomm command and clocks data out of the COMM register.
Definition: LTC6811.cpp:452
void LTC6811_set_cfgr_ov(uint8_t nIC, cell_asic *ic, uint16_t ov)
Helper function to set ov field in CFGRA register.
Definition: LTC6811.cpp:534
void LTC6811_axst(uint8_t MD, uint8_t ST)
Start an Auxiliary Register Self Test Conversion.
Definition: LTC6811.cpp:244
void LTC6811_init_cfg(uint8_t total_ic, cell_asic *ic)
Helper Function to initialize the CFGR data structures.
Definition: LTC6811.cpp:475
void LTC6811_clrcell()
Clears the LTC6811 cell voltage registers.
Definition: LTC6811.cpp:206
void LTC6811_cvst(uint8_t MD, uint8_t ST)
Starts cell voltage self test conversion.
Definition: LTC6811.cpp:236
int16_t LTC6811_run_adc_redundancy_st(uint8_t adc_mode, uint8_t adc_reg, uint8_t total_ic, cell_asic *ic)
Helper function that runs the ADC Digital Redundancy commands and checks output for errors...
Definition: LTC6811.cpp:307
void LTC6811_init_reg_limits(uint8_t total_ic, cell_asic *ic)
Initialize the Register limits.
Definition: LTC6811.cpp:66
void LTC6811_set_cfgr_adcopt(uint8_t nIC, cell_asic *ic, bool adcopt)
Helper function to turn the ADCOPT bit HIGH or LOW.
Definition: LTC6811.cpp:504
uint32_t LTC6811_pollAdc()
This function will block operation until the ADC has finished it&#39;s conversion.
Definition: LTC6811.cpp:197
void LTC6811_wrsctrl(uint8_t total_ic, uint8_t sctrl_reg, cell_asic *ic)
Write the LTC6811 Sctrl register.
Definition: LTC6811.cpp:395
uint8_t LTC6811_pladc()
Sends the poll ADC command.
Definition: LTC6811.cpp:191