54 #ifndef FOXBMS__BAL_H_
55 #define FOXBMS__BAL_H_
231 #ifdef UNITY_UNIT_TEST
235 #ifdef UNITY_UNIT_TEST
237 extern BAL_STATE_s *TEST_BAL_GetBalancingState(
void);
enum BAL_STATEMACH BAL_STATEMACH_e
STD_RETURN_TYPE_e BAL_GetInitializationState(void)
gets the initialization state.
STD_RETURN_TYPE_e BAL_Init(DATA_BLOCK_BALANCING_CONTROL_s *pControl)
Generic initialization function for the balancing module.
@ BAL_STATEMACH_ALLOWBALANCING
@ BAL_STATEMACH_UNINITIALIZED
@ BAL_STATEMACH_INITIALIZATION
@ BAL_STATEMACH_GLOBALENABLE
@ BAL_STATEMACH_NO_BALANCING
@ BAL_STATEMACH_RESERVED1
@ BAL_STATEMACH_GLOBALDISABLE
@ BAL_STATEMACH_INITIALIZED
@ BAL_STATEMACH_CHECK_BALANCING
@ BAL_STATEMACH_UNDEFINED
void BAL_SaveLastStates(BAL_STATE_s *pBalancingState)
Saves the last state and the last substate.
struct BAL_STATE BAL_STATE_s
void BAL_ProcessStateInitialization(BAL_STATE_s *currentState)
State machine subfunction to initialize the balancing state machine.
enum BAL_STATE_REQUEST BAL_STATE_REQUEST_e
@ BAL_ALREADY_INITIALIZED
void BAL_ProcessStateUninitalized(BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest)
Substate handling function for BAL_Trigger()
@ BAL_CHECK_LOWEST_VOLTAGE
BAL_RETURN_TYPE_e BAL_SetStateRequest(BAL_STATE_REQUEST_e stateRequest)
sets the current state request of the state variable bal_state.
BAL_STATE_REQUEST_e BAL_TransferStateRequest(BAL_STATE_s *currentState)
transfers the current state request to the state machine.
void BAL_ProcessStateInitialized(BAL_STATE_s *currentState)
State machine subfunction to transfer from an initalized state to "running" states of th state machin...
@ BAL_STATE_GLOBAL_ENABLE_REQUEST
@ BAL_STATE_ERROR_REQUEST
@ BAL_STATE_ALLOWBALANCING_REQUEST
@ BAL_STATE_NO_BALANCING_REQUEST
@ BAL_STATE_GLOBAL_DISABLE_REQUEST
uint8_t BAL_CheckReEntrance(BAL_STATE_s *currentState)
re-entrance check of BAL state machine trigger function
void BAL_Trigger(void)
trigger function for the BAL driver state machine.
enum BAL_STATEMACH_SUB BAL_STATEMACH_SUB_e
BAL_RETURN_TYPE_e BAL_CheckStateRequest(BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest)
checks the state requests that are made.
enum BAL_RETURN_TYPE BAL_RETURN_TYPE_e
Header for the configuration for the driver for balancing.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
BAL_STATEMACH_SUB_e substate
bool balancingGlobalAllowed
BAL_STATE_REQUEST_e stateRequest
uint32_t errorRequestCounter
STD_RETURN_TYPE_e initializationFinished
BAL_STATEMACH_e lastState
int32_t balancingThreshold