foxBMS - Unit Tests
1.2.1
The foxBMS Unit Tests API Documentation
|
bms driver header More...
Go to the source code of this file.
Data Structures | |
struct | BMS_STATE |
Typedefs | |
typedef enum BMS_CURRENT_FLOW_STATE | BMS_CURRENT_FLOW_STATE_e |
typedef enum BMS_CHECK | BMS_CHECK_e |
typedef enum BMS_CONSIDER_PRECHARGE | BMS_CONSIDER_PRECHARGE_e |
typedef enum BMS_STATEMACH | BMS_STATEMACH_e |
typedef enum BMS_CANSTATE | BMS_CANSTATE_e |
typedef enum BMS_STATEMACH_SUB | BMS_STATEMACH_SUB_e |
typedef enum BMS_STATE_REQUEST | BMS_STATE_REQUEST_e |
typedef enum BMS_RETURN_TYPE | BMS_RETURN_TYPE_e |
typedef enum BMS_POWER_PATH_TYPE | BMS_POWER_PATH_TYPE_e |
typedef struct BMS_STATE | BMS_STATE_s |
bms driver header
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 bms.h.
typedef enum BMS_CANSTATE BMS_CANSTATE_e |
CAN states of the BMS state machine
typedef enum BMS_CHECK BMS_CHECK_e |
Symbolic names for busyness of the syscontrol
typedef enum BMS_CONSIDER_PRECHARGE BMS_CONSIDER_PRECHARGE_e |
Symbolic names to take precharge into account or not
typedef enum BMS_CURRENT_FLOW_STATE BMS_CURRENT_FLOW_STATE_e |
Symbolic names for battery system state
typedef enum BMS_POWER_PATH_TYPE BMS_POWER_PATH_TYPE_e |
Power path type (discharge or charge)
typedef enum BMS_RETURN_TYPE BMS_RETURN_TYPE_e |
Possible return values when state requests are made to the SYS statemachine
typedef enum BMS_STATE_REQUEST BMS_STATE_REQUEST_e |
State requests for the BMS statemachine
typedef struct BMS_STATE BMS_STATE_s |
This structure contains all the variables relevant for the CONT state machine. The user can get the current state of the CONT state machine with this variable
typedef enum BMS_STATEMACH BMS_STATEMACH_e |
States of the SYS state machine
typedef enum BMS_STATEMACH_SUB BMS_STATEMACH_SUB_e |
Substates of the SYS state machine
enum BMS_CANSTATE |
enum BMS_CHECK |
enum BMS_POWER_PATH_TYPE |
enum BMS_RETURN_TYPE |
Possible return values when state requests are made to the SYS statemachine
enum BMS_STATE_REQUEST |
enum BMS_STATEMACH |
States of the SYS state machine
enum BMS_STATEMACH_SUB |
Substates of the SYS state machine
BMS_CURRENT_FLOW_STATE_e BMS_GetBatterySystemState | ( | void | ) |
Returns current battery system state (charging/discharging, resting or in relaxation phase)
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection | ( | int32_t | current_mA | ) |
Get current flow direction, current value as function parameter.
[in] | current_mA | current that is flowing |
STD_RETURN_TYPE_e BMS_GetInitializationState | ( | void | ) |
Gets the initialization state.
This function is used for getting the BMS initialization state.
uint8_t BMS_GetNumberOfConnectedStrings | ( | void | ) |
BMS_STATEMACH_e BMS_GetState | ( | void | ) |
bool BMS_IsStringClosed | ( | uint8_t | stringNumber | ) |
bool BMS_IsStringPrecharging | ( | uint8_t | stringNumber | ) |
bool BMS_IsTransitionToErrorStateActive | ( | void | ) |
BMS_RETURN_TYPE_e BMS_SetStateRequest | ( | BMS_STATE_REQUEST_e | statereq | ) |
sets the current state request of the state variable bms_state.
This function is used to make a state request to the state machine, e.g, start voltage measurement, read result of voltage measurement, re-initialization. It calls BMS_CheckStateRequest() to check if the request is valid. The state request is rejected if is not valid. The result of the check is returned immediately, so that the requester can act in case it made a non-valid state request.
statereq | state request to set |
Definition at line 633 of file bms.c.
void BMS_Trigger | ( | void | ) |
uint8_t TEST_BMS_CheckCanRequests | ( | void | ) |
void TEST_BMS_CheckOpenSenseWire | ( | void | ) |
STD_RETURN_TYPE_e TEST_BMS_CheckPrecharge | ( | uint8_t | stringNumber, |
DATA_BLOCK_PACK_VALUES_s * | pPackValues | ||
) |
uint8_t TEST_BMS_CheckReEntrance | ( | void | ) |
BMS_RETURN_TYPE_e TEST_BMS_CheckStateRequest | ( | BMS_STATE_REQUEST_e | statereq | ) |
int32_t TEST_BMS_GetAverageStringCurrent | ( | DATA_BLOCK_PACK_VALUES_s * | pPackValues | ) |
uint8_t TEST_BMS_GetClosestString | ( | BMS_CONSIDER_PRECHARGE_e | precharge, |
DATA_BLOCK_PACK_VALUES_s * | pPackValues | ||
) |
uint8_t TEST_BMS_GetHighestString | ( | BMS_CONSIDER_PRECHARGE_e | precharge, |
DATA_BLOCK_PACK_VALUES_s * | pPackValues | ||
) |
uint8_t TEST_BMS_GetLowestString | ( | BMS_CONSIDER_PRECHARGE_e | precharge, |
DATA_BLOCK_PACK_VALUES_s * | pPackValues | ||
) |
void TEST_BMS_GetMeasurementValues | ( | void | ) |
int32_t TEST_BMS_GetStringVoltageDifference | ( | uint8_t | string, |
DATA_BLOCK_PACK_VALUES_s * | pPackValues | ||
) |
bool TEST_BMS_IsAnyFatalErrorFlagSet | ( | void | ) |
STD_RETURN_TYPE_e TEST_BMS_IsBatterySystemStateOkay | ( | void | ) |
BMS_STATE_REQUEST_e TEST_BMS_TransferStateRequest | ( | void | ) |
void TEST_BMS_UpdateBatsysState | ( | DATA_BLOCK_PACK_VALUES_s * | pPackValues | ) |