foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Driver for the SBC module. More...
Go to the source code of this file.
Enumerations | |
enum | SBC_CHECK_REENTRANCE_e { SBC_REENTRANCE_NO , SBC_REENTRANCE_YES } |
Functions | |
static void | SBC_SaveLastStates (SBC_STATE_s *pInstance) |
Saves the last state and last substate. More... | |
static SBC_RETURN_TYPE_e | SBC_CheckStateRequest (SBC_STATE_s *pInstance, SBC_STATE_REQUEST_e stateRequest) |
checks the state requests that are made. More... | |
static SBC_CHECK_REENTRANCE_e | SBC_CheckReEntrance (SBC_STATE_s *pInstance) |
Re-entrance check of SBC state machine trigger function. More... | |
static SBC_STATE_REQUEST_e | SBC_TransferStateRequest (SBC_STATE_s *pInstance) |
Transfers the current state request to the state machine. More... | |
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 |
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 source files.
Definition in file sbc.c.
Symbolic names to check re-entrance in SBC_Trigger
Enumerator | |
---|---|
SBC_REENTRANCE_NO | no re-entrance |
SBC_REENTRANCE_YES | re-entrance |
|
static |
Re-entrance check of SBC state machine trigger function.
re-entrance check of SYS 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 pInstance->triggerEntry. 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.
This function is not re-entrant and should only be called time- or event-triggered. It increments the triggerentry counter from the state variable sys_systemState. 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 185 of file sbc.c.
|
static |
checks the state requests that are made.
This function checks the validity of the state requests. The results of the checked is returned immediately.
[in,out] | pInstance | |
[in] | stateRequest | state request to be checked |
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 |
|
static |
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 215 of file sbc.c.
|
static |
Transfers the current state request to the state machine.
This function takes the current state request from pInstance->stateRequest and transfers it to the state machine. It resets the value from stateRequest to SBC_STATE_NO_REQUEST
[in,out] | pInstance |
Definition at line 201 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 237 of file sbc.c.
SBC_STATE_s sbc_stateMcuSupervisor |
state of the SBC module