foxBMS
1.1.0
The foxBMS Battery Management System API Documentation
|
Header for the driver for the SBC module. More...
Go to the source code of this file.
Data Structures | |
struct | SBC_STATE |
Macros | |
#define | SBC_STATEMACHINE_TASK_CYCLE_CONTEXT_MS (10u) |
#define | SBC_STATEMACHINE_SHORTTIME (1u) |
#define | SBC_STATEMACHINE_MEDIUMTIME (5u) |
#define | SBC_STATEMACHINE_LONGTIME (10u) |
#define | SBC_WINDOW_WATCHDOG_PERIOD_MS (100u) |
Typedefs | |
typedef enum SBC_STATE_REQUEST | SBC_STATE_REQUEST_e |
typedef enum SBC_PERIODIC_WATCHDOG_STATE | SBC_PERIODIC_WATCHDOG_STATE_e |
typedef enum SBC_RETURN_TYPE | SBC_RETURN_TYPE_e |
typedef enum SBC_STATEMACHINE | SBC_STATEMACHINE_e |
typedef enum SBC_STATEMACHINE_SUB | SBC_STATEMACHINE_SUB_e |
typedef struct SBC_STATE | SBC_STATE_s |
Functions | |
SBC_RETURN_TYPE_e | SBC_SetStateRequest (SBC_STATE_s *pInstance, SBC_STATE_REQUEST_e stateRequest) |
sets the current state request of passed state variable More... | |
SBC_STATEMACHINE_e | SBC_GetState (SBC_STATE_s *pInstance) |
gets the current state of passed state variable More... | |
void | SBC_Trigger (SBC_STATE_s *pInstance) |
trigger function for the SYS driver state machine. More... | |
Variables | |
SBC_STATE_s | sbc_stateMcuSupervisor |
Header for the driver for the SBC 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:
It must always be used when creating new c header files.
Definition in file sbc.h.
#define SBC_STATEMACHINE_LONGTIME (10u) |
SBC statemachine long time definition in SBC_Trigger() calls until next state/substate is processed
#define SBC_STATEMACHINE_MEDIUMTIME (5u) |
SBC statemachine medium time definition in SBC_Trigger() calls until next state/substate is processed
#define SBC_STATEMACHINE_SHORTTIME (1u) |
SBC statemachine short time definition in SBC_Trigger() calls until next state/substate is processed
#define SBC_STATEMACHINE_TASK_CYCLE_CONTEXT_MS (10u) |
This define MUST represent the cycle time of the task in which context the functions run, e.g., if the SBC_Trigger() is running in the 10 ms task then the define must be set to 10.
This sets the minimum time between two subsequent executed states/substates.
Define is only used for compile-time assertion, it has no programatic influence on the actual code.
#define SBC_WINDOW_WATCHDOG_PERIOD_MS (100u) |
typedef enum SBC_PERIODIC_WATCHDOG_STATE SBC_PERIODIC_WATCHDOG_STATE_e |
State of watchdog state
typedef enum SBC_RETURN_TYPE SBC_RETURN_TYPE_e |
Possible return values when state requests are made to the SYS statemachine
typedef enum SBC_STATE_REQUEST SBC_STATE_REQUEST_e |
State requests for the SYS statemachine
typedef struct SBC_STATE SBC_STATE_s |
This structure contains all the variables relevant for the SBC state machine. The user can get the current state of the SBC state machine with this variable
typedef enum SBC_STATEMACHINE SBC_STATEMACHINE_e |
States of the SBC state machine
typedef enum SBC_STATEMACHINE_SUB SBC_STATEMACHINE_SUB_e |
Substates of the SBC state machine
enum SBC_RETURN_TYPE |
Possible return values when state requests are made to the SYS statemachine
enum SBC_STATE_REQUEST |
enum SBC_STATEMACHINE |
States of the SBC state machine
enum SBC_STATEMACHINE_SUB |
Substates of the SBC state machine
SBC_STATEMACHINE_e SBC_GetState | ( | SBC_STATE_s * | pInstance | ) |
gets the current state of passed state variable
This function is used in the functioning of the SBC state machine.
[in] | pInstance | SBC instance where the current state is requested |
SBC_RETURN_TYPE_e SBC_SetStateRequest | ( | SBC_STATE_s * | pInstance, |
SBC_STATE_REQUEST_e | stateRequest | ||
) |
sets the current state request of passed state variable
This function is used to make a state request to the state machine, e.g., start initialization. It calls SBC_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.
[in,out] | pInstance | SBC instance where different state is requested |
[in] | stateRequest | requested state |
Definition at line 214 of file sbc.c.
void SBC_Trigger | ( | SBC_STATE_s * | pInstance | ) |
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 10ms.
[in,out] | pInstance | SBC instance that is controlled |
Definition at line 236 of file sbc.c.
|
extern |