foxBMS - Unit Tests  1.6.0
The foxBMS Unit Tests API Documentation
bms.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file bms.h
44  * @author foxBMS Team
45  * @date 2020-02-24 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup ENGINE
49  * @prefix BMS
50  *
51  * @brief bms driver header
52  *
53  *
54  */
55 
56 #ifndef FOXBMS__BMS_H_
57 #define FOXBMS__BMS_H_
58 
59 /*========== Includes =======================================================*/
60 #include "battery_system_cfg.h"
61 #include "bms_cfg.h"
62 
63 #include "contactor.h"
64 #include "fstd_types.h"
65 
66 #include <stdbool.h>
67 #include <stdint.h>
68 
69 /*========== Macros and Definitions =========================================*/
70 
71 /** Symbolic names for battery system state */
72 typedef enum {
73  BMS_CHARGING, /*!< battery is charged */
74  BMS_DISCHARGING, /*!< battery is discharged */
75  BMS_RELAXATION, /*!< battery relaxation ongoing */
76  BMS_AT_REST, /*!< battery is resting */
78 
79 /** Symbolic names for busyness of the syscontrol */
80 typedef enum {
81  BMS_CHECK_OK, /*!< syscontrol ok */
82  BMS_CHECK_BUSY, /*!< syscontrol busy */
83  BMS_CHECK_NOT_OK, /*!< syscontrol not ok */
84 } BMS_CHECK_e;
85 
86 /** Symbolic names to take precharge into account or not */
87 typedef enum {
88  BMS_DO_NOT_TAKE_PRECHARGE_INTO_ACCCOUNT, /*!< do not take precharge into account */
89  BMS_TAKE_PRECHARGE_INTO_ACCCOUNT, /*!< do take precharge into account */
91 
92 /** States of the SYS state machine */
93 typedef enum {
94  /* Init-Sequence */
109 
110 /** CAN states of the BMS state machine */
111 typedef enum {
112  /* Init-Sequence */
124 
125 /** Substates of the SYS state machine */
126 typedef enum {
127  BMS_ENTRY, /*!< Substate entry state */
128  BMS_CHECK_ERROR_FLAGS_INTERLOCK, /*!< Substate check measurements after interlock closed */
129  BMS_INTERLOCK_CHECKED, /*!< Substate interlocked checked */
130  BMS_CHECK_STATE_REQUESTS, /*!< Substate check if there is a state request */
131  BMS_CHECK_BALANCING_REQUESTS, /*!< Substate check if there is a balancing request */
132  BMS_CHECK_ERROR_FLAGS, /*!< Substate check if any error flag set */
133  BMS_CHECK_CONTACTOR_NORMAL_STATE, /*!< Substate in precharge, check if there contactors reached normal */
134  BMS_CHECK_CONTACTOR_CHARGE_STATE, /*!< Substate in precharge, check if there contactors reached normal */
161 
162 /** State requests for the BMS state machine */
163 typedef enum {
164  BMS_STATE_INIT_REQUEST, /*!< request for initialization */
165  BMS_STATE_ERROR_REQUEST, /*!< request for ERROR state */
166  BMS_STATE_NO_REQUEST, /*!< dummy request for no request */
168 
169 /** Possible return values when state requests are made to the BMS state machine */
170 typedef enum {
171  BMS_OK, /*!< request was successful */
172  BMS_REQUEST_PENDING, /*!< error: another request is currently processed */
173  BMS_ILLEGAL_REQUEST, /*!< error: request can not be executed */
174  BMS_ALREADY_INITIALIZED, /*!< error: BMS state machine already initialized */
176 
177 /** Power path type (discharge or charge) */
178 typedef enum {
179  BMS_POWER_PATH_OPEN, /* contactors open */
180  BMS_POWER_PATH_0, /* power path */
181  BMS_POWER_PATH_1, /* second power path */
183 
184 /**
185  * This structure contains all the variables relevant for the CONT state
186  * machine. The user can get the current state of the CONT state machine with
187  * this variable
188  */
189 typedef struct {
190  uint16_t timer; /*!< time in ms before the state machine processes the next state, e.g. in counts of 1ms */
191  BMS_STATE_REQUEST_e stateRequest; /*!< current state request made to the state machine */
192  BMS_STATEMACH_e state; /*!< current state of State Machine */
193  BMS_STATEMACH_SUB_e substate; /*!< current substate of the state machine */
194  BMS_STATEMACH_e laststate; /*!< previous state of the state machine */
195  BMS_STATEMACH_SUB_e lastsubstate; /*!< previous substate of the state machine */
196  uint32_t ErrRequestCounter; /*!< counts the number of illegal requests to the LTC state machine */
197  STD_RETURN_TYPE_e initFinished; /*!< #STD_OK if the initialization has passed, #STD_NOT_OK otherwise */
198  uint8_t triggerentry; /*!< counter for re-entrance protection (function running flag) */
199  uint8_t counter; /*!< general purpose counter */
200  BMS_CURRENT_FLOW_STATE_e currentFlowState; /*!< state of battery system */
201  uint32_t restTimer_10ms; /*!< timer until battery system is at rest */
202  uint16_t OscillationTimeout; /*!< timeout to prevent oscillation of contactors */
203  uint8_t prechargeTryCounter; /*!< timeout to prevent oscillation of contactors */
204  BMS_POWER_PATH_TYPE_e powerPath; /*!< power path type (discharge or charge) */
205  uint8_t numberOfClosedStrings; /*!< number of closed strings */
206  uint16_t stringOpenTimeout; /*!< timeout to abort if string opening takes too long */
207  uint32_t nextstringclosedtimer; /*!< timer to wait if the next string was closed */
208  uint16_t stringCloseTimeout; /*!< timeout to abort if a string takes too long to close */
209  BMS_STATEMACH_e nextstate; /*!< next state of the State Machine */
210  uint8_t firstClosedString; /*!< strings with highest or lowest voltage, that was closed first */
211  uint16_t prechargeOpenTimeout; /*!< timeout to abort if string opening takes too long */
212  uint16_t prechargeCloseTimeout; /*!< timeout to abort if a string takes too long to close */
213  uint32_t remainingDelay_ms; /*!< time until state machine should switch to error state */
214  uint32_t minimumActiveDelay_ms; /*!< minimum delay time of all active fatal errors */
215  uint32_t timeAboveContactorBreakCurrent_ms; /*!< duration of current flow above maximum contactor break current */
216  uint8_t stringToBeOpened; /*!< string that is currently opened */
217  CONT_TYPE_e contactorToBeOpened; /*!< contactor that is currently opened */
218  bool transitionToErrorState; /*!< flag if fatal error has been detected and delay is active */
219  uint8_t closedPrechargeContactors[BS_NR_OF_STRINGS]; /*!< strings whose precharge contactors are closed */
220  uint8_t closedStrings[BS_NR_OF_STRINGS]; /*!< strings whose contactors are closed */
221  uint8_t deactivatedStrings[BS_NR_OF_STRINGS]; /*!< Deactivated strings after error detection, cannot be closed */
222 } BMS_STATE_s;
223 
224 /*========== Extern Constant and Variable Declarations ======================*/
225 
226 /*========== Extern Function Prototypes =====================================*/
227 /**
228  * @brief sets the current state request of the state variable bms_state.
229  * @details This function is used to make a state request to the state machine,
230  * e.g, start voltage measurement, read result of voltage measurement,
231  * re-initialization.
232  * It calls #BMS_CheckStateRequest() to check if the request is valid.
233  * The state request is rejected if is not valid. The result of the
234  * check is returned immediately, so that the requester can act in
235  * case it made a non-valid state request.
236  * @param statereq state request to set
237  * @return current state request
238  */
240 
241 /**
242  * @brief Returns the current state.
243  * @details This function is used in the functioning of the SYS state machine.
244  * @return current state, taken from BMS_STATEMACH_e
245  */
246 extern BMS_STATEMACH_e BMS_GetState(void);
247 
248 /**
249  * @brief Gets the initialization state.
250  * @details This function is used for getting the BMS initialization state.
251  * @return #STD_OK if initialized, otherwise #STD_NOT_OK
252  */
254 
255 /**
256  * @brief trigger function for the BMS driver state machine.
257  * @details This function contains the sequence of events in the BMS state
258  * machine.
259  * It must be called time-triggered, every 10 milliseconds.
260  * This function needs to be adapted to be adapted to the behavior
261  * the batter system shall provide to the target application.
262  */
263 extern void BMS_Trigger(void);
264 
265 /**
266  * @brief Returns current battery system state (charging/discharging,
267  * resting or in relaxation phase)
268  *
269  * @return #BMS_CURRENT_FLOW_STATE_e
270  */
272 
273 /**
274  * @brief Get current flow direction, current value as function parameter
275  * @param[in] current_mA current that is flowing
276  * @return #BMS_DISCHARGING or #BMS_CHARGING depending on current direction.
277  * Return #BMS_AT_REST. ((type: #BMS_CURRENT_FLOW_STATE_e)
278  */
279 extern BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA);
280 
281 /**
282  * @brief Returns string state (closed or open)
283  * @param[in] stringNumber string addressed
284  * @return false if string is open, true if string is closed
285  */
286 extern bool BMS_IsStringClosed(uint8_t stringNumber);
287 
288 /**
289  * @brief Returns if string is currently precharging or not
290  * @param[in] stringNumber string addressed
291  * @return false if precharge contactor is open, true if closed and string is
292  * precharging
293  */
294 extern bool BMS_IsStringPrecharging(uint8_t stringNumber);
295 
296 /**
297  * @brief Returns number of connected strings
298  * @return Returns number of connected strings
299  */
300 extern uint8_t BMS_GetNumberOfConnectedStrings(void);
301 
302 /**
303  * @brief Check if transition in to error state is active
304  * @return True, if transition into error state is ongoing, otherwise false
305  */
306 extern bool BMS_IsTransitionToErrorStateActive(void);
307 
308 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
309 #ifdef UNITY_UNIT_TEST
310 /* database.h is only included in bms.c and there used as function parameter
311  * for static functions. Thus, we need to add the required include here. */
312 #include "database.h"
313 
316 extern uint8_t TEST_BMS_CheckReEntrance(void);
317 extern uint8_t TEST_BMS_CheckCanRequests(void);
319 extern bool TEST_BMS_IsAnyFatalErrorFlagSet(void);
320 extern void TEST_BMS_GetMeasurementValues(void);
321 extern void TEST_BMS_CheckOpenSenseWire(void);
322 extern STD_RETURN_TYPE_e TEST_BMS_CheckPrecharge(uint8_t stringNumber, DATA_BLOCK_PACK_VALUES_s *pPackValues);
323 extern uint8_t TEST_BMS_GetHighestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues);
324 extern uint8_t TEST_BMS_GetClosestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues);
325 extern uint8_t TEST_BMS_GetLowestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues);
326 extern int32_t TEST_BMS_GetStringVoltageDifference(uint8_t string, DATA_BLOCK_PACK_VALUES_s *pPackValues);
328 extern void TEST_BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues);
329 #endif
330 
331 #endif /* FOXBMS__BMS_H_ */
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
uint8_t TEST_BMS_GetLowestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1676
void TEST_BMS_CheckOpenSenseWire(void)
Definition: bms.c:1663
uint8_t TEST_BMS_GetClosestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1672
BMS_CANSTATE_e
Definition: bms.h:111
@ BMS_CANSTATE_UNINITIALIZED
Definition: bms.h:113
@ BMS_CANSTATE_INITIALIZED
Definition: bms.h:115
@ BMS_CANSTATE_NORMAL
Definition: bms.h:120
@ BMS_CANSTATE_CHARGE
Definition: bms.h:121
@ BMS_CANSTATE_STANDBY
Definition: bms.h:118
@ BMS_CANSTATE_ERROR
Definition: bms.h:122
@ BMS_CANSTATE_OPENCONTACTORS
Definition: bms.h:117
@ BMS_CANSTATE_INITIALIZATION
Definition: bms.h:114
@ BMS_CANSTATE_IDLE
Definition: bms.h:116
@ BMS_CANSTATE_PRECHARGE
Definition: bms.h:119
BMS_RETURN_TYPE_e TEST_BMS_CheckStateRequest(BMS_STATE_REQUEST_e statereq)
Definition: bms.c:1642
BMS_CHECK_e
Definition: bms.h:80
@ BMS_CHECK_OK
Definition: bms.h:81
@ BMS_CHECK_NOT_OK
Definition: bms.h:83
@ BMS_CHECK_BUSY
Definition: bms.h:82
bool BMS_IsStringPrecharging(uint8_t stringNumber)
Returns if string is currently precharging or not.
Definition: bms.c:1623
bool BMS_IsTransitionToErrorStateActive(void)
Check if transition in to error state is active.
Definition: bms.c:1636
BMS_RETURN_TYPE_e BMS_SetStateRequest(BMS_STATE_REQUEST_e statereq)
sets the current state request of the state variable bms_state.
Definition: bms.c:811
BMS_STATE_REQUEST_e TEST_BMS_TransferStateRequest(void)
Definition: bms.c:1645
STD_RETURN_TYPE_e TEST_BMS_CheckPrecharge(uint8_t stringNumber, DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1666
int32_t TEST_BMS_GetStringVoltageDifference(uint8_t string, DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1679
uint8_t TEST_BMS_CheckCanRequests(void)
Definition: bms.c:1651
BMS_CONSIDER_PRECHARGE_e
Definition: bms.h:87
@ BMS_DO_NOT_TAKE_PRECHARGE_INTO_ACCCOUNT
Definition: bms.h:88
@ BMS_TAKE_PRECHARGE_INTO_ACCCOUNT
Definition: bms.h:89
BMS_STATE_REQUEST_e
Definition: bms.h:163
@ BMS_STATE_NO_REQUEST
Definition: bms.h:166
@ BMS_STATE_INIT_REQUEST
Definition: bms.h:164
@ BMS_STATE_ERROR_REQUEST
Definition: bms.h:165
uint8_t TEST_BMS_CheckReEntrance(void)
Definition: bms.c:1648
void TEST_BMS_GetMeasurementValues(void)
Definition: bms.c:1660
void BMS_Trigger(void)
trigger function for the BMS driver state machine.
Definition: bms.c:825
uint8_t BMS_GetNumberOfConnectedStrings(void)
Returns number of connected strings.
Definition: bms.c:1632
BMS_STATEMACH_SUB_e
Definition: bms.h:126
@ BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR
Definition: bms.h:152
@ BMS_CHECK_ALL_PRECHARGES_OPEN
Definition: bms.h:154
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE
Definition: bms.h:144
@ BMS_PRECHARGE_OPEN_PRECHARGE
Definition: bms.h:138
@ BMS_OPEN_SECOND_STRING_CONTACTOR
Definition: bms.h:157
@ BMS_OPEN_STRINGS_EXIT
Definition: bms.h:159
@ BMS_PRECHARGE_CLOSE_PRECHARGE
Definition: bms.h:136
@ BMS_NORMAL_CLOSE_NEXT_STRING
Definition: bms.h:151
@ BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE
Definition: bms.h:143
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE_CLOSINGSTRINGS
Definition: bms.h:149
@ BMS_ENTRY
Definition: bms.h:127
@ BMS_OPEN_SECOND_CONTACTOR_MINUS
Definition: bms.h:141
@ BMS_INTERLOCK_CHECKED
Definition: bms.h:129
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING
Definition: bms.h:145
@ BMS_OPEN_STRINGS_ENTRY
Definition: bms.h:155
@ BMS_CHECK_BALANCING_REQUESTS
Definition: bms.h:131
@ BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE
Definition: bms.h:150
@ BMS_CLOSE_SECOND_CONTACTOR_PLUS
Definition: bms.h:147
@ BMS_PRECHARGE_CHECK_VOLTAGES
Definition: bms.h:137
@ BMS_PRECHARGE_CLOSE_MINUS
Definition: bms.h:135
@ BMS_CHECK_STRING_CLOSED
Definition: bms.h:148
@ BMS_PRECHARGE_CHECK_OPEN_PRECHARGE
Definition: bms.h:139
@ BMS_CHECK_ERROR_FLAGS
Definition: bms.h:132
@ BMS_OPEN_ALL_PRECHARGES
Definition: bms.h:153
@ BMS_OPEN_FIRST_CONTACTOR
Definition: bms.h:140
@ BMS_CHECK_CONTACTOR_CHARGE_STATE
Definition: bms.h:134
@ BMS_CHECK_ERROR_FLAGS_INTERLOCK
Definition: bms.h:128
@ BMS_CHECK_STATE_REQUESTS
Definition: bms.h:130
@ BMS_CHECK_CONTACTOR_NORMAL_STATE
Definition: bms.h:133
@ BMS_PRECHARGE_CLOSE_NEXT_STRING
Definition: bms.h:146
@ BMS_OPEN_SECOND_CONTACTOR_PLUS
Definition: bms.h:142
@ BMS_OPEN_FIRST_STRING_CONTACTOR
Definition: bms.h:156
@ BMS_CHECK_SECOND_STRING_CONTACTOR
Definition: bms.h:158
bool BMS_IsStringClosed(uint8_t stringNumber)
Returns string state (closed or open)
Definition: bms.c:1614
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA)
Get current flow direction, current value as function parameter.
Definition: bms.c:1590
STD_RETURN_TYPE_e TEST_BMS_IsBatterySystemStateOkay(void)
Definition: bms.c:1657
BMS_POWER_PATH_TYPE_e
Definition: bms.h:178
@ BMS_POWER_PATH_1
Definition: bms.h:181
@ BMS_POWER_PATH_OPEN
Definition: bms.h:179
@ BMS_POWER_PATH_0
Definition: bms.h:180
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
Definition: bms.c:1586
int32_t TEST_BMS_GetAverageStringCurrent(DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1682
bool TEST_BMS_IsAnyFatalErrorFlagSet(void)
Definition: bms.c:1654
BMS_STATEMACH_e
Definition: bms.h:93
@ BMS_STATEMACH_RESERVED1
Definition: bms.h:107
@ BMS_STATEMACH_PRECHARGE
Definition: bms.h:101
@ BMS_STATEMACH_STANDBY
Definition: bms.h:100
@ BMS_STATEMACH_CHARGE
Definition: bms.h:104
@ BMS_STATEMACH_UNDEFINED
Definition: bms.h:106
@ BMS_STATEMACH_UNINITIALIZED
Definition: bms.h:95
@ BMS_STATEMACH_ERROR
Definition: bms.h:105
@ BMS_STATEMACH_NORMAL
Definition: bms.h:102
@ BMS_STATEMACH_INITIALIZATION
Definition: bms.h:96
@ BMS_STATEMACH_DISCHARGE
Definition: bms.h:103
@ BMS_STATEMACH_OPEN_CONTACTORS
Definition: bms.h:99
@ BMS_STATEMACH_INITIALIZED
Definition: bms.h:97
@ BMS_STATEMACH_IDLE
Definition: bms.h:98
BMS_CURRENT_FLOW_STATE_e
Definition: bms.h:72
@ BMS_AT_REST
Definition: bms.h:76
@ BMS_DISCHARGING
Definition: bms.h:74
@ BMS_CHARGING
Definition: bms.h:73
@ BMS_RELAXATION
Definition: bms.h:75
void TEST_BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1685
BMS_RETURN_TYPE_e
Definition: bms.h:170
@ BMS_OK
Definition: bms.h:171
@ BMS_REQUEST_PENDING
Definition: bms.h:172
@ BMS_ALREADY_INITIALIZED
Definition: bms.h:174
@ BMS_ILLEGAL_REQUEST
Definition: bms.h:173
STD_RETURN_TYPE_e BMS_GetInitializationState(void)
Gets the initialization state.
Definition: bms.c:803
BMS_STATEMACH_e BMS_GetState(void)
Returns the current state.
Definition: bms.c:807
uint8_t TEST_BMS_GetHighestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
Definition: bms.c:1669
bms driver configuration header
Headers for the driver for the contactors.
CONT_TYPE_e
Definition: contactor_cfg.h:85
Database module header.
Definition of foxBMS standard types.
STD_RETURN_TYPE_e
Definition: fstd_types.h:82
uint32_t restTimer_10ms
Definition: bms.h:201
uint8_t prechargeTryCounter
Definition: bms.h:203
uint8_t counter
Definition: bms.h:199
bool transitionToErrorState
Definition: bms.h:218
uint16_t timer
Definition: bms.h:190
uint16_t prechargeOpenTimeout
Definition: bms.h:211
BMS_CURRENT_FLOW_STATE_e currentFlowState
Definition: bms.h:200
BMS_STATEMACH_SUB_e lastsubstate
Definition: bms.h:195
uint8_t triggerentry
Definition: bms.h:198
STD_RETURN_TYPE_e initFinished
Definition: bms.h:197
BMS_STATEMACH_e nextstate
Definition: bms.h:209
uint16_t prechargeCloseTimeout
Definition: bms.h:212
uint8_t firstClosedString
Definition: bms.h:210
CONT_TYPE_e contactorToBeOpened
Definition: bms.h:217
uint32_t nextstringclosedtimer
Definition: bms.h:207
BMS_STATEMACH_e laststate
Definition: bms.h:194
BMS_STATE_REQUEST_e stateRequest
Definition: bms.h:191
uint8_t stringToBeOpened
Definition: bms.h:216
uint32_t ErrRequestCounter
Definition: bms.h:196
uint32_t minimumActiveDelay_ms
Definition: bms.h:214
uint8_t numberOfClosedStrings
Definition: bms.h:205
BMS_STATEMACH_e state
Definition: bms.h:192
uint16_t stringCloseTimeout
Definition: bms.h:208
BMS_STATEMACH_SUB_e substate
Definition: bms.h:193
uint16_t stringOpenTimeout
Definition: bms.h:206
uint32_t timeAboveContactorBreakCurrent_ms
Definition: bms.h:215
BMS_POWER_PATH_TYPE_e powerPath
Definition: bms.h:204
uint32_t remainingDelay_ms
Definition: bms.h:213
uint16_t OscillationTimeout
Definition: bms.h:202