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