foxBMS
1.1.0
The foxBMS Battery Management System 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_POWERLINE_TYPE | BMS_POWERLINE_TYPE_e |
typedef struct BMS_STATE | BMS_STATE_s |
Functions | |
BMS_RETURN_TYPE_e | BMS_SetStateRequest (BMS_STATE_REQUEST_e statereq) |
sets the current state request of the state variable bms_state. More... | |
BMS_STATEMACH_e | BMS_GetState (void) |
Returns the current state. More... | |
STD_RETURN_TYPE_e | BMS_GetInitializationState (void) |
Gets the initialization state. More... | |
void | BMS_Trigger (void) |
trigger function for the SYS driver state machine. More... | |
BMS_CURRENT_FLOW_STATE_e | BMS_GetBatterySystemState (void) |
Returns current battery system state (charging/discharging, resting or in relaxation phase) More... | |
BMS_CURRENT_FLOW_STATE_e | BMS_GetCurrentFlowDirection (int32_t current_mA) |
Get current flow direction, current value as function parameter. More... | |
bool | BMS_IsStringClosed (uint8_t stringNumber) |
Returns string state (closed or open) More... | |
bool | BMS_IsStringPrecharging (uint8_t stringNumber) |
Returns if string is currently precharging or not. More... | |
uint8_t | BMS_GetNumberOfConnectedStrings (void) |
Returns number of connected strings. More... | |
bool | BMS_IsTransitionToErrorStateActive (void) |
Check if transition in to error state is active. More... | |
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_POWERLINE_TYPE BMS_POWERLINE_TYPE_e |
Powerline 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_POWERLINE_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 | ) |
trigger function for the SYS driver state machine.
This function contains the sequence of events in the SYS state machine. It must be called time-triggered, every 10 milliseconds.
Remove statements below once interlock module is working
Remove statements above once interlock module is working
Definition at line 647 of file bms.c.