foxBMS
1.1.0
The foxBMS Battery Management System API Documentation
|
Driver for the Balancing module. More...
#include "bal.h"
Go to the source code of this file.
Functions | |
void | BAL_SaveLastStates (BAL_STATE_s *pBalancingState) |
Saves the last state and the last substate. More... | |
uint8_t | BAL_CheckReEntrance (BAL_STATE_s *currentState) |
re-entrance check of BAL state machine trigger function More... | |
BAL_STATE_REQUEST_e | BAL_TransferStateRequest (BAL_STATE_s *currentState) |
transfers the current state request to the state machine. More... | |
BAL_RETURN_TYPE_e | BAL_CheckStateRequest (BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest) |
checks the state requests that are made. More... | |
STD_RETURN_TYPE_e | BAL_Init (DATA_BLOCK_BALANCING_CONTROL_s *pControl) |
Generic initialization function for the balancing module. More... | |
void | BAL_ProcessStateUninitalized (BAL_STATE_s *pCurrentState, BAL_STATE_REQUEST_e stateRequest) |
Substate handling function for BAL_Trigger() More... | |
void | BAL_ProcessStateInitialization (BAL_STATE_s *currentState) |
State machine subfunction to initialize the balancing state machine. More... | |
void | BAL_ProcessStateInitialized (BAL_STATE_s *currentState) |
State machine subfunction to transfer from an initalized state to "running" states of th state machine. More... | |
Driver for the Balancing module.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file bal.c.
uint8_t BAL_CheckReEntrance | ( | BAL_STATE_s * | currentState | ) |
re-entrance check of BAL state machine trigger function
This function is not re-entrant and should only be called time- or event-triggered. It increments the triggerentry counter from the state variable. It should never be called by two different processes, so if it is the case, triggerentry should never be higher than 0 when this function is called.
Definition at line 82 of file bal.c.
BAL_RETURN_TYPE_e BAL_CheckStateRequest | ( | BAL_STATE_s * | pCurrentState, |
BAL_STATE_REQUEST_e | stateRequest | ||
) |
checks the state requests that are made.
This function checks the validity of the state requests. The results of the checked is returned immediately.
pCurrentState | pointer to the current state |
stateRequest | state request to be checked |
STD_RETURN_TYPE_e BAL_Init | ( | DATA_BLOCK_BALANCING_CONTROL_s * | pControl | ) |
void BAL_ProcessStateInitialization | ( | BAL_STATE_s * | currentState | ) |
void BAL_ProcessStateInitialized | ( | BAL_STATE_s * | currentState | ) |
void BAL_ProcessStateUninitalized | ( | BAL_STATE_s * | pCurrentState, |
BAL_STATE_REQUEST_e | stateRequest | ||
) |
Substate handling function for BAL_Trigger()
pCurrentState | pointer to the current state |
stateRequest | state request to set |
void BAL_SaveLastStates | ( | BAL_STATE_s * | pBalancingState | ) |
BAL_STATE_REQUEST_e BAL_TransferStateRequest | ( | BAL_STATE_s * | currentState | ) |
transfers the current state request to the state machine.
This function takes the current state request from current state and transfers it to the state machine. It resets the value from to BAL_STATE_NO_REQUEST
Definition at line 97 of file bal.c.