| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC6810.h
Go to the documentation of this file.
1 /*! LTC6810: 6-Channel Battery Stack Monitors
2 *
3 *@verbatim
4 *The LTC6810 is multi-cell battery stack monitor that measures up to 6 series
5 *connected battery cells with a total measurement error of less than 1.8mV.
6 *The cell measurement range of 0V to 5V makes the LTC6810 suitable for most
7 *battery chemistries. All 6 cell voltages can be captured in 290uS, and lower
8 *data acquisition rates can be selected for high noise reduction.
9 *Using the LTC6810-1, multiple devices are connected in a daisy-chain with one
10 *host processor connection for all devices, permitting simultaneous cell monitoring
11 *of long, high voltage battery strings.
12 *@endverbatim
13 *
14 * https://www.analog.com/en/products/ltc6810-1.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 LTC6810-1
53 Header for LTC6810-1 Multicell Battery Monitor
54 */
55
56 #ifndef LTC6810_H
57 #define LTC6810_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 LTC6810_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 LTC6810 configuration register
76 @return void
77 */
78 void LTC6810_wrcfg(uint8_t nIC, //!< 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 LTC6810 daisy chain
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 LTC6810_rdcfg(uint8_t nIC, //!< Number of ICs in the daisy chain
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 LTC6810_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, cell 0 and Vref2 Conversion
103 @return void
104 */
105 void LTC6810_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 LTC6810_adstat(uint8_t MD, //!< ADC Conversion Mode
114 uint8_t CHST //!< Sets which Stat channels are converted
115 );
116
117 /*!
118 Starts cell voltage, Cell 0 and GPIO 1 conversion
119 @return void */
120 void LTC6810_adcvax(uint8_t MD, //!< ADC Conversion Mode
121 uint8_t DCP //!< Controls if Discharge is permitted during conversion
122 );
123
124 /*!
125 Starts cell voltage and SOC conversion
126 @return void
127 */
128 void LTC6810_adcvsc(uint8_t MD, //!< ADC Conversion Mode
129 uint8_t DCP //!< Controls if Discharge is permitted during conversion
130 );
131
132 /*!
133 Reads and parses the LTC6810 cell voltage registers.
134 @return uint8_t, pec_error PEC Status.
135 0: No PEC error detected
136 -1: PEC error detected, retry read
137 */
138 uint8_t LTC6810_rdcv(uint8_t reg, //!< Determines which cell voltage register is read back.
139 uint8_t total_ic, //!< The number of ICs in the daisy chain
140 cell_asic *ic //!< Array of the parsed cell codes
141 );
142
143 /*!
144 Reads and parses the LTC6810 auxiliary registers.
145 @return int8_t, pec_error PEC Status.
146 0: No PEC error detected
147 -1: PEC error detected, retry read
148 */
149 int8_t LTC6810_rdaux(uint8_t reg, //!< Determines which GPIO voltage register is read back
150 uint8_t nIC, //!< The number of ICs in the daisy chain
151 cell_asic *ic //!< A two dimensional array of the parsed gpio voltage codes
152 );
153
154 /*!
155 Reads and parses the LTC6810 stat registers.
156 @return int8_t, pec_error PEC Status.
157 0: No PEC error detected
158 -1: PEC error detected, retry read
159 */
160 int8_t LTC6810_rdstat(uint8_t reg, //!< Determines which Stat register is read back.
161 uint8_t total_ic, //!< The number of ICs in the system
162 cell_asic *ic //!< A two dimensional array of the parsed stat codes
163 );
164
165 /*!
166 Reads and parses the LTC6810 S voltage registers
167 @return uint8_t, pec_error PEC Status.
168 0: No PEC error detected
169 -1: PEC error detected, retry read
170 */
171 uint8_t LTC6810_rds(uint8_t reg, //!< Determines which S voltage registers is read back.
172 uint8_t total_ic, //!< The number of ICs in the system
173 cell_asic *ic //!< Array of the parsed cell codes
174 );
175
176 /*!
177 Reads the raw S voltage register data
178 @return void
179 */
180 void LTC6810_rds_reg(uint8_t reg, //!< Determines which s voltage register is read back
181 uint8_t total_ic, //!< The number of ICs in the daisy-chain
182 uint8_t *data //!< An array of the unparsed cell codes
183 );
184
185 /*!
186 Sends the poll ADC command
187 @returns 1 byte read back after a pladc command. If the byte is not 0xFF ADC conversion has completed
188 */
189 uint8_t LTC6810_pladc();
190
191 /*!
192 This function will block operation until the ADC has finished it's conversion
193 @returns the approximate time it took for the ADC function to complete.
194 */
195 uint32_t LTC6810_pollAdc();
196
197 /*! Clears the LTC6810 cell voltage registers
198 @return void
199 */
200 void LTC6810_clrcell();
201
202 /*!
203 Clears the LTC6810 Auxiliary registers
204 @return void
205 */
206 void LTC6810_clraux();
207
208 /*!
209 Clears the LTC6810 Stat registers
210 @return void */
211 void LTC6810_clrstat();
212
213 /*!
214 Starts the Mux Decoder diagnostic self test.
215 Running this command will start the Mux Decoder Diagnostic Self Test.
216 This test takes roughly 1ms to complete. The MUXFAIL bit will be updated.
217 The bit will be set to 1 for a failure and 0 if the test has been passed.
218 @return void
219 */
220 void LTC6810_diagn();
221
222 /*!
223 Starts Cell voltage self test conversion
224 @return void
225 */
226 void LTC6810_cvst(uint8_t MD, //!< ADC Conversion Mode
227 uint8_t ST //!< Sets if self test 1 or 2 is run
228 );
229
230 /*!
231 Start an Auxiliary Register Self Test Conversion
232 @return void
233 */
234 void LTC6810_axst(uint8_t MD, //!< ADC Conversion Mode
235 uint8_t ST //!< Sets if self test 1 or 2 is run
236 );
237
238 /*!
239 Start a Status Register Self Test Conversion
240 @return void
241 */
242 void LTC6810_statst(uint8_t MD, //!< ADC Conversion Mode
243 uint8_t ST //!< Sets if self test 1 or 2 is run
244 );
245
246 /*!
247 Start an GPIO Redundancy test
248 @return void
249 */
250 void LTC6810_adaxd(uint8_t MD, //!< ADC Conversion Mode
251 uint8_t CHG //!< Sets which GPIO channels are converted
252 );
253
254 /*!
255 Start a Status register redundancy test Conversion
256 @return void
257 */
258 void LTC6810_adstatd(uint8_t MD, //!< ADC Mode
259 uint8_t CHST //!< Sets which Status channels are converted
260 );
261
262 /*!
263 Helper function that runs the ADC Self Tests
264 @return int16_t, error Number of errors detected.
265 */
266 int16_t LTC6810_run_cell_adc_st(uint8_t adc_reg, //!< Type of register
267 uint8_t total_ic, //!< Number of ICs in the daisy chain
268 cell_asic *ic, //!< A two dimensional array that will store the data
269 uint8_t md, //!< ADC Mode
270 bool adcopt //!< the adcopt bit in the configuration register
271 );
272
273 /*!
274 Helper function that runs the ADC Digital Redundancy commands and checks output for errors
275 @return int16_t, error Number of errors detected.
276 */
277 int16_t LTC6810_run_adc_redundancy_st(uint8_t adc_mode, //!< ADC Mode
278 uint8_t adc_reg, //!< Type of register
279 uint8_t total_ic, //!< Number of ICs in the daisy chain
280 cell_asic *ic //!< A two dimensional array that will store the data
281 );
282
283 /*!
284 Start an open wire Conversion
285 @return void
286 */
287 void LTC6810_adow(uint8_t MD, //!< ADC Conversion Mode
288 uint8_t PUP, //!< Pull up/Pull down current
289 uint8_t CH, //!< Channels
290 uint8_t DCP//!< Discharge Permit
291 );
292
293 /*!
294 Start GPIOs open wire ADC conversion
295 @return void
296 */
297 void LTC6810_axow(uint8_t MD, //!< ADC Mode
298 uint8_t PUP //!< Pull up/Pull down current
299 );
300
301 /*!
302 Helper function that runs the data sheet open wire algorithm for single cell detection
303 @return void
304 */
305 void LTC6810_run_openwire_single(uint8_t total_ic, //!< Number of ICs in the daisy chain
306 cell_asic *ic //!< A two dimensional array that will store the data
307 );
308
309 /*!
310 Runs the data sheet algorithm for open wire for multiple cell and two consecutive cells detection
311 @return void
312 */
313 void LTC6810_run_openwire_multi(uint8_t total_ic, //!< Number of ICs in the daisy chain
314 cell_asic *ic //!< A two dimensional array that will store the data
315 );
316
317 /*!
318 Runs open wire for GPIOs
319 @return void
320 */
321 void LTC6810_run_gpio_openwire(uint8_t total_ic, //!< Number of ICs in the daisy chain
322 cell_asic *ic //!< A two dimensional array that will store the data
323 );
324
325 /*!
326 Helper function to set discharge bit in CFG register
327 @return void
328 */
329 void LTC6810_set_discharge(int Cell, //!< The cell to be discharged
330 uint8_t total_ic, //!< Number of ICs in the system
331 cell_asic *ic //!< A two dimensional array that will store the data
332 );
333
334 /*!
335 Clears all of the DCC bits in the configuration registers
336 @return void
337 */
338 void LTC6810_clear_discharge(uint8_t total_ic, //!< Number of ICs in the daisy chain
339 cell_asic *ic //!< A two dimensional array that will store the data
340 );
341
342 /*!
343 Writes to the LTC6810 PWM register of LTC6810
344 @return void
345 */
346 void LTC6810_wrpwm(uint8_t total_ic, //!< Number of ICs in the daisy chain
347 uint8_t pwmReg, //!< Select register
348 cell_asic *ic //!< A two dimensional array that will store the data to be written
349 );
350
351 /*!
352 Reads pwm registers of the LTC6810 in daisy chain
353 @return void
354 */
355 int8_t LTC6810_rdpwm(uint8_t total_ic, //!< Number of ICs in the daisy chain
356 uint8_t pwmReg, //!< Select register
357 cell_asic *ic //!< A two dimensional array that the function stores the read pwm data
358 );
359
360 /*!
361 Write the LTC6810 COMM register
362 @return void
363 */
364 void LTC6810_wrcomm(uint8_t total_ic, //!< Number of ICs in the daisy chain
365 cell_asic *ic //!< A two dimensional array of the comm data that will be written
366 );
367
368 /*!
369 Reads comm registers of a LTC6810 in daisy chain
370 @return int8_t, pec_error PEC Status.
371 0: Data read back has matching PEC
372 -1: Data read back has incorrect PEC
373 */
374 int8_t LTC6810_rdcomm(uint8_t total_ic, //!< Number of ICs in the daisy chain
375 cell_asic *ic //!< Two dimensional array that the function stores the read comm data.
376 );
377
378 /*!
379 Issues a stcomm command and clocks data out of the COMM register
380 @return void
381 */
382 void LTC6810_stcomm(uint8_t len //!< Length of data to be transmitted
383 );
384
385 /*!
386 Reads Serial ID registers group
387 @return uint8_t, pec_error PEC Status.
388 0: Data read back has matching PEC
389 -1: Data read back has incorrect PEC
390 */
391 uint8_t LTC6810_rdsid(uint8_t total_ic, //!< The number of ICs in the system
392 cell_asic *ic //!< A two dimensional array that will store the read data
393 );
394
395 /*!
396 Mutes the LTC6810 discharge transistors
397 @return void
398 */
399 void LTC6810_mute();
400
401 /*!
402 Clears the LTC6810 Mute Discharge
403 @return void
404 */
405 void LTC6810_unmute();
406
407 /*!
408 Helper Function that counts overall PEC errors and register/IC PEC errors
409 @return void
410 */
411 void LTC6810_check_pec(uint8_t total_ic, //!< Number of ICs in the daisy chain
412 uint8_t reg, //!< Type of register
413 cell_asic *ic //!< A two dimensional array that will store the data
414 );
415
416 /*!
417 Helper Function that resets the PEC error counters
418 @return void
419 */
420 void LTC6810_reset_crc_count(uint8_t total_ic, //!< Number of ICs in the daisy chain
421 cell_asic *ic//!< A two dimensional array that will store the data
422 );
423
424 /*!
425 Helper Function to initialize the CFGR data structures
426 @return void
427 */
428 void LTC6810_init_cfg(uint8_t total_ic, //!< Number of ICs in the daisy chain
429 cell_asic *ic //!< A two dimensional array that will store the data
430 );
431
432 /*!
433 Helper function to set appropriate bits in CFGR register based on bit function
434 @return void
435 */
436 void LTC6810_set_cfgr(uint8_t nIC, //!< Current IC
437 cell_asic *ic, //!< A two dimensional array that will store the data
438 bool refon, //!< The REFON bit
439 bool adcopt, //!< The ADCOPT bit
440 bool gpio[4], //!< The GPIO bits
441 bool dcc[6], //!< The DCC bits
442 bool dcc_0, //!< The DCC bit
443 bool mcal, //!< Enable Multi-Calibration
444 bool en_dtmen, //!< Enable Discharge timer monitor
445 bool dis_red, //!< Disable Digital Redundancy Check
446 bool fdrf, //!< Force digital Redundancy Failure
447 bool sconv, //!< Enable Cell Measurement Redundancy using S Pin
448 bool dcto[4], //!< Discharge Time Out Value
449 uint16_t uv, //!< The UV value
450 uint16_t ov //!< The OV value
451 );
452
453 /*!
454 Helper function to turn the REFON bit HIGH or LOW
455 @return void
456 */
457 void LTC6810_set_cfgr_refon(uint8_t nIC, //!< Current IC
458 cell_asic *ic, //!< A two dimensional array that will store the data
459 bool refon //!< The REFON bit
460 );
461
462 /*!
463 Helper function to turn the ADCOPT bit HIGH or LOW
464 @return void
465 */
466 void LTC6810_set_cfgr_adcopt(uint8_t nIC, //!< Current IC
467 cell_asic *ic, //!< A two dimensional array that will store the data
468 bool adcopt //!< The ADCOPT bit
469 );
470
471 /*!
472 Helper function to turn the GPIO bits HIGH or LOW
473 @return void
474 */
475 void LTC6810_set_cfgr_gpio(uint8_t nIC, //!< Current IC
476 cell_asic *ic, //!< A two dimensional array that will store the data
477 bool gpio[] //!< The GPIO bits
478 );
479 /*!
480 Helper function to turn the DCC bits HIGH or LOW
481 @return void
482 */
483 void LTC6810_set_cfgr_dis(uint8_t nIC, //!< Current IC
484 cell_asic *ic, //!< A two dimensional array that will store the data
485 bool dcc[] //!< The DCC bits
486 );
487
488 /*!
489 Helper function to set uv field in CFGRA register
490 @return void
491 */
492 void LTC6810_set_cfgr_uv(uint8_t nIC, //!< Current IC
493 cell_asic *ic, //!< A two dimensional array that will store the data
494 uint16_t uv //!< The UV value
495 );
496
497 /*!
498 Helper function to set ov field in CFGRA register
499 @return void
500 */
501 void LTC6810_set_cfgr_ov(uint8_t nIC, //!< Current IC
502 cell_asic *ic, //!< A two dimensional array that will store the data
503 uint16_t ov //!< The OV value
504 );
505
506 /*!
507 Helper function to set the MCAL bit
508 @return void
509 */
510 void LTC6810_set_cfgr_mcal(uint8_t nIC, //!< Current IC
511 cell_asic *ic, //!< A two dimensional array that will store the data
512 bool mcal //!< Enable Multi-Calibration
513 );
514
515 /*!
516 Helper function to set the DCC_0 bit
517 @return void
518 */
519 void LTC6810_set_cfgr_dcc_0(uint8_t nIC, //!< Current IC
520 cell_asic *ic, //!< A two dimensional array that will store the data
521 bool dcc_0 //!< The DCC bit
522 );
523
524 /*!
525 Helper function to set the EN_DTMEN bit
526 @return void
527 */
528 void LTC6810_set_cfgr_en_dtmen(uint8_t nIC, //!< Current IC
529 cell_asic *ic, //!< A two dimensional array that will store the data
530 bool en_dtmen //!< Enable Discharge timer monitor
531 );
532
533 /*!
534 Helper function to set the DIS_RED bit
535 @return void
536 */
537 void LTC6810_set_cfgr_dis_red(uint8_t nIC, //!< Current IC
538 cell_asic *ic, //!< A two dimensional array that will store the data
539 bool dis_red //!< Disable Digital Redundancy Check
540 );
541
542 /*!
543 Helper function to set the FDRF bit
544 @return void
545 */
546 void LTC6810_set_cfgr_fdrf(uint8_t nIC, //!< Current IC
547 cell_asic *ic, //!< A two dimensional array that will store the data
548 bool fdrf //!< Force digital Redundancy Failure
549 );
550
551 /*!
552 Helper function to set the SCONV bit
553 @return void
554 */
555 void LTC6810_set_cfgr_sconv(uint8_t nIC, //!< Current IC
556 cell_asic *ic, //!< A two dimensional array that will store the data
557 bool sconv //!< Enable Cell Measurement Redundancy using S Pin
558 );
559
560 /*!
561 Helper function to set the DCTO bit
562 @return void
563 */
564 void LTC6810_set_cfgr_dcto(uint8_t nIC, //!< Current IC
565 cell_asic *ic, //!< A two dimensional array that will store the data
566 bool dcto[] //!< Discharge Time Out Value
567 );
568
569 #endif
LTC6810_set_cfgr_fdrf
void LTC6810_set_cfgr_fdrf(uint8_t nIC, cell_asic *ic, bool fdrf)
Helper function to set the FDRF bit.
Definition: LTC6810.cpp:756
LTC681x.h
General BMS Library.
LTC6810_set_discharge
void LTC6810_set_discharge(int Cell, uint8_t total_ic, cell_asic *ic)
Helper function to set discharge bit in CFG register.
Definition: LTC6810.cpp:510
LTC6810_set_cfgr
void LTC6810_set_cfgr(uint8_t nIC, cell_asic *ic, bool refon, bool adcopt, bool gpio[4], bool dcc[6], bool dcc_0, bool mcal, bool en_dtmen, bool dis_red, bool fdrf, bool sconv, bool dcto[4], uint16_t uv, uint16_t ov)
Helper function to set appropriate bits in CFGR register based on bit function.
Definition: LTC6810.cpp:666
LTC6810_clraux
void LTC6810_clraux()
Clears the LTC6810 Auxiliary registers.
Definition: LTC6810.cpp:306
LTC6810_set_cfgr_mcal
void LTC6810_set_cfgr_mcal(uint8_t nIC, cell_asic *ic, bool mcal)
Helper function to set the MCAL bit.
Definition: LTC6810.cpp:728
LTC6810_run_openwire_multi
void LTC6810_run_openwire_multi(uint8_t total_ic, cell_asic *ic)
Runs the data sheet algorithm for open wire for multiple cell and two consecutive cells detection...
Definition: LTC6810.cpp:419
LTC6810_cvst
void LTC6810_cvst(uint8_t MD, uint8_t ST)
Starts Cell voltage self test conversion.
Definition: LTC6810.cpp:328
LTC6810_pladc
uint8_t LTC6810_pladc()
Sends the poll ADC command.
Definition: LTC6810.cpp:280
LTC6810_wrcomm
void LTC6810_wrcomm(uint8_t total_ic, cell_asic *ic)
Write the LTC6810 COMM register.
Definition: LTC6810.cpp:561
LTC6810_pollAdc
uint32_t LTC6810_pollAdc()
This function will block operation until the ADC has finished it&#39;s conversion.
Definition: LTC6810.cpp:286
LTC6810_clrcell
void LTC6810_clrcell()
Clears the LTC6810 cell voltage registers.
Definition: LTC6810.cpp:296
cell_asic
Cell variable structure.
Definition: LTC681x.h:170
LTC6810_wrpwm
void LTC6810_wrpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Writes to the LTC6810 PWM register of LTC6810.
Definition: LTC6810.cpp:540
LTC6810_rds
uint8_t LTC6810_rds(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6810 S voltage registers.
Definition: LTC6810.cpp:198
LTC6810_rdaux
int8_t LTC6810_rdaux(uint8_t reg, uint8_t nIC, cell_asic *ic)
Reads and parses the LTC6810 auxiliary registers.
Definition: LTC6810.cpp:166
LTC6810_set_cfgr_dcto
void LTC6810_set_cfgr_dcto(uint8_t nIC, cell_asic *ic, bool dcto[])
Helper function to set the DCTO bit.
LTC6810_run_openwire_single
void LTC6810_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: LTC6810.cpp:411
LTC6810_init_cfg
void LTC6810_init_cfg(uint8_t total_ic, cell_asic *ic)
Helper Function to initialize the CFGR data structures.
Definition: LTC6810.cpp:660
LTC6810_rdcv
uint8_t LTC6810_rdcv(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6810 cell voltage registers.
Definition: LTC6810.cpp:150
LTC6810_run_adc_redundancy_st
int16_t LTC6810_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: LTC6810.cpp:381
LTC6810_check_pec
void LTC6810_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: LTC6810.cpp:643
LTC6810_run_cell_adc_st
int16_t LTC6810_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: LTC6810.cpp:368
data
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
LTC6810_clrstat
void LTC6810_clrstat()
Clears the LTC6810 Stat registers.
Definition: LTC6810.cpp:316
LTC6810_mute
void LTC6810_mute()
Mutes the LTC6810 discharge transistors.
Definition: LTC6810.cpp:622
LTC6810_adcv
void LTC6810_adcv(uint8_t MD, uint8_t DCP, uint8_t CH)
Starts cell voltage conversion.
Definition: LTC6810.cpp:104
LTC6810_set_cfgr_en_dtmen
void LTC6810_set_cfgr_en_dtmen(uint8_t nIC, cell_asic *ic, bool en_dtmen)
Helper function to set the EN_DTMEN bit.
Definition: LTC6810.cpp:742
LTC6810_rdsid
uint8_t LTC6810_rdsid(uint8_t total_ic, cell_asic *ic)
Reads Serial ID registers group.
Definition: LTC6810.cpp:585
LTC6810_init_reg_limits
void LTC6810_init_reg_limits(uint8_t total_ic, cell_asic *ic)
Initialize the Register limits.
Definition: LTC6810.cpp:66
LTC6810_set_cfgr_refon
void LTC6810_set_cfgr_refon(uint8_t nIC, cell_asic *ic, bool refon)
Helper function to turn the REFON bit HIGH or LOW.
Definition: LTC6810.cpp:684
LTC6810_statst
void LTC6810_statst(uint8_t MD, uint8_t ST)
Start a Status Register Self Test Conversion.
Definition: LTC6810.cpp:344
LTC6810_run_gpio_openwire
void LTC6810_run_gpio_openwire(uint8_t total_ic, cell_asic *ic)
Runs open wire for GPIOs.
LTC6810_set_cfgr_adcopt
void LTC6810_set_cfgr_adcopt(uint8_t nIC, cell_asic *ic, bool adcopt)
Helper function to turn the ADCOPT bit HIGH or LOW.
Definition: LTC6810.cpp:690
LTC6810_adow
void LTC6810_adow(uint8_t MD, uint8_t PUP, uint8_t CH, uint8_t DCP)
Start an open wire Conversion.
Definition: LTC6810.cpp:393
LTC6810_adax
void LTC6810_adax(uint8_t MD, uint8_t CHG)
Start a GPIO, cell 0 and Vref2 Conversion.
Definition: LTC6810.cpp:113
LTC6810_set_cfgr_uv
void LTC6810_set_cfgr_uv(uint8_t nIC, cell_asic *ic, uint16_t uv)
Helper function to set uv field in CFGRA register.
Definition: LTC6810.cpp:716
LTC6810_set_cfgr_dis_red
void LTC6810_set_cfgr_dis_red(uint8_t nIC, cell_asic *ic, bool dis_red)
Helper function to set the DIS_RED bit.
Definition: LTC6810.cpp:749
LTC6810_set_cfgr_sconv
void LTC6810_set_cfgr_sconv(uint8_t nIC, cell_asic *ic, bool sconv)
Helper function to set the SCONV bit.
Definition: LTC6810.cpp:763
LTC6810_clear_discharge
void LTC6810_clear_discharge(uint8_t total_ic, cell_asic *ic)
Clears all of the DCC bits in the configuration registers.
Definition: LTC6810.cpp:529
LTC6810_rdcfg
int8_t LTC6810_rdcfg(uint8_t nIC, cell_asic *ic)
Reads configuration registers of a LTC6810 daisy chain.
Definition: LTC6810.cpp:94
LTC6810_rdcomm
int8_t LTC6810_rdcomm(uint8_t total_ic, cell_asic *ic)
Reads comm registers of a LTC6810 in daisy chain.
Definition: LTC6810.cpp:569
LTC6810_set_cfgr_gpio
void LTC6810_set_cfgr_gpio(uint8_t nIC, cell_asic *ic, bool gpio[])
Helper function to turn the GPIO bits HIGH or LOW.
LTC6810_rdpwm
int8_t LTC6810_rdpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Reads pwm registers of the LTC6810 in daisy chain.
Definition: LTC6810.cpp:549
LTC6810_adstat
void LTC6810_adstat(uint8_t MD, uint8_t CHST)
Start a Status ADC Conversion.
Definition: LTC6810.cpp:121
LTC6810_adcvsc
void LTC6810_adcvsc(uint8_t MD, uint8_t DCP)
Starts cell voltage and SOC conversion.
Definition: LTC6810.cpp:129
LTC6810_diagn
void LTC6810_diagn()
Starts the Mux Decoder diagnostic self test.
Definition: LTC6810.cpp:322
LTC6810_set_cfgr_dcc_0
void LTC6810_set_cfgr_dcc_0(uint8_t nIC, cell_asic *ic, bool dcc_0)
Helper function to set the DCC_0 bit.
Definition: LTC6810.cpp:735
LTC6810_adcvax
void LTC6810_adcvax(uint8_t MD, uint8_t DCP)
Starts cell voltage, Cell 0 and GPIO 1 conversion.
Definition: LTC6810.cpp:137
LTC6810_axow
void LTC6810_axow(uint8_t MD, uint8_t PUP)
Start GPIOs open wire ADC conversion.
Definition: LTC6810.cpp:403
LTC6810_reset_crc_count
void LTC6810_reset_crc_count(uint8_t total_ic, cell_asic *ic)
Helper Function that resets the PEC error counters.
Definition: LTC6810.cpp:652
LTC6810_axst
void LTC6810_axst(uint8_t MD, uint8_t ST)
Start an Auxiliary Register Self Test Conversion.
Definition: LTC6810.cpp:336
LTC6810_wrcfg
void LTC6810_wrcfg(uint8_t nIC, cell_asic *ic)
Write the LTC6810 configuration register.
Definition: LTC6810.cpp:86
LTC6810_rdstat
int8_t LTC6810_rdstat(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6810 stat registers.
Definition: LTC6810.cpp:182
LTC6810_unmute
void LTC6810_unmute()
Clears the LTC6810 Mute Discharge.
Definition: LTC6810.cpp:633
LTC6810_adaxd
void LTC6810_adaxd(uint8_t MD, uint8_t CHG)
Start an GPIO Redundancy test.
Definition: LTC6810.cpp:352
LTC6810_set_cfgr_dis
void LTC6810_set_cfgr_dis(uint8_t nIC, cell_asic *ic, bool dcc[])
Helper function to turn the DCC bits HIGH or LOW.
LTC6810_stcomm
void LTC6810_stcomm(uint8_t len)
Issues a stcomm command and clocks data out of the COMM register.
Definition: LTC6810.cpp:579
LTC6810_adstatd
void LTC6810_adstatd(uint8_t MD, uint8_t CHST)
Start a Status register redundancy test Conversion.
Definition: LTC6810.cpp:360
LTC6810_rds_reg
void LTC6810_rds_reg(uint8_t reg, uint8_t total_ic, uint8_t *data)
Reads the raw S voltage register data.
Definition: LTC6810.cpp:256
LTC6810_set_cfgr_ov
void LTC6810_set_cfgr_ov(uint8_t nIC, cell_asic *ic, uint16_t ov)
Helper function to set ov field in CFGRA register.
Definition: LTC6810.cpp:722