56 #ifndef FOXBMS__BMS_H_
57 #define FOXBMS__BMS_H_
309 #ifdef UNITY_UNIT_TEST
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)
void TEST_BMS_CheckOpenSenseWire(void)
uint8_t TEST_BMS_GetClosestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
@ BMS_CANSTATE_UNINITIALIZED
@ BMS_CANSTATE_INITIALIZED
@ BMS_CANSTATE_OPENCONTACTORS
@ BMS_CANSTATE_INITIALIZATION
BMS_RETURN_TYPE_e TEST_BMS_CheckStateRequest(BMS_STATE_REQUEST_e statereq)
bool BMS_IsStringPrecharging(uint8_t stringNumber)
Returns if string is currently precharging or not.
bool BMS_IsTransitionToErrorStateActive(void)
Check if transition in to error state is active.
BMS_RETURN_TYPE_e BMS_SetStateRequest(BMS_STATE_REQUEST_e statereq)
sets the current state request of the state variable bms_state.
BMS_STATE_REQUEST_e TEST_BMS_TransferStateRequest(void)
STD_RETURN_TYPE_e TEST_BMS_CheckPrecharge(uint8_t stringNumber, DATA_BLOCK_PACK_VALUES_s *pPackValues)
int32_t TEST_BMS_GetStringVoltageDifference(uint8_t string, DATA_BLOCK_PACK_VALUES_s *pPackValues)
uint8_t TEST_BMS_CheckCanRequests(void)
@ BMS_DO_NOT_TAKE_PRECHARGE_INTO_ACCCOUNT
@ BMS_TAKE_PRECHARGE_INTO_ACCCOUNT
@ BMS_STATE_ERROR_REQUEST
uint8_t TEST_BMS_CheckReEntrance(void)
void TEST_BMS_GetMeasurementValues(void)
void BMS_Trigger(void)
trigger function for the BMS driver state machine.
uint8_t BMS_GetNumberOfConnectedStrings(void)
Returns number of connected strings.
@ BMS_NORMAL_CLOSE_SECOND_STRING_CONTACTOR
@ BMS_CHECK_ALL_PRECHARGES_OPEN
@ BMS_CHECK_ERROR_FLAGS_PRECHARGE
@ BMS_PRECHARGE_OPEN_PRECHARGE
@ BMS_OPEN_SECOND_STRING_CONTACTOR
@ BMS_PRECHARGE_CLOSE_PRECHARGE
@ BMS_NORMAL_CLOSE_NEXT_STRING
@ BMS_CHECK_CLOSE_SECOND_STRING_CONTACTOR_PRECHARGE_STATE
@ 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_CLOSE_SECOND_CONTACTOR_PLUS
@ BMS_PRECHARGE_CHECK_VOLTAGES
@ BMS_PRECHARGE_CLOSE_MINUS
@ BMS_CHECK_STRING_CLOSED
@ BMS_PRECHARGE_CHECK_OPEN_PRECHARGE
@ BMS_OPEN_ALL_PRECHARGES
@ BMS_OPEN_FIRST_CONTACTOR
@ BMS_CHECK_CONTACTOR_CHARGE_STATE
@ BMS_CHECK_ERROR_FLAGS_INTERLOCK
@ BMS_CHECK_STATE_REQUESTS
@ BMS_CHECK_CONTACTOR_NORMAL_STATE
@ BMS_PRECHARGE_CLOSE_NEXT_STRING
@ BMS_OPEN_SECOND_CONTACTOR_PLUS
@ BMS_OPEN_FIRST_STRING_CONTACTOR
@ BMS_CHECK_SECOND_STRING_CONTACTOR
bool BMS_IsStringClosed(uint8_t stringNumber)
Returns string state (closed or open)
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA)
Get current flow direction, current value as function parameter.
STD_RETURN_TYPE_e TEST_BMS_IsBatterySystemStateOkay(void)
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState(void)
Returns current battery system state (charging/discharging, resting or in relaxation phase)
int32_t TEST_BMS_GetAverageStringCurrent(DATA_BLOCK_PACK_VALUES_s *pPackValues)
bool TEST_BMS_IsAnyFatalErrorFlagSet(void)
@ BMS_STATEMACH_RESERVED1
@ BMS_STATEMACH_PRECHARGE
@ BMS_STATEMACH_UNDEFINED
@ BMS_STATEMACH_UNINITIALIZED
@ BMS_STATEMACH_INITIALIZATION
@ BMS_STATEMACH_DISCHARGE
@ BMS_STATEMACH_OPEN_CONTACTORS
@ BMS_STATEMACH_INITIALIZED
void TEST_BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues)
@ BMS_ALREADY_INITIALIZED
STD_RETURN_TYPE_e BMS_GetInitializationState(void)
Gets the initialization state.
BMS_STATEMACH_e BMS_GetState(void)
Returns the current state.
uint8_t TEST_BMS_GetHighestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
bms driver configuration header
Definition of foxBMS standard types.
uint8_t PrechargeTryCounter
bool transitionToErrorState
uint16_t prechargeOpenTimeout
BMS_CURRENT_FLOW_STATE_e currentFlowState
BMS_STATEMACH_SUB_e lastsubstate
STD_RETURN_TYPE_e initFinished
BMS_STATEMACH_e nextstate
uint16_t prechargeCloseTimeout
uint8_t firstClosedString
CONT_TYPE_e contactorToBeOpened
uint32_t nextstringclosedtimer
BMS_STATEMACH_e laststate
BMS_STATE_REQUEST_e stateRequest
uint32_t ErrRequestCounter
uint32_t minimumActiveDelay_ms
uint8_t numberOfClosedStrings
uint16_t stringCloseTimeout
BMS_STATEMACH_SUB_e substate
uint16_t stringOpenTimeout
uint32_t timeAboveContactorBreakCurrent_ms
BMS_POWER_PATH_TYPE_e powerPath
uint32_t remainingDelay_ms
uint16_t OscillationTimeout