55 #ifndef FOXBMS__BMS_H_
56 #define FOXBMS__BMS_H_
299 #ifdef UNITY_UNIT_TEST
306 extern uint8_t TEST_BMS_CheckReEntrance(
void);
307 extern uint8_t TEST_BMS_CheckCanRequests(
void);
309 extern bool TEST_BMS_IsAnyFatalErrorFlagSet(
void);
310 extern void TEST_BMS_GetMeasurementValues(
void);
311 extern void TEST_BMS_CheckOpenSenseWire(
void);
Configuration of the battery system (e.g., number of battery modules, battery cells,...
@ BMS_CANSTATE_UNINITIALIZED
@ BMS_CANSTATE_INITIALIZED
@ BMS_CANSTATE_OPENCONTACTORS
@ BMS_CANSTATE_INITIALIZATION
bool BMS_IsStringPrecharging(uint8_t stringNumber)
Returns if string is currently precharging or not.
enum BMS_CHECK BMS_CHECK_e
bool BMS_IsTransitionToErrorStateActive(void)
Check if transition in to error state is active.
enum BMS_RETURN_TYPE BMS_RETURN_TYPE_e
BMS_RETURN_TYPE_e BMS_SetStateRequest(BMS_STATE_REQUEST_e statereq)
sets the current state request of the state variable bms_state.
@ BMS_ALREADY_INITIALIZED
enum BMS_STATE_REQUEST BMS_STATE_REQUEST_e
enum BMS_STATEMACH BMS_STATEMACH_e
enum BMS_CURRENT_FLOW_STATE BMS_CURRENT_FLOW_STATE_e
enum BMS_CANSTATE BMS_CANSTATE_e
struct BMS_STATE BMS_STATE_s
void BMS_Trigger(void)
trigger function for the SYS driver state machine.
uint8_t BMS_GetNumberOfConnectedStrings(void)
Returns number of connected strings.
enum BMS_STATEMACH_SUB BMS_STATEMACH_SUB_e
bool BMS_IsStringClosed(uint8_t stringNumber)
Returns string state (closed or open)
@ BMS_STATE_ERROR_REQUEST
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA)
Get current flow direction, current value as function parameter.
enum BMS_POWERLINE_TYPE BMS_POWERLINE_TYPE_e
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
@ BMS_DO_NOT_TAKE_PRECHARGE_INTO_ACCCOUNT
@ BMS_TAKE_PRECHARGE_INTO_ACCCOUNT
@ BMS_CHECK_ALL_PRECHARGES_OPEN
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE
@ BMS_PRECHARGE_OPEN_PRECHARGE
@ BMS_PRECHARGE_CLOSE_PRECHARGE
@ BMS_NORMAL_CLOSE_NEXT_STRING
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE_CLOSINGSTRINGS
@ BMS_OPEN_SECOND_CONTACTOR_MINUS
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE_FIRST_STRING
@ BMS_CHECK_BALANCING_REQUESTS
@ BMS_CHECK_ERROR_FLAGS_CLOSINGPRECHARGE
@ BMS_CHECK_INTERLOCK_CLOSE_AFTER_ERROR
@ BMS_PRECHARGE_CHECK_VOLTAGES
@ BMS_PRECHARGE_CLOSE_MINUS
@ BMS_CHECK_STRING_CLOSED
@ BMS_OPEN_ALL_PRECHARGES
@ BMS_OPEN_FIRST_CONTACTOR
@ BMS_CHECK_CONTACTOR_CHARGE_STATE
@ BMS_CHECK_ERROR_FLAGS_INTERLOCK
@ BMS_CHECK_STATE_REQUESTS
@ BMS_CLOSE_FIRST_STRING_PRECHARGE_STATE
@ BMS_CHECK_CONTACTOR_NORMAL_STATE
@ BMS_PRECHARGE_CLOSE_NEXT_STRING
@ BMS_OPEN_SECOND_CONTACTOR_PLUS
@ BMS_CHECK_CLOSE_FIRST_STRING_PRECHARGE_STATE
enum BMS_CONSIDER_PRECHARGE BMS_CONSIDER_PRECHARGE_e
@ BMS_STATEMACH_RESERVED1
@ BMS_STATEMACH_PRECHARGE
@ BMS_STATEMACH_UNDEFINED
@ BMS_STATEMACH_OPENCONTACTORS
@ BMS_STATEMACH_UNINITIALIZED
@ BMS_STATEMACH_INITIALIZATION
@ BMS_STATEMACH_DISCHARGE
@ BMS_STATEMACH_INITIALIZED
STD_RETURN_TYPE_e BMS_GetInitializationState(void)
Gets the initialization state.
BMS_STATEMACH_e BMS_GetState(void)
Returns the current state.
bms driver configuration header
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
uint8_t deactivatedStrings[BS_NR_OF_STRINGS]
BMS_STATEMACH_e nextstate
uint8_t numberOfClosedStrings
BMS_STATEMACH_e laststate
uint16_t stringCloseTimeout
BMS_STATE_REQUEST_e stateRequest
uint8_t firstClosedString
uint32_t minimumActiveDelay_ms
BMS_POWERLINE_TYPE_e powerline
uint8_t PrechargeTryCounter
uint16_t OscillationTimeout
BMS_STATEMACH_SUB_e substate
uint16_t prechargeOpenTimeout
uint16_t prechargeCloseTimeout
STD_RETURN_TYPE_e initFinished
uint32_t ErrRequestCounter
uint32_t nextstringclosedtimer
uint8_t closedStrings[BS_NR_OF_STRINGS]
BMS_STATEMACH_SUB_e lastsubstate
uint16_t stringOpenTimeout
bool transitionToErrorState
uint32_t remainingDelay_ms
uint8_t closedPrechargeContactors[BS_NR_OF_STRINGS]
BMS_CURRENT_FLOW_STATE_e currentFlowState