QP/C
8.1.2
Real-Time Event Framework
Loading...
Searching...
No Matches
qp_config.h
Go to the documentation of this file.
1
/*!@file
2
@code_uid{qp_config.h, Sample @QPX configuration file}
3
@code_litem{Details}
4
This an example of a @QPX configuration file with the explanation
5
of the available configuration macros. The `qp_config.h` file is
6
required for every @QPX Application.
7
8
@attention
9
The `qp_config.h` file is required for every @QPX Application.
10
11
@remark
12
Some of the configuration macros listed in this file apply only
13
to specific @QPX ports.
14
15
@code_litem{Configuration Wizard support}
16
The `qp_config.h` header files provided in the various @QPX examples
17
are formatted to support the "Configuration Wizard" editor available in some IDEs
18
(e.g., KEIL uVision). The screen shot below shows how to edit `qp_config.h`
19
in that mode.
20
21
@image html qp_config.png
22
@image latex qp_config.png width=5in
23
24
@code_fw_trace
25
- @tr{DVP_QP_MC5_D4_4}: <i>MISRA-C:2025 Directive 4.4(Advisory): C++ line block comment may contain commented-out code</i>
26
@endcode_uid
27
*/
28
#ifndef QP_CONFIG_H_
29
#define QP_CONFIG_H_
30
31
//------------------------------------------------------------------------------
32
/*!
33
@code_uid{#QP_API_VERSION, @QPX Framework API backwards-compatibility version}
34
@code_litem{Details}
35
QP API backwards compatibility with the @QPX API version.
36
Lower `QP_API_VERSION` values enable backwards compatibility
37
with lower (older) QP API versions.
38
39
- 0 => maximum supported compatibility
40
- 580 => QP 5.8.0 or newer
41
- 660 => QP 6.6.0 or newer
42
- 691 => QP 6.9.1 or newer
43
- 700 => QP 7.0.0 or newer
44
- 9999 => Latest QP API only (minimum compatibility)
45
46
For example, `QP_API_VERSION==691` will enable the compatibility
47
layer with QP version 6.9.1 and newer, but not older than 6.9.1.
48
`QP_API_VERSION==0` enables the maximum currently supported
49
backwards compatibility. Conversely, `QP_API_VERSION==9999` means
50
that no backwards compatibility layer should be enabled.
51
Default: 0 (All supported)
52
@endcode_uid
53
*/
54
#define QP_API_VERSION 0
55
56
//------------------------------------------------------------------------------
57
/*!
58
@code_uid{#Q_UNSAFE, Disable the QP Functional Safety (FuSa) Subsystem}
59
@code_litem{Details}
60
Defining the macro #Q_UNSAFE (in the application-specific qp_config.h header file)
61
disables most of the QP FuSa Subsystem, affecting the following facilities:
62
- Software assertions as a recommended technique
63
(called Failure Assertion Programming (FAP) in IEC 61508)
64
- Software Self-Monitoring Safety Functions, which encompasses such techniques:
65
+ @ref ssrs-qp_dim-dis "Duplicate Inverse Storage" for critical variables
66
+ @ref ssrs-qp_cfm-lbound "Fixed Upper Loop Bound" for all loops
67
+ @ref ssrs-qp_cfm-icf "Invalid Control Flow" for all unreachable code paths
68
69
The intent of the #Q_UNSAFE macro is to support verification (during development)
70
that assertions (and more generally, Safety Functions) have _no side effects_
71
on the primary functionalityare and are truly independent from the nominal
72
flow of control.
73
74
However, quite specifically, the #Q_UNSAFE macro should _not_ be used to permanently
75
disable the @QPX FuSa Subsystem in the final, production release of the @QPX
76
Application, especially in the context of a safety-related system.
77
78
@attention
79
Disabling QP FuSa Subsystem (by defining the macro #Q_UNSAFE) in the final production
80
release, _contradicts_ the most fundamental principles of functional safety and
81
is __not allowed__ in safety-related applications.
82
83
@endcode_uid
84
*/
85
#define Q_UNSAFE
86
87
//------------------------------------------------------------------------------
88
// <h>QF Framework
89
// <i>Active Object framework
90
91
/*!
92
@code_uid{#QF_MAX_ACTIVE,Maximum # Active Objects in the system (1..64)}
93
@code_litem{Details}
94
Defines the maximum # Active Objects that @QPX Framework can manage at any time.
95
- Minimum: 1
96
- Default: 32
97
- Maximum: 64 (inclusive)
98
@endcode_uid
99
*/
100
#define QF_MAX_ACTIVE 32U
101
102
/*!
103
@code_uid{::QF_MAX_EPOOL,Maximum # event pools in the system (0..15)}
104
@code_litem{Details}
105
- Minimum: 0 -- no event pools at all
106
- Default: 3
107
- Maximum: 15 (inclusive)
108
@endcode_uid
109
*/
110
#define QF_MAX_EPOOL 3U
111
112
/*!
113
@code_uid{::QF_MAX_TICK_RATE,Maximum # clock tick rates in the system (0..15)}
114
@code_litem{Details}
115
- Minimum: 0 -- no time events at all
116
- Default: 1
117
- Maximum: 15 (inclusive)
118
@endcode_uid
119
*/
120
#define QF_MAX_TICK_RATE 1U
121
122
//------------------------------------------------------------------------------
123
/*!
124
@code_uid{QEVT_PAR_INIT(), Event parameter initialization (RAII) for dynamic events}
125
@code_litem{Details}
126
When defined, the macro activates initialization of event parameters while
127
creating dynamic events. This could be used to apply __RAII__
128
(Resource Acquisition Is Initialization) for dynamic events.
129
130
Default: undefined
131
132
@sa
133
- Q_NEW()
134
- Q_NEW_X()
135
- @ref QEvt::QEvt_init() "QEvt_init()"
136
@endcode_uid
137
*/
138
#define QEVT_PAR_INIT
139
140
//------------------------------------------------------------------------------
141
/*!
142
@code_uid{#QACTIVE_CAN_STOP, Enable the Active Object stop API}
143
@code_litem{Details}
144
When defined, enable Active Object stop API (Not recommended)
145
146
Default: undefined
147
@endcode_uid
148
*/
149
#define QACTIVE_CAN_STOP
150
151
//------------------------------------------------------------------------------
152
/*!
153
@code_uid{#QF_EVENT_SIZ_SIZE, Maximum size of dynamic events managed by QP}
154
155
@code_litem{Details}
156
This macro controls the maximum size of dynamic events managed by @QPX Framework.
157
- 1U => 1 byte dynamic range (event size up to 255 bytes)
158
- 2U => 2 byte dynamic range (event size up to 65535 bytes) (default)
159
160
Default: 2 byte dynamic range (64K bytes maximum event size)
161
*/
162
#define QF_EVENT_SIZ_SIZE 2U
163
164
//------------------------------------------------------------------------------
165
/*!
166
@code_uid{::QF_TIMEEVT_CTR_SIZE,Time event counter size}
167
@code_litem{Details}
168
This macro controls the dynamic range of timeouts allowed in ::QTimeEvt.
169
The timeouts are counted in tick _of the associated_ clock tick rate.
170
- 1U => 1 byte (timeouts of up to 255 ticks)
171
- 2U => 2 bytes (timeouts of up to 65535 ticks)
172
- 4U => 4 bytes (timeouts of up to 2^32 ticks) (default)
173
174
Default: 4 bytes (2^32 dynamic range)
175
@endcode_uid
176
*/
177
#define QF_TIMEEVT_CTR_SIZE 4U
178
179
//------------------------------------------------------------------------------
180
/*!
181
@code_uid{#QF_EQUEUE_CTR_SIZE, Event queue counter size}
182
@code_litem{Details}
183
This macro controls the maximum number of events that ::QEQueue can hold
184
- 1U => 1 byte (maximum 255 events) (default)
185
- 2U => 2 bytes (maximum 65535 events)
186
187
Default: 1 (maximum 255 events in a queue)
188
@endcode_uid
189
*/
190
#define QF_EQUEUE_CTR_SIZE 1U
191
192
//------------------------------------------------------------------------------
193
/*!
194
@code_uid{#QF_MPOOL_CTR_SIZE, Memory pool counter size (QF_MPOOL_CTR_SIZE)}
195
@code_litem{Details}
196
This macro controls the maximum number of memory blocks that ::QMPool can hold
197
- 1U => 1 byte (up to 255 memory blocks)
198
- 2U => 2 bytes (up to 65535 memory blocks) (default)
199
- 2U => 2 bytes (up to 2^32 memory blocks)
200
201
Default: 2 bytes (up to 65535 memory blocks maximum in a pool)
202
@endcode_uid
203
*/
204
#define QF_MPOOL_CTR_SIZE 2U
205
206
//------------------------------------------------------------------------------
207
/*!
208
@code_uid{#QF_MPOOL_SIZ_SIZE, Memory block size (QF_MPOOL_SIZ_SIZE)}
209
@code_litem{Details}
210
This macro controls the maximum size of memory blocks that ::QMPool can hold.
211
- 1U => 1 byte dynamic range (event size up to 255 bytes)
212
- 2 U=> 2 byte dynamic range (event size up to 65535 bytes) (default)
213
214
Default: 2 byte dynamic range (64K bytes maximum block size)
215
@endcode_uid
216
*/
217
#define QF_MPOOL_SIZ_SIZE 2U
218
219
//==============================================================================
220
// QS Software Tracing
221
// Target-resident component of QP/Spy software tracing system
222
// (tracing instrumentation and command-input).
223
224
//------------------------------------------------------------------------------
225
/*!
226
@code_uid{#QS_TIME_SIZE, QS timestamp size (QS_TIME_SIZE)}
227
@code_litem{Details}
228
This macro controls the dynamic range of timestamp produced by QS software tracing.
229
- 1U => 1 byte (timestamp wraps around at 255 )
230
- 2U => 2 bytes (timestamp wraps around at 65535)
231
- 4U => 4 bytes (timestamp wraps around at 2^32) (default)
232
233
Default: 4 bytes (2^32 dynamic range)
234
@sa
235
- ::QSTimeCtr
236
- QS::QS_onGetTime()
237
@endcode_uid
238
*/
239
#define QS_TIME_SIZE 4U
240
241
//------------------------------------------------------------------------------
242
/*!
243
@code_uid{#QS_CTR_SIZE, QS buffer counter size}
244
@code_litem{Details}
245
This macro controls the maximum number of bytes held in the QS TX/RX buffers.
246
- 1U => 1 byte (maximum 255 bytes)
247
- 2U => 2 bytes (maximum 65535 bytes) (default)
248
- 4U => 4 bytes (maximum 2^32 bytes)
249
250
Default: 2 bytes (maximum 65535 bytes in QS buffers)
251
@endcode_uid
252
*/
253
#define QS_CTR_SIZE 2U
254
255
//==============================================================================
256
/*!
257
@code_uid{#QF_ON_CONTEXT_SW, Enable context switch callback WITHOUT QS}
258
@code_litem{Details}
259
When defined, enables context switch callback QF_onContextSw() in the built-in
260
kernels (QV, QK, QXK).
261
262
Default: undefined
263
@endcode_uid
264
*/
265
#define QF_ON_CONTEXT_SW
266
267
//------------------------------------------------------------------------------
268
/*!
269
@code_uid{#QF_MEM_ISOLATE, Enable MPU memory isolation}
270
@code_litem{Details}
271
When defined, enables memory isolation (requires MPU)
272
@note
273
Implies ::QF_ON_CONTEXT_SW (i.e., ::QF_ON_CONTEXT_SW gets defined)
274
@endcode_uid
275
*/
276
#define QF_MEM_ISOLATE
277
// </c>
278
279
//------------------------------------------------------------------------------
280
/*!
281
@code_uid{#QK_USE_IRQ_NUM, Use IRQ handler for QK return-from-preemption in ARM Cortex-M}
282
@code_litem{Details}
283
If #QK_USE_IRQ_NUM macro is defined, it specifies the IRQ number in ARM Cortex-M
284
to be used as the exception for return-from-preemption in the QK kernel.
285
286
This macro should be defined only if the NMI handler is utilized in the project.
287
The specified IRQ number must be otherwise unused.
288
289
Default: undefined
290
291
@sa
292
Requires defining the macro #QK_USE_IRQ_HANDLER
293
@endcode_uid
294
*/
295
#define QK_USE_IRQ_NUM 31
296
297
/*!
298
@code_uid{#QK_USE_IRQ_HANDLER, Use IRQ handler for QK return-from-preemption in ARM Cortex-M}
299
@code_litem{Details}
300
If #QK_USE_IRQ_HANDLER macro is defined, it specifies the IRQ handler name
301
in ARM Cortex-M to be used as the exception for return-from-preemption
302
in the QK kernel.
303
304
This macro should be defined only if the NMI handler is utilized in the project.
305
The specified IRQ handler must be otherwise unused.
306
307
@sa
308
Requires defining the macro #QK_USE_IRQ_NUM
309
@endcode_uid
310
*/
311
#define QK_USE_IRQ_HANDLER Reserved31_IRQHandler
312
313
//------------------------------------------------------------------------------
314
/*!
315
@code_uid{#QXK_USE_IRQ_NUM, Use IRQ handler for QXK return-from-preemption in ARM Cortex-M}
316
@code_litem{Details}
317
If #QXK_USE_IRQ_NUM macro is defined, it specifies the IRQ number in ARM Cortex-M
318
to be used as the exception for return-from-preemption in the QXK kernel.
319
320
This macro should be defined only if the NMI handler is utilized in the project.
321
The specified IRQ number must be otherwise unused.
322
323
Default: undefined
324
325
@sa
326
Requires defining the macro #QXK_USE_IRQ_HANDLER
327
@endcode_uid
328
*/
329
#define QXK_USE_IRQ_NUM 31
330
331
/*!
332
@code_uid{#QXK_USE_IRQ_HANDLER, Use IRQ handler for QK return-from-preemption in ARM Cortex-M}
333
@code_litem{Details}
334
If #QXK_USE_IRQ_HANDLER macro is defined, it specifies the IRQ handler name
335
in ARM Cortex-M to be used as the exception for return-from-preemption
336
in the QK kernel.
337
338
This macro should be defined only if the NMI handler is utilized in the project.
339
The specified IRQ handler must be otherwise unused.
340
341
Default: undefined
342
343
@sa
344
Requires defining the macro #QXK_USE_IRQ_NUM
345
@endcode_uid
346
*/
347
#define QXK_USE_IRQ_HANDLER Reserved31_IRQHandler
348
349
#endif
// QP_CONFIG_H_
spex
qp_config.h
© 2005-
Quantum Leaps
|
Using Online Help
|
QP/C 8.1.2
| created with
Spexygen
© 2005-
Quantum Leaps
|
Using Online Help
|
QP/C 8.1.2
| created with
Spexygen