![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
LTC6813: Multicell Battery Monitors. More...
LTC6813: Multicell Battery Monitors.
*The LTC6813 is multi-cell battery stack monitor that measures up to 18 series *connected battery cells with a total measurement error of less than 2.2mV. *The cell measurement range of 0V to 5V makes the LTC6813 suitable for most *battery chemistries. All 18 cell voltages can be captured in 290uS, and lower *data acquisition rates can be selected for high noise reduction. *Using the LTC6813-1, multiple devices are connected in a daisy-chain with one *host processor connection for all devices, permitting simultaneous cell monitoring *of long, high voltage battery strings. *
https://www.analog.com/en/products/ltc6813-1.html https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/dc2350a-b.html
Copyright 2019(c) Analog Devices, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Header for LTC6813-1 Multicell Battery Monitor
Definition in file LTC6813.h.
Go to the source code of this file.
Functions | |
void | LTC6813_init_reg_limits (uint8_t total_ic, cell_asic *ic) |
Helper function to initialize register limits. More... | |
void | LTC6813_wrcfg (uint8_t total_ic, cell_asic *ic) |
Write the LTC6813 configuration register A. More... | |
void | LTC6813_wrcfgb (uint8_t total_ic, cell_asic *ic) |
Write the LTC6813 configuration register B. More... | |
int8_t | LTC6813_rdcfg (uint8_t total_ic, cell_asic *ic) |
Reads configuration register A of a LTC6813 daisy chain. More... | |
int8_t | LTC6813_rdcfgb (uint8_t total_ic, cell_asic *ic) |
Reads configuration register B of a LTC6813 daisy chain. More... | |
void | LTC6813_adcv (uint8_t MD, uint8_t DCP, uint8_t CH) |
Starts cell voltage conversion. More... | |
void | LTC6813_adax (uint8_t MD, uint8_t CHG) |
Start a GPIO and Vref2 Conversion. More... | |
void | LTC6813_adstat (uint8_t MD, uint8_t CHST) |
Start a Status ADC Conversion. More... | |
void | LTC6813_adcvax (uint8_t MD, uint8_t DCP) |
Starts cell voltage and GPIO 1 & 2 conversion. More... | |
void | LTC6813_adcvsc (uint8_t MD, uint8_t DCP) |
Starts cell voltage and Sum of cells conversion. More... | |
uint8_t | LTC6813_rdcv (uint8_t reg, uint8_t total_ic, cell_asic *ic) |
Reads and parses the LTC6813 cell voltage registers. More... | |
int8_t | LTC6813_rdaux (uint8_t reg, uint8_t nIC, cell_asic *ic) |
Reads and parses the LTC6813 auxiliary registers. More... | |
int8_t | LTC6813_rdstat (uint8_t reg, uint8_t total_ic, cell_asic *ic) |
Reads and parses the LTC6813 stat registers. More... | |
uint8_t | LTC6813_pladc () |
Sends the poll ADC command. More... | |
uint32_t | LTC6813_pollAdc () |
This function will block operation until the ADC has finished it's conversion. More... | |
void | LTC6813_clrcell () |
Clears the LTC6813 cell voltage registers. More... | |
void | LTC6813_clraux () |
Clears the LTC6813 Auxiliary registers. More... | |
void | LTC6813_clrstat () |
Clears the LTC6813 Stat registers. More... | |
void | LTC6813_diagn () |
Starts the Mux Decoder diagnostic self test Running this command will start the Mux Decoder Diagnostic Self Test This test takes roughly 1mS to complete. More... | |
void | LTC6813_cvst (uint8_t MD, uint8_t ST) |
Starts cell voltage self test conversion. More... | |
void | LTC6813_axst (uint8_t MD, uint8_t ST) |
Start an Auxiliary Register Self Test Conversion. More... | |
void | LTC6813_statst (uint8_t MD, uint8_t ST) |
Start a Status Register Self Test Conversion. More... | |
void | LTC6813_adol (uint8_t MD, uint8_t DCP) |
Starts cell voltage overlap conversion. More... | |
void | LTC6813_adaxd (uint8_t MD, uint8_t CHG) |
Start an GPIO Redundancy test. More... | |
void | LTC6813_adstatd (uint8_t MD, uint8_t CHST) |
Start a Status register redundancy test Conversion. More... | |
int16_t | LTC6813_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. More... | |
uint16_t | LTC6813_run_adc_overlap (uint8_t total_ic, cell_asic *ic) |
Helper Function that runs the ADC Overlap test. More... | |
int16_t | LTC6813_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. More... | |
void | LTC6813_adow (uint8_t MD, uint8_t PUP, uint8_t CH, uint8_t DCP) |
Start an open wire Conversion. More... | |
void | LTC6813_axow (uint8_t MD, uint8_t PUP) |
Start GPIOs open wire ADC conversion. More... | |
void | LTC6813_run_openwire_single (uint8_t total_ic, cell_asic *ic) |
Helper function that runs the data sheet algorithm for open wire for single cell detection. More... | |
void | LTC6813_run_openwire_multi (uint8_t total_ic, cell_asic *ic) |
Helper function that runs open wire for multiple cell and two consecutive cells detection. More... | |
void | LTC6813_run_gpio_openwire (uint8_t total_ic, cell_asic *ic) |
Runs open wire for GPIOs. More... | |
void | LTC6813_set_discharge (int Cell, uint8_t total_ic, cell_asic *ic) |
Helper Function to Set DCC bits in the CFGR Registers. More... | |
void | LTC6813_clear_discharge (uint8_t total_ic, cell_asic *ic) |
Helper Function to clear DCC bits in the CFGR Registers. More... | |
void | LTC6813_wrpwm (uint8_t total_ic, uint8_t pwmReg, cell_asic *ic) |
Write the LTC6813 PWM register. More... | |
int8_t | LTC6813_rdpwm (uint8_t total_ic, uint8_t pwmReg, cell_asic *ic) |
Reads pwm registers of a LTC6813 daisy chain. More... | |
void | LTC6813_wrsctrl (uint8_t nIC, uint8_t sctrl_reg, cell_asic *ic) |
Write the LTC6813 Sctrl register. More... | |
int8_t | LTC6813_rdsctrl (uint8_t nIC, uint8_t sctrl_reg, cell_asic *ic) |
Reads sctrl registers of a LTC6813 daisy chain. More... | |
void | LTC6813_stsctrl () |
Start Sctrl data communication This command will start the sctrl pulse communication over the spins. More... | |
void | LTC6813_clrsctrl () |
Clears the LTC6813 Sctrl registers. More... | |
void | LTC6813_wrpsb (uint8_t total_ic, cell_asic *ic) |
Write the 6813 PWM/Sctrl Register B. More... | |
uint8_t | LTC6813_rdpsb (uint8_t total_ic, cell_asic *ic) |
Reading pwm/s control register B. More... | |
void | LTC6813_wrcomm (uint8_t total_ic, cell_asic *ic) |
Write the LTC6813 COMM register. More... | |
int8_t | LTC6813_rdcomm (uint8_t total_ic, cell_asic *ic) |
Reads comm registers of a LTC6813 daisy chain. More... | |
void | LTC6813_stcomm (uint8_t len) |
Issues a stcomm command and clocks data out of the COMM register. More... | |
void | LTC6813_mute () |
Mutes the LTC6813 discharge transistors. More... | |
void | LTC6813_unmute () |
Clears the LTC6813 Mute Discharge. More... | |
void | LTC6813_check_pec (uint8_t total_ic, uint8_t reg, cell_asic *ic) |
Helper Function that counts overall PEC errors and register/IC PEC errors. More... | |
void | LTC6813_reset_crc_count (uint8_t total_ic, cell_asic *ic) |
Helper Function that resets the PEC error counters. More... | |
void | LTC6813_init_cfg (uint8_t total_ic, cell_asic *ic) |
Helper Function to initialize the CFGR data structures. More... | |
void | LTC6813_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. More... | |
void | LTC6813_set_cfgr_refon (uint8_t nIC, cell_asic *ic, bool refon) |
Helper function to turn the REFON bit HIGH or LOW. More... | |
void | LTC6813_set_cfgr_adcopt (uint8_t nIC, cell_asic *ic, bool adcopt) |
Helper function to turn the ADCOPT bit HIGH or LOW. More... | |
void | LTC6813_set_cfgr_gpio (uint8_t nIC, cell_asic *ic, bool gpio[]) |
Helper function to turn the GPIO bits HIGH or LOW. More... | |
void | LTC6813_set_cfgr_dis (uint8_t nIC, cell_asic *ic, bool dcc[]) |
Helper function to turn the DCC bits HIGH or LOW. More... | |
void | LTC6813_set_cfgr_uv (uint8_t nIC, cell_asic *ic, uint16_t uv) |
Helper function to set UV field in CFGRA register. More... | |
void | LTC6813_set_cfgr_dcto (uint8_t nIC, cell_asic *ic, bool dcto[4]) |
Helper function to set DCTO field in CFGRA register. More... | |
void | LTC6813_set_cfgr_ov (uint8_t nIC, cell_asic *ic, uint16_t ov) |
Helper function to set OV field in CFGRA register. More... | |
void | LTC6813_init_cfgb (uint8_t total_ic, cell_asic *ic) |
Helper Function to initialize the CFGR B data structures. More... | |
void | LTC6813_set_cfgrb (uint8_t nIC, cell_asic *ic, bool fdrf, bool dtmen, bool ps[2], bool gpiobits[4], bool dccbits[7]) |
Helper function to set appropriate bits in CFGR register based on bit function. More... | |
void | LTC6813_set_cfgrb_fdrf (uint8_t nIC, cell_asic *ic, bool fdrf) |
Helper function to turn the FDRF bit HIGH or LOW. More... | |
void | LTC6813_set_cfgrb_dtmen (uint8_t nIC, cell_asic *ic, bool dtmen) |
Helper function to turn the DTMEN bit HIGH or LOW. More... | |
void | LTC6813_set_cfgrb_ps (uint8_t nIC, cell_asic *ic, bool ps[]) |
Helper function to turn the Path Select bit HIGH or LOW. More... | |
void | LTC6813_set_cfgrb_gpio_b (uint8_t nIC, cell_asic *ic, bool gpiobits[]) |
Helper function to turn the GPIO bit HIGH or LOW. More... | |
void | LTC6813_set_cfgrb_dcc_b (uint8_t nIC, cell_asic *ic, bool dccbits[]) |
Helper function to turn the DCC bit HIGH or LOW. More... | |
Macros | |
#define | CELL 1 |
#define | AUX 2 |
#define | STAT 3 |
void LTC6813_adax | ( | uint8_t | MD, |
uint8_t | CHG | ||
) |
Start a GPIO and Vref2 Conversion.
MD | ADC Conversion Mode |
CHG | Sets which GPIO channels are converted |
Definition at line 136 of file LTC6813.cpp.
void LTC6813_adaxd | ( | uint8_t | MD, |
uint8_t | CHG | ||
) |
Start an GPIO Redundancy test.
MD | ADC Conversion Mode |
CHG | Sets which GPIO channels are converted |
Definition at line 290 of file LTC6813.cpp.
void LTC6813_adcv | ( | uint8_t | MD, |
uint8_t | DCP, | ||
uint8_t | CH | ||
) |
Starts cell voltage conversion.
MD | ADC Conversion Mode |
DCP | Controls if Discharge is permitted during conversion |
CH | Sets which Cell channels are converted |
Definition at line 127 of file LTC6813.cpp.
void LTC6813_adcvax | ( | uint8_t | MD, |
uint8_t | DCP | ||
) |
Starts cell voltage and GPIO 1 & 2 conversion.
MD | ADC Conversion Mode |
DCP | Controls if Discharge is permitted during conversion |
Definition at line 152 of file LTC6813.cpp.
void LTC6813_adcvsc | ( | uint8_t | MD, |
uint8_t | DCP | ||
) |
Starts cell voltage and Sum of cells conversion.
MD | ADC Conversion Mode |
DCP | Controls if Discharge is permitted during conversion |
Definition at line 160 of file LTC6813.cpp.
void LTC6813_adol | ( | uint8_t | MD, |
uint8_t | DCP | ||
) |
Starts cell voltage overlap conversion.
MD | ADC Conversion Mode |
DCP | Discharge permitted during conversion |
Definition at line 282 of file LTC6813.cpp.
void LTC6813_adow | ( | uint8_t | MD, |
uint8_t | PUP, | ||
uint8_t | CH, | ||
uint8_t | DCP | ||
) |
Start an open wire Conversion.
MD | ADC Conversion Mode |
PUP | Pull up/Pull down current |
CH | Sets which Cell channels are converted |
DCP | Discharge permitted during conversion |
Definition at line 365 of file LTC6813.cpp.
void LTC6813_adstat | ( | uint8_t | MD, |
uint8_t | CHST | ||
) |
Start a Status ADC Conversion.
MD | ADC Conversion Mode |
CHST | Sets which Stat channels are converted |
Definition at line 144 of file LTC6813.cpp.
void LTC6813_adstatd | ( | uint8_t | MD, |
uint8_t | CHST | ||
) |
Start a Status register redundancy test Conversion.
MD | ADC Mode |
CHST | Sets which Status channels are converted |
Definition at line 298 of file LTC6813.cpp.
void LTC6813_axow | ( | uint8_t | MD, |
uint8_t | PUP | ||
) |
Start GPIOs open wire ADC conversion.
MD | ADC Mode |
PUP | Pull up/Pull down current |
Definition at line 375 of file LTC6813.cpp.
void LTC6813_axst | ( | uint8_t | MD, |
uint8_t | ST | ||
) |
Start an Auxiliary Register Self Test Conversion.
MD | ADC Conversion Mode |
ST | Sets if self test 1 or 2 is run |
Definition at line 266 of file LTC6813.cpp.
void LTC6813_check_pec | ( | uint8_t | total_ic, |
uint8_t | reg, | ||
cell_asic * | ic | ||
) |
Helper Function that counts overall PEC errors and register/IC PEC errors.
total_ic | Number of ICs in the system |
reg | Type of register |
ic | A two dimensional array that will store the data |
Definition at line 630 of file LTC6813.cpp.
void LTC6813_clear_discharge | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper Function to clear DCC bits in the CFGR Registers.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 442 of file LTC6813.cpp.
void LTC6813_clraux | ( | ) |
void LTC6813_clrcell | ( | ) |
void LTC6813_clrsctrl | ( | ) |
void LTC6813_clrstat | ( | ) |
void LTC6813_cvst | ( | uint8_t | MD, |
uint8_t | ST | ||
) |
Starts cell voltage self test conversion.
MD | ADC Conversion Mode |
ST | Self Test Mode |
Definition at line 258 of file LTC6813.cpp.
void LTC6813_diagn | ( | ) |
Starts the Mux Decoder diagnostic self test Running this command will start the Mux Decoder Diagnostic Self Test This test takes roughly 1mS to complete.
The MUXFAIL bit will be updated, the bit will be set to 1 for a failure and 0 if the test has been passed.
Definition at line 252 of file LTC6813.cpp.
void LTC6813_init_cfg | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper Function to initialize the CFGR data structures.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 647 of file LTC6813.cpp.
void LTC6813_init_cfgb | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper Function to initialize the CFGR B data structures.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 707 of file LTC6813.cpp.
void LTC6813_init_reg_limits | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper function to initialize register limits.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 67 of file LTC6813.cpp.
void LTC6813_mute | ( | ) |
uint8_t LTC6813_pladc | ( | ) |
Sends the poll ADC command.
Definition at line 210 of file LTC6813.cpp.
uint32_t LTC6813_pollAdc | ( | ) |
This function will block operation until the ADC has finished it's conversion.
Definition at line 216 of file LTC6813.cpp.
int8_t LTC6813_rdaux | ( | uint8_t | reg, |
uint8_t | nIC, | ||
cell_asic * | ic | ||
) |
Reads and parses the LTC6813 auxiliary registers.
reg | Controls which GPIO voltage register is read back |
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array of the parsed gpio voltage codes |
Definition at line 183 of file LTC6813.cpp.
int8_t LTC6813_rdcfg | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Reads configuration register A of a LTC6813 daisy chain.
total_ic | Number of ICs in the system |
ic | A two dimensional array that the function stores the read configuration data |
Definition at line 107 of file LTC6813.cpp.
int8_t LTC6813_rdcfgb | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Reads configuration register B of a LTC6813 daisy chain.
total_ic | Number of ICs in the system |
ic | A two dimensional array that the function stores the read configuration data |
Definition at line 117 of file LTC6813.cpp.
int8_t LTC6813_rdcomm | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Reads comm registers of a LTC6813 daisy chain.
total_ic | Number of ICs in the daisy chain |
ic | Two dimensional array that the function stores the read comm data. |
Definition at line 594 of file LTC6813.cpp.
uint8_t LTC6813_rdcv | ( | uint8_t | reg, |
uint8_t | total_ic, | ||
cell_asic * | ic | ||
) |
Reads and parses the LTC6813 cell voltage registers.
reg | Controls which cell voltage register is read back. |
total_ic | The number of ICs in the daisy chain |
ic | Array of the parsed cell codes from lowest to highest. |
Definition at line 168 of file LTC6813.cpp.
uint8_t LTC6813_rdpsb | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Reading pwm/s control register B.
total_ic | Number of ICs in the daisy chain |
ic | A two dimensional array that the function stores the read data |
Definition at line 533 of file LTC6813.cpp.
int8_t LTC6813_rdpwm | ( | uint8_t | total_ic, |
uint8_t | pwmReg, | ||
cell_asic * | ic | ||
) |
Reads pwm registers of a LTC6813 daisy chain.
total_ic | Number of ICs in the daisy chain |
pwmReg | PWM Register A or B |
ic | A two dimensional array that will store the data |
Definition at line 459 of file LTC6813.cpp.
int8_t LTC6813_rdsctrl | ( | uint8_t | nIC, |
uint8_t | sctrl_reg, | ||
cell_asic * | ic | ||
) |
Reads sctrl registers of a LTC6813 daisy chain.
nIC | Number of ICs in the daisy chain |
sctrl_reg | SCTRL Register A or B |
ic | A two dimensional array that will store the data |
Definition at line 479 of file LTC6813.cpp.
int8_t LTC6813_rdstat | ( | uint8_t | reg, |
uint8_t | total_ic, | ||
cell_asic * | ic | ||
) |
Reads and parses the LTC6813 stat registers.
reg | Determines which Stat register is read back. |
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 199 of file LTC6813.cpp.
void LTC6813_reset_crc_count | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper Function that resets the PEC error counters.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 639 of file LTC6813.cpp.
uint16_t LTC6813_run_adc_overlap | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper Function that runs the ADC Overlap test.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 319 of file LTC6813.cpp.
int16_t LTC6813_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.
adc_mode | ADC Mode |
adc_reg | Type of register |
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 353 of file LTC6813.cpp.
int16_t LTC6813_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.
adc_reg | Type of register |
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
md | ADC Mode |
adcopt | The adcopt bit in the configuration register |
Definition at line 306 of file LTC6813.cpp.
void LTC6813_run_gpio_openwire | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Runs open wire for GPIOs.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 399 of file LTC6813.cpp.
void LTC6813_run_openwire_multi | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper function that runs open wire for multiple cell and two consecutive cells detection.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 391 of file LTC6813.cpp.
void LTC6813_run_openwire_single | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Helper function that runs the data sheet algorithm for open wire for single cell detection.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 383 of file LTC6813.cpp.
void LTC6813_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.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
refon | The REFON bit |
adcopt | The ADCOPT bit |
gpio | The GPIO bits |
dcc | The DCC bits |
dcto | The Dcto bits |
uv | The UV value |
ov | The OV value |
Definition at line 653 of file LTC6813.cpp.
void LTC6813_set_cfgr_adcopt | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | adcopt | ||
) |
Helper function to turn the ADCOPT bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
adcopt | The ADCOPT bit |
Definition at line 671 of file LTC6813.cpp.
void LTC6813_set_cfgr_dcto | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | dcto[4] | ||
) |
Helper function to set DCTO field in CFGRA register.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
dcto | The Dcto bits |
Definition at line 695 of file LTC6813.cpp.
void LTC6813_set_cfgr_dis | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | dcc[] | ||
) |
Helper function to turn the DCC bits HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
dcc | The DCC bits |
void LTC6813_set_cfgr_gpio | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | gpio[] | ||
) |
Helper function to turn the GPIO bits HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
gpio | The GPIO bits |
void LTC6813_set_cfgr_ov | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
uint16_t | ov | ||
) |
Helper function to set OV field in CFGRA register.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
ov | The OV value |
Definition at line 701 of file LTC6813.cpp.
void LTC6813_set_cfgr_refon | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | refon | ||
) |
Helper function to turn the REFON bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
refon | The REFON bit |
Definition at line 665 of file LTC6813.cpp.
void LTC6813_set_cfgr_uv | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
uint16_t | uv | ||
) |
Helper function to set UV field in CFGRA register.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
uv | The UV value |
Definition at line 689 of file LTC6813.cpp.
void LTC6813_set_cfgrb | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | fdrf, | ||
bool | dtmen, | ||
bool | ps[2], | ||
bool | gpiobits[4], | ||
bool | dccbits[7] | ||
) |
Helper function to set appropriate bits in CFGR register based on bit function.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
fdrf | The FDRF bit |
dtmen | The DTMEN bit |
ps | Path selection bits |
gpiobits | The GPIO bits |
dccbits | The DCC bits |
Definition at line 719 of file LTC6813.cpp.
void LTC6813_set_cfgrb_dcc_b | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | dccbits[] | ||
) |
Helper function to turn the DCC bit HIGH or LOW.
nIC | The number of ICs in The daisy chain |
ic | A two dimensional array that will store The data |
dccbits | The DCC bits |
Definition at line 763 of file LTC6813.cpp.
void LTC6813_set_cfgrb_dtmen | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | dtmen | ||
) |
Helper function to turn the DTMEN bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
dtmen | The DTMEN bit |
Definition at line 736 of file LTC6813.cpp.
void LTC6813_set_cfgrb_fdrf | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | fdrf | ||
) |
Helper function to turn the FDRF bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
fdrf | The FDRF bit |
Definition at line 729 of file LTC6813.cpp.
void LTC6813_set_cfgrb_gpio_b | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | gpiobits[] | ||
) |
Helper function to turn the GPIO bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
gpiobits | The GPIO bits |
Definition at line 753 of file LTC6813.cpp.
void LTC6813_set_cfgrb_ps | ( | uint8_t | nIC, |
cell_asic * | ic, | ||
bool | ps[] | ||
) |
Helper function to turn the Path Select bit HIGH or LOW.
nIC | The number of ICs in the daisy chain |
ic | A two dimensional array that will store the data |
ps | Path selection bits |
Definition at line 743 of file LTC6813.cpp.
void LTC6813_set_discharge | ( | int | Cell, |
uint8_t | total_ic, | ||
cell_asic * | ic | ||
) |
Helper Function to Set DCC bits in the CFGR Registers.
Cell | The cell to be discharged |
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 407 of file LTC6813.cpp.
void LTC6813_statst | ( | uint8_t | MD, |
uint8_t | ST | ||
) |
Start a Status Register Self Test Conversion.
MD | ADC Conversion Mode |
ST | Sets if self test 1 or 2 is run |
Definition at line 274 of file LTC6813.cpp.
void LTC6813_stcomm | ( | uint8_t | len | ) |
Issues a stcomm command and clocks data out of the COMM register.
len | Length of data to be transmitted |
Definition at line 604 of file LTC6813.cpp.
void LTC6813_stsctrl | ( | ) |
Start Sctrl data communication This command will start the sctrl pulse communication over the spins.
Definition at line 491 of file LTC6813.cpp.
void LTC6813_unmute | ( | ) |
void LTC6813_wrcfg | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Write the LTC6813 configuration register A.
total_ic | Number of ICs in the system |
ic | A two dimensional array of the configuration data that will be written |
Definition at line 87 of file LTC6813.cpp.
void LTC6813_wrcfgb | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Write the LTC6813 configuration register B.
total_ic | Number of ICs in the system |
ic | A two dimensional array of the configuration data that will be written |
Definition at line 99 of file LTC6813.cpp.
void LTC6813_wrcomm | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Write the LTC6813 COMM register.
total_ic | Number of ICs in the daisy chain |
ic | A two dimensional array of the comm data that will be written |
Definition at line 586 of file LTC6813.cpp.
void LTC6813_wrpsb | ( | uint8_t | total_ic, |
cell_asic * | ic | ||
) |
Write the 6813 PWM/Sctrl Register B.
total_ic | Number of ICs in the system |
ic | A two dimensional array that will store the data |
Definition at line 507 of file LTC6813.cpp.
void LTC6813_wrpwm | ( | uint8_t | total_ic, |
uint8_t | pwmReg, | ||
cell_asic * | ic | ||
) |
Write the LTC6813 PWM register.
total_ic | Number of ICs in the daisy chain |
pwmReg | PWM Register A or B |
ic | A two dimensional array that will store the data |
Definition at line 450 of file LTC6813.cpp.
void LTC6813_wrsctrl | ( | uint8_t | nIC, |
uint8_t | sctrl_reg, | ||
cell_asic * | ic | ||
) |
Write the LTC6813 Sctrl register.
nIC | Number of ICs in the daisy chain |
ic | SCTRL Register A or B A two dimensional array that will store the data |
Definition at line 470 of file LTC6813.cpp.