foxBMS - Unit Tests
1.2.1
The foxBMS Unit Tests API Documentation
interlock_cfg.h
Go to the documentation of this file.
1
/**
2
*
3
* @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4
* All rights reserved.
5
*
6
* SPDX-License-Identifier: BSD-3-Clause
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
10
*
11
* 1. Redistributions of source code must retain the above copyright notice, this
12
* list of conditions and the following disclaimer.
13
*
14
* 2. Redistributions in binary form must reproduce the above copyright notice,
15
* this list of conditions and the following disclaimer in the documentation
16
* and/or other materials provided with the distribution.
17
*
18
* 3. Neither the name of the copyright holder nor the names of its
19
* contributors may be used to endorse or promote products derived from
20
* this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
*
33
* We kindly request you to use one or more of the following phrases to refer to
34
* foxBMS in your hardware, software, documentation or advertising materials:
35
*
36
* - ″This product uses parts of foxBMS®″
37
* - ″This product includes parts of foxBMS®″
38
* - ″This product is derived from foxBMS®″
39
*
40
*/
41
42
/**
43
* @file interlock_cfg.h
44
* @author foxBMS Team
45
* @date 2020-02-24 (date of creation)
46
* @updated 2021-12-08 (date of last update)
47
* @ingroup DRIVERS_CONFIGURATION
48
* @prefix ILCK
49
*
50
* @brief Header for the configuration for the driver for the interlock
51
*
52
*/
53
54
#ifndef FOXBMS__INTERLOCK_CFG_H_
55
#define FOXBMS__INTERLOCK_CFG_H_
56
57
/*========== Includes =======================================================*/
58
#include "
general.h
"
59
60
#include "HL_het.h"
61
62
/*========== Macros and Definitions =========================================*/
63
64
/** IO register to which the interlock is connected */
65
#define ILCK_IO_REG_DIR (hetREG1->DIR)
66
/** IO port for interlock related pins */
67
#define ILCK_IO_REG_PORT (hetREG1)
68
69
/** Enable pin for diagnostic power supply */
70
#define ILCK_INTERLOCK_CONTROL_PIN_IL_HS_ENABLE (30u)
71
72
/** Defines the pin where interlock feedback pin is connected to the mcu */
73
#define ILCK_INTERLOCK_FEEDBACK_PIN_IL_STATE (29u)
74
75
/* Defines to which ADC input the interlock circuitry is connected to */
76
/** High-side voltage sense signal connected to ADC input 2 (IL_HS_VS) */
77
#define ILCK_ADC_INPUT_HIGH_SIDE_VOLTAGE_SENSE (2u)
78
/** Low-side voltage sense signal connected to ADC input 3 (IL_LS_VS) */
79
#define ILCK_ADC_INPUT_LOW_SIDE_VOLTAGE_SENSE (3u)
80
/** High-side current sense signal connected to ADC input 4 (IL_HS_CS) */
81
#define ILCK_ADC_INPUT_HIGH_SIDE_CURRENT_SENSE (4u)
82
/** Low-side current sense signal connected to ADC input 5 (IL_LS_CS) */
83
#define ILCK_ADC_INPUT_LOW_SIDE_CURRENT_SENSE (5u)
84
85
/** Factor of resistor divider used for measuring the low- and high-side
86
* interlock voltages. Used resistor values are 5k6 ohm and 3k9 ohm. */
87
#define ILCK_VOLTAGE_DIVIDER_FACTOR ((5.6f + 3.9f) / 3.9f)
88
89
/**
90
* Conversion factor for interlock current IL_HS_CS
91
* 2k49 ohm is the resistance through which sense current flows
92
* 80 is the (output current / sense current) ratio of high-side power switch
93
* TPS2H000-Q1 data sheet SLVSD72D - DECEMBER 2015 - REVISED DECEMBER 2019 p.8
94
*/
95
#define ILCK_FACTOR_IL_HS_CS_1_ohm (80.0f / 2049.0f)
96
97
/** Linear conversion factor for low-side interlock current measurement
98
* (IL_LS_CS). Measurement performed via 2 ohm shunt with a gain of 20V/V */
99
#define ILCK_FACTOR_IL_LS_CS_1_ohm (0.025f)
100
101
/**
102
* @brief ILCK statemachine short time definition in #ILCK_Trigger() calls
103
* until next state/substate is processed
104
*/
105
#define ILCK_STATEMACH_SHORTTIME (1u)
106
107
/** Symbolic names for contactors' possible states */
108
typedef
enum
ILCK_ELECTRICAL_STATE_TYPE
{
109
ILCK_SWITCH_OFF
,
/*!< Contactor off --> Contactor is open */
110
ILCK_SWITCH_ON
,
/*!< Contactor on --> Contactor is closed */
111
ILCK_SWITCH_UNDEF
,
/*!< Contactor undefined --> Contactor state not known */
112
}
ILCK_ELECTRICAL_STATE_TYPE_e
;
113
114
/*========== Extern Constant and Variable Declarations ======================*/
115
116
/*========== Extern Function Prototypes =====================================*/
117
118
/*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
119
120
#endif
/* FOXBMS__INTERLOCK_CFG_H_ */
general.h
General macros and definitions for the whole platform.
ILCK_ELECTRICAL_STATE_TYPE
ILCK_ELECTRICAL_STATE_TYPE
Definition:
interlock_cfg.h:108
ILCK_SWITCH_ON
@ ILCK_SWITCH_ON
Definition:
interlock_cfg.h:110
ILCK_SWITCH_UNDEF
@ ILCK_SWITCH_UNDEF
Definition:
interlock_cfg.h:111
ILCK_SWITCH_OFF
@ ILCK_SWITCH_OFF
Definition:
interlock_cfg.h:109
ILCK_ELECTRICAL_STATE_TYPE_e
enum ILCK_ELECTRICAL_STATE_TYPE ILCK_ELECTRICAL_STATE_TYPE_e
src
app
driver
config
interlock_cfg.h
Generated by
1.9.1