55 #ifndef FOXBMS__BMS_H_
56 #define FOXBMS__BMS_H_
297 #ifdef UNITY_UNIT_TEST
Configuration of the battery system (e.g., number of battery modules, battery cells,...
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
enum BMS_POWER_PATH_TYPE BMS_POWER_PATH_TYPE_e
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.
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_STATE_REQUEST_e TEST_BMS_TransferStateRequest(void)
@ BMS_ALREADY_INITIALIZED
enum BMS_STATE_REQUEST BMS_STATE_REQUEST_e
enum BMS_STATEMACH BMS_STATEMACH_e
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)
enum BMS_CURRENT_FLOW_STATE BMS_CURRENT_FLOW_STATE_e
uint8_t TEST_BMS_CheckReEntrance(void)
enum BMS_CANSTATE BMS_CANSTATE_e
struct BMS_STATE BMS_STATE_s
void TEST_BMS_GetMeasurementValues(void)
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.
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)
void TEST_BMS_UpdateBatsysState(DATA_BLOCK_PACK_VALUES_s *pPackValues)
@ 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_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.
uint8_t TEST_BMS_GetHighestString(BMS_CONSIDER_PRECHARGE_e precharge, DATA_BLOCK_PACK_VALUES_s *pPackValues)
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_POWER_PATH_TYPE_e powerPath
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