55 #ifndef FOXBMS__LTC_6806_CFG_H_
56 #define FOXBMS__LTC_6806_CFG_H_
75 #define SLAVE_BOARD_VERSION (2)
81 #define LTC_PORTEXPANDER_VERSION (1)
86 #define LTC_PORTEXPANDER_ADR_TI (0)
89 #define LTC_DISCARD_PEC (false)
92 #define LTC_N_MUX_PER_LTC (3)
95 #define LTC_N_MUX_CHANNELS_PER_MUX (8)
98 #define LTC_NUMBER_OF_MUX_MEASUREMENTS_PER_CYCLE (8)
101 #define LTC_N_MUX_CHANNELS_PER_LTC (LTC_N_MUX_PER_LTC * LTC_N_MUX_CHANNELS_PER_MUX)
104 #define LTC_NUMBER_OF_LTC_PER_MODULE (1u)
111 #define LTC_HIRNG (0u)
114 #define LTC_FUEL_CELL_ADOW_TIME_MS (100u + 1u)
117 #define LTC_ADOW_THRESHOLD (-200)
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_FUELCELL_NORMAL_ALL_CELLS_MS (11)
171 #define LTC_STATEMACH_SHORTTIME (1)
177 #define LTC_STATEMACH_DAISY_CHAIN_FIRST_INITIALIZATION_TIME ((LTC_TWAKE_US * LTC_N_LTC) / 1000)
182 #define LTC_STATEMACH_DAISY_CHAIN_SECOND_INITIALIZATION_TIME ((LTC_TREADY_US * LTC_N_LTC) / 1000)
192 #define LTC_STATEMACH_MEAS_ALL_FAST_TCYCLE (2)
198 #define LTC_STATEMACH_MEAS_ALL_NORMAL_TCYCLE (3)
204 #define LTC_STATEMACH_MEAS_ALL_FILTERED_TCYCLE (202)
214 #define LTC_STATEMACH_MEAS_SINGLE_FAST_TCYCLE (1)
220 #define LTC_STATEMACH_MEAS_SINGLE_NORMAL_TCYCLE (1)
226 #define LTC_STATEMACH_MEAS_SINGLE_FILTERED_TCYCLE (35)
229 #define LTC_STATEMACH_SEQERRTTIME (5)
231 #define LTC_STATEMACH_PECERRTIME (1)
237 #define LTC_TRANSMIT_PECERRLIMIT (10)
243 #define LTC_TRANSMIT_SPIERRLIMIT (3)
246 #define LTC_READCOM (0)
262 #define LTC_NMBR_REQ_ADOW_COMMANDS (2)
268 #define LTC_TRANSMIT_WAKE_UP(spi_ltcInterface) SPI_TransmitDummyByte(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US)
269 #define LTC_TRANSMIT_I2C_COMMAND(spi_ltcInterface, txbuf) \
270 SPI_TransmitDummyByte(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US); \
271 SPI_TransmitData(spi_ltcInterface, txbuf, 4 + 9)
272 #define LTC_TRANSMIT_COMMAND(spi_ltcInterface, command) \
273 SPI_TransmitDummyByte(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US); \
274 SPI_TransmitData(spi_ltcInterface, command, 4)
275 #define LTC_TRANSMIT_RECEIVE_DATA(spi_ltcInterface, txbuf, rxbuf, length) \
276 SPI_TransmitDummyByte(spi_ltcInterface, LTC_SPI_WAKEUP_WAIT_TIME_US); \
277 SPI_TransmitReceiveDataDma(spi_ltcInterface, 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
const uint8_t ltc_muxsensortemperatur_cfg[BS_NR_OF_TEMP_SENSORS_PER_MODULE]
const uint8_t ltc_voltage_input_used[BS_MAX_SUPPORTED_CELLS]
int16_t LTC_ConvertMuxVoltagesToTemperatures(uint16_t adcVoltage_mV)
converts a raw voltage from multiplexer to a temperature value in deci °C.
Headers for the driver for the DMA module for the LTC.
Headers for the configuration for the LTC monitoring chip.
Headers for the driver for the LTC monitoring chip.
Headers for the driver for the SPI module.