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