QP/C++ Real-Time Event Framework 8.1.5
Loading...
Searching...
No Matches
qp_config.hpp
Go to the documentation of this file.
1/*!@file
2@code_uid{qp_config.hpp, @QPX configuration file}
3@code_litem{Details}
4The qp_config.hpp header defines all compile-time customization options for the @QPX component. It provides a centralized, controlled interface for configuring, enabling, or disabling specific framework features through preprocessor macros. This file is the sole authoritative location for @QPX customization settings and is intended to ensure deterministic and reviewable configuration management.
5
6This an example of a @QPX configuration file with the explanation of the available customization macros.
7
8@attention
9The `qp_config.hpp` file is required for every @QPX Application.
10
11@remark
12Some of the customization macros listed in this file apply only
13to specific @QPX ports.
14
15@code_litem{Configuration Wizard support}
16The `qp_config.hpp` header files provided in the various @QPX examples
17are 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.hpp`
19in that mode.
20
21@image html qp_config.png
22@image latex qp_config.png width=5in
23
24@code_bw_trace{brief}
25- @tr{SCM_QP_CUST}: <i>@QPX software component shall apply centralized customization management.</i>
26@code_fw_trace
27- @tr{AOU_QA_CUST_20}: <i>@QPX Application should set @QPX customization macros in the @if QPC qp_config.h @elseif QPCPP qp_config.hpp @endif header file according to the following guidelines.</i>
28- @tr{DVR_QP_MP2_D5_7_2}: <i>Directive 5.7.2(Advisory): Section of code should not be "commented out"</i>
29@endcode_uid
30*/
31#ifndef QP_CONFIG_HPP_
32#define QP_CONFIG_HPP_
33
34//------------------------------------------------------------------------------
35/*!
36@code_uid{#QP_API_VERSION, @QPX Framework API backwards-compatibility version}
37@code_litem{Details}
38QP API backwards compatibility with the @QPX API version.
39Lower `QP_API_VERSION` values enable backwards compatibility
40with lower (older) QP API versions.
41
42- 0 => maximum supported compatibility
43- 580 => QP 5.8.0 or newer
44- 660 => QP 6.6.0 or newer
45- 691 => QP 6.9.1 or newer
46- 700 => QP 7.0.0 or newer
47- 9999 => Latest QP API only (minimum compatibility)
48
49For example, `QP_API_VERSION==691` will enable the compatibility
50layer with QP version 6.9.1 and newer, but not older than 6.9.1.
51`QP_API_VERSION==0` enables the maximum currently supported
52backwards compatibility. Conversely, `QP_API_VERSION==9999` means
53that no backwards compatibility layer should be enabled.
54Default: 0 (All supported)
55@endcode_uid
56*/
57#define QP_API_VERSION 0
58
59//------------------------------------------------------------------------------
60// <h>QF Framework
61// <i>Active Object framework
62
63/*!
64@code_uid{#QF_MAX_ACTIVE,Maximum # Active Objects in the system (1..64)}
65@code_litem{Details}
66Defines the maximum # Active Objects that @QPX Framework can manage at any time.
67- Minimum: 1
68- Default: 32
69- Maximum: 64 (inclusive)
70@endcode_uid
71*/
72#define QF_MAX_ACTIVE 32U
73
74/*!
75@code_uid{::QF_MAX_EPOOL,Maximum # event pools in the system (0..15)}
76@code_litem{Details}
77- Minimum: 0 -- no event pools at all
78- Default: 3
79- Maximum: 15 (inclusive)
80@endcode_uid
81*/
82#define QF_MAX_EPOOL 3U
83
84/*!
85@code_uid{::QF_MAX_TICK_RATE,Maximum # clock tick rates in the system (0..15)}
86@code_litem{Details}
87- Minimum: 0 -- no time events at all
88- Default: 1
89- Maximum: 15 (inclusive)
90@endcode_uid
91*/
92#define QF_MAX_TICK_RATE 1U
93
94//------------------------------------------------------------------------------
95/*!
96@code_uid{QEVT_PAR_INIT(), Event parameter initialization (RAII) for dynamic events}
97@code_litem{Details}
98When defined, the macro activates initialization of event parameters while
99creating dynamic events. This could be used to apply __RAII__
100(Resource Acquisition Is Initialization) for dynamic events.
101
102Default: undefined
103
104@sa
105- Q_NEW()
106- Q_NEW_X()
107- QP::QEvt::init()
108@endcode_uid
109*/
110#define QEVT_PAR_INIT
111
112//------------------------------------------------------------------------------
113/*!
114@code_uid{#QACTIVE_CAN_STOP, Enable the Active Object stop API}
115@code_litem{Details}
116When defined, enable Active Object stop API (Not recommended)
117
118Default: undefined
119@endcode_uid
120*/
121#define QACTIVE_CAN_STOP
122
123//------------------------------------------------------------------------------
124/*!
125@code_uid{#Q_XTOR, Enable the virtual destructor in the QP::QAsm base class}
126@code_litem{Details}
127When defined, the macro #Q_XTOR enables the virtual destructor in the QP::QAsm base
128class and all its subclasses: QP::QHsm, QP::QMsm, QP::QActive, QP::QMActive, etc.
129
130@note
131The virtual destructor is not enabled by default because such a destructor tends
132to pull in the `delete` operator, which then must be linked from a standard library.
133This is undesirable in many embedded systems.
134
135Default: undefined
136
137@sa
138- QP::QAsm::~QAsm()
139@endcode_uid
140*/
141#define Q_XTOR
142
143//------------------------------------------------------------------------------
144/*!
145@code_uid{#QF_EVENT_SIZ_SIZE, Maximum size of dynamic events managed by QP}
146@code_litem{Details}
147This macro controls the maximum size of dynamic events managed by @QPX Framework.
148- 1U => 1 byte dynamic range (event size up to 255 bytes)
149- 2U => 2 byte dynamic range (event size up to 65535 bytes) (default)
150
151Default: 2 byte dynamic range (64K bytes maximum event size)
152*/
153#define QF_EVENT_SIZ_SIZE 2U
154
155//------------------------------------------------------------------------------
156/*!
157@code_uid{::QF_TIMEEVT_CTR_SIZE,Time event counter size}
158@code_litem{Details}
159This macro controls the dynamic range of timeouts allowed in QP::QTimeEvt.
160The timeouts are counted in tick _of the associated_ clock tick rate.
161- 1U => 1 byte (timeouts of up to 255 ticks)
162- 2U => 2 bytes (timeouts of up to 65535 ticks)
163- 4U => 4 bytes (timeouts of up to 2^32 ticks) (default)
164
165Default: 4 bytes (2^32 dynamic range)
166@endcode_uid
167*/
168#define QF_TIMEEVT_CTR_SIZE 4U
169
170//------------------------------------------------------------------------------
171/*!
172@code_uid{#QF_EQUEUE_CTR_SIZE, Event queue counter size}
173@code_litem{Details}
174This macro controls the maximum number of events that QP::QEQueue can hold
175- 1U => 1 byte (maximum 255 events) (default)
176- 2U => 2 bytes (maximum 65535 events)
177
178Default: 1 (maximum 255 events in a queue)
179@endcode_uid
180*/
181#define QF_EQUEUE_CTR_SIZE 1U
182
183//------------------------------------------------------------------------------
184/*!
185@code_uid{#QF_MPOOL_CTR_SIZE, Memory pool counter size (QF_MPOOL_CTR_SIZE)}
186@code_litem{Details}
187This macro controls the maximum number of memory blocks that QP::QMPool can hold
188- 1U => 1 byte (up to 255 memory blocks)
189- 2U => 2 bytes (up to 65535 memory blocks) (default)
190- 2U => 2 bytes (up to 2^32 memory blocks)
191
192Default: 2 bytes (up to 65535 memory blocks maximum in a pool)
193@endcode_uid
194*/
195#define QF_MPOOL_CTR_SIZE 2U
196
197//------------------------------------------------------------------------------
198/*!
199@code_uid{#QF_MPOOL_SIZ_SIZE, Memory block size (QF_MPOOL_SIZ_SIZE)}
200@code_litem{Details}
201This macro controls the maximum size of memory blocks that QP::QMPool can hold.
202- 1U => 1 byte dynamic range (event size up to 255 bytes)
203- 2 U=> 2 byte dynamic range (event size up to 65535 bytes) (default)
204
205Default: 2 byte dynamic range (64K bytes maximum block size)
206@endcode_uid
207*/
208#define QF_MPOOL_SIZ_SIZE 2U
209
210//==============================================================================
211// QS Software Tracing
212// Target-resident component of QP/Spy software tracing system
213// (tracing instrumentation and command-input).
214
215//------------------------------------------------------------------------------
216/*!
217@code_uid{#QS_TIME_SIZE, QS timestamp size (QS_TIME_SIZE)}
218@code_litem{Details}
219This macro controls the dynamic range of timestamp produced by QS software tracing.
220- 1U => 1 byte (timestamp wraps around at 255 )
221- 2U => 2 bytes (timestamp wraps around at 65535)
222- 4U => 4 bytes (timestamp wraps around at 2^32) (default)
223
224Default: 4 bytes (2^32 dynamic range)
225@sa
226- QP::QSTimeCtr
227- QP::QS::onGetTime()
228@endcode_uid
229*/
230#define QS_TIME_SIZE 4U
231
232//------------------------------------------------------------------------------
233/*!
234@code_uid{#QS_CTR_SIZE, QS buffer counter size}
235@code_litem{Details}
236This macro controls the maximum number of bytes held in the QS TX/RX buffers.
237- 1U => 1 byte (maximum 255 bytes)
238- 2U => 2 bytes (maximum 65535 bytes) (default)
239- 4U => 4 bytes (maximum 2^32 bytes)
240
241Default: 2 bytes (maximum 65535 bytes in QS buffers)
242@endcode_uid
243*/
244#define QS_CTR_SIZE 2U
245
246//----------------------------------------------------------------------------
247/*!
248@code_uid{QS_NFLOAT_T, The preprocessor switch to suppress definitions of float32_t and float64_t.}
249@code_litem{Details}
250When defined, #QS_NFLOAT_T suppresses the definitions of float32_t and float64_t.
251@endcode_uid
252*/
253#define QS_NFLOAT_T
254
255//==============================================================================
256/*!
257@code_uid{#QF_ON_CONTEXT_SW, Enable context switch callback WITHOUT QS}
258@code_litem{Details}
259When defined, enables context switch callback QF_onContextSw() in the built-in
260kernels (QV, QK, QXK).
261
262Default: 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}
271When defined, enables memory isolation (requires MPU)
272@note
273Implies ::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}
283If #QK_USE_IRQ_NUM macro is defined, it specifies the IRQ number in ARM Cortex-M
284to be used as the exception for return-from-preemption in the QK kernel.
285
286This macro should be defined only if the NMI handler is utilized in the project.
287The specified IRQ number must be otherwise unused.
288
289Default: undefined
290
291@sa
292Requires 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}
300If #QK_USE_IRQ_HANDLER macro is defined, it specifies the IRQ handler name
301in ARM Cortex-M to be used as the exception for return-from-preemption
302in the QK kernel.
303
304This macro should be defined only if the NMI handler is utilized in the project.
305The specified IRQ handler must be otherwise unused.
306
307@sa
308Requires 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}
317If #QXK_USE_IRQ_NUM macro is defined, it specifies the IRQ number in ARM Cortex-M
318to be used as the exception for return-from-preemption in the QXK kernel.
319
320This macro should be defined only if the NMI handler is utilized in the project.
321The specified IRQ number must be otherwise unused.
322
323Default: undefined
324
325@sa
326Requires 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}
334If #QXK_USE_IRQ_HANDLER macro is defined, it specifies the IRQ handler name
335in ARM Cortex-M to be used as the exception for return-from-preemption
336in the QK kernel.
337
338This macro should be defined only if the NMI handler is utilized in the project.
339The specified IRQ handler must be otherwise unused.
340
341Default: undefined
342
343@sa
344Requires defining the macro #QXK_USE_IRQ_NUM
345@endcode_uid
346*/
347#define QXK_USE_IRQ_HANDLER Reserved31_IRQHandler
348
349#endif // QP_CONFIG_HPP_