| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC6810.cpp File Reference
Battery Management System (BMS) » LTC6810-1: Multicell Battery Monitor

Library for LTC6810-1 Multicell Battery Monitor. More...

## Detailed Description

Library for LTC6810-1 Multicell Battery Monitor.

Definition in file LTC6810.cpp.

Go to the source code of this file.

## Functions
void | LTC6810_init_reg_limits (uint8_t total_ic, cell_asic *ic)
| Initialize the Register limits. More...
void | LTC6810_wrcfg (uint8_t total_ic, cell_asic *ic)
| Write the LTC6810 configuration register. More...
int8_t | LTC6810_rdcfg (uint8_t total_ic, cell_asic *ic)
| Reads configuration registers of a LTC6810 daisy chain. More...
void | LTC6810_adcv (uint8_t MD, uint8_t DCP, uint8_t CH)
| Starts cell voltage conversion. More...
void | LTC6810_adax (uint8_t MD, uint8_t CHG)
| Start a GPIO, cell 0 and Vref2 Conversion. More...
void | LTC6810_adstat (uint8_t MD, uint8_t CHST)
| Start a Status ADC Conversion. More...
void | LTC6810_adcvsc (uint8_t MD, uint8_t DCP)
| Starts cell voltage and SOC conversion. More...
void | LTC6810_adcvax (uint8_t MD, uint8_t DCP)
| Starts cell voltage, Cell 0 and GPIO 1 conversion. More...
uint8_t | LTC6810_rdcv (uint8_t reg, uint8_t total_ic, cell_asic *ic)
| Reads and parses the LTC6810 cell voltage registers. More...
int8_t | LTC6810_rdaux (uint8_t reg, uint8_t total_ic, cell_asic *ic)
| Reads and parses the LTC6810 auxiliary registers. More...
int8_t | LTC6810_rdstat (uint8_t reg, uint8_t total_ic, cell_asic *ic)
| Reads and parses the LTC6810 stat registers. More...
uint8_t | LTC6810_rds (uint8_t reg, uint8_t total_ic, cell_asic *ic)
| Reads and parses the LTC6810 S voltage registers. More...
void | LTC6810_rds_reg (uint8_t reg, uint8_t total_ic, uint8_t *data)
| Reads the raw S voltage register data. More...
uint8_t | LTC6810_pladc ()
| Sends the poll ADC command. More...
uint32_t | LTC6810_pollAdc ()
| This function will block operation until the ADC has finished it's conversion. More...
void | LTC6810_clrcell ()
| Clears the LTC6810 cell voltage registers. More...
void | LTC6810_clraux ()
| Clears the LTC6810 Auxiliary registers. More...
void | LTC6810_clrstat ()
| Clears the LTC6810 Stat registers. More...
void | LTC6810_diagn ()
| Starts the Mux Decoder diagnostic self test. More...
void | LTC6810_cvst (uint8_t MD, uint8_t ST)
| Starts Cell voltage self test conversion. More...
void | LTC6810_axst (uint8_t MD, uint8_t ST)
| Start an Auxiliary Register Self Test Conversion. More...
void | LTC6810_statst (uint8_t MD, uint8_t ST)
| Start a Status Register Self Test Conversion. More...
void | LTC6810_adaxd (uint8_t MD, uint8_t CHG)
| Start an GPIO Redundancy test. More...
void | LTC6810_adstatd (uint8_t MD, uint8_t CHST)
| Start a Status register redundancy test Conversion. More...
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. More...
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. More...
void | LTC6810_adow (uint8_t MD, uint8_t PUP, uint8_t CH, uint8_t DCP)
| Start an open wire Conversion. More...
void | LTC6810_axow (uint8_t MD, uint8_t PUP)
| Start GPIOs open wire ADC conversion. More...
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. More...
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. More...
void | LTC6810_run_gpio_openwire (uint8_t total_ic, cell_asic ic[])
void | LTC6810_set_discharge (int Cell, uint8_t total_ic, cell_asic *ic)
| Helper function to set discharge bit in CFG register. More...
void | LTC6810_clear_discharge (uint8_t total_ic, cell_asic *ic)
| Clears all of the DCC bits in the configuration registers. More...
void | LTC6810_wrpwm (uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
| Writes to the LTC6810 PWM register of LTC6810. More...
int8_t | LTC6810_rdpwm (uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
| Reads pwm registers of the LTC6810 in daisy chain. More...
void | LTC6810_wrcomm (uint8_t total_ic, cell_asic *ic)
| Write the LTC6810 COMM register. More...
int8_t | LTC6810_rdcomm (uint8_t total_ic, cell_asic *ic)
| Reads comm registers of a LTC6810 in daisy chain. More...
void | LTC6810_stcomm (uint8_t len)
| Issues a stcomm command and clocks data out of the COMM register. More...
uint8_t | LTC6810_rdsid (uint8_t total_ic, cell_asic *ic)
| Reads Serial ID registers group. More...
void | LTC6810_mute ()
| Mutes the LTC6810 discharge transistors. More...
void | LTC6810_unmute ()
| Clears the LTC6810 Mute Discharge. More...
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. More...
void | LTC6810_reset_crc_count (uint8_t total_ic, cell_asic *ic)
| Helper Function that resets the PEC error counters. More...
void | LTC6810_init_cfg (uint8_t total_ic, cell_asic *ic)
| Helper Function to initialize the CFGR data structures. More...
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. More...
void | LTC6810_set_cfgr_refon (uint8_t nIC, cell_asic *ic, bool refon)
| Helper function to turn the REFON bit HIGH or LOW. More...
void | LTC6810_set_cfgr_adcopt (uint8_t nIC, cell_asic *ic, bool adcopt)
| Helper function to turn the ADCOPT bit HIGH or LOW. More...
void | LTC6810_set_cfgr_gpio (uint8_t nIC, cell_asic *ic, bool gpio[4])
void | LTC6810_set_cfgr_dis (uint8_t nIC, cell_asic *ic, bool dcc[6])
void | LTC6810_set_cfgr_uv (uint8_t nIC, cell_asic *ic, uint16_t uv)
| Helper function to set uv field in CFGRA register. More...
void | LTC6810_set_cfgr_ov (uint8_t nIC, cell_asic *ic, uint16_t ov)
| Helper function to set ov field in CFGRA register. More...
void | LTC6810_set_cfgr_mcal (uint8_t nIC, cell_asic *ic, bool mcal)
| Helper function to set the MCAL bit. More...
void | LTC6810_set_cfgr_dcc_0 (uint8_t nIC, cell_asic *ic, bool dcc_0)
| Helper function to set the DCC_0 bit. More...
void | LTC6810_set_cfgr_en_dtmen (uint8_t nIC, cell_asic *ic, bool en_dtmen)
| Helper function to set the EN_DTMEN bit. More...
void | LTC6810_set_cfgr_dis_red (uint8_t nIC, cell_asic *ic, bool dis_red)
| Helper function to set the DIS_RED bit. More...
void | LTC6810_set_cfgr_fdrf (uint8_t nIC, cell_asic *ic, bool fdrf)
| Helper function to set the FDRF bit. More...
void | LTC6810_set_cfgr_sconv (uint8_t nIC, cell_asic *ic, bool sconv)
| Helper function to set the SCONV bit. More...
void | LTC6810_set_cfgr_dcto (uint8_t nIC, cell_asic *ic, bool dcto[4])

## Function Documentation

## ◆ LTC6810_adax()

void LTC6810_adax | ( | uint8_t | MD,
|  | uint8_t | CHG
| ) |  |

Start a GPIO, cell 0 and Vref2 Conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  CHG | Sets which GPIO channels are converted

Definition at line 113 of file LTC6810.cpp.

## ◆ LTC6810_adaxd()

void LTC6810_adaxd | ( | uint8_t | MD,
|  | uint8_t | CHG
| ) |  |

Start an GPIO Redundancy test.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  CHG | Sets which GPIO channels are converted

Definition at line 352 of file LTC6810.cpp.

## ◆ LTC6810_adcv()

void LTC6810_adcv | ( | uint8_t | MD,
|  | uint8_t | DCP,
|  | uint8_t | CH
| ) |  |

Starts cell voltage conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  DCP | Controls if Discharge is permitted during conversion
  CH | Sets which Cell channels are converted

Definition at line 104 of file LTC6810.cpp.

## ◆ LTC6810_adcvax()

void LTC6810_adcvax | ( | uint8_t | MD,
|  | uint8_t | DCP
| ) |  |

Starts cell voltage, Cell 0 and GPIO 1 conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  DCP | Controls if Discharge is permitted during conversion

Definition at line 137 of file LTC6810.cpp.

## ◆ LTC6810_adcvsc()

void LTC6810_adcvsc | ( | uint8_t | MD,
|  | uint8_t | DCP
| ) |  |

Starts cell voltage and SOC conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  DCP | Controls if Discharge is permitted during conversion

Definition at line 129 of file LTC6810.cpp.

## ◆ LTC6810_adow()

void LTC6810_adow | ( | uint8_t | MD,
|  | uint8_t | PUP,
|  | uint8_t | CH,
|  | uint8_t | DCP
| ) |  |

Start an open wire Conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  PUP | Pull up/Pull down current
  CH | Channels
  DCP | Discharge Permit

Definition at line 393 of file LTC6810.cpp.

## ◆ LTC6810_adstat()

void LTC6810_adstat | ( | uint8_t | MD,
|  | uint8_t | CHST
| ) |  |

Start a Status ADC Conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  CHST | Sets which Stat channels are converted

Definition at line 121 of file LTC6810.cpp.

## ◆ LTC6810_adstatd()

void LTC6810_adstatd | ( | uint8_t | MD,
|  | uint8_t | CHST
| ) |  |

Start a Status register redundancy test Conversion.

Returns
  void

Parameters

  MD | ADC Mode
  CHST | Sets which Status channels are converted

Definition at line 360 of file LTC6810.cpp.

## ◆ LTC6810_axow()

void LTC6810_axow | ( | uint8_t | MD,
|  | uint8_t | PUP
| ) |  |

Start GPIOs open wire ADC conversion.

Returns
  void

Parameters

  MD | ADC Mode
  PUP | Pull up/Pull down current

Definition at line 403 of file LTC6810.cpp.

## ◆ LTC6810_axst()

void LTC6810_axst | ( | uint8_t | MD,
|  | uint8_t | ST
| ) |  |

Start an Auxiliary Register Self Test Conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  ST | Sets if self test 1 or 2 is run

Definition at line 336 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  reg | Type of register
  ic | A two dimensional array that will store the data

Definition at line 643 of file LTC6810.cpp.

## ◆ LTC6810_clear_discharge()

void LTC6810_clear_discharge | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Clears all of the DCC bits in the configuration registers.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 529 of file LTC6810.cpp.

## ◆ LTC6810_clraux()

void LTC6810_clraux | ( |  | ) |

Clears the LTC6810 Auxiliary registers.

Returns
  void

Definition at line 306 of file LTC6810.cpp.

## ◆ LTC6810_clrcell()

void LTC6810_clrcell | ( |  | ) |

Clears the LTC6810 cell voltage registers.

Returns
  void

Definition at line 296 of file LTC6810.cpp.

## ◆ LTC6810_clrstat()

void LTC6810_clrstat | ( |  | ) |

Clears the LTC6810 Stat registers.

Returns
  void

Definition at line 316 of file LTC6810.cpp.

## ◆ LTC6810_cvst()

void LTC6810_cvst | ( | uint8_t | MD,
|  | uint8_t | ST
| ) |  |

Starts Cell voltage self test conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  ST | Sets if self test 1 or 2 is run

Definition at line 328 of file LTC6810.cpp.

## ◆ LTC6810_diagn()

void LTC6810_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.

Returns
  void

Definition at line 322 of file LTC6810.cpp.

## ◆ LTC6810_init_cfg()

void LTC6810_init_cfg | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Helper Function to initialize the CFGR data structures.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 660 of file LTC6810.cpp.

## ◆ LTC6810_init_reg_limits()

void LTC6810_init_reg_limits | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Initialize the Register limits.

Returns
  void

Parameters

  total_ic | Number of ICs in the system
  ic | A two dimensional array that will store the data

Definition at line 66 of file LTC6810.cpp.

## ◆ LTC6810_mute()

void LTC6810_mute | ( |  | ) |

Mutes the LTC6810 discharge transistors.

Returns
  void

Definition at line 622 of file LTC6810.cpp.

## ◆ LTC6810_pladc()

uint8_t LTC6810_pladc | ( |  | ) |

Sends the poll ADC command.

Returns
  1 byte read back after a pladc command. If the byte is not 0xFF ADC conversion has completed

Definition at line 280 of file LTC6810.cpp.

## ◆ LTC6810_pollAdc()

uint32_t LTC6810_pollAdc | ( |  | ) |

This function will block operation until the ADC has finished it's conversion.

Returns
  the approximate time it took for the ADC function to complete.

Definition at line 286 of file LTC6810.cpp.

## ◆ LTC6810_rdaux()

int8_t LTC6810_rdaux | ( | uint8_t | reg,
|  | uint8_t | nIC,
|  | cell_asic * | ic
| ) |  |

Reads and parses the LTC6810 auxiliary registers.

Returns
  int8_t, pec_error PEC Status. 0: No PEC error detected -1: PEC error detected, retry read

Parameters

  reg | Determines which GPIO voltage register is read back
  total_ic | The number of ICs in the daisy chain
  ic | A two dimensional array of the parsed gpio voltage codes

Definition at line 166 of file LTC6810.cpp.

## ◆ LTC6810_rdcfg()

int8_t LTC6810_rdcfg | ( | uint8_t | nIC,
|  | cell_asic * | ic
| ) |  |

Reads configuration registers of a LTC6810 daisy chain.

Returns
  int8_t, PEC Status. 0: Data read back has matching PEC -1: Data read back has incorrect PEC

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that the function stores the read configuration data

Definition at line 94 of file LTC6810.cpp.

## ◆ LTC6810_rdcomm()

int8_t LTC6810_rdcomm | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Reads comm registers of a LTC6810 in daisy chain.

Returns
  int8_t, pec_error PEC Status. 0: Data read back has matching PEC -1: Data read back has incorrect PEC

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | Two dimensional array that the function stores the read comm data.

Definition at line 569 of file LTC6810.cpp.

## ◆ LTC6810_rdcv()

uint8_t LTC6810_rdcv | ( | uint8_t | reg,
|  | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Reads and parses the LTC6810 cell voltage registers.

Returns
  uint8_t, pec_error PEC Status. 0: No PEC error detected -1: PEC error detected, retry read

Parameters

  reg | Determines which cell voltage register is read back.
  total_ic | The number of ICs in the daisy chain
  ic | Array of the parsed cell codes

Definition at line 150 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  pwmReg | Select register
  ic | A two dimensional array that the function stores the read pwm data

Definition at line 549 of file LTC6810.cpp.

## ◆ LTC6810_rds()

uint8_t LTC6810_rds | ( | uint8_t | reg,
|  | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Reads and parses the LTC6810 S voltage registers.

Returns
  uint8_t, pec_error PEC Status. 0: No PEC error detected -1: PEC error detected, retry read

Parameters

  reg | Determines which S voltage registers is read back.
  total_ic | The number of ICs in the system
  ic | Array of the parsed cell codes

Definition at line 198 of file LTC6810.cpp.

## ◆ LTC6810_rds_reg()

void LTC6810_rds_reg | ( | uint8_t | reg,
|  | uint8_t | total_ic,
|  | uint8_t * | data
| ) |  |

Reads the raw S voltage register data.

Returns
  void

Parameters

  reg | Determines which s voltage register is read back
  total_ic | The number of ICs in the daisy-chain
  data | An array of the unparsed cell codes

Definition at line 256 of file LTC6810.cpp.

## ◆ LTC6810_rdsid()

uint8_t LTC6810_rdsid | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Reads Serial ID registers group.

Returns
  uint8_t, pec_error PEC Status. 0: Data read back has matching PEC -1: Data read back has incorrect PEC

Parameters

  total_ic | The number of ICs in the system
  ic | A two dimensional array that will store the read data

Definition at line 585 of file LTC6810.cpp.

## ◆ LTC6810_rdstat()

int8_t LTC6810_rdstat | ( | uint8_t | reg,
|  | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Reads and parses the LTC6810 stat registers.

Returns
  int8_t, pec_error PEC Status. 0: No PEC error detected -1: PEC error detected, retry read

Parameters

  reg | Determines which Stat register is read back.
  total_ic | The number of ICs in the system
  ic | A two dimensional array of the parsed stat codes

Definition at line 182 of file LTC6810.cpp.

## ◆ LTC6810_reset_crc_count()

void LTC6810_reset_crc_count | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Helper Function that resets the PEC error counters.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 652 of file LTC6810.cpp.

## ◆ 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.

Returns
  int16_t, error Number of errors detected.

Parameters

  adc_mode | ADC Mode
  adc_reg | Type of register
  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 381 of file LTC6810.cpp.

## ◆ 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.

Returns
  int16_t, error Number of errors detected.

Parameters

  adc_reg | Type of register
  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data
  md | ADC Mode
  adcopt | the adcopt bit in the configuration register

Definition at line 368 of file LTC6810.cpp.

## ◆ LTC6810_run_gpio_openwire()

void LTC6810_run_gpio_openwire | ( | uint8_t | total_ic,
|  | cell_asic | ic[]
| ) |  |

Definition at line 427 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 419 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  ic | A two dimensional array that will store the data

Definition at line 411 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  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
  dcc_0 | The DCC bit
  mcal | Enable Multi-Calibration
  en_dtmen | Enable Discharge timer monitor
  dis_red | Disable Digital Redundancy Check
  fdrf | Force digital Redundancy Failure
  sconv | Enable Cell Measurement Redundancy using S Pin
  dcto | Discharge Time Out Value
  uv | The UV value
  ov | The OV value

Definition at line 666 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  adcopt | The ADCOPT bit

Definition at line 690 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  dcc_0 | The DCC bit

Definition at line 735 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_dcto()

void LTC6810_set_cfgr_dcto | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | dcto[4]
| ) |  |

Definition at line 770 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_dis()

void LTC6810_set_cfgr_dis | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | dcc[6]
| ) |  |

Definition at line 706 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  dis_red | Disable Digital Redundancy Check

Definition at line 749 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  en_dtmen | Enable Discharge timer monitor

Definition at line 742 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_fdrf()

void LTC6810_set_cfgr_fdrf | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | fdrf
| ) |  |

Helper function to set the FDRF bit.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  fdrf | Force digital Redundancy Failure

Definition at line 756 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_gpio()

void LTC6810_set_cfgr_gpio | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | gpio[4]
| ) |  |

Definition at line 696 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_mcal()

void LTC6810_set_cfgr_mcal | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | mcal
| ) |  |

Helper function to set the MCAL bit.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  mcal | Enable Multi-Calibration

Definition at line 728 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  ov | The OV value

Definition at line 722 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  refon | The REFON bit

Definition at line 684 of file LTC6810.cpp.

## ◆ LTC6810_set_cfgr_sconv()

void LTC6810_set_cfgr_sconv | ( | uint8_t | nIC,
|  | cell_asic * | ic,
|  | bool | sconv
| ) |  |

Helper function to set the SCONV bit.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  sconv | Enable Cell Measurement Redundancy using S Pin

Definition at line 763 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  nIC | Current IC
  ic | A two dimensional array that will store the data
  uv | The UV value

Definition at line 716 of file LTC6810.cpp.

## ◆ 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.

Returns
  void

Parameters

  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 510 of file LTC6810.cpp.

## ◆ LTC6810_statst()

void LTC6810_statst | ( | uint8_t | MD,
|  | uint8_t | ST
| ) |  |

Start a Status Register Self Test Conversion.

Returns
  void

Parameters

  MD | ADC Conversion Mode
  ST | Sets if self test 1 or 2 is run

Definition at line 344 of file LTC6810.cpp.

## ◆ LTC6810_stcomm()

void LTC6810_stcomm | ( | uint8_t | len | ) |

Issues a stcomm command and clocks data out of the COMM register.

Returns
  void

Parameters

  len | Length of data to be transmitted

Definition at line 579 of file LTC6810.cpp.

## ◆ LTC6810_unmute()

void LTC6810_unmute | ( |  | ) |

Clears the LTC6810 Mute Discharge.

Returns
  void

Definition at line 633 of file LTC6810.cpp.

## ◆ LTC6810_wrcfg()

void LTC6810_wrcfg | ( | uint8_t | nIC,
|  | cell_asic * | ic
| ) |  |

Write the LTC6810 configuration register.

Returns
  void

Parameters

  total_ic | The number of ICs being written
  ic | A two dimensional array of the configuration data that will be written

Definition at line 86 of file LTC6810.cpp.

## ◆ LTC6810_wrcomm()

void LTC6810_wrcomm | ( | uint8_t | total_ic,
|  | cell_asic * | ic
| ) |  |

Write the LTC6810 COMM register.

Returns
  void

Parameters

  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 561 of file LTC6810.cpp.

## ◆ LTC6810_wrpwm()

void LTC6810_wrpwm | ( | uint8_t | total_ic,
|  | uint8_t | pwmReg,
|  | cell_asic * | ic
| ) |  |

Writes to the LTC6810 PWM register of LTC6810.

Returns
  void

Parameters

  total_ic | Number of ICs in the daisy chain
  pwmReg | Select register
  ic | A two dimensional array that will store the data to be written

Definition at line 540 of file LTC6810.cpp.