void LTC6812_run_gpio_openwire(uint8_t total_ic, cell_asic *ic)
Runs open wire for GPIOs.
int8_t LTC6812_rdpsb(uint8_t total_ic, cell_asic *ic)
Reading pwm/s control register b.
void LTC6812_wrcomm(uint8_t total_ic, cell_asic *ic)
Write the LTC6812 COMM register.
void LTC6812_clrcell()
Clears the LTC6812 cell voltage registers.
int8_t LTC6812_rdcfgb(uint8_t total_ic, cell_asic *ic)
Reads configuration registers of a LTC6812 daisy chain.
uint32_t LTC6812_pollAdc()
This function will block operation until the ADC has finished it's conversion.
void LTC6812_adcvsc(uint8_t MD, uint8_t DCP)
Starts cell voltage and SOC conversion.
void LTC6812_adstatd(uint8_t MD, uint8_t CHST)
Start a Status register redundancy test Conversion.
void LTC6812_axow(uint8_t MD, uint8_t PUP)
Start GPIOs open wire ADC conversion.
int8_t LTC6812_rdstat(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6812 stat registers.
void LTC6812_init_cfgb(uint8_t total_ic, cell_asic *ic)
Helper Function to initialize the CFGR B data structures.
void LTC6812_diagn()
Starts the Mux Decoder diagnostic self test Running this command will start the Mux Decoder Diagnosti...
void LTC6812_init_reg_limits(uint8_t total_ic, cell_asic *ic)
Initialize the Register limits.
void LTC6812_set_cfgrb_dcc_b(uint8_t nIC, cell_asic *ic, bool dccbits[])
Helper function to turn the DCC bit HIGH or LOW.
void LTC6812_wrcfgb(uint8_t total_ic, cell_asic *ic)
Write the LTC6812 configuration register B.
void LTC6812_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.
void LTC6812_run_openwire_single(uint8_t total_ic, cell_asic *ic)
Runs the data sheet algorithm for open wire for single cell detection.
void LTC6812_unmute()
Clears the LTC6812 Mute Discharge.
void LTC6812_adax(uint8_t MD, uint8_t CHG)
Start a GPIO and Vref2 Conversion.
void LTC6812_clear_discharge(uint8_t total_ic, cell_asic *ic)
Clears all of the DCC bits in the configuration registers.
void LTC6812_reset_crc_count(uint8_t total_ic, cell_asic *ic)
Helper Function that resets the PEC error counters.
int8_t LTC6812_rdpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Reads pwm registers of a LTC6811 daisy chain.
void LTC6812_adcv(uint8_t MD, uint8_t DCP, uint8_t CH)
Starts cell voltage conversion.
uint16_t LTC6812_run_adc_overlap(uint8_t total_ic, cell_asic *ic)
Helper Function that runs the ADC Overlap test.
void LTC6812_set_cfgr_ov(uint8_t nIC, cell_asic *ic, uint16_t ov)
Helper function to set OV field in CFGRA register.
void LTC6812_cvst(uint8_t MD, uint8_t ST)
Starts cell voltage self test conversion.
void LTC6812_check_pec(uint8_t total_ic, uint8_t reg, cell_asic *ic)
Helper Function that counts overall PEC errors and register/IC PEC errors.
void LTC6812_set_cfgr_dcto(uint8_t nIC, cell_asic *ic, bool dcto[4])
Helper Function to set dcto value in CFG register.
uint8_t LTC6812_rdcv(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6812 cell voltage registers.
void LTC6812_adstat(uint8_t MD, uint8_t CHST)
Start a Status ADC Conversion.
void LTC6812_wrpwm(uint8_t total_ic, uint8_t pwmReg, cell_asic *ic)
Write the LTC6812 PWM register.
void LTC6812_mute()
Mutes the LTC6812 discharge transistors.
int8_t LTC6812_rdcomm(uint8_t total_ic, cell_asic *ic)
Reads comm registers of a LTC6812 daisy chain.
void LTC6812_set_cfgrb_ps(uint8_t nIC, cell_asic *ic, bool ps[])
Helper function to turn the Path Select bit HIGH or LOW.
int8_t LTC6812_rdsctrl(uint8_t total_ic, uint8_t sctrl_reg, cell_asic *ic)
Reads sctrl registers of a LTC6812 daisy chain.
void LTC6812_clrsctrl()
Clears the LTC6812 Sctrl registers.
void LTC6812_set_cfgr_gpio(uint8_t nIC, cell_asic *ic, bool gpio[])
Helper function to turn the GPIO bits HIGH or LOW.
void LTC6812_adaxd(uint8_t MD, uint8_t CHG)
Start an GPIO Redundancy test.
void LTC6812_set_cfgr_adcopt(uint8_t nIC, cell_asic *ic, bool adcopt)
Helper function to turn the ADCOPT bit HIGH or LOW.
void LTC6812_init_cfg(uint8_t total_ic, cell_asic *ic)
Helper Function to initialize the CFGR data structures.
void LTC6812_set_cfgr_uv(uint8_t nIC, cell_asic *ic, uint16_t uv)
Helper function to set uv field in CFGRA register.
int8_t LTC6812_rdcfg(uint8_t total_ic, cell_asic *ic)
Reads configuration registers of a LTC6812 daisy chain.
void LTC6812_wrcfg(uint8_t total_ic, cell_asic *ic)
Write the LTC6812 configuration register.
void LTC6812_wrsctrl(uint8_t total_ic, uint8_t sctrl_reg, cell_asic *ic)
Write the LTC6812 Sctrl register.
void LTC6812_set_cfgrb_gpio_b(uint8_t nIC, cell_asic *ic, bool gpiobits[])
Helper function to turn the GPIO bit HIGH or LOW.
void LTC6812_wrpsb(uint8_t total_ic, cell_asic *ic)
Write the 6812 PWM/Sctrl Register B.
void LTC6812_set_cfgr_refon(uint8_t nIC, cell_asic *ic, bool refon)
Helper function to turn the refon bit HIGH or LOW.
void LTC6812_adow(uint8_t MD, uint8_t PUP, uint8_t CH, uint8_t DCP)
Start an open wire Conversion.
int16_t LTC6812_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.
void LTC6812_set_discharge(int Cell, uint8_t total_ic, cell_asic *ic)
Helper function to set discharge bit in CFG register.
void LTC6812_set_cfgrb_dtmen(uint8_t nIC, cell_asic *ic, bool dtmen)
Helper function to turn the DTMEN bit HIGH or LOW.
void LTC6812_set_cfgr_dis(uint8_t nIC, cell_asic *ic, bool dcc[])
Helper function to turn the DCC bits HIGH or LOW.
uint8_t LTC6812_pladc()
Sends the poll ADC command.
void LTC6812_clraux()
Clears the LTC6812 Auxiliary registers.
void LTC6812_adol(uint8_t MD, uint8_t DCP)
Starts Cell voltage overlap conversion.
void LTC6812_stcomm(uint8_t len)
Issues a stcomm command and clocks data out of the COMM register.
void LTC6812_statst(uint8_t MD, uint8_t ST)
Start a Status Register Self Test Conversion.
int8_t LTC6812_rdaux(uint8_t reg, uint8_t total_ic, cell_asic *ic)
Reads and parses the LTC6812 auxiliary registers.
void LTC6812_clrstat()
Clears the LTC6812 Stat registers.
void LTC6812_set_cfgrb(uint8_t nIC, cell_asic *ic, bool fdrf, bool dtmen, bool ps[2], bool gpiobits[4], bool dccbits[4])
Helper function to set appropriate bits in CFGR register based on bit function.
void LTC6812_stsctrl()
Start Sctrl data communication This command will start the sctrl pulse communication over the spins...
void LTC6812_set_cfgrb_fdrf(uint8_t nIC, cell_asic *ic, bool fdrf)
Helper function to turn the FDRF bit HIGH or LOW.
int16_t LTC6812_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...
void LTC6812_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...
void LTC6812_axst(uint8_t MD, uint8_t ST)
Start an Auxiliary Register Self Test Conversion.
void LTC6812_adcvax(uint8_t MD, uint8_t DCP)
Starts cell voltage and GPIO 1&2 conversion.