QTools  7.2.1
Collection of Host-Based Tools
Loading...
Searching...
No Matches
qpc_qs.h
Go to the documentation of this file.
1/*$file${include::qs.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
2/*
3* Model: qpc.qm
4* File: ${include::qs.h}
5*
6* This code has been generated by QM 5.2.5 <www.state-machine.com/qm>.
7* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8*
9* This code is covered by the following QP license:
10* License # : LicenseRef-QL-dual
11* Issued to : Any user of the QP/C real-time embedded framework
12* Framework(s) : qpc
13* Support ends : 2023-12-31
14* License scope:
15*
16* Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17*
18* SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
19*
20* This software is dual-licensed under the terms of the open source GNU
21* General Public License version 3 (or any later version), or alternatively,
22* under the terms of one of the closed source Quantum Leaps commercial
23* licenses.
24*
25* The terms of the open source GNU General Public License version 3
26* can be found at: <www.gnu.org/licenses/gpl-3.0>
27*
28* The terms of the closed source Quantum Leaps commercial licenses
29* can be found at: <www.state-machine.com/licensing>
30*
31* Redistributions in source code must retain this top-level comment block.
32* Plagiarizing this software to sidestep the license obligations is illegal.
33*
34* Contact information:
35* <www.state-machine.com/licensing>
36* <info@state-machine.com>
37*/
38/*$endhead${include::qs.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
39/*! @file
40* @brief QS/C platform-independent public interface.
41*/
42#ifndef QS_H_
43#define QS_H_
44
45#ifndef Q_SPY
46 #error "Q_SPY must be defined to include qs.h"
47#endif
48
49/*==========================================================================*/
50/*$declare${QS-config} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
51
52/*${QS-config::QS_CTR_SIZE} ................................................*/
53#ifndef QS_CTR_SIZE
54/*! The size [bytes] of the internal QS buffer-counters. Valid values: 2U or 4U;
55* default 2U.
56*
57* @details
58* This macro can be defined in the QS port file (qs_port.h) to
59* configure the ::QSCtr type. Here the macro is not defined so the
60* default of 2 byte is chosen.
61*/
62#define QS_CTR_SIZE 2U
63#endif /* ndef QS_CTR_SIZE */
64
65/*${QS-config::QS_CTR_SIZE defined incorrectly,~} ..........................*/
66#if (QS_CTR_SIZE != 2U) && (QS_CTR_SIZE != 4U)
67#error QS_CTR_SIZE defined incorrectly, expected 2U or 4U;
68#endif /* (QS_CTR_SIZE != 2U) && (QS_CTR_SIZE != 4U) */
69
70/*${QS-config::QS_TIME_SIZE} ...............................................*/
71#ifndef QS_TIME_SIZE
72/*! The size [bytes] of the QS time stamp. Valid values: 1U, 2U, or 4U;
73* default 4U.
74*
75* @details
76* This macro can be defined in the QS port file (qs_port.h) to
77* configure the ::QSTimeCtr type. Here the macro is not defined so the
78* default of 4 byte is chosen.
79*/
80#define QS_TIME_SIZE 4U
81#endif /* ndef QS_TIME_SIZE */
82
83/*${QS-config::QS_TIME_SIZE defined incorrectly~} ..........................*/
84#if (QS_TIME_SIZE != 1U) && (QS_TIME_SIZE != 2U) && (QS_TIME_SIZE != 4U)
85#error QS_TIME_SIZE defined incorrectly, expected 1U, 2U, or 4U;
86#endif /* (QS_TIME_SIZE != 1U) && (QS_TIME_SIZE != 2U) && (QS_TIME_SIZE != 4U) */
87/*$enddecl${QS-config} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
88
89/*==========================================================================*/
90/*$declare${QS} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
91
92/*${QS::QSCtr} .............................................................*/
93#if (QS_CTR_SIZE == 2U)
94/*! QS ring buffer counter and offset type */
95typedef uint_fast16_t QSCtr;
96#endif /* (QS_CTR_SIZE == 2U) */
97
98/*${QS::QSCtr} .............................................................*/
99#if (QS_CTR_SIZE == 4U)
100typedef uint_fast32_t QSCtr;
101#endif /* (QS_CTR_SIZE == 4U) */
102
103/*${QS::QSTimeCtr} .........................................................*/
104#if (QS_TIME_SIZE == 4U)
105/*! QS time stamp type, which determines the dynamic range of QS time stamps */
106typedef uint32_t QSTimeCtr;
107#endif /* (QS_TIME_SIZE == 4U) */
108
109/*${QS::QSTimeCtr} .........................................................*/
110#if (QS_TIME_SIZE == 2U)
111typedef uint16_t QSTimeCtr;
112#endif /* (QS_TIME_SIZE == 2U) */
113
114/*${QS::QSTimeCtr} .........................................................*/
115#if (QS_TIME_SIZE == 1U)
116typedef uint8_t QSTimeCtr;
117#endif /* (QS_TIME_SIZE == 1U) */
118
119/*${QS::QSFun} .............................................................*/
120#if (QS_FUN_PTR_SIZE == 4U)
121/*! QS function pointer type (for serializing function pointers) */
122typedef uint32_t QSFun;
123#endif /* (QS_FUN_PTR_SIZE == 4U) */
124
125/*${QS::QSFun} .............................................................*/
126#if (QS_FUN_PTR_SIZE == 8U)
127typedef uint64_t QSFun;
128#endif /* (QS_FUN_PTR_SIZE == 8U) */
129
130/*${QS::QSFun} .............................................................*/
131#if (QS_FUN_PTR_SIZE == 2U)
132typedef uint16_t QSFun;
133#endif /* (QS_FUN_PTR_SIZE == 2U) */
134
135/*${QS::QSFun} .............................................................*/
136#if (QS_FUN_PTR_SIZE == 1U)
137typedef uint8_t QSFun;
138#endif /* (QS_FUN_PTR_SIZE == 1U) */
139
140/*${QS::QSpyPre} ...........................................................*/
141/*! QS pre-defined record types (TX channel)
142* @static @public @memberof QS
143*
144* @details
145* This enumeration specifies the record types used in the QP components.
146* You can specify your own record types starting from ::QS_USER offset.
147* Currently, the maximum of all records cannot exceed 125.
148*
149* @note
150* The QS records labeled as "not maskable" are always enabled and cannot
151* be turend off with the QS_GLB_FILTER() macro. Other QS trace records
152* can be disabled by means of the "global filters"
153*
154* @sa QS_GLB_FILTER() macro
155*/
157 /* [0] QS session (not maskable) */
158 QS_EMPTY, /*!< QS record for cleanly starting a session */
159
160 /* [1] SM records */
161 QS_QEP_STATE_ENTRY, /*!< a state was entered */
162 QS_QEP_STATE_EXIT, /*!< a state was exited */
163 QS_QEP_STATE_INIT, /*!< an initial transition was taken in a state */
164 QS_QEP_INIT_TRAN, /*!< the top-most initial transition was taken */
165 QS_QEP_INTERN_TRAN, /*!< an internal transition was taken */
166 QS_QEP_TRAN, /*!< a regular transition was taken */
167 QS_QEP_IGNORED, /*!< an event was ignored (silently discarded) */
168 QS_QEP_DISPATCH, /*!< an event was dispatched (begin of RTC step) */
169 QS_QEP_UNHANDLED, /*!< an event was un-handled due to a guard */
170
171 /* [10] Active Object (AO) records */
172 QS_QF_ACTIVE_DEFER, /*!< AO deferred an event */
173 QS_QF_ACTIVE_RECALL, /*!< AO recalled an event */
174 QS_QF_ACTIVE_SUBSCRIBE, /*!< an AO subscribed to an event */
175 QS_QF_ACTIVE_UNSUBSCRIBE, /*!< an AO unsubscribed to an event */
176 QS_QF_ACTIVE_POST, /*!< an event was posted (FIFO) directly to AO */
177 QS_QF_ACTIVE_POST_LIFO, /*!< an event was posted (LIFO) directly to AO */
178 QS_QF_ACTIVE_GET, /*!< AO got an event and its queue is not empty */
179 QS_QF_ACTIVE_GET_LAST,/*!< AO got an event and its queue is empty */
180 QS_QF_ACTIVE_RECALL_ATTEMPT, /*!< AO attempted to recall an event */
181
182 /* [19] Event Queue (EQ) records */
183 QS_QF_EQUEUE_POST, /*!< an event was posted (FIFO) to a raw queue */
184 QS_QF_EQUEUE_POST_LIFO, /*!< an event was posted (LIFO) to a raw queue */
185 QS_QF_EQUEUE_GET, /*!< get an event and queue still not empty */
186 QS_QF_EQUEUE_GET_LAST,/*!< get the last event from the queue */
187
188 /* [23] Framework (QF) records */
189 QS_QF_NEW_ATTEMPT, /*!< an attempt to allocate an event failed */
190
191 /* [24] Memory Pool (MP) records */
192 QS_QF_MPOOL_GET, /*!< a memory block was removed from memory pool */
193 QS_QF_MPOOL_PUT, /*!< a memory block was returned to memory pool */
194
195 /* [26] Additional Framework (QF) records */
196 QS_QF_PUBLISH, /*!< an event was published to active objects */
197 QS_QF_NEW_REF, /*!< new event reference was created */
198 QS_QF_NEW, /*!< new event was created */
199 QS_QF_GC_ATTEMPT, /*!< garbage collection attempt */
200 QS_QF_GC, /*!< garbage collection */
201 QS_QF_TICK, /*!< QTimeEvt_tick_() was called */
202
203 /* [32] Time Event (TE) records */
204 QS_QF_TIMEEVT_ARM, /*!< a time event was armed */
205 QS_QF_TIMEEVT_AUTO_DISARM, /*!< a time event expired and was disarmed */
206 QS_QF_TIMEEVT_DISARM_ATTEMPT,/*!< attempt to disarm a disarmed QTimeEvt */
207 QS_QF_TIMEEVT_DISARM, /*!< true disarming of an armed time event */
208 QS_QF_TIMEEVT_REARM, /*!< rearming of a time event */
209 QS_QF_TIMEEVT_POST, /*!< a time event posted itself directly to an AO */
210
211 /* [38] Additional Framework (QF) records */
212 QS_QF_DELETE_REF, /*!< an event reference is about to be deleted */
213 QS_QF_CRIT_ENTRY, /*!< critical section was entered */
214 QS_QF_CRIT_EXIT, /*!< critical section was exited */
215 QS_QF_ISR_ENTRY, /*!< an ISR was entered */
216 QS_QF_ISR_EXIT, /*!< an ISR was exited */
217 QS_QF_INT_DISABLE, /*!< interrupts were disabled */
218 QS_QF_INT_ENABLE, /*!< interrupts were enabled */
219
220 /* [45] Additional Active Object (AO) records */
221 QS_QF_ACTIVE_POST_ATTEMPT,/*!< attempt to post an evt to AO failed */
222
223 /* [46] Additional Event Queue (EQ) records */
224 QS_QF_EQUEUE_POST_ATTEMPT,/*!< attempt to post evt to QEQueue failed */
225
226 /* [47] Additional Memory Pool (MP) records */
227 QS_QF_MPOOL_GET_ATTEMPT, /*!< attempt to get a memory block failed */
228
229 /* [48] Scheduler (SC) records */
230 QS_SCHED_PREEMPT, /*!< scheduler asynchronously preempted a task */
231 QS_SCHED_RESTORE, /*!< scheduler restored preempted task */
232 QS_SCHED_LOCK, /*!< scheduler was locked */
233 QS_SCHED_UNLOCK, /*!< scheduler was unlocked */
234 QS_SCHED_NEXT, /*!< scheduler started new task */
235 QS_SCHED_IDLE, /*!< scheduler restored the idle task */
236
237 /* [54] Miscellaneous QS records (not maskable) */
238 QS_ENUM_DICT, /*!< enumeration dictionary entry */
239
240 /* [55] Additional QEP records */
241 QS_QEP_TRAN_HIST, /*!< a tran to history was taken */
242 QS_QEP_TRAN_EP, /*!< a tran to entry point into a submachine */
243 QS_QEP_TRAN_XP, /*!< a tran to exit point out of a submachine */
244
245 /* [58] Miscellaneous QS records (not maskable) */
246 QS_TEST_PAUSED, /*!< test has been paused */
247 QS_TEST_PROBE_GET, /*!< reports that Test-Probe has been used */
248 QS_SIG_DICT, /*!< signal dictionary entry */
249 QS_OBJ_DICT, /*!< object dictionary entry */
250 QS_FUN_DICT, /*!< function dictionary entry */
251 QS_USR_DICT, /*!< user QS record dictionary entry */
252 QS_TARGET_INFO, /*!< reports the Target information */
253 QS_TARGET_DONE, /*!< reports completion of a user callback */
254 QS_RX_STATUS, /*!< reports QS data receive status */
255 QS_QUERY_DATA, /*!< reports the data from "current object" query */
256 QS_PEEK_DATA, /*!< reports the data from the PEEK query */
257 QS_ASSERT_FAIL, /*!< assertion failed in the code */
258 QS_QF_RUN, /*!< QF_run() was entered */
259
260 /* [71] Semaphore (SEM) records */
261 QS_SEM_TAKE, /*!< a semaphore was taken by a thread */
262 QS_SEM_BLOCK, /*!< a semaphore blocked a thread */
263 QS_SEM_SIGNAL, /*!< a semaphore was signaled */
264 QS_SEM_BLOCK_ATTEMPT, /*!< a semaphore blocked was attempted */
265
266 /* [75] Mutex (MTX) records */
267 QS_MTX_LOCK, /*!< a mutex was locked */
268 QS_MTX_BLOCK, /*!< a mutex blocked a thread */
269 QS_MTX_UNLOCK, /*!< a mutex was unlocked */
270 QS_MTX_LOCK_ATTEMPT, /*!< a mutex lock was attempted */
271 QS_MTX_BLOCK_ATTEMPT, /*!< a mutex blocking was attempted */
272 QS_MTX_UNLOCK_ATTEMPT,/*!< a mutex unlock was attempted */
273
274 /* [81] */
275 QS_PRE_MAX /*!< the number of predefined signals */
277
278/*${QS::QSpyGroups} ........................................................*/
279/*! QS record groups for QS_GLB_FILTER()
280* @static @public @memberof QS
281*/
283 QS_ALL_RECORDS = 0xF0,/*!< all maskable QS records */
284 QS_SM_RECORDS, /*!< State Machine QS records */
285 QS_AO_RECORDS, /*!< Active Object QS records */
286 QS_EQ_RECORDS, /*!< Event Queues QS records */
287 QS_MP_RECORDS, /*!< Memory Pools QS records */
288 QS_TE_RECORDS, /*!< Time Events QS records */
289 QS_QF_RECORDS, /*!< QF QS records */
290 QS_SC_RECORDS, /*!< Scheduler QS records */
291 QS_SEM_RECORDS, /*!< Semaphore QS records */
292 QS_MTX_RECORDS, /*!< Mutex QS records */
293 QS_U0_RECORDS, /*!< User Group 100-104 records */
294 QS_U1_RECORDS, /*!< User Group 105-109 records */
295 QS_U2_RECORDS, /*!< User Group 110-114 records */
296 QS_U3_RECORDS, /*!< User Group 115-119 records */
297 QS_U4_RECORDS, /*!< User Group 120-124 records */
298 QS_UA_RECORDS /*!< All User records */
300
301/*${QS::QSpyUserOffsets} ...................................................*/
302/*! QS user record group offsets for QS_GLB_FILTER()
303* @static @public @memberof QS
304*/
306 QS_USER = 100, /*!< the first record available to QS users */
307 QS_USER0 = (enum_t)QS_USER, /*!< offset for User Group 0 */
308 QS_USER1 = (enum_t)QS_USER0 + 5, /*!< offset for User Group 1 */
309 QS_USER2 = (enum_t)QS_USER1 + 5, /*!< offset for User Group 2 */
310 QS_USER3 = (enum_t)QS_USER2 + 5, /*!< offset for User Group 3 */
311 QS_USER4 = (enum_t)QS_USER3 + 5 /*!< offset for User Group 4 */
313
314/*${QS::QSpyIdOffsets} .....................................................*/
315/*! QS ID offsets for QS_LOC_FILTER()
316* @static @public @memberof QS
317*/
319 QS_AO_ID = 0, /*!< offset for AO priorities */
320 QS_EP_ID = 64, /*!< offset for event-pool IDs */
321 QS_EQ_ID = 80, /*!< offset for event-queue IDs */
322 QS_AP_ID = 96 /*!< offset for Application-specific IDs */
324
325/*${QS::QSpyIdGroups} ......................................................*/
326/*! QS ID groups for QS_LOC_FILTER()
327* @static @public @memberof QS
328*/
330 QS_ALL_IDS = 0xF0, /*!< all QS IDs */
331 QS_AO_IDS = (0x80 + (enum_t)QS_AO_ID), /*!< AO IDs (priorities) */
332 QS_EP_IDS = (0x80 + (enum_t)QS_EP_ID), /*!< event-pool IDs */
333 QS_EQ_IDS = (0x80 + (enum_t)QS_EQ_ID), /*!< event-queue IDs */
334 QS_AP_IDS = (0x80 + (enum_t)QS_AP_ID) /*!< Application-specific IDs */
336
337/*${QS::QSpyFunPtr} ........................................................*/
338/*! function pointer type for QS_fun_dict_pre_()
339* @static @private @memberof QS
340*/
341typedef void (* QSpyFunPtr )(void);
342
343/*${QS::QSpyId} ............................................................*/
344/*! @brief QS ID type for applying local filtering
345* @static @public @memberof QS
346*/
347typedef struct { uint8_t prio; } QSpyId;
348
349/*${QS::QS-tx::tx} .........................................................*/
350/*! @brief Software tracing, output (QS-TX)
351* @class QS
352*
353* @details
354* This class groups together QS services.
355*/
356typedef struct {
357/* public: */
358
359 /*! global on/off QS filter */
360 uint8_t glbFilter[16];
361
362 /*! local on/off QS filter */
363 uint8_t locFilter[16];
364
365 /*! @deprecated old local QS filter */
366 void const * locFilter_AP;
367
368 /*! pointer to the start of the QS-TX ring buffer */
369 uint8_t * buf;
370
371 /*! offset of the end of the ring buffer */
373
374 /*! offset to where next byte will be inserted */
375 QSCtr volatile head;
376
377 /*! offset of where next record will be extracted */
378 QSCtr volatile tail;
379
380 /*! number of bytes currently in the ring buffer */
381 QSCtr volatile used;
382
383 /*! sequence number of the last inserted QS record */
384 uint8_t volatile seq;
385
386 /*! checksum of the currently inserted record */
387 uint8_t volatile chksum;
388
389 /*! critical section nesting level */
390 uint8_t volatile critNest;
391
392 /* flags for internal use */
393 uint8_t flags;
394} QS_tx;
395
396/*${QS::QS-tx::preType} ....................................................*/
397/*! Enumerates data elements for app-specific trace records */
399 QS_I8_ENUM_T, /*!< signed 8-bit integer or enum format */
400 QS_U8_T, /*!< unsigned 8-bit integer format */
401 QS_I16_T, /*!< signed 16-bit integer format */
402 QS_U16_T, /*!< unsigned 16-bit integer format */
403 QS_I32_T, /*!< signed 32-bit integer format */
404 QS_U32_T, /*!< unsigned 32-bit integer format */
405 QS_F32_T, /*!< 32-bit floating point format */
406 QS_F64_T, /*!< 64-bit floating point format */
407 QS_STR_T, /*!< zero-terminated ASCII string format */
408 QS_MEM_T, /*!< up to 255-bytes memory block format */
409 QS_SIG_T, /*!< event signal format */
410 QS_OBJ_T, /*!< object pointer format */
411 QS_FUN_T, /*!< function pointer format */
412 QS_I64_T, /*!< signed 64-bit integer format */
413 QS_U64_T /*!< unsigned 64-bit integer format */
415
416/*${QS::QS-tx::priv_} ......................................................*/
417/*! the only instance of the QS-TX object (Singleton) */
418extern QS_tx QS_priv_;
419
420/*${QS::QS-tx::initBuf} ....................................................*/
421/*! Initialize the QS-TX data buffer
422* @static @public @memberof QS_tx
423*
424* @details
425* This function should be called from QS_onStartup() to provide
426* QS with the data buffer. The first argument `sto` is the address
427* of the memory block, and the second argument `stoSize` is the size
428* of this block [in bytes]. Currently the size of the QS buffer cannot
429* exceed 64KB.
430*
431* @param[in] sto pointer to the storage for the transmit buffer
432* @param[in] stoSize size in [bytes] of the storage buffer
433*
434* @remark
435* QS can work with quite small data buffers, but you will start losing
436* data if the buffer is too small for the bursts of tracing activity.
437* The right size of the buffer depends on the data production rate and
438* the data output rate. QS offers flexible filtering to reduce the data
439* production rate.
440*
441* @note
442* If the data output rate cannot keep up with the production rate,
443* QS will start overwriting the older data with newer data. This is
444* consistent with the "last-is-best" QS policy. The record sequence
445* counters and check sums on each record allow the QSPY host utility
446* to easily detect any data loss.
447*/
449 uint8_t * const sto,
450 uint_fast32_t const stoSize);
451
452/*${QS::QS-tx::getByte} ....................................................*/
453/*! Byte-oriented interface to the QS-TX data buffer
454* @static @public @memberof QS_tx
455*
456* @details
457* This function delivers one byte at a time from the QS data buffer.
458*
459* @returns
460* the byte in the least-significant 8-bits of the 16-bit return
461* value if the byte is available. If no more data is available at the
462* time, the function returns ::QS_EOD (End-Of-Data).
463*
464* @note
465* QS_getByte() is NOT protected with a critical section.
466*/
467uint16_t QS_getByte(void);
468
469/*${QS::QS-tx::getBlock} ...................................................*/
470/*! Block-oriented interface to the QS-TX data buffer
471* @static @public @memberof QS_tx
472*
473* @details
474* This function delivers a contiguous block of data from the QS data
475* buffer. The function returns the pointer to the beginning of the
476* block, and writes the number of bytes in the block to the location
477* pointed to by `pNbytes`. The argument `pNbytes` is also used as
478* input to provide the maximum size of the data block that the caller
479* can accept.
480*
481* @param[in,out] pNbytes pointer to the number of bytes to send.
482* On input, `pNbytes` specifies the maximum number
483* of bytes that the function can provide.
484* On output, `pNbytes` contains the actual number
485* of bytes available.
486* @returns
487* if data is available, the function returns pointer to the
488* contiguous block of data and sets the value pointed to by `pNbytes`
489* to the # available bytes. If data is available at the time the
490* function is called, the function returns NULL pointer and sets the
491* value pointed to by `pNbytes` to zero.
492*
493* @note
494* Only the NULL return from QS_getBlock() indicates that the QS
495* buffer is empty at the time of the call. The non-NULL return often
496* means that the block is at the end of the buffer and you need to call
497* QS_getBlock() again to obtain the rest of the data that
498* "wrapped around" to the beginning of the QS data buffer.
499*
500* @note QS_getBlock() is **not** protected with a critical section.
501*/
502uint8_t const * QS_getBlock(uint16_t * const pNbytes);
503
504/*${QS::QS-tx::glbFilter_} .................................................*/
505/*! Set/clear the global Filter for a given QS record or a group
506* of records
507* @static @public @memberof QS_tx
508*
509* @details
510* This function sets up the QS filter to enable record types specified
511* in the `filter` parameter. The value #QS_ALL_RECORDS specifies to
512* filter-in all records. This function should be called indirectly
513* through the macro QS_GLB_FILTER()
514*
515* @param[in] filter the QS record-d or group to enable in the filter,
516* if positive or disable, if negative. The record-id
517* numbers must be in the range -127..127.
518* @note
519* Filtering based on the record-type is only the first layer of
520* filtering. The second layer is based on the object-type. Both filter
521* layers must be enabled for the QS record to be inserted in the
522* QS buffer.
523*
524* @sa QS_locFilter_()
525*/
526void QS_glbFilter_(int_fast16_t const filter);
527
528/*${QS::QS-tx::locFilter_} .................................................*/
529/*! Set/clear the local Filter for a given object-id
530* or a group of object-ids
531* @static @public @memberof QS_tx
532*
533* @details
534* This function sets up the local QS filter to enable or disable the
535* given QS object-id or a group of object-ids @a filter.
536* This function should be called indirectly through the macro
537* QS_LOC_FILTER()
538*
539* @param[in] filter the QS object-id or group to enable in the filter,
540* if positive or disable, if negative. The qs_id numbers
541* must be in the range 1..127.
542* @note
543* Filtering based on the object-id (local filter) is the second layer
544* of filtering. The first layer is based on the QS record-type (global
545* filter). Both filter layers must be enabled for the QS record to be
546* inserted into the QS buffer.
547*
548* @sa QS_glbFilter_()
549*/
550void QS_locFilter_(int_fast16_t const filter);
551
552/*${QS::QS-tx::doOutput} ...................................................*/
553/*! Perform the QS-TX output (implemented in some QS ports)
554* @static @public @memberof QS_tx
555*/
556void QS_doOutput(void);
557
558/*${QS::QS-tx::beginRec_} ..................................................*/
559/*! Mark the begin of a QS record `rec`
560* @static @private @memberof QS_tx
561*
562* @details
563* This function must be called at the beginning of each QS record.
564* This function should be called indirectly through the macro QS_BEGIN_ID(),
565* or QS_BEGIN_NOCRIT(), depending if it's called in a normal code or from
566* a critical section.
567*/
568void QS_beginRec_(uint_fast8_t const rec);
569
570/*${QS::QS-tx::endRec_} ....................................................*/
571/*! Mark the end of a QS record `rec`
572* @static @private @memberof QS_tx
573*
574* @details
575* This function must be called at the end of each QS record.
576* This function should be called indirectly through the macro QS_END(),
577* or QS_END_NOCRIT(), depending if it's called in a normal code or from
578* a critical section.
579*/
580void QS_endRec_(void);
581
582/*${QS::QS-tx::u8_raw_} ....................................................*/
583/*! output uint8_t data element without format information
584* @static @private @memberof QS_tx
585*/
586void QS_u8_raw_(uint8_t const d);
587
588/*${QS::QS-tx::2u8_raw_} ...................................................*/
589/*! output two uint8_t data elements without format information
590* @static @private @memberof QS_tx
591*/
593 uint8_t const d1,
594 uint8_t const d2);
595
596/*${QS::QS-tx::u16_raw_} ...................................................*/
597/*! output uint16_t data element without format information
598* @static @private @memberof QS_tx
599*/
600void QS_u16_raw_(uint16_t const d);
601
602/*${QS::QS-tx::u32_raw_} ...................................................*/
603/*! output uint32_t data element without format information
604* @static @private @memberof QS_tx
605*/
606void QS_u32_raw_(uint32_t const d);
607
608/*${QS::QS-tx::obj_raw_} ...................................................*/
609/*! Output obj pointer data element without format information
610* @static @private @memberof QS_tx
611*
612* @note This function is only to be used through macros, never in the
613* client code directly.
614*/
615void QS_obj_raw_(void const * const obj);
616
617/*${QS::QS-tx::str_raw_} ...................................................*/
618/*! Output raw zero-terminated string element (without format information)
619* @static @private @memberof QS_tx
620*
621* @note This function is only to be used through macros, never in the
622* client code directly.
623*/
624void QS_str_raw_(char const * const str);
625
626/*${QS::QS-tx::u8_fmt_} ....................................................*/
627/*! Output uint8_t data element with format information
628* @static @private @memberof QS_tx
629*
630* @details
631* @note This function is only to be used through macros, never in the
632* client code directly.
633*/
635 uint8_t const format,
636 uint8_t const d);
637
638/*${QS::QS-tx::u16_fmt_} ...................................................*/
639/*! output uint16_t data element with format information
640* @static @private @memberof QS_tx
641*
642* @details
643* This function is only to be used through macros, never in the
644* client code directly.
645*/
647 uint8_t const format,
648 uint16_t const d);
649
650/*${QS::QS-tx::u32_fmt_} ...................................................*/
651/*! Output uint32_t data element with format information
652* @static @private @memberof QS_tx
653*
654* @note This function is only to be used through macros, never in the
655* client code directly.
656*/
658 uint8_t const format,
659 uint32_t const d);
660
661/*${QS::QS-tx::str_fmt_} ...................................................*/
662/*! Output formatted zero-terminated ASCII string to the QS record
663* @static @private @memberof QS_tx
664*/
665void QS_str_fmt_(char const * const str);
666
667/*${QS::QS-tx::mem_fmt_} ...................................................*/
668/*! Output formatted memory block of up to 255 bytes to the QS record
669* @static @private @memberof QS_tx
670*/
672 uint8_t const * const blk,
673 uint8_t const size);
674
675/*${QS::QS-tx::sig_dict_pre_} ..............................................*/
676/*! Output predefined signal-dictionary record
677* @static @private @memberof QS_tx
678*
679* @note This function is only to be used through macro QS_SIG_DICTIONARY()
680*/
682 enum_t const sig,
683 void const * const obj,
684 char const * const name);
685
686/*${QS::QS-tx::obj_dict_pre_} ..............................................*/
687/*! Output predefined object-dictionary record
688* @static @private @memberof QS_tx
689*
690* @note This function is only to be used through macro QS_OBJ_DICTIONARY()
691*/
693 void const * const obj,
694 char const * const name);
695
696/*${QS::QS-tx::obj_arr_dict_pre_} ..........................................*/
697/*! Output predefined object-array dictionary record
698* @static @private @memberof QS_tx
699*
700* @note This function is only to be used through macro QS_OBJ_ARR_DICTIONARY()
701*/
703 void const * const obj,
704 uint_fast16_t const idx,
705 char const * const name);
706
707/*${QS::QS-tx::fun_dict_pre_} ..............................................*/
708/*! Output predefined function-dictionary record
709* @static @private @memberof QS_tx
710*
711* @note This function is only to be used through macro QS_FUN_DICTIONARY()
712*/
714 QSpyFunPtr const fun,
715 char const * const name);
716
717/*${QS::QS-tx::usr_dict_pre_} ..............................................*/
718/*! Output predefined user-dictionary record
719* @static @private @memberof QS_tx
720*
721* @note This function is only to be used through macro QS_USR_DICTIONARY()
722*/
724 enum_t const rec,
725 char const * const name);
726
727/*${QS::QS-tx::enum_dict_pre_} .............................................*/
728/*! Output predefined enum-dictionary record
729* @static @private @memberof QS_tx
730*
731* @note This function is only to be used through macro QS_ENUM_DICTIONARY()
732*/
734 enum_t const value,
735 uint8_t const group,
736 char const * const name);
737
738/*${QS::QS-tx::ASSERTION} ..................................................*/
739/*! Output the predefined assertion failure trace record
740* @static @public @memberof QS_tx
741*
742* @details
743* This trace record is intended to use from the Q_onAssert() callback.
744*/
746 char const * const module,
747 int_t const loc,
748 uint32_t const delay);
749
750/*${QS::QS-tx::target_info_pre_} ...........................................*/
751/*! Helper function to output the predefined Target-info trace record
752* @static @private @memberof QS_tx
753*/
754void QS_target_info_pre_(uint8_t const isReset);
755
756/*${QS::QS-tx::onStartup} ..................................................*/
757/*! Callback to startup the QS facility
758* @static @public @memberof QS_tx
759*/
760uint8_t QS_onStartup(void const * arg);
761
762/*${QS::QS-tx::onCleanup} ..................................................*/
763/*! Callback to cleanup the QS facility
764* @static @public @memberof QS_tx
765*/
766void QS_onCleanup(void);
767
768/*${QS::QS-tx::onFlush} ....................................................*/
769/*! Callback to flush the QS trace data to the host
770* @static @public @memberof QS_tx
771*/
772void QS_onFlush(void);
773
774/*${QS::QS-tx::onGetTime} ..................................................*/
775/*! Callback to obtain a timestamp for a QS record
776* @static @public @memberof QS_tx
777*/
779
780/*${QS::QS-tx-64bit::u64_raw_} .............................................*/
781/*! Output uint64_t data element without format information
782* @static @private @memberof QS_tx
783*/
784void QS_u64_raw_(uint64_t d);
785
786/*${QS::QS-tx-64bit::u64_fmt_} .............................................*/
787/*! Output uint64_t data element with format information
788* @static @private @memberof QS_tx
789*
790* @sa QS_U64(), QS_I64()
791*/
793 uint8_t format,
794 uint64_t d);
795
796/*${QS::QS-tx-fp::f32_fmt_} ................................................*/
797/*! Output 32-bit floating point data element with format information
798* @static @private @memberof QS_tx
799*
800* @sa QS_F32()
801*/
803 uint8_t const format,
804 float32_t const d);
805
806/*${QS::QS-tx-fp::f64_fmt_} ................................................*/
807/*! Output 64-bit floating point data element with format information
808* @static @private @memberof QS_tx
809*
810* @sa QS_F64()
811*/
813 uint8_t const format,
814 float64_t const d);
815
816/*${QS::QS-rx::rx} .........................................................*/
817/*! @brief QS software tracing parameters for QS input (QS-RX)
818* @class QS_rx
819*/
820typedef struct {
821/* public: */
822 void * currObj[8];
823 uint8_t * buf;
825 QSCtr volatile head;
826 QSCtr volatile tail;
827
828#ifdef Q_UTEST
830#endif /* def Q_UTEST */
831} QS_rx;
832
833/*${QS::QS-rx::rxPriv_} ....................................................*/
834/*! the only instance of the QS-RX object (Singleton)
835* @static @private @memberof QS_rx
836*/
838
839/*${QS::QS-rx::QSpyObjKind} ................................................*/
840/*! Kinds of objects used in QS_setCurrObj() and QS_queryCurrObj()
841* @static @public @memberof QS_rx
842*/
844 SM_OBJ, /*!< state machine object */
845 AO_OBJ, /*!< active object */
846 MP_OBJ, /*!< event pool object */
847 EQ_OBJ, /*!< raw queue object */
848 TE_OBJ, /*!< time event object */
849 AP_OBJ, /*!< generic Application-specific object */
850 MAX_OBJ
852
853/*${QS::QS-rx::OSpyObjCombnation} ..........................................*/
854/*! Object combinations for QS_setCurrObj() and QS_queryCurrObj()
855* @static @public @memberof QS_rx
856*/
858 SM_AO_OBJ = (enum_t)MAX_OBJ /*!< combination of SM and AO */
860
861/*${QS::QS-rx::rxInitBuf} ..................................................*/
862/*! Initialize the QS-RX data buffer
863* @static @public @memberof QS_rx
864*
865* @details
866* This function should be called from QS::onStartup() to provide QS-RX
867* with the receive data buffer.
868*
869* @param[in] sto pointer to the memory block for input buffer
870* @param[in] stoSize the size of this block [bytes]. The size of the
871* QS-RX buffer cannot exceed 64KB.
872*
873* @note
874* QS-RX can work with quite small data buffers, but you will start
875* losing data if the buffer is not drained fast enough (e.g., in the
876* idle task).
877*
878* @note
879* If the data input rate exceeds the QS-RX processing rate, the data
880* will be lost, but the QS protocol will notice that:
881* (1) that the checksum in the incomplete QS records will fail; and
882* (2) the sequence counter in QS records will show discontinuities.
883*
884* The QS-RX channel will report any data errors by sending the
885* QS_RX_DATA_ERROR trace record.
886*/
888 uint8_t * const sto,
889 uint16_t const stoSize);
890
891/*${QS::QS-rx::rxPut} ......................................................*/
892/*! Put one byte into the QS-RX lock-free buffer
893* @static @public @memberof QS_rx
894*/
895static inline bool QS_rxPut(uint8_t const b) {
896 QSCtr head = QS_rxPriv_.head + 1U;
897 if (head == QS_rxPriv_.end) {
898 head = 0U;
899 }
900 if (head != QS_rxPriv_.tail) { /* buffer NOT full? */
901 QS_rxPriv_.buf[QS_rxPriv_.head] = b;
902 QS_rxPriv_.head = head; /* update the head to a *valid* index */
903 return true; /* byte placed in the buffer */
904 }
905 else {
906 return false; /* byte NOT placed in the buffer */
907 }
908}
909
910/*${QS::QS-rx::rxGetNfree} .................................................*/
911/*! Obtain the number of free bytes in the QS-RX data buffer
912* @static @public @memberof QS_rx
913*
914* @details
915* This function is intended to be called from the ISR that reads the
916* QS-RX bytes from the QSPY application. The function returns the
917* conservative number of free bytes currently available in the buffer,
918* assuming that the head pointer is not being moved concurrently.
919* The tail pointer might be moving, meaning that bytes can be
920* concurrently removed from the buffer.
921*/
922uint16_t QS_rxGetNfree(void);
923
924/*${QS::QS-rx::doInput} ....................................................*/
925/*! Perform the QS-RX input (implemented in some QS ports)
926* @static @public @memberof QS_rx
927*/
928void QS_doInput(void);
929
930/*${QS::QS-rx::setCurrObj} .................................................*/
931/*! Set the "current object" in the Target
932* @static @public @memberof QS_rx
933*
934* @details
935* This function sets the "current object" in the Target.
936*/
938 uint8_t const obj_kind,
939 void * const obj_ptr);
940
941/*${QS::QS-rx::queryCurrObj} ...............................................*/
942/*! Query the "current object" in the Target
943* @static @public @memberof QS_rx
944*
945* @details
946* This function programmatically generates the response to the query for
947* a "current object".
948*/
949void QS_queryCurrObj(uint8_t const obj_kind);
950
951/*${QS::QS-rx::rxParse} ....................................................*/
952/*! Parse all bytes present in the QS-RX data buffer
953* @static @public @memberof QS_rx
954*/
955void QS_rxParse(void);
956
957/*${QS::QS-rx::rxHandleGoodFrame_} .........................................*/
958/*! internal function to handle incoming (QS-RX) packet
959* @static @private @memberof QS_rx
960*/
961void QS_rxHandleGoodFrame_(uint8_t const state);
962
963/*${QS::QS-rx::onReset} ....................................................*/
964/*! callback function to reset the Target (to be implemented in the BSP)
965* @static @public @memberof QS_rx
966*/
967void QS_onReset(void);
968
969/*${QS::QS-rx::onCommand} ..................................................*/
970/*! Callback function to execute user commands (to be implemented in BSP)
971* @static @public @memberof QS_rx
972*/
974 uint8_t cmdId,
975 uint32_t param1,
976 uint32_t param2,
977 uint32_t param3);
978
979/*${QS::QS-rx::RX_PUT} .....................................................*/
980/*! Put one byte into the QS RX lock-free buffer
981* @static @public @memberof QS_rx
982*/
983bool QS_RX_PUT(uint8_t const b);
984/*$enddecl${QS} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
985
986/*==========================================================================*/
987/*$declare${QS-macros} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
988
989/*${QS-macros::QS_INIT} ....................................................*/
990/*! Initialize the QS facility
991*
992* @details
993* This macro provides an indirection layer to invoke the QS initialization
994* routine if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
995* @sa QS_onStartup(), example of setting up a QS filter in
996* QS_GLB_FILTER()
997*/
998#define QS_INIT(arg_) (QS_onStartup(arg_))
999
1000/*${QS-macros::QS_EXIT} ....................................................*/
1001/*! Cleanup the QS facility
1002*
1003* @details
1004* This macro provides an indirection layer to invoke the QS cleanup
1005* routine if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1006* @sa QS_onCleanup()
1007*/
1008#define QS_EXIT() (QS_onCleanup())
1009
1010/*${QS-macros::QS_OUTPUT} ..................................................*/
1011/*! macro to handle the QS output from the application
1012*
1013* @note
1014* If this macro is used, the application must define QS_output().
1015*/
1016#define QS_OUTPUT() (QS_output())
1017
1018/*${QS-macros::QS_RX_INPUT} ................................................*/
1019/*! macro to handle the QS-RX input to the application
1020*
1021* @note
1022* If this macro is used, the application must define QS_doInput().
1023*/
1024#define QS_RX_INPUT() (QS_rx_input())
1025
1026/*${QS-macros::QS_GLB_FILTER} ..............................................*/
1027/*! Global Filter ON for a given record type `rec_`
1028*
1029* @details
1030* This macro provides an indirection layer to call QS_filterOn()
1031* if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1032*
1033* @sa
1034* - enum QSpyGroups - QS record groups that can be used as `rec_`
1035* - enum QSpyPre - predefined QS records that can be used as `rec_`
1036*
1037* @usage
1038* The following example shows how to use QS filters:
1039* @include qs_filter.c
1040*/
1041#define QS_GLB_FILTER(rec_) (QS_glbFilter_((int_fast16_t)(rec_)))
1042
1043/*${QS-macros::QS_LOC_FILTER} ..............................................*/
1044/*! Local Filter for a given state machine object `qs_id`
1045*
1046* @details
1047* This macro provides an indirection layer to call QS_locFilter_()
1048* if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1049*
1050* @sa
1051* - enum QSpyIdGroups - QS ID groups that can be used as `qs_id_`
1052* - enum QSpyIdOffsets - QS ID offsets for `qs_id_` (e.g., QS_AP_IDS + 5)
1053*
1054* The following example shows how to use QS filters:
1055* @include qs_filter.c
1056*/
1057#define QS_LOC_FILTER(qs_id_) (QS_locFilter_((int_fast16_t)(qs_id_)))
1058
1059/*${QS-macros::QS_BEGIN_ID} ................................................*/
1060/*! Begin an application-specific QS record with entering critical section
1061*
1062* @details
1063* The following example shows how to build a user QS record using the
1064* macros QS_BEGIN_ID(), QS_END(), and the formatted output macros:
1065* QS_U8(), QS_STR(), etc.
1066*
1067* @note
1068* Must always be used in pair with QS_END()
1069*
1070* @include qs_ap.c
1071*/
1072#define QS_BEGIN_ID(rec_, qs_id_) \
1073if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
1074 QS_CRIT_STAT_ \
1075 QS_CRIT_E_(); \
1076 QS_beginRec_((uint_fast8_t)(rec_)); \
1077 QS_TIME_PRE_(); {
1078
1079/*${QS-macros::QS_END} .....................................................*/
1080/*! End an application-specific QS record with exiting critical section.
1081*
1082* @sa example for QS_BEGIN_ID()
1083* @note Must always be used in pair with QS_BEGIN_ID()
1084*/
1085#define QS_END() } \
1086 QS_endRec_(); \
1087 QS_CRIT_X_(); \
1088}
1089
1090/*${QS-macros::QS_FLUSH} ...................................................*/
1091/*! Flush the QS trace data to the host
1092*
1093* @details
1094* This macro invokes the QS_flush() platform-dependent callback
1095* function to flush the QS trace buffer to the host. The function
1096* typically busy-waits until all the data in the buffer is sent to
1097* the host. This is acceptable only in the initial transient.
1098*/
1099#define QS_FLUSH() (QS_onFlush())
1100
1101/*${QS-macros::QS_BEGIN_NOCRIT} ............................................*/
1102/*! Begin an application-specific QS record WITHOUT entering critical section */
1103#define QS_BEGIN_NOCRIT(rec_, qs_id_) \
1104if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
1105 QS_beginRec_((uint_fast8_t)(rec_)); \
1106 QS_TIME_PRE_(); {
1107
1108/*${QS-macros::QS_END_NOCRIT} ..............................................*/
1109/*! End an application-specific QS record WITHOUT exiting critical section */
1110#define QS_END_NOCRIT() } \
1111 QS_endRec_();\
1112}
1113
1114/*${QS-macros::QS_GLB_CHECK_} ..............................................*/
1115/*! Helper macro for checking the global QS filter */
1116#define QS_GLB_CHECK_(rec_) \
1117 (((uint_fast8_t)QS_priv_.glbFilter[(uint_fast8_t)(rec_) >> 3U] \
1118 & ((uint_fast8_t)1U << ((uint_fast8_t)(rec_) & 7U))) != 0U)
1119
1120/*${QS-macros::QS_LOC_CHECK_} ..............................................*/
1121/*! Helper macro for checking the local QS filter */
1122#define QS_LOC_CHECK_(qs_id_) \
1123 (((uint_fast8_t)QS_priv_.locFilter[(uint_fast8_t)(qs_id_) >> 3U] \
1124 & ((uint_fast8_t)1U << ((uint_fast8_t)(qs_id_) & 7U))) != 0U)
1125
1126/*${QS-macros::QS_REC_DONE} ................................................*/
1127#ifndef QS_REC_DONE
1128/*! Macro to execute user code when a QS record is produced
1129*
1130* @note
1131* This is a dummy definition in case this macro is undefined.
1132*/
1133#define QS_REC_DONE() ((void)0)
1134#endif /* ndef QS_REC_DONE */
1135
1136/*${QS-macros::QS_I8} ......................................................*/
1137/*! Output formatted int8_t to the QS record */
1138#define QS_I8(width_, data_) \
1139 (QS_u8_fmt_((uint8_t)(((width_) << 4U) & 0x7U) | (uint8_t)QS_I8_ENUM_T, \
1140 (data_)))
1141
1142/*${QS-macros::QS_U8} ......................................................*/
1143/*! Output formatted uint8_t to the QS record */
1144#define QS_U8(width_, data_) \
1145 (QS_u8_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))
1146
1147/*${QS-macros::QS_I16} .....................................................*/
1148/*! Output formatted int16_t to the QS record */
1149#define QS_I16(width_, data_) \
1150 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))
1151
1152/*${QS-macros::QS_U16} .....................................................*/
1153/*! Output formatted uint16_t to the QS record */
1154#define QS_U16(width_, data_) \
1155 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))
1156
1157/*${QS-macros::QS_I32} .....................................................*/
1158/*! Output formatted int32_t to the QS record */
1159#define QS_I32(width_, data_) \
1160 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))
1161
1162/*${QS-macros::QS_U32} .....................................................*/
1163/*! Output formatted uint32_t to the QS record */
1164#define QS_U32(width_, data_) \
1165 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))
1166
1167/*${QS-macros::QS_I64} .....................................................*/
1168/*! Output formatted int64_t to the QS record */
1169#define QS_I64(width_, data_) \
1170 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))
1171
1172/*${QS-macros::QS_U64} .....................................................*/
1173/*! Output formatted uint64_t to the QS record */
1174#define QS_U64(width_, data_) \
1175 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))
1176
1177/*${QS-macros::QS_F32} .....................................................*/
1178/*! Output formatted 32-bit floating point number to the QS record */
1179#define QS_F32(width_, data_) \
1180 (QS_f32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))
1181
1182/*${QS-macros::QS_F64} .....................................................*/
1183/*! Output formatted 64-bit floating point number to the QS record */
1184#define QS_F64(width_, data_) \
1185 (QS_f64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))
1186
1187/*${QS-macros::QS_STR} .....................................................*/
1188/*! Output formatted zero-terminated ASCII string to the QS record */
1189#define QS_STR(str_) (QS_str_fmt_((str_)))
1190
1191/*${QS-macros::QS_MEM} .....................................................*/
1192/*! Output formatted memory block of up to 255 bytes to the QS record */
1193#define QS_MEM(mem_, size_) (QS_mem_fmt_((mem_), (size_)))
1194
1195/*${QS-macros::QS_ENUM} ....................................................*/
1196/*! Output formatted enumeration to the QS record */
1197#define QS_ENUM(group_, value_) \
1198 (QS_u8_fmt_((uint8_t)(0x80U | ((group_) << 4U)) | (uint8_t)QS_I8_ENUM_T,\
1199 (uint8_t)(value_)))
1200
1201/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1202#if (QS_TIME_SIZE == 4U)
1203/*! Output time stamp to a QS record (used in predefined
1204* and application-specific trace records)
1205*/
1206#define QS_TIME_PRE_() (QS_u32_raw_(QS_onGetTime()))
1207#endif /* (QS_TIME_SIZE == 4U) */
1208
1209/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1210#if (QS_TIME_SIZE == 2U)
1211#define QS_TIME_PRE_() (QS_u16_raw_(QS_onGetTime()))
1212#endif /* (QS_TIME_SIZE == 2U) */
1213
1214/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1215#if (QS_TIME_SIZE == 1U)
1216#define QS_TIME_PRE_() (QS_u8_raw_(QS_onGetTime()))
1217#endif /* (QS_TIME_SIZE == 1U) */
1218
1219/*${QS-macros::QS_OBJ} .....................................................*/
1220#if (QS_OBJ_PTR_SIZE == 4U)
1221/*! Output formatted object pointer to the QS record */
1222#define QS_OBJ(obj_) (QS_u32_fmt_(QS_OBJ_T, (uint32_t)(obj_)))
1223#endif /* (QS_OBJ_PTR_SIZE == 4U) */
1224
1225/*${QS-macros::QS_OBJ} .....................................................*/
1226#if (QS_OBJ_PTR_SIZE == 2U)
1227#define QS_OBJ(obj_) (QS_u16_fmt_(QS_OBJ_T, (uint16_t)(obj_)))
1228#endif /* (QS_OBJ_PTR_SIZE == 2U) */
1229
1230/*${QS-macros::QS_OBJ} .....................................................*/
1231#if (QS_OBJ_PTR_SIZE == 1U)
1232#define QS_OBJ(obj_) (QS_u8_fmt_(QS_OBJ_T, (uint8_t)(obj_)))
1233#endif /* (QS_OBJ_PTR_SIZE == 1U) */
1234
1235/*${QS-macros::QS_OBJ} .....................................................*/
1236#if (QS_OBJ_PTR_SIZE == 8U)
1237#define QS_OBJ(obj_) (QS_u64_fmt_(QS_OBJ_T, (uint64_t)(obj_)))
1238#endif /* (QS_OBJ_PTR_SIZE == 8U) */
1239
1240/*${QS-macros::QS_FUN} .....................................................*/
1241#if (QS_FUN_PTR_SIZE == 4U)
1242/* Output formatted function pointer to the QS record */
1243#define QS_FUN(fun_) (QS_u32_fmt_(QS_FUN_T, (uint32_t)(fun_)))
1244#endif /* (QS_FUN_PTR_SIZE == 4U) */
1245
1246/*${QS-macros::QS_FUN} .....................................................*/
1247#if (QS_FUN_PTR_SIZE == 2U)
1248#define QS_FUN(fun_) (QS_u16_fmt_(QS_FUN_T, (uint16_t)(fun_)))
1249#endif /* (QS_FUN_PTR_SIZE == 2U) */
1250
1251/*${QS-macros::QS_FUN} .....................................................*/
1252#if (QS_FUN_PTR_SIZE == 1U)
1253#define QS_FUN(fun_) (QS_u8_fmt_(QS_FUN_T, (uint8_t)(fun_)))
1254#endif /* (QS_FUN_PTR_SIZE == 1U) */
1255
1256/*${QS-macros::QS_FUN} .....................................................*/
1257#if (QS_FUN_PTR_SIZE == 8U)
1258#define QS_FUN(fun_) (QS_u64_fmt_(QS_FUN_T, (uint64_t)(fun_)))
1259#endif /* (QS_FUN_PTR_SIZE == 8U) */
1260
1261/*${QS-macros::QS_SIG} .....................................................*/
1262#if (Q_SIGNAL_SIZE == 4U)
1263/*! Output formatted event signal (of type ::QSignal) and
1264* the state machine object to the user QS record
1265*/
1266#define QS_SIG(sig_, obj_) \
1267 QS_u32_fmt_(QS_SIG_T, (sig_)); \
1268 QS_obj_raw_(obj_)
1269#endif /* (Q_SIGNAL_SIZE == 4U) */
1270
1271/*${QS-macros::QS_SIG} .....................................................*/
1272#if (Q_SIGNAL_SIZE == 2U)
1273#define QS_SIG(sig_, obj_) \
1274 QS_u16_fmt_(QS_SIG_T, (sig_)); \
1275 QS_obj_raw_(obj_)
1276#endif /* (Q_SIGNAL_SIZE == 2U) */
1277
1278/*${QS-macros::QS_SIG} .....................................................*/
1279#if (Q_SIGNAL_SIZE == 1U)
1280#define QS_SIG(sig_, obj_) \
1281 QS_u8_fmt_(QS_SIG_T, (sig_)); \
1282 QS_obj_raw_(obj_)
1283#endif /* (Q_SIGNAL_SIZE == 1U) */
1284
1285/*${QS-macros::QS_SIG_DICTIONARY} ..........................................*/
1286/*! Output QS signal dictionary record
1287*
1288* @details
1289* A signal dictionary record associates the numerical value of the signal
1290* and the binary address of the state machine that consumes that signal
1291* with the human-readable name of the signal.
1292*
1293* @param[in] sig_ event signal (typically enumerated, e.g. `TIMEOUT_SIG`)
1294* @param[in] obj_ pointer to the associated state machine object
1295* (might be `(void*)0` for globally recognized signals)
1296*
1297* A signal dictionary entry is associated with both the signal value `sig_`
1298* and the state machine `obj_`, because signals are required to be unique
1299* only within a given state machine and therefore the same numerical values
1300* can represent different signals in different state machines.
1301*
1302* For the "global" signals that have the same meaning in many state machines
1303* (such as globally published signals), you can specify a signal dictionary
1304* entry with the `obj_` parameter set to `(void*)0`.
1305*
1306* The following example shows the definition of signal dictionary entries
1307* in the initial transition of the Table active object. Please note that
1308* signals HUNGRY_SIG and DONE_SIG are associated with the Table state
1309* machine only ("me" `obj_` pointer). The EAT_SIG signal, on the other
1310* hand, is global (0 `obj_` pointer):
1311* @include qs_sigDic.c
1312*
1313* The following QSpy log example shows the signal dictionary records
1314* generated from the Table initial transition and subsequent records that
1315* show human-readable names of the signals:
1316* @include qs_sigLog.txt
1317*/
1318#define QS_SIG_DICTIONARY(sig_, obj_) \
1319 (QS_sig_dict_pre_((sig_), (obj_), #sig_))
1320
1321/*${QS-macros::QS_OBJ_DICTIONARY} ..........................................*/
1322/*! Output object dictionary record
1323*
1324* @details
1325* An object dictionary record associates the binary address of an object
1326* in the target's memory with the human-readable name of the object.
1327*
1328* @param[in] obj_ pointer to the object (any object)
1329*
1330* The following example shows the definition of object dictionary entry
1331* for the Table active object:
1332* @include qs_objDic.c
1333*/
1334#define QS_OBJ_DICTIONARY(obj_) \
1335 (QS_obj_dict_pre_((obj_), #obj_))
1336
1337/*${QS-macros::QS_OBJ_ARR_DICTIONARY} ......................................*/
1338/*! Output object-array dictionary record
1339*
1340* @details
1341* An object array dictionary record associates the binary address of the
1342* object element in the target's memory with the human-readable name
1343* of the object.
1344*
1345* @param[in] obj_ pointer to the object (any object)
1346* @param[in] idx_ array index
1347*
1348* The following example shows the definition of object array dictionary
1349* for `Philo::inst[n]` and `Philo::inst[n].m_timeEvt`:
1350* @include qs_objArrDic.c
1351*/
1352#define QS_OBJ_ARR_DICTIONARY(obj_, idx_) \
1353 (QS_obj_arr_dict_pre_((obj_), (idx_), #obj_))
1354
1355/*${QS-macros::QS_FUN_DICTIONARY} ..........................................*/
1356/*! Output function dictionary record
1357*
1358* @details
1359* A function dictionary record associates the binary address of a function
1360* in the target's memory with the human-readable name of the function.
1361*
1362* Providing a function dictionary QS record can vastly improve readability
1363* of the QS log, because instead of dealing with cryptic machine addresses
1364* the QSpy host utility can display human-readable function names.
1365*
1366* The example from #QS_SIG_DICTIONARY shows the definition of a function
1367* dictionary.
1368*/
1369#define QS_FUN_DICTIONARY(fun_) \
1370 (QS_fun_dict_pre_((void (*)(void))(fun_), #fun_))
1371
1372/*${QS-macros::QS_USR_DICTIONARY} ..........................................*/
1373/*! Output user QS record dictionary record
1374*
1375* @details
1376* A user QS record dictionary record associates the numerical value of a
1377* user record with the human-readable identifier.
1378*/
1379#define QS_USR_DICTIONARY(rec_) \
1380 (QS_usr_dict_pre_((rec_), #rec_))
1381
1382/*${QS-macros::QS_ENUM_DICTIONARY} .........................................*/
1383/*! Output enumeration dictionary record
1384*
1385* @details
1386* An enum QS record dictionary record associates the numerical value of
1387* an enumeration with the human-readable identifier.
1388*/
1389#define QS_ENUM_DICTIONARY(value_, group_) \
1390 (QS_enum_dict_pre_((value_), (group_), #value_))
1391
1392/*${QS-macros::QF_QS_CRIT_ENTRY} ...........................................*/
1393/*! Output the critical section entry record */
1395
1396/*${QS-macros::QF_QS_CRIT_EXIT} ............................................*/
1397/*! Output the critical section exit record */
1399
1400/*${QS-macros::QF_QS_ISR_ENTRY} ............................................*/
1401/*! Output the interrupt entry record */
1403 uint_fast8_t const isrnest,
1404 uint_fast8_t const prio_);
1405
1406/*${QS-macros::QF_QS_ISR_EXIT} .............................................*/
1407/*! Output the ISR exit trace record */
1409 uint_fast8_t isrnest,
1410 uint_fast8_t prio);
1411
1412/*${QS-macros::QF_QS_ACTION} ...............................................*/
1413/*! Execute an action that is only necessary for QS output */
1414#define QF_QS_ACTION(act_) (act_)
1415
1416/*${QS-macros::QS_EOD} .....................................................*/
1417/*! Constant representing End-Of-Data condition returned from the
1418* QS_getByte() function.
1419*/
1420#define QS_EOD ((uint16_t)0xFFFFU)
1421
1422/*${QS-macros::QS_CMD} .....................................................*/
1423/*! Constant representing command enumeration group
1424* in QS_ENUM_DICTIONARY() and QS_ENUM()
1425* @sa QS_onCommand()
1426*/
1427#define QS_CMD ((uint8_t)7U)
1428
1429/*${QS-macros::QS_HEX_FMT} .................................................*/
1430/*! Constant representing HEX format for the "width" filed
1431* in QS_U8(), QS_U16(), QS_U32(), and QS_U64().
1432*/
1433#define QS_HEX_FMT ((uint8_t)0x0FU)
1434/*$enddecl${QS-macros} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1435
1436/*==========================================================================*/
1437/* Facilities for QS critical section */
1438
1439/* QS-specific critical section */
1440#ifdef QS_CRIT_ENTRY /* separate QS critical section defined? */
1441
1442#ifndef QS_CRIT_STAT_TYPE
1443 #define QS_CRIT_STAT_
1444 #define QS_CRIT_E_() QS_CRIT_ENTRY(dummy)
1445 #define QS_CRIT_X_() QS_CRIT_EXIT(dummy); QS_REC_DONE()
1446#else
1447 #define QS_CRIT_STAT_ QS_CRIT_STAT_TYPE critStat_;
1448 #define QS_CRIT_E_() QS_CRIT_ENTRY(critStat_)
1449 #define QS_CRIT_X_() QS_CRIT_EXIT(critStat_); QS_REC_DONE()
1450#endif /* QS_CRIT_STAT_TYPE */
1451
1452#else /* separate QS critical section not defined--use the QF definition */
1453
1454#ifndef QF_CRIT_STAT_TYPE
1455 /*! This is an internal macro for defining the critical section
1456 * status type.
1457 * @details
1458 * The purpose of this macro is to enable writing the same code for the
1459 * case when critical section status type is defined and when it is not.
1460 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1461 * provides the definition of the critical section status variable.
1462 * Otherwise this macro is empty.
1463 * @sa #QF_CRIT_STAT_TYPE
1464 */
1465 #define QS_CRIT_STAT_
1466
1467 /*! This is an internal macro for entering a critical section.
1468 * @details
1469 * The purpose of this macro is to enable writing the same code for the
1470 * case when critical section status type is defined and when it is not.
1471 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1472 * invokes QF_CRIT_ENTRY() passing the key variable as the parameter.
1473 * Otherwise QF_CRIT_ENTRY() is invoked with a dummy parameter.
1474 * @sa QF_CRIT_ENTRY()
1475 */
1476 #define QS_CRIT_E_() QF_CRIT_ENTRY(dummy)
1477
1478 /*! This is an internal macro for exiting a critical section.
1479 * @details
1480 * The purpose of this macro is to enable writing the same code for the
1481 * case when critical section status type is defined and when it is not.
1482 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1483 * invokes QF_CRIT_EXIT() passing the key variable as the parameter.
1484 * Otherwise QF_CRIT_EXIT() is invoked with a dummy parameter.
1485 * @sa QF_CRIT_EXIT()
1486 */
1487 #define QS_CRIT_X_() QF_CRIT_EXIT(dummy); QS_REC_DONE()
1488
1489#elif (!defined QS_CRIT_STAT_)
1490
1491 #define QS_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_;
1492 #define QS_CRIT_E_() QF_CRIT_ENTRY(critStat_)
1493 #define QS_CRIT_X_() QF_CRIT_EXIT(critStat_); QS_REC_DONE()
1494
1495#endif /* simple unconditional interrupt disabling used */
1496
1497#endif /* separate QS critical section not defined */
1498
1499/*==========================================================================*/
1500/* Macros for use in QUTest only */
1501#ifdef Q_UTEST
1502
1503/*$declare${QUTest} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1504
1505/*${QUTest::QS::TProbe} ....................................................*/
1506/*! @brief Test Probe attributes */
1509 uint32_t data;
1510 uint8_t idx;
1511};
1512
1513/*${QUTest::QS::TestData} ..................................................*/
1514/*! @brief QUTest data */
1516 struct QS_TProbe tpBuf[16]; /*!< buffer of Test-Probes received so far */
1517 uint8_t tpNum; /*!< current number of Test-Probes */
1518 QSTimeCtr testTime; /*!< test time (tick counter) */
1519};
1520
1521/*${QUTest::QS::testData} ..................................................*/
1522/*! QUTest data */
1523extern struct QS_TestData QS_testData;
1524
1525/*${QUTest::QS::test_pause_} ...............................................*/
1526/*! internal function to pause test and enter the test event loop */
1528
1529/*${QUTest::QS::getTestProbe_} .............................................*/
1530/*! get the test probe data for the given API */
1531uint32_t QS_getTestProbe_(QSpyFunPtr const api);
1532
1533/*${QUTest::QS::onTestSetup} ...............................................*/
1534/*! callback to setup a unit test inside the Target */
1536
1537/*${QUTest::QS::onTestTeardown} ............................................*/
1538/*! callback to teardown after a unit test inside the Target */
1540
1541/*${QUTest::QS::onTestEvt} .................................................*/
1542/*! callback to "massage" the test event before dispatching/posting it */
1543void QS_onTestEvt(QEvt * e);
1544
1545/*${QUTest::QS::onTestPost} ................................................*/
1546/*! callback to examine an event that is about to be posted */
1548 void const * sender,
1549 QActive * recipient,
1550 QEvt const * e,
1551 bool status);
1552
1553/*${QUTest::QS::onTestLoop} ................................................*/
1554/*! callback to run the test loop */
1555void QS_onTestLoop(void);
1556
1557/*${QUTest::QUTEST_ON_POST} ................................................*/
1558/*! record-ID for posting events */
1559#define QUTEST_ON_POST 124
1560/*$enddecl${QUTest} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1561
1562/*--------------------------------------------------------------------------*/
1563/* QP-stub for QUTest
1564* NOTE: The QP-stub is needed for unit testing QP applications,
1565* but might NOT be needed for testing QP itself.
1566*/
1567#if Q_UTEST != 0
1568/*$declare${QUTest-stub::QS} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1569
1570/*${QUTest-stub::QS::processTestEvts_} .....................................*/
1571/*! internal function to process posted events during test */
1573/*$enddecl${QUTest-stub::QS} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1574/*$declare${QUTest-stub::QHsmDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1575
1576/*${QUTest-stub::QHsmDummy} ................................................*/
1577/*! @brief QHsmDummy class
1578* @class QHsmDummy
1579* @extends QHsm
1580*
1581* @details
1582* ::QHsmDummy is a test double for the role of "Orthogonal Components"
1583* HSM objects in QUTest unit testing.
1584*/
1585typedef struct {
1586/* protected: */
1587 QHsm super;
1588} QHsmDummy;
1589
1590/* public: */
1591
1592/*! Constructor of the QHsmDummy HSM class
1593* @public @memberof QHsmDummy
1594*/
1595void QHsmDummy_ctor(QHsmDummy * const me);
1596
1597/*! override for QHsm_init_()
1598* @private @memberof QHsmDummy
1599*/
1601 QHsm * const me,
1602 void const * const par,
1603 uint_fast8_t const qs_id);
1604
1605/*! override for QHsm_dispatch_()
1606* @private @memberof QHsmDummy
1607*/
1609 QHsm * const me,
1610 QEvt const * const e,
1611 uint_fast8_t const qs_id);
1612/*$enddecl${QUTest-stub::QHsmDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1613/*$declare${QUTest-stub::QActiveDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1614
1615/*${QUTest-stub::QActiveDummy} .............................................*/
1616/*! @brief QActiveDummy Object class
1617* @class QActiveDummy
1618* @extends QActive
1619*
1620* @details
1621* QActiveDummy is a test double for the role of collaborating active
1622* objects in QUTest unit testing.
1623*/
1624typedef struct {
1625/* protected: */
1626 QActive super;
1627} QActiveDummy;
1628
1629/* public: */
1630
1631/*! Constructor of the QActiveDummy Active Object class
1632* @public @memberof QActiveDummy
1633*/
1635
1636/*! override for QHsm_init_()
1637* @private @memberof QActiveDummy
1638*/
1640 QHsm * const me,
1641 void const * const par,
1642 uint_fast8_t const qs_id);
1643
1644/*! override for QHsm_dispatch_()
1645* @private @memberof QActiveDummy
1646*/
1648 QHsm * const me,
1649 QEvt const * const e,
1650 uint_fast8_t const qs_id);
1651
1652/*! override for QActive_start_()
1653* @private @memberof QActiveDummy
1654*/
1656 QActive * const me,
1657 QPrioSpec const prioSpec,
1658 QEvt const * * const qSto,
1659 uint_fast16_t const qLen,
1660 void * const stkSto,
1661 uint_fast16_t const stkSize,
1662 void const * const par);
1663
1664/*! override for QActive_post_()
1665* @private @memberof QActiveDummy
1666*/
1668 QActive * const me,
1669 QEvt const * const e,
1670 uint_fast16_t const margin,
1671 void const * const sender);
1672
1673/*! override for QActive_postLIFO_()
1674* @private @memberof QActiveDummy
1675*/
1677 QActive * const me,
1678 QEvt const * const e);
1679/*$enddecl${QUTest-stub::QActiveDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1680#endif /* Q_UTEST != 0 */
1681
1682/*! QS macro to define the Test-Probe for a given `fun_` */
1683#define QS_TEST_PROBE_DEF(fun_) \
1684 uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));
1685
1686/*! QS macro to apply a Test-Probe */
1687#define QS_TEST_PROBE(code_) \
1688 if (qs_tp_ != 0U) { code_ }
1689
1690/*! QS macro to apply a Test-Probe */
1691#define QS_TEST_PROBE_ID(id_, code_) \
1692 if (qs_tp_ == (uint32_t)(id_)) { code_ }
1693
1694/*! QS macro to pause test execution and enter the test event-loop */
1695#define QS_TEST_PAUSE() (QS_test_pause_())
1696
1697#else /* Q_UTEST not defined */
1698
1699/* dummy definitions when not building for QUTEST */
1700#define QS_TEST_PROBE_DEF(fun_)
1701#define QS_TEST_PROBE(code_)
1702#define QS_TEST_PROBE_ID(id_, code_)
1703#define QS_TEST_PAUSE() ((void)0)
1704
1705#endif /* Q_UTEST */
1706
1707#endif /* QS_H_ */
QSpyIdOffsets
Definition: qpc_qs.h:318
QSpyUserOffsets
Definition: qpc_qs.h:305
QSpyPre
Definition: qpc_qs.h:156
QSpyGroups
Definition: qpc_qs.h:282
QSpyIdGroups
Definition: qpc_qs.h:329
@ QS_ASSERT_FAIL
Definition: qpc_qs.h:257
@ QS_QF_TIMEEVT_AUTO_DISARM
Definition: qpc_qs.h:205
void QF_QS_ISR_EXIT(uint_fast8_t isrnest, uint_fast8_t prio)
@ QS_QF_INT_ENABLE
Definition: qpc_qs.h:218
@ QS_QF_RUN
Definition: qpc_qs.h:258
@ QS_USER0
Definition: qpc_qs.h:307
@ QS_QF_MPOOL_GET_ATTEMPT
Definition: qpc_qs.h:227
@ QS_U2_RECORDS
Definition: qpc_qs.h:295
@ QS_QF_DELETE_REF
Definition: qpc_qs.h:212
@ QS_QF_ACTIVE_RECALL
Definition: qpc_qs.h:173
void QS_onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
@ QS_QF_EQUEUE_GET_LAST
Definition: qpc_qs.h:186
@ QS_QF_TIMEEVT_DISARM
Definition: qpc_qs.h:207
@ QS_TEST_PROBE_GET
Definition: qpc_qs.h:247
@ QS_SEM_BLOCK
Definition: qpc_qs.h:262
@ QS_QEP_STATE_INIT
Definition: qpc_qs.h:163
uint32_t data
Definition: qpc_qs.h:1509
@ QS_QEP_TRAN_HIST
Definition: qpc_qs.h:241
@ QS_ENUM_DICT
Definition: qpc_qs.h:238
@ QS_QF_TIMEEVT_REARM
Definition: qpc_qs.h:208
@ QS_FUN_DICT
Definition: qpc_qs.h:250
@ QS_USER3
Definition: qpc_qs.h:310
uint8_t idx
Definition: qpc_qs.h:1510
QSFun addr
Definition: qpc_qs.h:1508
@ QS_MP_RECORDS
Definition: qpc_qs.h:287
@ QS_QF_PUBLISH
Definition: qpc_qs.h:196
@ QS_USER1
Definition: qpc_qs.h:308
uint32_t QS_getTestProbe_(QSpyFunPtr const api)
@ QS_MTX_UNLOCK
Definition: qpc_qs.h:269
QS_preType
Definition: qpc_qs.h:398
@ QS_STR_T
Definition: qpc_qs.h:407
@ QS_U64_T
Definition: qpc_qs.h:413
@ QS_MEM_T
Definition: qpc_qs.h:408
@ QS_OBJ_T
Definition: qpc_qs.h:410
@ QS_F32_T
Definition: qpc_qs.h:405
@ QS_SIG_T
Definition: qpc_qs.h:409
@ QS_I8_ENUM_T
Definition: qpc_qs.h:399
@ QS_U8_T
Definition: qpc_qs.h:400
@ QS_I64_T
Definition: qpc_qs.h:412
@ QS_FUN_T
Definition: qpc_qs.h:411
@ QS_F64_T
Definition: qpc_qs.h:406
@ QS_U32_T
Definition: qpc_qs.h:404
@ QS_I32_T
Definition: qpc_qs.h:403
@ QS_I16_T
Definition: qpc_qs.h:401
@ QS_U16_T
Definition: qpc_qs.h:402
void QF_QS_ISR_ENTRY(uint_fast8_t const isrnest, uint_fast8_t const prio_)
@ QS_TE_RECORDS
Definition: qpc_qs.h:288
@ QS_MTX_BLOCK
Definition: qpc_qs.h:268
void QS_onTestSetup(void)
@ QS_SEM_BLOCK_ATTEMPT
Definition: qpc_qs.h:264
@ SM_OBJ
Definition: qpc_qs.h:844
@ QS_QF_ACTIVE_POST_LIFO
Definition: qpc_qs.h:177
@ QS_QEP_TRAN_EP
Definition: qpc_qs.h:242
@ QS_QEP_STATE_EXIT
Definition: qpc_qs.h:162
@ EQ_OBJ
Definition: qpc_qs.h:847
@ QS_TARGET_DONE
Definition: qpc_qs.h:253
@ QS_EP_IDS
Definition: qpc_qs.h:332
@ QS_USER
Definition: qpc_qs.h:306
@ QS_MTX_LOCK_ATTEMPT
Definition: qpc_qs.h:270
@ QS_QF_GC_ATTEMPT
Definition: qpc_qs.h:199
@ QS_QF_CRIT_ENTRY
Definition: qpc_qs.h:213
@ QS_QF_MPOOL_PUT
Definition: qpc_qs.h:193
@ QS_QF_EQUEUE_POST_ATTEMPT
Definition: qpc_qs.h:224
@ QS_PRE_MAX
Definition: qpc_qs.h:275
@ QS_QF_GC
Definition: qpc_qs.h:200
@ QS_QF_ACTIVE_GET
Definition: qpc_qs.h:178
@ QS_AO_IDS
Definition: qpc_qs.h:331
@ AO_OBJ
Definition: qpc_qs.h:845
@ QS_QF_CRIT_EXIT
Definition: qpc_qs.h:214
void QF_QS_CRIT_EXIT(void)
@ QS_SM_RECORDS
Definition: qpc_qs.h:284
@ QS_QF_TIMEEVT_POST
Definition: qpc_qs.h:209
@ QS_QF_INT_DISABLE
Definition: qpc_qs.h:217
@ QS_OBJ_DICT
Definition: qpc_qs.h:249
@ QS_QF_MPOOL_GET
Definition: qpc_qs.h:192
@ QS_MTX_UNLOCK_ATTEMPT
Definition: qpc_qs.h:272
@ QS_QF_TIMEEVT_DISARM_ATTEMPT
Definition: qpc_qs.h:206
@ QS_SEM_TAKE
Definition: qpc_qs.h:261
@ QS_U0_RECORDS
Definition: qpc_qs.h:293
@ QS_QF_ACTIVE_RECALL_ATTEMPT
Definition: qpc_qs.h:180
uint32_t QSTimeCtr
Definition: qpc_qs.h:106
QSTimeCtr testTime
Definition: qpc_qs.h:1518
@ QS_QEP_INIT_TRAN
Definition: qpc_qs.h:164
@ QS_TARGET_INFO
Definition: qpc_qs.h:252
@ QS_QEP_INTERN_TRAN
Definition: qpc_qs.h:165
@ QS_SEM_SIGNAL
Definition: qpc_qs.h:263
@ QS_QEP_TRAN_XP
Definition: qpc_qs.h:243
@ QS_RX_STATUS
Definition: qpc_qs.h:254
@ QS_EQ_ID
Definition: qpc_qs.h:321
void QS_processTestEvts_(void)
@ QS_U3_RECORDS
Definition: qpc_qs.h:296
@ QS_SCHED_IDLE
Definition: qpc_qs.h:235
@ QS_QF_EQUEUE_POST_LIFO
Definition: qpc_qs.h:184
@ QS_QEP_STATE_ENTRY
Definition: qpc_qs.h:161
@ QS_MTX_RECORDS
Definition: qpc_qs.h:292
@ QS_SCHED_PREEMPT
Definition: qpc_qs.h:230
@ QS_EP_ID
Definition: qpc_qs.h:320
void QS_onTestLoop(void)
@ QS_QEP_UNHANDLED
Definition: qpc_qs.h:169
@ QS_QF_ACTIVE_POST_ATTEMPT
Definition: qpc_qs.h:221
@ QS_QEP_TRAN
Definition: qpc_qs.h:166
@ QS_U4_RECORDS
Definition: qpc_qs.h:297
@ QS_QF_EQUEUE_GET
Definition: qpc_qs.h:185
uint8_t tpNum
Definition: qpc_qs.h:1517
@ QS_QF_ISR_ENTRY
Definition: qpc_qs.h:215
@ QS_AO_RECORDS
Definition: qpc_qs.h:285
void QS_test_pause_(void)
@ QS_QF_NEW_ATTEMPT
Definition: qpc_qs.h:189
@ TE_OBJ
Definition: qpc_qs.h:848
@ QS_QF_ISR_EXIT
Definition: qpc_qs.h:216
@ QS_QF_TICK
Definition: qpc_qs.h:201
@ QS_SEM_RECORDS
Definition: qpc_qs.h:291
@ QS_QF_ACTIVE_UNSUBSCRIBE
Definition: qpc_qs.h:175
@ QS_QEP_DISPATCH
Definition: qpc_qs.h:168
@ QS_QF_ACTIVE_DEFER
Definition: qpc_qs.h:172
@ QS_AP_ID
Definition: qpc_qs.h:322
@ QS_SCHED_LOCK
Definition: qpc_qs.h:232
uint_fast16_t QSCtr
Definition: qpc_qs.h:95
QS_tx QS_priv_
@ MAX_OBJ
Definition: qpc_qs.h:850
@ QS_QF_RECORDS
Definition: qpc_qs.h:289
@ QS_QF_NEW_REF
Definition: qpc_qs.h:197
@ QS_TEST_PAUSED
Definition: qpc_qs.h:246
@ QS_SC_RECORDS
Definition: qpc_qs.h:290
@ QS_SCHED_UNLOCK
Definition: qpc_qs.h:233
@ QS_AO_ID
Definition: qpc_qs.h:319
void QS_onTestTeardown(void)
@ AP_OBJ
Definition: qpc_qs.h:849
@ QS_EMPTY
Definition: qpc_qs.h:158
@ QS_EQ_IDS
Definition: qpc_qs.h:333
@ QS_ALL_IDS
Definition: qpc_qs.h:330
uint8_t prio
Definition: qpc_qs.h:347
@ QS_USER2
Definition: qpc_qs.h:309
@ QS_QF_ACTIVE_POST
Definition: qpc_qs.h:176
@ QS_SIG_DICT
Definition: qpc_qs.h:248
@ SM_AO_OBJ
Definition: qpc_qs.h:858
struct QS_TestData QS_testData
void QS_onTestEvt(QEvt *e)
@ QS_U1_RECORDS
Definition: qpc_qs.h:294
@ QS_EQ_RECORDS
Definition: qpc_qs.h:286
@ QS_QUERY_DATA
Definition: qpc_qs.h:255
@ QS_QF_TIMEEVT_ARM
Definition: qpc_qs.h:204
@ QS_QEP_IGNORED
Definition: qpc_qs.h:167
@ QS_USR_DICT
Definition: qpc_qs.h:251
@ QS_QF_NEW
Definition: qpc_qs.h:198
@ QS_QF_EQUEUE_POST
Definition: qpc_qs.h:183
@ QS_QF_ACTIVE_GET_LAST
Definition: qpc_qs.h:179
@ QS_ALL_RECORDS
Definition: qpc_qs.h:283
void QF_QS_CRIT_ENTRY(void)
@ QS_SCHED_NEXT
Definition: qpc_qs.h:234
struct QS_TProbe tpBuf[16]
Definition: qpc_qs.h:1516
@ QS_PEEK_DATA
Definition: qpc_qs.h:256
uint32_t QSFun
Definition: qpc_qs.h:122
@ QS_MTX_LOCK
Definition: qpc_qs.h:267
@ QS_SCHED_RESTORE
Definition: qpc_qs.h:231
@ QS_UA_RECORDS
Definition: qpc_qs.h:298
@ MP_OBJ
Definition: qpc_qs.h:846
@ QS_USER4
Definition: qpc_qs.h:311
@ QS_QF_ACTIVE_SUBSCRIBE
Definition: qpc_qs.h:174
@ QS_MTX_BLOCK_ATTEMPT
Definition: qpc_qs.h:271
@ QS_AP_IDS
Definition: qpc_qs.h:334
Test Probe attributes.
Definition: qpc_qs.h:1507
QUTest data.
Definition: qpc_qs.h:1515
QS ID type for applying local filtering.
Definition: qpc_qs.h:347
QActiveDummy Object class.
Definition: qpc_qs.h:1624
void QActiveDummy_start_(QActive *const me, QPrioSpec const prioSpec, QEvt const **const qSto, uint_fast16_t const qLen, void *const stkSto, uint_fast16_t const stkSize, void const *const par)
void QActiveDummy_ctor(QActiveDummy *const me)
void QActiveDummy_postLIFO_(QActive *const me, QEvt const *const e)
QActive super
Definition: qpc_qs.h:1626
void QActiveDummy_dispatch_(QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
void QActiveDummy_init_(QHsm *const me, void const *const par, uint_fast8_t const qs_id)
bool QActiveDummy_post_(QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender)
QHsmDummy class.
Definition: qpc_qs.h:1585
void QHsmDummy_ctor(QHsmDummy *const me)
QHsm super
Definition: qpc_qs.h:1587
void QHsmDummy_dispatch_(QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
void QHsmDummy_init_(QHsm *const me, void const *const par, uint_fast8_t const qs_id)
QS software tracing parameters for QS input (QS-RX)
Definition: qpc_qs.h:820
void QS_onReset(void)
void QS_queryCurrObj(uint8_t const obj_kind)
uint8_t * buf
Definition: qpc_qs.h:823
void QS_rxParse(void)
QS_rx QS_rxPriv_
Definition: qpc_qs.h:837
void QS_rxInitBuf(uint8_t *const sto, uint16_t const stoSize)
QSCtr volatile tail
Definition: qpc_qs.h:826
static bool QS_rxPut(uint8_t const b)
Definition: qpc_qs.h:895
void QS_rxHandleGoodFrame_(uint8_t const state)
bool QS_RX_PUT(uint8_t const b)
bool inTestLoop
Definition: qpc_qs.h:829
void QS_doInput(void)
QSCtr end
Definition: qpc_qs.h:824
QSCtr volatile head
Definition: qpc_qs.h:825
QS_OSpyObjCombnation
Definition: qpc_qs.h:857
void QS_setCurrObj(uint8_t const obj_kind, void *const obj_ptr)
uint16_t QS_rxGetNfree(void)
void QS_onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3)
QS_QSpyObjKind
Definition: qpc_qs.h:843
Definition: qpc_qs.h:356
void QS_mem_fmt_(uint8_t const *const blk, uint8_t const size)
void QS_locFilter_(int_fast16_t const filter)
void QS_doOutput(void)
uint8_t volatile chksum
Definition: qpc_qs.h:387
void QS_endRec_(void)
void const * locFilter_AP
Definition: qpc_qs.h:366
void QS_onCleanup(void)
uint8_t * buf
Definition: qpc_qs.h:369
void QS_u16_raw_(uint16_t const d)
void QS_target_info_pre_(uint8_t const isReset)
void QS_u32_fmt_(uint8_t const format, uint32_t const d)
void QS_beginRec_(uint_fast8_t const rec)
void QS_fun_dict_pre_(QSpyFunPtr const fun, char const *const name)
void QS_u64_fmt_(uint8_t format, uint64_t d)
void QS_obj_arr_dict_pre_(void const *const obj, uint_fast16_t const idx, char const *const name)
uint8_t const * QS_getBlock(uint16_t *const pNbytes)
QSCtr volatile tail
Definition: qpc_qs.h:378
void QS_u8_raw_(uint8_t const d)
void QS_u64_raw_(uint64_t d)
void QS_f64_fmt_(uint8_t const format, float64_t const d)
void QS_u8_fmt_(uint8_t const format, uint8_t const d)
QSCtr volatile used
Definition: qpc_qs.h:381
void QS_usr_dict_pre_(enum_t const rec, char const *const name)
void QS_str_raw_(char const *const str)
void QS_u16_fmt_(uint8_t const format, uint16_t const d)
uint8_t flags
Definition: qpc_qs.h:393
void QS_ASSERTION(char const *const module, int_t const loc, uint32_t const delay)
QSTimeCtr QS_onGetTime(void)
void QS_onFlush(void)
QSCtr end
Definition: qpc_qs.h:372
uint8_t QS_onStartup(void const *arg)
void QS_enum_dict_pre_(enum_t const value, uint8_t const group, char const *const name)
void QS_obj_dict_pre_(void const *const obj, char const *const name)
uint8_t volatile seq
Definition: qpc_qs.h:384
uint16_t QS_getByte(void)
void QS_sig_dict_pre_(enum_t const sig, void const *const obj, char const *const name)
void QS_glbFilter_(int_fast16_t const filter)
QSCtr volatile head
Definition: qpc_qs.h:375
void QS_str_fmt_(char const *const str)
void QS_initBuf(uint8_t *const sto, uint_fast32_t const stoSize)
void QS_u32_raw_(uint32_t const d)
void QS_2u8_raw_(uint8_t const d1, uint8_t const d2)
void QS_obj_raw_(void const *const obj)
uint8_t volatile critNest
Definition: qpc_qs.h:390
void QS_f32_fmt_(uint8_t const format, float32_t const d)