55 #ifndef FOXBMS__LTC_6813_1_CFG_H_
56 #define FOXBMS__LTC_6813_1_CFG_H_
75 #define SLAVE_BOARD_VERSION (2)
77 #if SLAVE_BOARD_VERSION == 1
78 #elif SLAVE_BOARD_VERSION == 2
80 #error Please select the slave board version you want to use. Configuration file: \src\module\config\ltc_cfg.h
87 #define LTC_PORTEXPANDER_VERSION (1u)
90 #define LTC_PORTEXPANDER_ADR_TI (0u)
93 #define LTC_DISCARD_PEC (false)
96 #define LTC_GOTO_MUX_CHECK (true)
99 #define LTC_DISCARD_MUX_CHECK (false)
102 #define LTC_N_MUX_PER_LTC (3u)
105 #define LTC_N_MUX_CHANNELS_PER_MUX (8u)
108 #define LTC_NUMBER_OF_MUX_MEASUREMENTS_PER_CYCLE (8u)
111 #define LTC_N_MUX_CHANNELS_PER_LTC (LTC_N_MUX_PER_LTC * LTC_N_MUX_CHANNELS_PER_MUX)
114 #define LTC_NUMBER_OF_LTC_PER_MODULE (1u)
117 #define LTC_ADOW_THRESHOLD (-400)
125 #define LTC_VOLTAGE_MEASUREMENT_MODE (LTC_ADCMODE_NORMAL_DCP0)
133 #define LTC_GPIO_MEASUREMENT_MODE (LTC_ADCMODE_NORMAL_DCP0)
140 #define LTC_OW_MEASUREMENT_MODE (LTC_ADCMODE_NORMAL_DCP0)
146 #define LTC_TRANSMISSION_TIMEOUT (10)
152 #define LTC_SPI_HANDLE &spi_devices[0]
153 #define LTC_SPI_INSTANCE *LTC_SPI_HANDLE.Instance
154 #define LTC_SPI_PRESCALER *LTC_SPI_HANDLE.Init.BaudRatePrescaler
158 #define LTC_TWAKE_US (300)
160 #define LTC_TREADY_US (10)
162 #define LTC_TIDLE_US (6700)
165 #define LTC_SPI_WAKEUP_WAIT_TIME_US (30U)
168 #define LTC_STATEMACH_SHORTTIME (1)
174 #define LTC_STATEMACH_DAISY_CHAIN_FIRST_INITIALIZATION_TIME ((LTC_TWAKE_US * LTC_N_LTC) / 1000)
179 #define LTC_STATEMACH_DAISY_CHAIN_SECOND_INITIALIZATION_TIME ((LTC_TREADY_US * LTC_N_LTC) / 1000)
189 #define LTC_STATEMACH_MEAS_ALL_FAST_TCYCLE (2)
195 #define LTC_STATEMACH_MEAS_ALL_NORMAL_TCYCLE (3)
201 #define LTC_STATEMACH_MEAS_ALL_FILTERED_TCYCLE (202)
211 #define LTC_STATEMACH_MEAS_SINGLE_FAST_TCYCLE (1)
217 #define LTC_STATEMACH_MEAS_SINGLE_NORMAL_TCYCLE (1)
223 #define LTC_STATEMACH_MEAS_SINGLE_FILTERED_TCYCLE (35)
226 #define LTC_STATEMACH_SEQERRTTIME (5)
228 #define LTC_STATEMACH_PECERRTIME (1)
234 #define LTC_TRANSMIT_PECERRLIMIT (10)
240 #define LTC_TRANSMIT_SPIERRLIMIT (3)
243 #define LTC_READCOM (0)
253 #define LTC_STANDBY_PERIODIC_OPEN_WIRE_CHECK (false)
256 #define LTC_STANDBY_OPEN_WIRE_PERIOD_ms (600000)
259 #define LTC_NORMAL_PERIODIC_OPEN_WIRE_CHECK (false)
262 #define LTC_NORMAL_OPEN_WIRE_PERIOD_ms (600000)
265 #define LTC_CHARGE_PERIODIC_OPEN_WIRE_CHECK (false)
268 #define LTC_CHARGE_OPEN_WIRE_PERIOD_ms (600000)
271 #define LTC_ERROR_OPEN_WIRE_PERIOD_ms (30000)
287 #define LTC_NMBR_REQ_ADOW_COMMANDS (2)
293 #define LTC_TransmitWakeUp(spi_ltcInterface) SPI_TransmitDummyByte(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US)
294 #define LTC_TransmitI2cCommand(spi_ltcInterface, txbuf) \
295 SPI_TransmitDataWithDummy(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US, txbuf, 4 + 9)
296 #define LTC_TransmitCommand(spi_ltcInterface, command) \
297 SPI_TransmitDataWithDummy(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US, command, 4)
298 #define LTC_TransmitReceiveData(spi_ltcInterface, txbuf, rxbuf, length) \
299 SPI_TransmitReceiveDataWithDummyDma(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US, txbuf, rxbuf, length)
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_MAX_SUPPORTED_CELLS
Defines the maximal number of supported cells per module.
#define BS_NR_OF_TEMP_SENSORS_PER_MODULE
number of temperature sensors per battery module
int16_t LTC_Convert_MuxVoltages_to_Temperatures(uint16_t adcVoltage_mV)
converts a raw voltage from multiplexer to a temperature value in deci °C.
const uint8_t ltc_muxsensortemperatur_cfg[BS_NR_OF_TEMP_SENSORS_PER_MODULE]
const uint8_t ltc_voltage_input_used[BS_MAX_SUPPORTED_CELLS]
LTC_MUX_SEQUENCE_s ltc_mux_seq
Headers for the configuration for the LTC monitoring chip.
Headers for the driver for the LTC monitoring chip.
Headers for the driver for the DMA module for the LTC.
Headers for the driver for the SPI module.