foxBMS - Unit Tests  1.2.1
The foxBMS Unit Tests API Documentation
interlock.h File Reference

Headers for the driver for the interlock. More...

#include "interlock_cfg.h"
Include dependency graph for interlock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ILCK_STATE_s
 

Enumerations

enum  ILCK_STATEMACH_e { ILCK_STATEMACHINE_UNINITIALIZED , ILCK_STATEMACHINE_INITIALIZED , ILCK_STATEMACHINE_UNDEFINED }
 
enum  ILCK_STATEMACH_SUB_e { ILCK_ENTRY }
 
enum  ILCK_STATE_REQUEST_e { ILCK_STATE_INITIALIZATION_REQUEST , ILCK_STATE_NO_REQUEST }
 
enum  ILCK_RETURN_TYPE_e { ILCK_OK , ILCK_REQUEST_PENDING , ILCK_ALREADY_INITIALIZED , ILCK_ILLEGAL_REQUEST }
 

Functions

STD_RETURN_TYPE_e ILCK_Init (void)
 Checks the configuration of the interlock-module. More...
 
ILCK_RETURN_TYPE_e ILCK_SetStateRequest (ILCK_STATE_REQUEST_e statereq)
 sets the current state request of the state variable ilck_state. More...
 
ILCK_STATEMACH_e ILCK_GetState (void)
 gets the current state. More...
 
void ILCK_Trigger (void)
 trigger function for the ILCK driver state machine. More...
 
void TEST_ILCK_SetStateStruct (ILCK_STATE_s state)
 
ILCK_ELECTRICAL_STATE_TYPE_e TEST_ILCK_GetInterlockFeedback (void)
 

Detailed Description

Headers for the driver for the interlock.

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2020-02-24 (date of creation)
Updated
2021-10-18 (date of last update)
Prefix
ILCK

Definition in file interlock.h.

Enumeration Type Documentation

◆ ILCK_RETURN_TYPE_e

Possible return values when state requests are made to the ILCK statemachine

Enumerator
ILCK_OK 

ILCK --> ok

ILCK_REQUEST_PENDING 

requested to be executed

ILCK_ALREADY_INITIALIZED 

Initialization of ilck already finished

ILCK_ILLEGAL_REQUEST 

Request can not be executed

Definition at line 90 of file interlock.h.

◆ ILCK_STATE_REQUEST_e

State requests for the ILCK statemachine

Enumerator
ILCK_STATE_INITIALIZATION_REQUEST 
ILCK_STATE_NO_REQUEST 

Definition at line 82 of file interlock.h.

◆ ILCK_STATEMACH_e

States of the ILCK state machine

Enumerator
ILCK_STATEMACHINE_UNINITIALIZED 

Uninitialized state

ILCK_STATEMACHINE_INITIALIZED 

statemachine initialized

ILCK_STATEMACHINE_UNDEFINED 

undefined state

Definition at line 65 of file interlock.h.

◆ ILCK_STATEMACH_SUB_e

Substates of the ILCK state machine

Enumerator
ILCK_ENTRY 

Substate entry state

Definition at line 75 of file interlock.h.

Function Documentation

◆ ILCK_GetState()

ILCK_STATEMACH_e ILCK_GetState ( void  )

gets the current state.

This function is used in the functioning of the ILCK state machine.

Returns
current state, taken from ILCK_STATEMACH_e

Definition at line 246 of file interlock.c.

◆ ILCK_Init()

STD_RETURN_TYPE_e ILCK_Init ( void  )

Checks the configuration of the interlock-module.

Returns
retVal (type: STD_RETURN_TYPE_e)

◆ ILCK_SetStateRequest()

ILCK_RETURN_TYPE_e ILCK_SetStateRequest ( ILCK_STATE_REQUEST_e  statereq)

sets the current state request of the state variable ilck_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 ILCK_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.

Parameters
statereqstate request to set
Returns
retVal current state request, taken from ILCK_STATE_REQUEST_e

Definition at line 250 of file interlock.c.

Here is the call graph for this function:

◆ ILCK_Trigger()

void ILCK_Trigger ( void  )

trigger function for the ILCK driver state machine.

This function contains the sequence of events in the ILCK state machine. It must be called time-triggered, every 1ms.

Definition at line 264 of file interlock.c.

Here is the call graph for this function:

◆ TEST_ILCK_GetInterlockFeedback()

ILCK_ELECTRICAL_STATE_TYPE_e TEST_ILCK_GetInterlockFeedback ( void  )

Definition at line 324 of file interlock.c.

Here is the call graph for this function:

◆ TEST_ILCK_SetStateStruct()

void TEST_ILCK_SetStateStruct ( ILCK_STATE_s  state)

Definition at line 321 of file interlock.c.