|
foxBMS-UnitTests
1.0.0
The foxBMS Unit Tests API Documentation
|
Go to the documentation of this file.
61 #include "HL_system.h"
76 #define LTC_LTC6820CONTROL_GIODIR (hetREG1->DIR)
77 #define LTC_LTC6820CONTROL_GIOPORT (hetREG1->DOUT)
79 #define LTC_LTC6820_FORWARD_ENABLE_PIN (22U)
80 #define LTC_LTC6820_FORWARD_SPI1_MASTER_PIN (24U)
82 #define LTC_LTC6820_REVERSE_ENABLE_PIN (23U)
83 #define LTC_LTC6820_REVERSE_MASTER_PIN (25U)
90 #define LTC_PORT_EXPANDER_TI_INPUT_REG_ADR (0x00u)
91 #define LTC_PORT_EXPANDER_TI_OUTPUT_REG_ADR (0x01u)
92 #define LTC_PORT_EXPANDER_TI_CONFIG_REG_ADR (0x03u)
99 #define LTC_FUEL_CELL_LSB_RESOLUTION_mV (1.5f)
101 #define LTC_FUEL_CELL_LSB_RESOLUTION_mV (3.0f)
107 #define LTC_FUELCELL_POSITIVE_FULLSCALE_RANGE_mV ((int16_t)((0x7FF * LTC_FUEL_CELL_LSB_RESOLUTION_mV)))
112 #define LTC_FUELCELL_NEGATIVE_FULLSCALE_RANGE_mV \
113 ((int16_t)((((~0x001) + 1) & 0x7FF) * (-LTC_FUEL_CELL_LSB_RESOLUTION_mV)))
120 #pragma SET_DATA_SECTION(".sharedRAM")
123 #pragma SET_DATA_SECTION()
142 .minimumPlausibleVoltage_mV = -5000,
158 .numberOfMeasuredMux = 32,
160 .ErrRetryCounter = 0,
161 .ErrRequestCounter = 0,
162 .VoltageSampleTime = 0,
164 .commandDataTransferTime = 3,
165 .commandTransferTime = 3,
166 .gpioClocksTransferTime = 3,
170 .first_measurement_made =
false,
174 .transmit_ongoing =
false,
182 .ltcData.balancingFeedback =
NULL_PTR,
183 .ltcData.balancingControl =
NULL_PTR,
191 .requestedString = 0u,
240 {0x07, 0xC0, 0xBA, 0x70};
242 {0x06, 0xC0, 0x32, 0x3C};
255 uint16_t timer_ms_ok,
257 uint8_t substate_nok,
258 uint16_t timer_ms_nok);
265 uint32_t frameLength);
280 uint8_t stringNumber);
284 uint16_t *DataBufferSPI_RX_with_PEC,
285 uint8_t stringNumber);
291 uint32_t frameLength);
312 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
359 ltc_state->
state = state;
361 ltc_state->
timer = timer_ms;
388 uint16_t timer_ms_ok,
390 uint8_t substate_nok,
391 uint16_t timer_ms_nok) {
413 int32_t stringVoltage_mV = 0;
414 uint16_t numberValidMeasurements = 0;
439 numberValidMeasurements++;
465 uint16_t numberValidMeasurements = 0;
480 numberValidMeasurements++;
573 return ltc_state->
state;
628 uint8_t tmpbusID = 0;
641 if (ltc_state->
timer > 0u) {
642 if ((--ltc_state->
timer) > 0u) {
649 if (ltc_state->
timer > 0u) {
650 if ((--ltc_state->
timer) > 0u) {
658 if (continueFunction ==
STD_OK) {
659 switch (ltc_state->
state) {
670 ltc_state->
adcMode = tmpadcMode;
1302 uint8_t registerSet,
1303 uint8_t stringNumber) {
1304 uint16_t cellOffset = 0;
1305 uint16_t val_ui = 0;
1306 int16_t voltage = 0;
1307 uint64_t bitmask = 0;
1308 uint16_t buffer_LSB = 0;
1309 uint16_t buffer_MSB = 0;
1311 cellOffset = registerSet * 4u;
1314 bitmask |= 0x0Full << cellOffset;
1317 if (cellOffset == 0u) {
1322 for (uint8_t m = 0u; m <
LTC_N_LTC; m++) {
1323 uint8_t incrementations = 0u;
1326 for (uint8_t c = 0u; c < 4u; c++) {
1329 buffer_MSB = pRxBuff[4u + (m * 8u)];
1330 buffer_LSB = (pRxBuff[4u + 1u + (m * 8u)]) >> 4u;
1331 val_ui = (uint16_t)(buffer_LSB | (buffer_MSB << 4u));
1334 buffer_MSB = pRxBuff[4u + 1u + (m * 8u)] & 0x0Fu;
1335 buffer_LSB = (pRxBuff[4u + 2u + (m * 8u)]);
1336 val_ui = (uint16_t)(buffer_LSB | (buffer_MSB << 8u));
1339 buffer_MSB = pRxBuff[4u + 3u + (m * 8u)];
1340 buffer_LSB = (pRxBuff[4u + 4u + (m * 8u)]) >> 4u;
1341 val_ui = (uint16_t)(buffer_LSB | (buffer_MSB << 4u));
1344 buffer_MSB = pRxBuff[4u + 4u + (m * 8u)] & 0x0Fu;
1345 buffer_LSB = (pRxBuff[4u + 5u + (m * 8u)]);
1346 val_ui = (uint16_t)(buffer_LSB | (buffer_MSB << 8u));
1353 if ((val_ui & (1u << (12u - 1u))) == 0u) {
1406 uint32_t frameLength) {
1409 uint8_t PEC_Check[6];
1410 uint16_t PEC_result = 0;
1420 for (uint16_t i = 0u; i <
LTC_N_LTC; i++) {
1422 pTxBuff[4u + (i * 8u)] = 0x3F;
1423 pTxBuff[5u + (i * 8u)] = (
LTC_HIRNG << 7u) | 0x40u;
1424 pTxBuff[6u + (i * 8u)] = 0x00;
1425 pTxBuff[7u + (i * 8u)] = 0x00;
1426 pTxBuff[8u + (i * 8u)] = 0x00;
1427 pTxBuff[9u + (i * 8u)] = 0x00;
1429 PEC_Check[0] = pTxBuff[4u + (i * 8u)];
1430 PEC_Check[1] = pTxBuff[5u + (i * 8u)];
1431 PEC_Check[2] = pTxBuff[6u + (i * 8u)];
1432 PEC_Check[3] = pTxBuff[7u + (i * 8u)];
1433 PEC_Check[4] = pTxBuff[8u + (i * 8u)];
1434 PEC_Check[5] = pTxBuff[9u + (i * 8u)];
1436 PEC_result = LTC_pec15_calc(6, PEC_Check);
1437 pTxBuff[10u + (i * 8u)] = (PEC_result >> 8u) & 0xFFu;
1438 pTxBuff[11u + (i * 8u)] = PEC_result & 0xFFu;
1457 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
1512 }
else if (PUP == 1u) {
1537 uint16_t *DataBufferSPI_RX_with_PEC,
1538 uint8_t stringNumber) {
1542 uint16_t PEC_result = 0;
1543 uint8_t PEC_Check[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
1547 PEC_Check[0] = DataBufferSPI_RX_with_PEC[4u + (i * 8u)];
1548 PEC_Check[1] = DataBufferSPI_RX_with_PEC[5u + (i * 8u)];
1549 PEC_Check[2] = DataBufferSPI_RX_with_PEC[6u + (i * 8u)];
1550 PEC_Check[3] = DataBufferSPI_RX_with_PEC[7u + (i * 8u)];
1551 PEC_Check[4] = DataBufferSPI_RX_with_PEC[8u + (i * 8u)];
1552 PEC_Check[5] = DataBufferSPI_RX_with_PEC[9u + (i * 8u)];
1554 PEC_result = LTC_pec15_calc(6, PEC_Check);
1555 PEC_TX[0] = (uint8_t)((PEC_result >> 8u) & 0xFFu);
1556 PEC_TX[1] = (uint8_t)(PEC_result & 0xFFu);
1559 if ((PEC_TX[0] != DataBufferSPI_RX_with_PEC[10u + (i * 8u)]) ||
1560 (PEC_TX[1] != DataBufferSPI_RX_with_PEC[11u + (i * 8u)])) {
1603 uint32_t frameLength) {
1615 pTxBuff[0] = Command[0];
1616 pTxBuff[1] = Command[1];
1617 pTxBuff[2] = Command[2];
1618 pTxBuff[3] = Command[3];
1635 uint32_t SPI_Clock = 0;
1636 uint32_t prescaler = 0;
1661 prescaler = ((pSpiInterface->
pNode->FMT0) >> 8u) & 0xFFu;
1662 SPI_Clock = (uint32_t)(AVCLK1_FREQ * 1000000u) / (prescaler + 1u);
1676 uint32_t transferTime_us = 0;
1677 uint32_t SPI_Clock = 0;
1683 transferTime_us = (8u * 1000u * 1000u) / (SPI_Clock);
1690 transferTime_us = ((4u) * 8u * 1000u * 1000u) / (SPI_Clock);
1696 transferTime_us = ((4u + 9u) * 8u * 1000u * 1000u) / (SPI_Clock);
1734 bool retval =
false;
1771 #ifdef UNITY_UNIT_TEST
1781 #define TEST_LTC_DEFINE_GET(VARIABLE) \
1782 extern void TEST_LTC_Get_##VARIABLE(uint8_t data[4]) { \
1783 for (uint8_t i = 0u; i < 4u; i++) { \
1784 data[i] = (uint8_t)(VARIABLE)[i]; \
Implementation of the tasks used by the system, headers.
#define LTC_STATEMACH_SHORTTIME
#define LTC_STATEMACH_DAISY_CHAIN_FIRST_INITIALIZATION_TIME
uint16_t nrValidTemperatures[BS_NR_OF_STRINGS]
@ LTC_STATEMACH_STARTMEAS
#define BS_NR_OF_BAT_CELLS
uint8_t spiNumberInterfaces
static DATA_BLOCK_CELL_VOLTAGE_s ltc_cellvoltage
static uint16_t ltc_cmdRDCVI_Fuelcell[4]
#define LTC_NMBR_REQ_ADOW_COMMANDS
bool first_measurement_made
DATA_BLOCK_OPEN_WIRE_s * openWire
LTC_OPENWIRE_DETECTION_s * openWireDetection
static LTC_OPENWIRE_DETECTION_s ltc_openWireDetection
#define LTC_FUELCELL_POSITIVE_FULLSCALE_RANGE_mV
static STD_RETURN_TYPE_e LTC_Init(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16_t *pTxBuff, uint16_t *pRxBuff, uint32_t frameLength)
initialize the daisy-chain.
#define BS_NR_OF_TEMP_SENSORS
LTC_STATE_REQUEST_e request
static uint16_t ltc_BC_cmdADOW_PUP_100ms_fuelcell[4]
#define LTC_SPI_WAKEUP_WAIT_TIME_US
bool LTC_IsFirstMeasurementCycleFinished(LTC_STATE_s *ltc_state)
gets the measurement initialization status.
LTC_REQUEST_s LTC_TransferStateRequest(LTC_STATE_s *ltc_state, uint8_t *pBusIDptr, LTC_ADCMODE_e *pAdcModeptr, LTC_ADCMEAS_CHAN_e *pAdcMeasChptr)
transfers the current state request to the state machine.
#define BS_NR_OF_MODULES
number of modules in battery pack
static uint16_t ltc_cmdWRCFG[4]
@ LTC_READ_VOLTAGES_PULLDOWN_OPENWIRE_CHECK
uint8_t mux1[BS_NR_OF_STRINGS][LTC_N_LTC]
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
uint32_t gpioClocksTransferTime
@ LTC_READ_VOLTAGE_REGISTER_H_RDCVH_READVOLTAGE
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
static uint16_t ltc_cmdRDCVA_Fuelcell[4]
uint8_t mux2[BS_NR_OF_STRINGS][LTC_N_LTC]
int16_t openWirePdown[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
#define TEST_LTC_DEFINE_GET(VARIABLE)
static void LTC_StateTransition(LTC_STATE_s *ltc_state, LTC_STATEMACH_e state, uint8_t substate, uint16_t timer_ms)
function for setting LTC_Trigger state transitions
@ LTC_RE_ENTRY_INITIALIZATION
SPI_INTERFACE_CONFIG_s * pSpiInterface
uint16_t gpioVoltages_mV[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *BS_NR_OF_GPIOS_PER_MODULE]
static void LTC_CondBasedStateTransition(LTC_STATE_s *ltc_state, STD_RETURN_TYPE_e retVal, DIAG_ID_e diagCode, LTC_STATEMACH_e state_ok, uint8_t substate_ok, uint16_t timer_ms_ok, LTC_STATEMACH_e state_nok, uint8_t substate_nok, uint16_t timer_ms_nok)
condition-based state transition depending on retVal
static void LTC_SetTransferTimes(LTC_STATE_s *ltc_state)
sets the transfer time needed to receive/send data with the LTC daisy-chain.
@ LTC_READ_VOLTAGE_REGISTER_A_RDCVA_READVOLTAGE
#define BS_NR_OF_TEMP_SENSORS_PER_MODULE
number of temperature sensors per battery module
#define LTC_FUEL_CELL_LSB_RESOLUTION_mV
#define LTC_LTC6820_REVERSE_ENABLE_PIN
#define DATA_WRITE_DATA(...)
int32_t packVoltage_mV[BS_NR_OF_STRINGS]
#define LTC_FUEL_CELL_ADOW_TIME_MS
uint16_t ltc_RxPecBuffer[LTC_N_BYTES_FOR_DATA_TRANSMISSION]
@ LTC_READ_VOLTAGE_REGISTER_C_RDCVC_READVOLTAGE
static void LTC_SetFirstMeasurementCycleFinished(LTC_STATE_s *ltc_state)
sets the measurement initialization status.
static void LTC_Initialize_Database(LTC_STATE_s *ltc_state)
in the database, initializes the fields related to the LTC drivers.
@ LTC_ENTRY_INITIALIZATION
@ LTC_START_INIT_INITIALIZATION
#define BS_NR_OF_CELLS_PER_MODULE
number of battery cells per battery module (parallel cells are counted as one)
@ LTC_REUSE_READVOLT_FOR_ADOW_PDOWN
static void LTC_SaveRXtoVoltagebuffer_Fuelcell(LTC_STATE_s *ltc_state, uint16_t *pRxBuff, uint8_t registerSet, uint8_t stringNumber)
saves the voltage values read from the LTC daisy-chain.
@ LTC_READ_VOLTAGE_REGISTER_B_RDCVB_READVOLTAGE
@ LTC_EXIT_INITIALIZATION
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diag_id, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
static uint16_t ltc_cmdRDCVH_Fuelcell[4]
LTC_ADCMEAS_CHAN_e adcMeasChreq
static DATA_BLOCK_OPEN_WIRE_s ltc_openwire
void LTC_Trigger(LTC_STATE_s *ltc_state)
trigger function for the LTC driver state machine.
uint8_t mux0[BS_NR_OF_STRINGS][LTC_N_LTC]
static uint16_t ltc_cmdRDCVB_Fuelcell[4]
int16_t openWirePup[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
void MIC_SetTransmitOngoing(LTC_STATE_s *pLtcState)
sets the SPI transmit status.
SPI_INTERFACE_CONFIG_s * spiSeqPtr
@ LTC_CHECK_INITIALIZATION
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
DATA_BLOCK_CELL_TEMPERATURE_s * cellTemperature
LTC_REUSE_MODE_e reusageMeasurementMode
#define LTC_NUMBER_OF_LTC_PER_MODULE
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
LTC_RETURN_TYPE_e LTC_SetStateRequest(LTC_STATE_s *ltc_state, LTC_REQUEST_s statereq)
sets the current state request of the state variable ltc_state.
static uint16_t ltc_cmdRDCVD_Fuelcell[4]
static LTC_ERRORTABLE_s ltc_errorTable
DATA_BLOCK_HEADER_s header
void LTC_SaveTemperatures(LTC_STATE_s *ltc_state, uint8_t stringNumber)
stores the measured temperatures and the measured multiplexer feedbacks in the database.
@ LTC_STATEMACH_UNINITIALIZED
uint16_t ltc_TxPecBuffer[LTC_N_BYTES_FOR_DATA_TRANSMISSION]
@ LTC_STATE_OPENWIRE_CHECK_REQUEST
static uint16_t ltc_cmdRDCFG[4]
SPI_INTERFACE_CONFIG_s spi_ltcInterface[BS_NR_OF_STRINGS]
#define LTC_LTC6820CONTROL_GIODIR
const int16_t maximumPlausibleVoltage_mV
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
plausibility checks for cell voltage and cell temperatures
#define LTC_ADOW_THRESHOLD
#define LTC_TransmitCommand(spi_ltcInterface, command)
@ LTC_READ_VOLTAGE_REGISTER_F_RDCVF_READVOLTAGE
SPI_INTERFACE_CONFIG_s * spiSeqEndPtr
void LTC_SaveAllGPIOMeasurement(LTC_STATE_s *ltc_state)
stores the measured GPIOs in the database.
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
uint8_t mux3[BS_NR_OF_STRINGS][LTC_N_LTC]
LTC_STATEMACH_e laststate
@ LTC_STATEMACH_INITIALIZATION
Headers for the driver for the LTC monitoring chip.
void LTC_SaveVoltages(LTC_STATE_s *ltc_state, uint8_t stringNumber)
stores the measured voltages in the database.
#define LTC_LTC6820_FORWARD_SPI1_MASTER_PIN
static LTC_RETURN_TYPE_e LTC_CheckStateRequest(LTC_STATE_s *ltc_state, LTC_REQUEST_s statereq)
checks the state requests that are made.
@ LTC_READ_VOLTAGE_REGISTER_I_RDCVI_READVOLTAGE
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
static DATA_BLOCK_CELL_TEMPERATURE_s ltc_celltemperature
STD_RETURN_TYPE_e MIC_PlausibilityCheckTempMinMax(const int16_t celltemperature_ddegC)
Cell temperature plausibility check.
STD_RETURN_TYPE_e DIAG_CheckEvent(STD_RETURN_TYPE_e cond, DIAG_ID_e diag_id, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_CheckEvent provides a simple interface to check an event for STD_OK.
DATA_BLOCK_HEADER_s header
static uint16_t ltc_used_cells_index[BS_NR_OF_STRINGS]
@ LTC_STATEMACH_OPENWIRE_CHECK
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
uint16_t nrOpenWires[BS_NR_OF_STRINGS]
static uint16_t ltc_cmdRDCVF_Fuelcell[4]
static uint16_t ltc_cmdRDCVE_Fuelcell[4]
#define LTC_VOLTAGE_MEASUREMENT_MODE
@ LTC_READ_VOLTAGES_PULLUP_OPENWIRE_CHECK
uint16_t invalidCellTemperature[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
uint64_t invalidCellVoltage[BS_NR_OF_STRINGS][BS_NR_OF_MODULES]
@ LTC_READ_VOLTAGE_REGISTER_E_RDCVE_READVOLTAGE
@ LTC_REQUEST_PULLUP_CURRENT_OPENWIRE_CHECK
static uint16_t ltc_cmdRDCVG_Fuelcell[4]
LTC_STATEMACH_e LTC_GetState(LTC_STATE_s *ltc_state)
gets the current state.
#define LTC_LTC6820CONTROL_GIOPORT
uint32_t commandTransferTime
@ LTC_REUSE_READVOLT_FOR_ADOW_PUP
LTC_REQUEST_s LTC_GetStateRequest(LTC_STATE_s *ltc_state)
gets the current state request.
LTC_ERRORTABLE_s * errorTable
void IO_PinReset(uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
uint8_t LTC_CheckReEntrance(LTC_STATE_s *ltc_state)
re-entrance check of LTC state machine trigger function
static STD_RETURN_TYPE_e LTC_RX_PECCheck(LTC_STATE_s *ltc_state, uint16_t *DataBufferSPI_RX_with_PEC, uint8_t stringNumber)
checks if the data received from the daisy-chain is not corrupt.
#define LTC_LTC6820_FORWARD_ENABLE_PIN
@ LTC_STATEMACH_STARTMEAS_CONTINUE
static uint16_t ltc_cmdRDCVC_Fuelcell[4]
static STD_RETURN_TYPE_e LTC_StartVoltageMeasurement(SPI_INTERFACE_CONFIG_s *pSpiInterface, LTC_ADCMODE_e adcMode, LTC_ADCMEAS_CHAN_e adcMeasCh)
tells the LTC daisy-chain to start measuring the voltage on all cells.
uint8_t openwire[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *(BS_NR_OF_CELLS_PER_MODULE+1)]
@ DIAG_ID_MEASUREMENT_IC_CELL_VOLTAGE_MEAS_ERROR
#define LTC_TransmitWakeUp(spi_ltcInterface)
int32_t openWireDelta[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltage
Header for the configuration for the LTC 6806 monitoring IC.
STD_RETURN_TYPE_e MIC_PlausibilityCheckVoltageMeasurementRange(const int16_t cellvoltage_mV, const MIC_PLAUSIBILITY_VALUES_s plausibleValues)
Cell voltage measurement range plausibility check.
#define NULL_PTR
Null pointer.
#define LTC_TRANSMISSION_TIMEOUT
void TEST_LTC_SetFirstMeasurementCycleFinished(LTC_STATE_s *ltc_state)
STD_RETURN_TYPE_e check_spi_flag
@ DIAG_ID_MEASUREMENT_IC_CELL_TEMPERATURE_MEAS_ERROR
uint8_t PEC_valid[BS_NR_OF_STRINGS][LTC_N_LTC]
@ LTC_STATEMACH_READVOLTAGE
Header for the driver for the IO module.
@ LTC_PERFORM_OPENWIRE_CHECK
uint32_t ErrRequestCounter
@ LTC_READ_VOLTAGE_REGISTER_D_RDCVD_READVOLTAGE
#define LTC_FUELCELL_NEGATIVE_FULLSCALE_RANGE_mV
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s ltc_allgpiovoltage
static uint16_t ltc_BC_cmdADOW_PDOWN_100ms_fuelcell[4]
#define BS_NR_OF_GPIOS_PER_MODULE
Number of GPIOs on the LTC IC.
void LTC_monitoringPinInit(void)
Sets the transceiver pins to enable LTC6820 IC.
static void LTC_SaveLastStates(LTC_STATE_s *ltc_state)
Saves the last state and the last substate.
@ LTC_REQUEST_PULLDOWN_CURRENT_OPENWIRE_CHECK
static STD_RETURN_TYPE_e LTC_RX(uint16_t *Command, SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16_t *pTxBuff, uint16_t *pRxBuff, uint32_t frameLength)
send command to the LTC daisy-chain and receives data from the LTC daisy-chain.
static uint16_t ltc_cmdADCV_normal_Fuelcell[4]
uint8_t resendCommandCounter
DATA_BLOCK_ALL_GPIO_VOLTAGES_s * allGpioVoltages
uint8_t TEST_LTC_CheckReEntrance(LTC_STATE_s *ltc_state)
static void LTC_ResetErrorTable(LTC_STATE_s *ltc_state)
resets the error table.
void IO_PinSet(uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
@ LTC_ALREADY_INITIALIZED
uint16_t nrValidCellVoltages[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
@ LTC_READ_VOLTAGE_REGISTER_G_RDCVG_READVOLTAGE
#define LTC_STATEMACH_DAISY_CHAIN_SECOND_INITIALIZATION_TIME
static const MIC_PLAUSIBILITY_VALUES_s ltc_plausibleCellVoltages6806
#define LTC_OW_MEASUREMENT_MODE
@ LTC_STATEMACH_INITIALIZED
struct definition for plausibility values of a MIC
DATA_BLOCK_HEADER_s header
LTC_ADCMEAS_CHAN_e adcMeasCh
#define LTC_N_BYTES_FOR_DATA_TRANSMISSION
static STD_RETURN_TYPE_e LTC_StartOpenWireMeasurement(SPI_INTERFACE_CONFIG_s *pSpiInterface, LTC_ADCMODE_e adcMode, uint8_t PUP)
tells LTC daisy-chain to start measuring the voltage on GPIOS.
#define LTC_FUELCELL_NORMAL_ALL_CELLS_MS
bool MIC_IsTransmitOngoing(LTC_STATE_s *pLtcState)
gets the SPI transmit status.
#define LTC_TransmitReceiveData(spi_ltcInterface, txbuf, rxbuf, length)
LTC_STATE_s ltc_stateBase
static uint32_t LTC_GetSPIClock(SPI_INTERFACE_CONFIG_s *pSpiInterface)
gets the frequency of the SPI clock.
#define SETBIT(register, bit)
sets a bit to 1u
int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_TEMP_SENSORS]
uint32_t commandDataTransferTime
#define LTC_LTC6820_REVERSE_MASTER_PIN