foxBMS  1.2.0
The foxBMS Battery Management System API Documentation
LTC_STATE_s Struct Reference

#include <ltc_defs.h>

Collaboration diagram for LTC_STATE_s:

Data Fields

uint16_t timer
LTC_TASK_TYPE_e taskMode
LTC_REQUEST_s statereq
uint8_t substate
LTC_STATEMACH_e laststate
uint8_t lastsubstate
LTC_ADCMODE_e voltMeasMode
LTC_ADCMODE_e gpioMeasMode
LTC_ADCMODE_e adcModereq
uint8_t numberOfMeasuredMux
uint32_t ErrPECCounter
uint8_t ErrRetryCounter
uint32_t ErrRequestCounter
uint8_t triggerentry
uint32_t commandDataTransferTime
uint32_t commandTransferTime
uint32_t gpioClocksTransferTime
uint32_t VoltageSampleTime
uint32_t muxSampleTime
uint8_t instanceID
uint8_t nrBatcellsPerModule
uint8_t busSize
LTC_ERROR_s errStatus
uint8_t * ltcIDs
uint8_t cntDeviceRD
uint32_t ctrlCallCnt
uint8_t taskCycleCnt
LTC_REUSE_MODE_e reusageMeasurementMode
LTC_CONFIG_s ltcConfig
bool first_measurement_made
STD_RETURN_TYPE_e ltc_muxcycle_finished
STD_RETURN_TYPE_e check_spi_flag
STD_RETURN_TYPE_e balance_control_done
uint8_t resendCommandCounter
bool transmit_ongoing
STD_RETURN_TYPE_e dummyByte_ongoing
uint8_t spiNumberInterfaces
uint8_t currentString
uint8_t requestedString
DIAG_ID_e spiDiagErrorEntry
DIAG_ID_e pecDiagErrorEntry
DIAG_ID_e muxDiagErrorEntry
DIAG_ID_e voltMeasDiagErrorEntry
DIAG_ID_e tempMeasDiagErrorEntry
LTC_MUX_CH_CFG_smuxmeas_seqptr [BS_NR_OF_STRINGS]
LTC_MUX_CH_CFG_smuxmeas_seqendptr [BS_NR_OF_STRINGS]
uint8_t muxmeas_nr_end [BS_NR_OF_STRINGS]
uint8_t configuration [6]

Detailed Description

This structure contains all the variables relevant for the LTC state machine. The user can get the current state of the LTC state machine with this variable

Definition at line 519 of file ltc_defs.h.

Field Documentation

◆ adcMeasCh


current number of channels measured for GPIOS (one at a time for multiplexers or all five GPIOs)

Definition at line 532 of file ltc_defs.h.

◆ adcMeasChreq


requested number of channels measured for GPIOS (one at a time for multiplexers or all five GPIOs)

Definition at line 534 of file ltc_defs.h.

◆ adcMode


current LTC ADCmeasurement mode (fast, normal or filtered)

Definition at line 527 of file ltc_defs.h.

◆ adcModereq


requested LTC ADCmeasurement mode (fast, normal or filtered)

Definition at line 530 of file ltc_defs.h.

◆ balance_control_done

STD_RETURN_TYPE_e LTC_STATE_s::balance_control_done

indicates if balance control was done

Definition at line 564 of file ltc_defs.h.

◆ busSize

uint8_t LTC_STATE_s::busSize

number of connected LTCs to parallel bus network

Definition at line 551 of file ltc_defs.h.

◆ check_spi_flag

STD_RETURN_TYPE_e LTC_STATE_s::check_spi_flag

indicates if interrupt flag or timer must be considered

Definition at line 563 of file ltc_defs.h.

◆ cntDeviceRD

uint8_t LTC_STATE_s::cntDeviceRD

current Index of array ltcIDs to determine device ID

Definition at line 554 of file ltc_defs.h.

◆ commandDataTransferTime

uint32_t LTC_STATE_s::commandDataTransferTime

time needed for sending an instruction to the LTC, followed by data transfer from the LTC

Definition at line 543 of file ltc_defs.h.

◆ commandTransferTime

uint32_t LTC_STATE_s::commandTransferTime

time needed for sending an instruction to the LTC

Definition at line 544 of file ltc_defs.h.

◆ configuration

uint8_t LTC_STATE_s::configuration[6]

holds the configuration of the ltc (configuration register)

Definition at line 585 of file ltc_defs.h.

◆ ctrlCallCnt

uint32_t LTC_STATE_s::ctrlCallCnt

counts the LTC2_CTRL calls

Definition at line 555 of file ltc_defs.h.

◆ currentString

uint8_t LTC_STATE_s::currentString

string currently being addressed

Definition at line 571 of file ltc_defs.h.

◆ dummyByte_ongoing

STD_RETURN_TYPE_e LTC_STATE_s::dummyByte_ongoing

SPI dummy byte is currently transmitted

Definition at line 567 of file ltc_defs.h.

◆ ErrPECCounter

uint32_t LTC_STATE_s::ErrPECCounter

counts the number of times there was A PEC (CRC) error during communication with LTC

Definition at line 537 of file ltc_defs.h.

◆ ErrRequestCounter

uint32_t LTC_STATE_s::ErrRequestCounter

counts the number of illegal requests to the LTC state machine

Definition at line 540 of file ltc_defs.h.

◆ ErrRetryCounter

uint8_t LTC_STATE_s::ErrRetryCounter

counts how many times the drivers retried to communicate with LTC in case of a communication error

Definition at line 539 of file ltc_defs.h.

◆ errStatus

LTC_ERROR_s LTC_STATE_s::errStatus

contains pointer to local error buffer and error indicators

Definition at line 552 of file ltc_defs.h.

◆ first_measurement_made

bool LTC_STATE_s::first_measurement_made

flag that indicates if the first measurement cycle was completed

Definition at line 560 of file ltc_defs.h.

◆ gpioClocksTransferTime

uint32_t LTC_STATE_s::gpioClocksTransferTime

time needed for sending 72 clock signal to the LTC, used for I2C communication

Definition at line 546 of file ltc_defs.h.

◆ gpioMeasMode


current LTC ADCmeasurement mode (fast, normal or filtered)

Definition at line 529 of file ltc_defs.h.

◆ instanceID

uint8_t LTC_STATE_s::instanceID

number to distinguish between different ltc states, starting with 0,1,2,3....8

Definition at line 549 of file ltc_defs.h.

◆ laststate


previous state of the state machine

Definition at line 525 of file ltc_defs.h.

◆ lastsubstate

uint8_t LTC_STATE_s::lastsubstate

previous substate of the state machine

Definition at line 526 of file ltc_defs.h.

◆ ltc_muxcycle_finished

STD_RETURN_TYPE_e LTC_STATE_s::ltc_muxcycle_finished

flag that indicates if the measurement sequence of the multiplexers is finished

Definition at line 562 of file ltc_defs.h.

◆ ltcConfig


struct that holds the measurement configuration of the ltc network

Definition at line 559 of file ltc_defs.h.

◆ ltcData


contains pointers to the local data buffer

Definition at line 578 of file ltc_defs.h.

◆ ltcIDs

uint8_t* LTC_STATE_s::ltcIDs

array with LTC IDs

Definition at line 553 of file ltc_defs.h.

◆ muxDiagErrorEntry

DIAG_ID_e LTC_STATE_s::muxDiagErrorEntry

diagnosis entry for multiplexer related events

Definition at line 575 of file ltc_defs.h.

◆ muxmeas_nr_end

uint8_t LTC_STATE_s::muxmeas_nr_end[BS_NR_OF_STRINGS]

number of multiplexer channels that have to be measured; end number of sequence, where measurement is finished

Definition at line 583 of file ltc_defs.h.

◆ muxmeas_seqendptr

LTC_MUX_CH_CFG_s* LTC_STATE_s::muxmeas_seqendptr[BS_NR_OF_STRINGS]

point to the end of the multiplexer sequence; pointer to ending point of sequence

Definition at line 581 of file ltc_defs.h.

◆ muxmeas_seqptr


pointer to the multiplexer sequence to be measured (contains a list of elements [multiplexer id, multiplexer channels]) (1,-1)...(3,-1),(0,1),...(0,7)

Definition at line 579 of file ltc_defs.h.

◆ muxSampleTime

uint32_t LTC_STATE_s::muxSampleTime

time stamp at which a multiplexer input was measured

Definition at line 548 of file ltc_defs.h.

◆ nrBatcellsPerModule

uint8_t LTC_STATE_s::nrBatcellsPerModule

number of cells per module

Definition at line 550 of file ltc_defs.h.

◆ numberOfMeasuredMux

uint8_t LTC_STATE_s::numberOfMeasuredMux

number of multiplexer channels measured by the LTC chip before a voltage measurement is made

Definition at line 536 of file ltc_defs.h.

◆ pecDiagErrorEntry

DIAG_ID_e LTC_STATE_s::pecDiagErrorEntry

diagnosis entry for PEC related events

Definition at line 574 of file ltc_defs.h.

◆ requestedString

uint8_t LTC_STATE_s::requestedString

string addressed by the current state request

Definition at line 572 of file ltc_defs.h.

◆ resendCommandCounter

uint8_t LTC_STATE_s::resendCommandCounter

counter if commandy should be send multiple times e.g. ADOW command

Definition at line 565 of file ltc_defs.h.

◆ reusageMeasurementMode

LTC_REUSE_MODE_e LTC_STATE_s::reusageMeasurementMode

flag that indicates if currently any state is reused i.e. cell voltage measurement

Definition at line 558 of file ltc_defs.h.

◆ spiDiagErrorEntry

DIAG_ID_e LTC_STATE_s::spiDiagErrorEntry

diagnosis entry for SPI related events

Definition at line 573 of file ltc_defs.h.

◆ spiNumberInterfaces

uint8_t LTC_STATE_s::spiNumberInterfaces

number of SPI channels that have to be measured

Definition at line 570 of file ltc_defs.h.

◆ spiSeqEndPtr


pointer to the end of the SPI sequence

Definition at line 569 of file ltc_defs.h.

◆ spiSeqPtr


pointer to the SPI sequence to be measured

Definition at line 568 of file ltc_defs.h.

◆ state


state of Driver State Machine

Definition at line 523 of file ltc_defs.h.

◆ statereq


current state request made to the state machine

Definition at line 522 of file ltc_defs.h.

◆ substate

uint8_t LTC_STATE_s::substate

current substate of the state machine

Definition at line 524 of file ltc_defs.h.

◆ taskCycleCnt

uint8_t LTC_STATE_s::taskCycleCnt

counts the current task cycle

Definition at line 556 of file ltc_defs.h.

◆ taskMode


current task of the state machine

Definition at line 521 of file ltc_defs.h.

◆ tempMeasDiagErrorEntry

DIAG_ID_e LTC_STATE_s::tempMeasDiagErrorEntry

diagnosis entry for temperature measurement related events

Definition at line 577 of file ltc_defs.h.

◆ timer

uint16_t LTC_STATE_s::timer

time in ms before the state machine processes the next state, e.g. in counts of 1ms

Definition at line 520 of file ltc_defs.h.

◆ transmit_ongoing

bool LTC_STATE_s::transmit_ongoing

SPI transmissioncurrently ongoing

Definition at line 566 of file ltc_defs.h.

◆ triggerentry

uint8_t LTC_STATE_s::triggerentry

counter for re-entrance protection (function running flag)

Definition at line 541 of file ltc_defs.h.

◆ VoltageSampleTime

uint32_t LTC_STATE_s::VoltageSampleTime

time stamp at which the cell voltage were measured

Definition at line 547 of file ltc_defs.h.

◆ voltMeasDiagErrorEntry

DIAG_ID_e LTC_STATE_s::voltMeasDiagErrorEntry

diagnosis entry for voltage measurement related events

Definition at line 576 of file ltc_defs.h.

◆ voltMeasMode


current LTC ADCmeasurement mode (fast, normal or filtered)

Definition at line 528 of file ltc_defs.h.

The documentation for this struct was generated from the following file: