DC2100A  1.2.0
Bi-Directional Cell Balancer Using the LTC3300-1 and the LTC6804-2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LTC6804-2.h
Go to the documentation of this file.
1 /*
2  Linear Technology DC2100A Demonstration Board.
3  API Header File for LTC6804-2 Multicell Battery Monitors.
4  All datasheet references in this file refer to Linear Technology Corp. document 680412fa.pdf.
5 
6  @verbatim
7  The LTC6804 is a 3rd generation multicell battery stack
8  monitor that measures up to 12 series connected battery
9  cells with a total measurement error of less than 1.2mV. The
10  cell measurement range of 0V to 5V makes the LTC6804
11  suitable for most battery chemistries. All 12 cell voltages
12  can be captured in 290us, and lower data acquisition rates
13  can be selected for high noise reduction.
14  Multiple LTC6804 devices can be connected in series,
15  permitting simultaneous cell monitoring of long, high voltage
16  battery strings. Each LTC6804 has an isoSPI interface
17  for high speed, RF-immune, local area communications.
18  Using the LTC6804-2, multiple devices are connected in
19  a daisy-chain with one host processor connection for all
20  devices. Using the LTC6804-2, multiple devices are connected
21  in parallel to the host processor, with each device
22  individually addressed.
23  Additional features include passive balancing for each cell,
24  an onboard 5V regulator, and 5 general purpose I/O lines.
25  In sleep mode, current consumption is reduced to 4uA.
26  The LTC6804 can be powered directly from the battery,
27  or from an isolated supply.
28  @endverbatim
29 
30  http://www.linear.com/product/LTC6804
31 
32  http://www.linear.com/product/LTC6804#demoboards
33 
34  REVISION HISTORY
35  $Revision: 693 $
36  $Date: 2014-09-08 13:52:04 -0400 (Mon, 08 Sep 2014) $
37 
38  Copyright (c) 2013, Linear Technology Corp.(LTC)
39  All rights reserved.
40 
41  Redistribution and use in source and binary forms, with or without
42  modification, are permitted provided that the following conditions are met:
43 
44  1. Redistributions of source code must retain the above copyright notice, this
45  list of conditions and the following disclaimer.
46  2. Redistributions in binary form must reproduce the above copyright notice,
47  this list of conditions and the following disclaimer in the documentation
48  and/or other materials provided with the distribution.
49 
50  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
51  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
52  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
53  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
54  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
55  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
56  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
57  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 
61  The views and conclusions contained in the software and documentation are those
62  of the authors and should not be interpreted as representing official policies,
63  either expressed or implied, of Linear Technology Corp.
64 
65 */
66 
67 /*! @file
68  @ingroup LTC6804-2
69  API Header File for LTC6804-2 Multicell Battery Monitors.
70 */
71 
72 #ifndef __LTC6804_H__
73 #define __LTC6804_H__
74 
75 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
76 // Includes
77 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
78 #include "Typedefs.h"
79 #include "DC2100A.h"
80 
81 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
82 // Definitions
83 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
84 
85 //! @name LTC6804-2 Driver Properties
86 //! @{
87 //!
88 #define LTC6804_MAX_BOARDS 16 //!< The maximum number of addresses available to the LTC6804-2
89 #define LTC6804_BROADCAST LTC6804_MAX_BOARDS //!< Code for application code to indicate an LTC6804 command is to be broadcast to all boards
90 #define LTC6804_NUM_CELLV_ADC 12 //!< Number of cell voltage ADC measurements
91 #define LTC6804_NUM_GPIO 5 //!< Number of GPIO pins available on LTC6804
92 #define LTC6804_NUM_AUX_ADC 6 //!< Number of auxiliary ADC measurements
93 #define LTC6804_ADC_CLEAR 0xFFFF //!< ADC Value returned when results are cleared, but not retaken.
94 //! @}
95 
96 //! @name Cell Selections
97 //! @{
98 //! Cell selection for ADC Conversion from datasheet table 35.
99 typedef enum {
100  LTC6804_CH_ALL = 0, //!< All Cells
101  LTC6804_CH_CELL_1_AND_7 = 1, //!< Cell 1 and Cell 7
102  LTC6804_CH_CELL_2_AND_8 = 2, //!< Cell 2 and Cell 8
103  LTC6804_CH_CELL_3_AND_9 = 3, //!< Cell 3 and Cell 9
104  LTC6804_CH_CELL_4_AND_10 = 4, //!< Cell 4 and Cell 10
105  LTC6804_CH_CELL_5_AND_11 = 5, //!< Cell 5 and Cell 11
106  LTC6804_CH_CELL_6_AND_12 = 6, //!< Cell 6 and Cell 12
107  LTC6804_CH_CELL_NUM
109 //! @}
110 
111 //! @name GPIO Selections
112 //! @{
113 //! GPIO for ADC Conversion from datasheet table 35.
114 typedef enum {
115  LTC6804_CHG_GPIO_ALL = 0, //!< GPIO 1-5, 2nd Ref
116  LTC6804_CHG_GPIO1 = 1, //!< GPIO 1
117  LTC6804_CHG_GPIO2 = 2, //!< GPIO 2
118  LTC6804_CHG_GPIO3 = 3, //!< GPIO 3
119  LTC6804_CHG_GPIO4 = 4, //!< GPIO 4
120  LTC6804_CHG_GPIO5 = 5, //!< GPIO 5
121  LTC6804_CHG_GPIO_2ND_REF = 6, //!< 2nd Reference
122  LTC6804_CHG_GPIO_NUM
124 //! @}
125 
126 //! @name Status Group Selections
127 //! @{
128 //! Status Group Selections from datasheet table 35.
129 typedef enum {
130  LTC6804_CHST_ALL = 0, //!< SOC, ITMP, VA, VD
131  LTC6804_CHST_SOC = 1, //!< SOC
132  LTC6804_CHST_ITMP = 2, //!< ITMP
133  LTC6804_CHST_VA = 3, //!< VA
134  LTC6804_CHST_VD = 4, //!< VD
135  LTC6804_CHST_NUM
137 //! @}
138 
139 //! @name Conversion Modes
140 //! @{
141 //! Conversion Modes Available in the LTC6804 from datasheet table 35.
142 typedef enum {
143  LTC6804_CONVERSION_27KHZ_MODE = 0, //!< 27kHz conversion mode
144  LTC6804_CONVERSION_14KHZ_MODE = 1, //!< 14kHz conversion mode
145  LTC6804_CONVERSION_7KHZ_MODE = 2, //!< 7kHz conversion mode
146  LTC6804_CONVERSION_3KHZ_MODE = 3, //!< 3kHz conversion mode
147  LTC6804_CONVERSION_2KHZ_MODE = 4, //!< 2kHz conversion mode
148  LTC6804_CONVERSION_26HZ_MODE = 5, //!< 26Hz conversion mode
149  LTC6804_CONVERSION_NUM_MODES
151 //! @}
152 
153 //! @name Conversion Delays
154 //! @{
155 //! Reference wakeup time from datasheet Electrical Characteristics page 7.
156 //! Time for ADC results for one channel to be ready, from Table 6 (t1C).
157 //! Time for ADC results for all channels to be ready, from Table 5 (t6C).
158 #define LTC6804_TREFUP 4400 //!< in us, max reference wakeup time.
159 #define LTC6804_CONVERSION_27KHZ_DELAY 201 //!< in us, delay between sampling and reading ADC in 27kHz conversion mode
160 #define LTC6804_CONVERSION_14KHZ_DELAY 230 //!< in us, delay between sampling and reading ADC in 14kHz conversion mode
161 #define LTC6804_CONVERSION_7KHZ_DELAY 405 //!< in us, delay between sampling and reading ADC in 7kHz conversion mode
162 #define LTC6804_CONVERSION_3KHZ_DELAY 501 //!< in us, delay between sampling and reading ADC in 3kHz conversion mode
163 #define LTC6804_CONVERSION_2KHZ_DELAY 754 //!< in us, delay between sampling and reading ADC in 2kHz conversion mode
164 #define LTC6804_CONVERSION_26HZ_DELAY 34 //!< in ms, delay between sampling and reading ADC in 26Hz conversion mode
165 #define LTC6804_CONVERSIONS_ALL_27KHZ_DELAY 11130 //!< in us, delay between sampling and reading ADC in 27kHz conversion mode
166 #define LTC6804_CONVERSIONS_ALL_14KHZ_DELAY 1288 //!< in us, delay between sampling and reading ADC in 14kHz conversion mode
167 #define LTC6804_CONVERSIONS_ALL_7KHZ_DELAY 2335 //!< in us, delay between sampling and reading ADC in 7kHz conversion mode
168 #define LTC6804_CONVERSIONS_ALL_3KHZ_DELAY 3033 //!< in us, delay between sampling and reading ADC in 3kHz conversion mode
169 #define LTC6804_CONVERSIONS_ALL_2KHZ_DELAY 4430 //!< in us, delay between sampling and reading ADC in 2kHz conversion mode
170 #define LTC6804_CONVERSIONS_ALL_26HZ_DELAY 202 //!< in ms, delay between sampling and reading ADC in 26Hz conversion mode
171 //! @}
172 
173 //! @name Voltage Resolution
174 //! @{
175 //! Voltage resolutions from Table 46 (t6C)
176 #define LTC6804_VOLTAGE_RESOLUTION 100 //!< uV per bit (CxV), cell voltage resolution.
177 #define LTC6804_UVOV_RESOLUTION (16*100) //!< uV per bit (VUV and VOV), under-voltage and over-voltage resolution.
178 #define LTC6804_SOC_RESOLUTION (20*100) //!< uV per bit (SOC), sum-of-cells resolution.
179 #define LTC6804_V_SUPPLY_VOLTAGE 11000 //!< mV per bit, Minimum supply voltage from datasheet page 7.
180 //! @}
181 
182 //! @name Communication Protocol Constants
183 //! @{
184 //! Communication Protocol Message Sizes, not including PEC, as specified by datasheet Table 26.
185 //! Baud Rate from from datasheet page 8
186 #define LTC6804_COMMAND_SIZE 2 //!< bytes per command
187 #define LTC6804_REGISTER_GROUP_SIZE 6 //!< bytes per register group
188 #define LTC6804_PEC_SIZE sizeof(int16) //!< 15 bit PEC, requires int16 data type
189 #define LTC6804_ADC_SIZE sizeof(int16) //!< 16 bit ADC results
190 #define LTC6804_BAUD_RATE 1000 //!< in kHz, Max input SPI Frequency (1/tCLK from datasheet)
191 #define LTC6804_COMMAND_TIME (1LL * (LTC6804_COMMAND_SIZE + LTC6804_PEC_SIZE) * \
192  BITS_PER_BYTE * US_PER_MS / LTC6804_BAUD_RATE) //!< minimum time necessary to send a command in us
193 #define LTC6804_REGISTER_GROUP_TIME (1LL * (LTC6804_COMMAND_SIZE + LTC6804_REGISTER_GROUP_SIZE + 2 * LTC6804_PEC_SIZE) * \
194  BITS_PER_BYTE * US_PER_MS / LTC6804_BAUD_RATE) //!< minimum time necessary to perform a register group read or write in us
195 //! @}
196 
197 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
198 // Global Data
199 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
200 
201 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
202 // Global Prototypes
203 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
204 
205 //! Initializes the LTC6804-2 code module.
206 //! @return void
207 void LTC6804_Init(void);
208 
209 //! Gets the LTC6804 revision.
210 //! @return TRUE if the LTC6804 communication was successful.
211 BOOLEAN LTC6804_Revision_Get(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
212  unsigned int8* revision //!< Pointer where to return revision.
213  );
214 
215 //! Sets the LTC6804 GPIO Pull Downs.
216 //! Write: 0 -> GPIOx Pin Pull-Down ON; 1-> GPIOx Pin Pull-Down OFF
217 //! @return void
218 void LTC6804_GPIO_Set(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
219  int8 gpio_bitmap //!< bitmap for GPIO pull-downs, bit0 = GPIO 0
220  );
221 
222 //! Gets the LTC6804 ADC Reference status, where 1 = ON and 0 = OFF.
223 //! @return TRUE if the LTC6804 communication was successful.
224 BOOLEAN LTC6804_Refon_Get(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
225  int8* refon //!< location where to return the ADC Reference status.
226  );
227 
228 
229 //! Turns the LTC6804 ADC Reference on and off.
230 //! @return void
231 void LTC6804_Refon_Set(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
232  BOOLEAN refon //!< TRUE to turn on the reference, FALSE to turn it off.
233  );
234 
235 //! Sets the LTC6804 discharger pin levels and timeout values.
236 //! @return void
237 void LTC6804_Dischargers_Set(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
238  int16 discharge_bitmap, //!< bitmap for discharger, bit0 = cell 0.
239  int16 timeout_value //!< timeout value for dischargers.
240  );
241 
242 //! Sets the LTC6804 under-voltage and over-voltage thresholds in LTC6804_UVOV_RESOLUTION units.
243 //! @return void
244 void LTC6804_UVOV_Thresholds_Set(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
245  int16 vuv_value, //!< Under-voltage value.
246  int16 vov_value //!< Over-voltage value.
247  );
248 
249 //! Gets the LTC6804 under-voltage and over-voltage thresholds in LTC6804_UVOV_RESOLUTION units.
250 //! @return TRUE if the LTC6804 communication was successful.
251 BOOLEAN LTC6804_UVOV_Thresholds_Get(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
252  unsigned int16* vuv_value, //!< Pointer where to return under-voltage value.
253  unsigned int16* vov_value //!< Pointer where to return over-voltage value.
254  );
255 
256 //! Gets the LTC6804 flags indicating under-voltage and over-voltage conditions are present.
257 //! @return TRUE if the LTC6804 communication was successful.
258 BOOLEAN LTC6804_UVOV_Flags_Get(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
259  int16* vuv_flags, //!< Pointer where to return under-voltage flags in a bitmap with bit 0 = cell 0.
260  int16* vov_flags //!< Pointer where to return over-voltage flags in a bitmap with bit 0 = cell 0.
261  );
262 
263 //! Clears the LTC6804 Cell Voltage ADC registers. This is useful to detect if the conversion was started properly when the results are read.
264 //! @return void
265 void LTC6804_Cell_ADC_Clear(int8 board_num //!< The logical address for the PCB containing this LTC6804-2 IC.
266  );
267 
268 //! Starts the LTC6804 Cell Voltage ADC conversion at the specified conversion mode.
269 //! Note function always permits discharge.
270 //! @return void
271 void LTC6804_Cell_ADC_Start(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
272  LTC6804_CONVERSION_MODE_T mode, //!< The mode to use for ADC conversion.
273  LTC6804_CH_CELL_TYPE cell_select, //!< The cells to convert.
274  BOOLEAN discharge_permitted //!< True if discharge is to be permitted during this cell voltage conversion.
275  );
276 
277 //! Reads the LTC6804 Cell Voltage ADC conversion results.
278 //! @return TRUE if the LTC6804 communication was successful.
279 BOOLEAN LTC6804_Cell_ADC_Read(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
280  LTC6804_CH_CELL_TYPE cell_select, //!< The cells that were converted.
281  unsigned int16* adc_value_ptr //!< Pointer where up to LTC6804_NUM_CELLV_ADC cell voltages will be returned.
282  );
283 
284 //! Clears the LTC6804 GPIO ADC registers. This is useful to detect if the conversion was started properly when the results are read.
285 //! @return void
286 void LTC6804_GPIO_ADC_Clear(int8 board_num //!< The logical address for the PCB containing this LTC6804-2 IC.
287  );
288 
289 //! Starts the specified LTC6804 GPIO ADC conversion at the specified conversion mode.
290 //! @return void
291 void LTC6804_GPIO_ADC_Start(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
292  LTC6804_CONVERSION_MODE_T mode, //!< The mode to use for ADC conversion.
293  LTC6804_CHG_GPIO_TYPE gpio_select //!< The gpio to convert from LTC6804_CHG GPIO Selections.
294  );
295 
296 //! Reads the specified LTC6804 GPIO ADC conversion results.
297 //! @return TRUE if the LTC6804 communication was successful.
298 BOOLEAN LTC6804_GPIO_ADC_Read(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
299  LTC6804_CHG_GPIO_TYPE gpio_select, //!< The gpio that was converted.
300  int16* adc_value_ptr //!< Pointer where up to LTC6804_NUM_GPIO GPIO ADC results will be returned.
301  );
302 
303 //! Writes a string of bytes to the LTC6804 I2C port implemented on its GPIO pins.
304 //! @return void
305 void LTC6804_I2C_Write(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
306  BOOLEAN start, //!< TRUE if this write would be started by an I2C Start Condition.
307  BOOLEAN stop, //!< TRUE if this write would be ended with an I2C Stop Condition.
308  int8* data_ptr, //!< Pointer to the data to write to the I2C Bus.
309  int16 num_bytes, //!< The number of bytes to write to the I2C Bus.
310  int16 baud_khz //!< The baud rate at which the I2C Bus should be clocked.
311  );
312 
313 //! Writes one byte, and then reads a string of bytes to the LTC6804 I2C port implemented on its GPIO pins.
314 //! @return TRUE if the LTC6804 communication was successful.
315 BOOLEAN LTC6804_I2C_Read(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
316  BOOLEAN start, //!< TRUE if this read would be started by an I2C Start Condition.
317  BOOLEAN stop, //!< TRUE if this read would be ended with an I2C Stop Condition.
318  int8* data_ptr, //!< Pointer to a byte to first write to the I2C Bus, and where to store the data read from the I2C Bus.
319  int16 num_bytes, //!< The number of bytes to read to the I2C Bus.
320  int16 baud_khz //!< The baud rate at which the I2C Bus should be clocked.
321  );
322 
323 //! Writes a string of bytes to the LTC6804 SPI port implemented on its GPIO pins.
324 //! @return void
325 void LTC6804_SPI_Write(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
326  BOOLEAN start, //!< TRUE if the CS should be raised at the start of SPI communication.
327  BOOLEAN stop, //!< TRUE if the CS should be lowered at the end of SPI communication.
328  int8* data_ptr, //!< Pointer to the data to write to the SPI Bus.
329  int16 num_bytes, //!< The number of bytes to write to the SPI Bus.
330  int16 baud_khz //!< The baud rate at which the SPI Bus should be clocked.
331  );
332 
333 //! Writes one byte, and then reads a string of bytes to the LTC6804 SPI port implemented on its GPIO pins.
334 //! @return TRUE if the LTC6804 communication was successful.
335 BOOLEAN LTC6804_SPI_Read(int8 board_num, //!< The logical address for the PCB containing this LTC6804-2 IC.
336  BOOLEAN start, //!< TRUE if the CS should be raised at the start of SPI communication.
337  BOOLEAN stop, //!< TRUE if the CS should be lowered at the end of SPI communication.
338  int8* data_ptr, //!< Pointer to a byte to first write to the SPI Bus, and where to store the data read from the SPI Bus.
339  int16 num_bytes, //!< The number of bytes to write to the SPI Bus.
340  int16 baud_khz //!< The baud rate at which the SPI Bus should be clocked.
341  );
342 
343 //! Calculates the LTC6804 CRC over a string of bytes as per datasheet figure 22.
344 //! @return the calculated CRC
345 unsigned int16 LTC6804_PEC_Calc(char *data, //!< Pointer to the data to over which to calculate the CRC.
346  int length //!< The number of bytes over which to calculate the CRC.
347  );
348 
349 #endif
GPIO 1-5, 2nd Ref.
Definition: LTC6804-2.h:115
All Cells.
Definition: LTC6804-2.h:100
BOOLEAN LTC6804_GPIO_ADC_Read(int8 board_num, LTC6804_CHG_GPIO_TYPE gpio_select, int16 *adc_value_ptr)
Reads the specified LTC6804 GPIO ADC conversion results.
Definition: LTC6804-2.c:633
Cell 4 and Cell 10.
Definition: LTC6804-2.h:104
void LTC6804_GPIO_ADC_Clear(int8 board_num)
Clears the LTC6804 GPIO ADC registers.
Definition: LTC6804-2.c:578
2nd Reference
Definition: LTC6804-2.h:121
Cell 6 and Cell 12.
Definition: LTC6804-2.h:106
void LTC6804_Refon_Set(int8 board_num, BOOLEAN refon)
Turns the LTC6804 ADC Reference on and off.
Definition: LTC6804-2.c:206
LTC6804_CONVERSION_MODE_T
Definition: LTC6804-2.h:142
7kHz conversion mode
Definition: LTC6804-2.h:145
BOOLEAN LTC6804_Revision_Get(int8 board_num, unsigned int8 *revision)
Gets the LTC6804 revision.
Definition: LTC6804-2.c:373
Cell 2 and Cell 8.
Definition: LTC6804-2.h:102
void LTC6804_Init(void)
Initializes the LTC6804-2 code module.
Definition: LTC6804-2.c:170
void LTC6804_SPI_Write(int8 board_num, BOOLEAN start, BOOLEAN stop, int8 *data_ptr, int16 num_bytes, int16 baud_khz)
Writes a string of bytes to the LTC6804 SPI port implemented on its GPIO pins.
Definition: LTC6804-2.c:861
BOOLEAN LTC6804_Refon_Get(int8 board_num, int8 *refon)
Gets the LTC6804 ADC Reference status, where 1 = ON and 0 = OFF.
Definition: LTC6804-2.c:406
void LTC6804_UVOV_Thresholds_Set(int8 board_num, int16 vuv_value, int16 vov_value)
Sets the LTC6804 under-voltage and over-voltage thresholds in LTC6804_UVOV_RESOLUTION units...
Definition: LTC6804-2.c:230
26Hz conversion mode
Definition: LTC6804-2.h:148
void LTC6804_Cell_ADC_Start(int8 board_num, LTC6804_CONVERSION_MODE_T mode, LTC6804_CH_CELL_TYPE cell_select, BOOLEAN discharge_permitted)
Starts the LTC6804 Cell Voltage ADC conversion at the specified conversion mode.
Definition: LTC6804-2.c:468
void LTC6804_I2C_Write(int8 board_num, BOOLEAN start, BOOLEAN stop, int8 *data_ptr, int16 num_bytes, int16 baud_khz)
Writes a string of bytes to the LTC6804 I2C port implemented on its GPIO pins.
Definition: LTC6804-2.c:703
2kHz conversion mode
Definition: LTC6804-2.h:147
27kHz conversion mode
Definition: LTC6804-2.h:143
3kHz conversion mode
Definition: LTC6804-2.h:146
BOOLEAN LTC6804_UVOV_Thresholds_Get(int8 board_num, unsigned int16 *vuv_value, unsigned int16 *vov_value)
Gets the LTC6804 under-voltage and over-voltage thresholds in LTC6804_UVOV_RESOLUTION units...
Definition: LTC6804-2.c:282
SOC, ITMP, VA, VD.
Definition: LTC6804-2.h:130
BOOLEAN LTC6804_SPI_Read(int8 board_num, BOOLEAN start, BOOLEAN stop, int8 *data_ptr, int16 num_bytes, int16 baud_khz)
Writes one byte, and then reads a string of bytes to the LTC6804 SPI port implemented on its GPIO pin...
Definition: LTC6804-2.c:912
BOOLEAN LTC6804_UVOV_Flags_Get(int8 board_num, int16 *vuv_flags, int16 *vov_flags)
Gets the LTC6804 flags indicating under-voltage and over-voltage conditions are present.
Definition: LTC6804-2.c:316
void LTC6804_GPIO_ADC_Start(int8 board_num, LTC6804_CONVERSION_MODE_T mode, LTC6804_CHG_GPIO_TYPE gpio_select)
Starts the specified LTC6804 GPIO ADC conversion at the specified conversion mode.
Definition: LTC6804-2.c:599
BOOLEAN LTC6804_Cell_ADC_Read(int8 board_num, LTC6804_CH_CELL_TYPE cell_select, unsigned int16 *adc_value_ptr)
Reads the LTC6804 Cell Voltage ADC conversion results.
Definition: LTC6804-2.c:502
LTC6804_CHST_TYPE
Definition: LTC6804-2.h:129
unsigned int16 LTC6804_PEC_Calc(char *data, int length)
Calculates the LTC6804 CRC over a string of bytes as per datasheet figure 22.
Definition: LTC6804-2.c:1009
Cell 5 and Cell 11.
Definition: LTC6804-2.h:105
LTC6804_CHG_GPIO_TYPE
Definition: LTC6804-2.h:114
BOOLEAN LTC6804_I2C_Read(int8 board_num, BOOLEAN start, BOOLEAN stop, int8 *data_ptr, int16 num_bytes, int16 baud_khz)
Writes one byte, and then reads a string of bytes to the LTC6804 I2C port implemented on its GPIO pin...
Definition: LTC6804-2.c:763
Cell 3 and Cell 9.
Definition: LTC6804-2.h:103
void LTC6804_GPIO_Set(int8 board_num, int8 gpio_bitmap)
Sets the LTC6804 GPIO Pull Downs.
Definition: LTC6804-2.c:185
14kHz conversion mode
Definition: LTC6804-2.h:144
void LTC6804_Cell_ADC_Clear(int8 board_num)
Clears the LTC6804 Cell Voltage ADC registers.
Definition: LTC6804-2.c:447
void LTC6804_Dischargers_Set(int8 board_num, int16 discharge_bitmap, int16 timeout_value)
Sets the LTC6804 discharger pin levels and timeout values.
Definition: LTC6804-2.c:256
Cell 1 and Cell 7.
Definition: LTC6804-2.h:101
LTC6804_CH_CELL_TYPE
Definition: LTC6804-2.h:99