88 #define LTC6804_MAX_BOARDS 16
89 #define LTC6804_BROADCAST LTC6804_MAX_BOARDS
90 #define LTC6804_NUM_CELLV_ADC 12
91 #define LTC6804_NUM_GPIO 5
92 #define LTC6804_NUM_AUX_ADC 6
93 #define LTC6804_ADC_CLEAR 0xFFFF
149 LTC6804_CONVERSION_NUM_MODES
158 #define LTC6804_TREFUP 4400
159 #define LTC6804_CONVERSION_27KHZ_DELAY 201
160 #define LTC6804_CONVERSION_14KHZ_DELAY 230
161 #define LTC6804_CONVERSION_7KHZ_DELAY 405
162 #define LTC6804_CONVERSION_3KHZ_DELAY 501
163 #define LTC6804_CONVERSION_2KHZ_DELAY 754
164 #define LTC6804_CONVERSION_26HZ_DELAY 34
165 #define LTC6804_CONVERSIONS_ALL_27KHZ_DELAY 11130
166 #define LTC6804_CONVERSIONS_ALL_14KHZ_DELAY 1288
167 #define LTC6804_CONVERSIONS_ALL_7KHZ_DELAY 2335
168 #define LTC6804_CONVERSIONS_ALL_3KHZ_DELAY 3033
169 #define LTC6804_CONVERSIONS_ALL_2KHZ_DELAY 4430
170 #define LTC6804_CONVERSIONS_ALL_26HZ_DELAY 202
176 #define LTC6804_VOLTAGE_RESOLUTION 100
177 #define LTC6804_UVOV_RESOLUTION (16*100)
178 #define LTC6804_SOC_RESOLUTION (20*100)
179 #define LTC6804_V_SUPPLY_VOLTAGE 11000
186 #define LTC6804_COMMAND_SIZE 2
187 #define LTC6804_REGISTER_GROUP_SIZE 6
188 #define LTC6804_PEC_SIZE sizeof(int16)
189 #define LTC6804_ADC_SIZE sizeof(int16)
190 #define LTC6804_BAUD_RATE 1000
191 #define LTC6804_COMMAND_TIME (1LL * (LTC6804_COMMAND_SIZE + LTC6804_PEC_SIZE) * \
192 BITS_PER_BYTE * US_PER_MS / LTC6804_BAUD_RATE)
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)
212 unsigned int8* revision
238 int16 discharge_bitmap,
252 unsigned int16* vuv_value,
253 unsigned int16* vov_value
274 BOOLEAN discharge_permitted
281 unsigned int16* adc_value_ptr
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.
void LTC6804_GPIO_ADC_Clear(int8 board_num)
Clears the LTC6804 GPIO ADC registers.
void LTC6804_Refon_Set(int8 board_num, BOOLEAN refon)
Turns the LTC6804 ADC Reference on and off.
LTC6804_CONVERSION_MODE_T
BOOLEAN LTC6804_Revision_Get(int8 board_num, unsigned int8 *revision)
Gets the LTC6804 revision.
void LTC6804_Init(void)
Initializes the LTC6804-2 code module.
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.
BOOLEAN LTC6804_Refon_Get(int8 board_num, int8 *refon)
Gets the LTC6804 ADC Reference status, where 1 = ON and 0 = OFF.
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...
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.
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.
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...
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...
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.
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.
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.
unsigned int16 LTC6804_PEC_Calc(char *data, int length)
Calculates the LTC6804 CRC over a string of bytes as per datasheet figure 22.
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...
void LTC6804_GPIO_Set(int8 board_num, int8 gpio_bitmap)
Sets the LTC6804 GPIO Pull Downs.
void LTC6804_Cell_ADC_Clear(int8 board_num)
Clears the LTC6804 Cell Voltage ADC registers.
void LTC6804_Dischargers_Set(int8 board_num, int16 discharge_bitmap, int16 timeout_value)
Sets the LTC6804 discharger pin levels and timeout values.