foxBMS-UnitTests  1.0.0
The foxBMS Unit Tests API Documentation
ftask_cfg.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der
4  * angewandten Forschung e.V. All rights reserved.
5  *
6  * BSD 3-Clause License
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * We kindly request you to use one or more of the following phrases to refer
31  * to foxBMS in your hardware, software, documentation or advertising
32  * materials:
33  *
34  * ″This product uses parts of foxBMS®″
35  *
36  * ″This product includes parts of foxBMS®″
37  *
38  * ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file ftask_cfg.h
44  * @author foxBMS Team
45  * @date 2019-08-26 (date of creation)
46  * @updated 2020-01-21 (date of last update)
47  * @ingroup TASK_CONFIGURATION
48  * @prefix FTSK
49  *
50  * @brief Task configuration header
51  * @details TODO
52  */
53 
54 #ifndef FOXBMS__FTASK_CFG_H_
55 #define FOXBMS__FTASK_CFG_H_
56 
57 /*========== Includes =======================================================*/
58 #include "general.h"
59 
60 #include "os.h"
61 
62 /*========== Macros and Definitions =========================================*/
63 /** @brief Stack size of engine task */
64 #define FTSK_TSK_ENGINE_STACK_SIZE (1024u / 4u)
65 
66 /** @brief Phase of engine task */
67 #define FTSK_TSK_ENGINE_PHASE (0u)
68 
69 /** @brief Cycle time of engine task */
70 #define FTSK_TSK_ENGINE_CYCLE_TIME (1u)
71 
72 /** @brief Maximum allowed jitter of engine task */
73 #define FTSK_TSK_ENGINE_MAXIMUM_JITTER (1u)
74 
75 /** @brief Stack size of cyclic 1 ms task */
76 #define FTSK_TSK_CYCLIC_1MS_STACK_SIZE (1024u / 4u)
77 
78 /** @brief Phase of cyclic 1ms task */
79 #define FTSK_TSK_CYCLIC_1MS_PHASE (0u)
80 
81 /** @brief Cycle time of 1ms task */
82 #define FTSK_TSK_CYCLIC_1MS_CYCLE_TIME (1u)
83 
84 /** @brief Maximum allowed jitter of 1ms task */
85 #define FTSK_TSK_CYCLIC_1MS_MAXIMUM_JITTER (1u)
86 
87 /** @brief Stack size of cyclic 10 ms task */
88 #define FTSK_TSK_CYCLIC_10MS_STACK_SIZE ((4096u) / 4u)
89 
90 /** @brief Phase of cyclic 10 ms task */
91 #define FTSK_TSK_CYCLIC_10MS_PHASE (2u)
92 
93 /** @brief Cycle time of 10 ms task */
94 #define FTSK_TSK_CYCLIC_10MS_CYCLE_TIME (10u)
95 
96 /** @brief Maximum allowed jitter of 10ms task */
97 #define FTSK_TSK_CYCLIC_10MS_MAXIMUM_JITTER (2u)
98 
99 /** @brief Stack size of cyclic 100 ms task */
100 #define FTSK_TSK_CYCLIC_100MS_STACK_SIZE (1024u / 4u)
101 
102 /** @brief Phase of cyclic 100 ms task */
103 #define FTSK_TSK_CYCLIC_100MS_PHASE (56u)
104 
105 /** @brief Cycle time of 100ms task */
106 #define FTSK_TSK_CYCLIC_100MS_CYCLE_TIME (100u)
107 
108 /** @brief Maximum allowed jitter of 100ms task */
109 #define FTSK_TSK_CYCLIC_100MS_MAXIMUM_JITTER (5u)
110 
111 /** @brief Stack size of cyclic 100 ms task for algorithms */
112 #define FTSK_TSK_CYCLIC_ALGORITHM_100MS_STACKSIZE (1024u / 4u)
113 
114 /** @brief Phase of cyclic 100 ms task for algorithms */
115 #define FTSK_TSK_CYCLIC_ALGORITHM_100MS_PHASE (64u)
116 
117 /** @brief Cycle time of 100ms task for algorithms*/
118 #define FTSK_TSK_CYCLIC_ALGORITHM_100MS_CYCLE_TIME (100u)
119 
120 /** @brief Maximum allowed jitter of 100ms task for algorithms */
121 #define FTSK_TSK_CYCLIC_ALGORITHM_100MS_MAXIMUM_JITTER (5u)
122 
123 /*========== Extern Constant and Variable Declarations ======================*/
124 /**
125  * @brief Task configuration of the engine task
126  * @details Task for database and system monitoring
127  * @ingroup API_OS
128  */
130 
131 /**
132  * @brief Task configuration of the cyclic 1 ms task
133  * @details Cyclic 1 ms task
134  * @ingroup API_OS
135  */
137 
138 /**
139  * @brief Task configuration of the cyclic 10 ms task
140  * @details Cyclic 10 ms task
141  * @ingroup API_OS
142  */
144 
145 /**
146  * @brief Task configuration of the cyclic 100 ms task
147  * @details Cyclic 100 ms task
148  * @ingroup API_OS
149  */
151 
152 /**
153  * @brief Task configuration of the cyclic 100 ms task for algorithms
154  * @details Cyclic 100 ms task for algorithms
155  * @ingroup API_OS
156  */
158 
159 /*========== Extern Function Prototypes =====================================*/
160 /**
161  * @brief Initializes the database
162  * @details Start up after scheduler starts
163  * @ingroup API_OS
164  * @warning Do not change the content of this function. This will very likely
165  * break the system. This function is kept in the configuration file
166  * to have a uniform task configuration.
167  */
168 extern void FTSK_UserCodeEngineInit(void);
169 
170 /**
171  * @brief Engine task for the database and the system monitoring module
172  * @details Start up after scheduler start. First task to be run, all other
173  * tasks only starts when this task has started
174  * @ingroup API_OS
175  * @warning Do not change the content of this function. This will very likely
176  * break the system. This function is kept in the configuration file
177  * to have a uniform task configuration.
178  */
179 extern void FTSK_UserCodeEngine(void);
180 
181 /**
182  * @brief Initialization function before all tasks started
183  * @details This function is called after the scheduler started but before any
184  * cyclic task runs. Here modules get initialized that are not used
185  * during the startup process.
186  * @ingroup API_OS
187  */
189 
190 /**
191  * @brief Cyclic 1 ms task
192  * @details TODO
193  * @ingroup API_OS
194  */
195 extern void FTSK_UserCodeCyclic1ms(void);
196 
197 /**
198  * @brief Cyclic 10 ms task
199  * @details TODO
200  * @ingroup API_OS
201  */
202 extern void FTSK_UserCodeCyclic10ms(void);
203 
204 /**
205  * @brief Cyclic 100 ms task
206  * @details TODO
207  * @ingroup API_OS
208  */
209 extern void FTSK_UserCodeCyclic100ms(void);
210 
211 /**
212  * @brief Cyclic 100 ms task for algorithms
213  * @details TODO
214  * @ingroup API_OS
215  */
216 extern void FTSK_UserCodeCyclicAlgorithm100ms(void);
217 
218 /**
219  * @brief Idle task
220  * @details Called by #vApplicationIdleHook() if configUSE_IDLE_HOOK in
221  * FreeRTOSConfig.h is enabled. If you do not need this hook, you can
222  * disable it in the FreeRTOS configuration.
223  * @ingroup API_OS
224  */
225 extern void FTSK_UserCodeIdle(void);
226 
227 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
228 
229 #endif /* FOXBMS__FTASK_CFG_H_ */
os.h
Implementation of the tasks used by the system, headers.
ftsk_taskDefinitionCyclic10ms
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic10ms
Task configuration of the cyclic 10 ms task.
Definition: ftask_cfg.c:97
general.h
TODO.
OS_TASK_DEFINITION
struct for FreeRTOS task definition
Definition: os.h:118
FTSK_UserCodeCyclic100ms
void FTSK_UserCodeCyclic100ms(void)
Cyclic 100 ms task.
Definition: ftask_cfg.c:199
ftsk_taskDefinitionCyclic100ms
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic100ms
Task configuration of the cyclic 100 ms task.
Definition: ftask_cfg.c:99
FTSK_UserCodeCyclic10ms
void FTSK_UserCodeCyclic10ms(void)
Cyclic 10 ms task.
Definition: ftask_cfg.c:179
FTSK_UserCodeEngineInit
void FTSK_UserCodeEngineInit(void)
Initializes the database.
Definition: ftask_cfg.c:115
ftsk_taskDefinitionCyclic1ms
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclic1ms
Task configuration of the cyclic 1 ms task.
Definition: ftask_cfg.c:95
FTSK_UserCodeIdle
void FTSK_UserCodeIdle(void)
Idle task.
Definition: ftask_cfg.c:220
FTSK_UserCodeCyclicAlgorithm100ms
void FTSK_UserCodeCyclicAlgorithm100ms(void)
Cyclic 100 ms task for algorithms.
Definition: ftask_cfg.c:211
ftsk_taskDefinitionCyclicAlgorithm100ms
OS_TASK_DEFINITION_s ftsk_taskDefinitionCyclicAlgorithm100ms
Task configuration of the cyclic 100 ms task for algorithms.
Definition: ftask_cfg.c:104
FTSK_UserCodePreCyclicTasksInitialization
void FTSK_UserCodePreCyclicTasksInitialization(void)
Initialization function before all tasks started.
Definition: ftask_cfg.c:145
FTSK_UserCodeCyclic1ms
void FTSK_UserCodeCyclic1ms(void)
Cyclic 1 ms task.
Definition: ftask_cfg.c:169
ftsk_taskDefinitionEngine
OS_TASK_DEFINITION_s ftsk_taskDefinitionEngine
Task configuration of the engine task.
Definition: ftask_cfg.c:93
FTSK_UserCodeEngine
void FTSK_UserCodeEngine(void)
Engine task for the database and the system monitoring module.
Definition: ftask_cfg.c:136