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.4 <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 QP_INC_QS_H_
43#define QP_INC_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_tx
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_tx
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_tx
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_tx
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_tx
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_tx
340*/
341typedef void (* QSpyFunPtr )(void);
342
343/*${QS::QSpyId} ............................................................*/
344/*! @brief QS ID type for applying local filtering
345* @static @public @memberof QS_tx
346*/
347typedef struct { uint8_t prio; } QSpyId;
348
349/*${QS::QS-tx::tx} .........................................................*/
350/*! @brief Software tracing, output QS-TX
351*
352* @details
353* This class groups together QS services.
354*/
355typedef struct {
356/* public: */
357
358 /*! global on/off QS filter */
359 uint8_t glbFilter[16];
360
361 /*! local on/off QS filter */
362 uint8_t locFilter[16];
363
364 /*! @deprecated old local QS filter */
365 void const * locFilter_AP;
366
367 /*! pointer to the start of the QS-TX ring buffer */
368 uint8_t * buf;
369
370 /*! offset of the end of the ring buffer */
372
373 /*! offset to where next byte will be inserted */
374 QSCtr volatile head;
375
376 /*! offset of where next record will be extracted */
377 QSCtr volatile tail;
378
379 /*! number of bytes currently in the ring buffer */
380 QSCtr volatile used;
381
382 /*! sequence number of the last inserted QS record */
383 uint8_t volatile seq;
384
385 /*! checksum of the currently inserted record */
386 uint8_t volatile chksum;
387
388 /*! critical section nesting level */
389 uint8_t volatile critNest;
390
391 /* flags for internal use */
392 uint8_t flags;
393} QS_tx;
394
395/*${QS::QS-tx::preType} ....................................................*/
396/*! Enumerates data elements for app-specific trace records */
398 QS_I8_ENUM_T, /*!< signed 8-bit integer or enum format */
399 QS_U8_T, /*!< unsigned 8-bit integer format */
400 QS_I16_T, /*!< signed 16-bit integer format */
401 QS_U16_T, /*!< unsigned 16-bit integer format */
402 QS_I32_T, /*!< signed 32-bit integer format */
403 QS_U32_T, /*!< unsigned 32-bit integer format */
404 QS_F32_T, /*!< 32-bit floating point format */
405 QS_F64_T, /*!< 64-bit floating point format */
406 QS_STR_T, /*!< zero-terminated ASCII string format */
407 QS_MEM_T, /*!< up to 255-bytes memory block format */
408 QS_SIG_T, /*!< event signal format */
409 QS_OBJ_T, /*!< object pointer format */
410 QS_FUN_T, /*!< function pointer format */
411 QS_I64_T, /*!< signed 64-bit integer format */
412 QS_U64_T /*!< unsigned 64-bit integer format */
414
415/*${QS::QS-tx::priv_} ......................................................*/
416/*! the only instance of the QS-TX object (Singleton) */
417extern QS_tx QS_priv_;
418
419/*${QS::QS-tx::initBuf} ....................................................*/
420/*! Initialize the QS-TX data buffer
421* @static @public @memberof QS_tx
422*
423* @details
424* This function should be called from QS_onStartup() to provide
425* QS with the data buffer. The first argument `sto` is the address
426* of the memory block, and the second argument `stoSize` is the size
427* of this block [in bytes]. Currently the size of the QS buffer cannot
428* exceed 64KB.
429*
430* @param[in] sto pointer to the storage for the transmit buffer
431* @param[in] stoSize size in [bytes] of the storage buffer
432*
433* @remark
434* QS can work with quite small data buffers, but you will start losing
435* data if the buffer is too small for the bursts of tracing activity.
436* The right size of the buffer depends on the data production rate and
437* the data output rate. QS offers flexible filtering to reduce the data
438* production rate.
439*
440* @note
441* If the data output rate cannot keep up with the production rate,
442* QS will start overwriting the older data with newer data. This is
443* consistent with the "last-is-best" QS policy. The record sequence
444* counters and check sums on each record allow the QSPY host utility
445* to easily detect any data loss.
446*/
448 uint8_t * const sto,
449 uint_fast32_t const stoSize);
450
451/*${QS::QS-tx::getByte} ....................................................*/
452/*! Byte-oriented interface to the QS-TX data buffer
453* @static @public @memberof QS_tx
454*
455* @details
456* This function delivers one byte at a time from the QS data buffer.
457*
458* @returns
459* the byte in the least-significant 8-bits of the 16-bit return
460* value if the byte is available. If no more data is available at the
461* time, the function returns ::QS_EOD (End-Of-Data).
462*
463* @note
464* QS_getByte() is NOT protected with a critical section.
465*/
466uint16_t QS_getByte(void);
467
468/*${QS::QS-tx::getBlock} ...................................................*/
469/*! Block-oriented interface to the QS-TX data buffer
470* @static @public @memberof QS_tx
471*
472* @details
473* This function delivers a contiguous block of data from the QS data
474* buffer. The function returns the pointer to the beginning of the
475* block, and writes the number of bytes in the block to the location
476* pointed to by `pNbytes`. The argument `pNbytes` is also used as
477* input to provide the maximum size of the data block that the caller
478* can accept.
479*
480* @param[in,out] pNbytes pointer to the number of bytes to send.
481* On input, `pNbytes` specifies the maximum number
482* of bytes that the function can provide.
483* On output, `pNbytes` contains the actual number
484* of bytes available.
485* @returns
486* if data is available, the function returns pointer to the
487* contiguous block of data and sets the value pointed to by `pNbytes`
488* to the # available bytes. If data is available at the time the
489* function is called, the function returns NULL pointer and sets the
490* value pointed to by `pNbytes` to zero.
491*
492* @note
493* Only the NULL return from QS_getBlock() indicates that the QS
494* buffer is empty at the time of the call. The non-NULL return often
495* means that the block is at the end of the buffer and you need to call
496* QS_getBlock() again to obtain the rest of the data that
497* "wrapped around" to the beginning of the QS data buffer.
498*
499* @note QS_getBlock() is **not** protected with a critical section.
500*/
501uint8_t const * QS_getBlock(uint16_t * const pNbytes);
502
503/*${QS::QS-tx::glbFilter_} .................................................*/
504/*! Set/clear the global Filter for a given QS record or a group
505* of records
506* @static @public @memberof QS_tx
507*
508* @details
509* This function sets up the QS filter to enable record types specified
510* in the `filter` parameter. The value #QS_ALL_RECORDS specifies to
511* filter-in all records. This function should be called indirectly
512* through the macro QS_GLB_FILTER()
513*
514* @param[in] filter the QS record-d or group to enable in the filter,
515* if positive or disable, if negative. The record-id
516* numbers must be in the range -127..127.
517* @note
518* Filtering based on the record-type is only the first layer of
519* filtering. The second layer is based on the object-type. Both filter
520* layers must be enabled for the QS record to be inserted in the
521* QS buffer.
522*
523* @sa QS_locFilter_()
524*/
525void QS_glbFilter_(int_fast16_t const filter);
526
527/*${QS::QS-tx::locFilter_} .................................................*/
528/*! Set/clear the local Filter for a given object-id
529* or a group of object-ids
530* @static @public @memberof QS_tx
531*
532* @details
533* This function sets up the local QS filter to enable or disable the
534* given QS object-id or a group of object-ids @a filter.
535* This function should be called indirectly through the macro
536* QS_LOC_FILTER()
537*
538* @param[in] filter the QS object-id or group to enable in the filter,
539* if positive or disable, if negative. The qs_id numbers
540* must be in the range 1..127.
541* @note
542* Filtering based on the object-id (local filter) is the second layer
543* of filtering. The first layer is based on the QS record-type (global
544* filter). Both filter layers must be enabled for the QS record to be
545* inserted into the QS buffer.
546*
547* @sa QS_glbFilter_()
548*/
549void QS_locFilter_(int_fast16_t const filter);
550
551/*${QS::QS-tx::doOutput} ...................................................*/
552/*! Perform the QS-TX output (implemented in some QS ports)
553* @static @public @memberof QS_tx
554*/
555void QS_doOutput(void);
556
557/*${QS::QS-tx::beginRec_} ..................................................*/
558/*! Mark the begin of a QS record `rec`
559* @static @private @memberof QS_tx
560*
561* @details
562* This function must be called at the beginning of each QS record.
563* This function should be called indirectly through the macro QS_BEGIN_ID(),
564* or QS_BEGIN_NOCRIT(), depending if it's called in a normal code or from
565* a critical section.
566*/
567void QS_beginRec_(uint_fast8_t const rec);
568
569/*${QS::QS-tx::endRec_} ....................................................*/
570/*! Mark the end of a QS record `rec`
571* @static @private @memberof QS_tx
572*
573* @details
574* This function must be called at the end of each QS record.
575* This function should be called indirectly through the macro QS_END(),
576* or QS_END_NOCRIT(), depending if it's called in a normal code or from
577* a critical section.
578*/
579void QS_endRec_(void);
580
581/*${QS::QS-tx::u8_raw_} ....................................................*/
582/*! output uint8_t data element without format information
583* @static @private @memberof QS_tx
584*/
585void QS_u8_raw_(uint8_t const d);
586
587/*${QS::QS-tx::2u8_raw_} ...................................................*/
588/*! output two uint8_t data elements without format information
589* @static @private @memberof QS_tx
590*/
592 uint8_t const d1,
593 uint8_t const d2);
594
595/*${QS::QS-tx::u16_raw_} ...................................................*/
596/*! output uint16_t data element without format information
597* @static @private @memberof QS_tx
598*/
599void QS_u16_raw_(uint16_t const d);
600
601/*${QS::QS-tx::u32_raw_} ...................................................*/
602/*! output uint32_t data element without format information
603* @static @private @memberof QS_tx
604*/
605void QS_u32_raw_(uint32_t const d);
606
607/*${QS::QS-tx::obj_raw_} ...................................................*/
608/*! Output obj pointer data element without format information
609* @static @private @memberof QS_tx
610*
611* @note This function is only to be used through macros, never in the
612* client code directly.
613*/
614void QS_obj_raw_(void const * const obj);
615
616/*${QS::QS-tx::str_raw_} ...................................................*/
617/*! Output raw zero-terminated string element (without format information)
618* @static @private @memberof QS_tx
619*
620* @note This function is only to be used through macros, never in the
621* client code directly.
622*/
623void QS_str_raw_(char const * const str);
624
625/*${QS::QS-tx::u8_fmt_} ....................................................*/
626/*! Output uint8_t data element with format information
627* @static @private @memberof QS_tx
628*
629* @details
630* @note This function is only to be used through macros, never in the
631* client code directly.
632*/
634 uint8_t const format,
635 uint8_t const d);
636
637/*${QS::QS-tx::u16_fmt_} ...................................................*/
638/*! output uint16_t data element with format information
639* @static @private @memberof QS_tx
640*
641* @details
642* This function is only to be used through macros, never in the
643* client code directly.
644*/
646 uint8_t const format,
647 uint16_t const d);
648
649/*${QS::QS-tx::u32_fmt_} ...................................................*/
650/*! Output uint32_t data element with format information
651* @static @private @memberof QS_tx
652*
653* @note This function is only to be used through macros, never in the
654* client code directly.
655*/
657 uint8_t const format,
658 uint32_t const d);
659
660/*${QS::QS-tx::str_fmt_} ...................................................*/
661/*! Output formatted zero-terminated ASCII string to the QS record
662* @static @private @memberof QS_tx
663*/
664void QS_str_fmt_(char const * const str);
665
666/*${QS::QS-tx::mem_fmt_} ...................................................*/
667/*! Output formatted memory block of up to 255 bytes to the QS record
668* @static @private @memberof QS_tx
669*/
671 uint8_t const * const blk,
672 uint8_t const size);
673
674/*${QS::QS-tx::sig_dict_pre_} ..............................................*/
675/*! Output predefined signal-dictionary record
676* @static @private @memberof QS_tx
677*
678* @note This function is only to be used through macro QS_SIG_DICTIONARY()
679*/
681 enum_t const sig,
682 void const * const obj,
683 char const * const name);
684
685/*${QS::QS-tx::obj_dict_pre_} ..............................................*/
686/*! Output predefined object-dictionary record
687* @static @private @memberof QS_tx
688*
689* @note This function is only to be used through macro QS_OBJ_DICTIONARY()
690*/
692 void const * const obj,
693 char const * const name);
694
695/*${QS::QS-tx::obj_arr_dict_pre_} ..........................................*/
696/*! Output predefined object-array dictionary record
697* @static @private @memberof QS_tx
698*
699* @note This function is only to be used through macro QS_OBJ_ARR_DICTIONARY()
700*/
702 void const * const obj,
703 uint_fast16_t const idx,
704 char const * const name);
705
706/*${QS::QS-tx::fun_dict_pre_} ..............................................*/
707/*! Output predefined function-dictionary record
708* @static @private @memberof QS_tx
709*
710* @note This function is only to be used through macro QS_FUN_DICTIONARY()
711*/
713 QSpyFunPtr const fun,
714 char const * const name);
715
716/*${QS::QS-tx::usr_dict_pre_} ..............................................*/
717/*! Output predefined user-dictionary record
718* @static @private @memberof QS_tx
719*
720* @note This function is only to be used through macro QS_USR_DICTIONARY()
721*/
723 enum_t const rec,
724 char const * const name);
725
726/*${QS::QS-tx::enum_dict_pre_} .............................................*/
727/*! Output predefined enum-dictionary record
728* @static @private @memberof QS_tx
729*
730* @note This function is only to be used through macro QS_ENUM_DICTIONARY()
731*/
733 enum_t const value,
734 uint8_t const group,
735 char const * const name);
736
737/*${QS::QS-tx::ASSERTION} ..................................................*/
738/*! Output the predefined assertion failure trace record
739* @static @public @memberof QS_tx
740*
741* @details
742* This trace record is intended to use from the Q_onAssert() callback.
743*/
745 char const * const module,
746 int_t const loc,
747 uint32_t const delay);
748
749/*${QS::QS-tx::target_info_pre_} ...........................................*/
750/*! Helper function to output the predefined Target-info trace record
751* @static @private @memberof QS_tx
752*/
753void QS_target_info_pre_(uint8_t const isReset);
754
755/*${QS::QS-tx::onStartup} ..................................................*/
756/*! Callback to startup the QS facility
757* @static @public @memberof QS_tx
758*/
759uint8_t QS_onStartup(void const * arg);
760
761/*${QS::QS-tx::onCleanup} ..................................................*/
762/*! Callback to cleanup the QS facility
763* @static @public @memberof QS_tx
764*/
765void QS_onCleanup(void);
766
767/*${QS::QS-tx::onFlush} ....................................................*/
768/*! Callback to flush the QS trace data to the host
769* @static @public @memberof QS_tx
770*/
771void QS_onFlush(void);
772
773/*${QS::QS-tx::onGetTime} ..................................................*/
774/*! Callback to obtain a timestamp for a QS record
775* @static @public @memberof QS_tx
776*/
778
779/*${QS::QS-tx-64bit::u64_raw_} .............................................*/
780/*! Output uint64_t data element without format information
781* @static @private @memberof QS_tx
782*/
783void QS_u64_raw_(uint64_t d);
784
785/*${QS::QS-tx-64bit::u64_fmt_} .............................................*/
786/*! Output uint64_t data element with format information
787* @static @private @memberof QS_tx
788*
789* @sa QS_U64(), QS_I64()
790*/
792 uint8_t format,
793 uint64_t d);
794
795/*${QS::QS-tx-fp::f32_fmt_} ................................................*/
796/*! Output 32-bit floating point data element with format information
797* @static @private @memberof QS_tx
798*
799* @sa QS_F32()
800*/
802 uint8_t const format,
803 float32_t const d);
804
805/*${QS::QS-tx-fp::f64_fmt_} ................................................*/
806/*! Output 64-bit floating point data element with format information
807* @static @private @memberof QS_tx
808*
809* @sa QS_F64()
810*/
812 uint8_t const format,
813 float64_t const d);
814
815/*${QS::QS-rx::rx} .........................................................*/
816/*! @brief QS software tracing parameters for QS input (QS-RX) */
817typedef struct {
818/* public: */
819 void * currObj[8];
820 uint8_t * buf;
822 QSCtr volatile head;
823 QSCtr volatile tail;
824
825#ifdef Q_UTEST
827#endif /* def Q_UTEST */
828} QS_rx;
829
830/*${QS::QS-rx::rxPriv_} ....................................................*/
831/*! the only instance of the QS-RX object (Singleton)
832* @static @private @memberof QS_rx
833*/
835
836/*${QS::QS-rx::QSpyObjKind} ................................................*/
837/*! Kinds of objects used in QS_setCurrObj() and QS_queryCurrObj()
838* @static @public @memberof QS_rx
839*/
841 SM_OBJ, /*!< state machine object */
842 AO_OBJ, /*!< active object */
843 MP_OBJ, /*!< event pool object */
844 EQ_OBJ, /*!< raw queue object */
845 TE_OBJ, /*!< time event object */
846 AP_OBJ, /*!< generic Application-specific object */
847 MAX_OBJ
849
850/*${QS::QS-rx::OSpyObjCombnation} ..........................................*/
851/*! Object combinations for QS_setCurrObj() and QS_queryCurrObj()
852* @static @public @memberof QS_rx
853*/
855 SM_AO_OBJ = (enum_t)MAX_OBJ /*!< combination of SM and AO */
857
858/*${QS::QS-rx::rxInitBuf} ..................................................*/
859/*! Initialize the QS-RX data buffer
860* @static @public @memberof QS_rx
861*
862* @details
863* This function should be called from QS::onStartup() to provide QS-RX
864* with the receive data buffer.
865*
866* @param[in] sto pointer to the memory block for input buffer
867* @param[in] stoSize the size of this block [bytes]. The size of the
868* QS-RX buffer cannot exceed 64KB.
869*
870* @note
871* QS-RX can work with quite small data buffers, but you will start
872* losing data if the buffer is not drained fast enough (e.g., in the
873* idle task).
874*
875* @note
876* If the data input rate exceeds the QS-RX processing rate, the data
877* will be lost, but the QS protocol will notice that:
878* (1) that the checksum in the incomplete QS records will fail; and
879* (2) the sequence counter in QS records will show discontinuities.
880*
881* The QS-RX channel will report any data errors by sending the
882* QS_RX_DATA_ERROR trace record.
883*/
885 uint8_t * const sto,
886 uint16_t const stoSize);
887
888/*${QS::QS-rx::rxPut} ......................................................*/
889/*! Put one byte into the QS-RX lock-free buffer
890* @static @public @memberof QS_rx
891*/
892static inline bool QS_rxPut(uint8_t const b) {
893 QSCtr head = QS_rxPriv_.head + 1U;
894 if (head == QS_rxPriv_.end) {
895 head = 0U;
896 }
897 if (head != QS_rxPriv_.tail) { /* buffer NOT full? */
898 QS_rxPriv_.buf[QS_rxPriv_.head] = b;
899 QS_rxPriv_.head = head; /* update the head to a *valid* index */
900 return true; /* byte placed in the buffer */
901 }
902 else {
903 return false; /* byte NOT placed in the buffer */
904 }
905}
906
907/*${QS::QS-rx::rxGetNfree} .................................................*/
908/*! Obtain the number of free bytes in the QS-RX data buffer
909* @static @public @memberof QS_rx
910*
911* @details
912* This function is intended to be called from the ISR that reads the
913* QS-RX bytes from the QSPY application. The function returns the
914* conservative number of free bytes currently available in the buffer,
915* assuming that the head pointer is not being moved concurrently.
916* The tail pointer might be moving, meaning that bytes can be
917* concurrently removed from the buffer.
918*/
919uint16_t QS_rxGetNfree(void);
920
921/*${QS::QS-rx::doInput} ....................................................*/
922/*! Perform the QS-RX input (implemented in some QS ports)
923* @static @public @memberof QS_rx
924*/
925void QS_doInput(void);
926
927/*${QS::QS-rx::setCurrObj} .................................................*/
928/*! Set the "current object" in the Target
929* @static @public @memberof QS_rx
930*
931* @details
932* This function sets the "current object" in the Target.
933*/
935 uint8_t const obj_kind,
936 void * const obj_ptr);
937
938/*${QS::QS-rx::queryCurrObj} ...............................................*/
939/*! Query the "current object" in the Target
940* @static @public @memberof QS_rx
941*
942* @details
943* This function programmatically generates the response to the query for
944* a "current object".
945*/
946void QS_queryCurrObj(uint8_t const obj_kind);
947
948/*${QS::QS-rx::rxParse} ....................................................*/
949/*! Parse all bytes present in the QS-RX data buffer
950* @static @public @memberof QS_rx
951*/
952void QS_rxParse(void);
953
954/*${QS::QS-rx::rxHandleGoodFrame_} .........................................*/
955/*! internal function to handle incoming (QS-RX) packet
956* @static @private @memberof QS_rx
957*/
958void QS_rxHandleGoodFrame_(uint8_t const state);
959
960/*${QS::QS-rx::onReset} ....................................................*/
961/*! callback function to reset the Target (to be implemented in the BSP)
962* @static @public @memberof QS_rx
963*/
964void QS_onReset(void);
965
966/*${QS::QS-rx::onCommand} ..................................................*/
967/*! Callback function to execute user commands (to be implemented in BSP)
968* @static @public @memberof QS_rx
969*/
971 uint8_t cmdId,
972 uint32_t param1,
973 uint32_t param2,
974 uint32_t param3);
975
976/*${QS::QS-rx::RX_PUT} .....................................................*/
977/*! Put one byte into the QS RX lock-free buffer
978* @static @public @memberof QS_rx
979*/
980bool QS_RX_PUT(uint8_t const b);
981/*$enddecl${QS} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
982
983/*==========================================================================*/
984/*$declare${QS-macros} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
985
986/*${QS-macros::QS_INIT} ....................................................*/
987/*! Initialize the QS facility
988*
989* @details
990* This macro provides an indirection layer to invoke the QS initialization
991* routine if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
992* @sa QS_onStartup(), example of setting up a QS filter in
993* QS_GLB_FILTER()
994*/
995#define QS_INIT(arg_) (QS_onStartup(arg_))
996
997/*${QS-macros::QS_EXIT} ....................................................*/
998/*! Cleanup the QS facility
999*
1000* @details
1001* This macro provides an indirection layer to invoke the QS cleanup
1002* routine if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1003* @sa QS_onCleanup()
1004*/
1005#define QS_EXIT() (QS_onCleanup())
1006
1007/*${QS-macros::QS_OUTPUT} ..................................................*/
1008/*! macro to handle the QS output from the application
1009*
1010* @note
1011* If this macro is used, the application must define QS_output().
1012*/
1013#define QS_OUTPUT() (QS_output())
1014
1015/*${QS-macros::QS_RX_INPUT} ................................................*/
1016/*! macro to handle the QS-RX input to the application
1017*
1018* @note
1019* If this macro is used, the application must define QS_doInput().
1020*/
1021#define QS_RX_INPUT() (QS_rx_input())
1022
1023/*${QS-macros::QS_GLB_FILTER} ..............................................*/
1024/*! Global Filter ON for a given record type `rec_`
1025*
1026* @details
1027* This macro provides an indirection layer to call QS_filterOn()
1028* if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1029*
1030* @sa
1031* - enum QSpyGroups - QS record groups that can be used as `rec_`
1032* - enum QSpyPre - predefined QS records that can be used as `rec_`
1033*
1034* @usage
1035* The following example shows how to use QS filters:
1036* @include qs_filter.c
1037*/
1038#define QS_GLB_FILTER(rec_) (QS_glbFilter_((int_fast16_t)(rec_)))
1039
1040/*${QS-macros::QS_LOC_FILTER} ..............................................*/
1041/*! Local Filter for a given state machine object `qs_id`
1042*
1043* @details
1044* This macro provides an indirection layer to call QS_locFilter_()
1045* if #Q_SPY is defined, or do nothing if #Q_SPY is not defined.
1046*
1047* @sa
1048* - enum QSpyIdGroups - QS ID groups that can be used as `qs_id_`
1049* - enum QSpyIdOffsets - QS ID offsets for `qs_id_` (e.g., QS_AP_IDS + 5)
1050*
1051* The following example shows how to use QS filters:
1052* @include qs_filter.c
1053*/
1054#define QS_LOC_FILTER(qs_id_) (QS_locFilter_((int_fast16_t)(qs_id_)))
1055
1056/*${QS-macros::QS_BEGIN_ID} ................................................*/
1057/*! Begin an application-specific QS record with entering critical section
1058*
1059* @details
1060* The following example shows how to build a user QS record using the
1061* macros QS_BEGIN_ID(), QS_END(), and the formatted output macros:
1062* QS_U8(), QS_STR(), etc.
1063*
1064* @note
1065* Must always be used in pair with QS_END()
1066*
1067* @include qs_ap.c
1068*/
1069#define QS_BEGIN_ID(rec_, qs_id_) \
1070if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
1071 QS_CRIT_STAT_ \
1072 QS_CRIT_E_(); \
1073 QS_beginRec_((uint_fast8_t)(rec_)); \
1074 QS_TIME_PRE_(); {
1075
1076/*${QS-macros::QS_END} .....................................................*/
1077/*! End an application-specific QS record with exiting critical section.
1078*
1079* @sa example for QS_BEGIN_ID()
1080* @note Must always be used in pair with QS_BEGIN_ID()
1081*/
1082#define QS_END() } \
1083 QS_endRec_(); \
1084 QS_CRIT_X_(); \
1085}
1086
1087/*${QS-macros::QS_FLUSH} ...................................................*/
1088/*! Flush the QS trace data to the host
1089*
1090* @details
1091* This macro invokes the QS_flush() platform-dependent callback
1092* function to flush the QS trace buffer to the host. The function
1093* typically busy-waits until all the data in the buffer is sent to
1094* the host. This is acceptable only in the initial transient.
1095*/
1096#define QS_FLUSH() (QS_onFlush())
1097
1098/*${QS-macros::QS_BEGIN_NOCRIT} ............................................*/
1099/*! Begin an application-specific QS record WITHOUT entering critical section */
1100#define QS_BEGIN_NOCRIT(rec_, qs_id_) \
1101if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
1102 QS_beginRec_((uint_fast8_t)(rec_)); \
1103 QS_TIME_PRE_(); {
1104
1105/*${QS-macros::QS_END_NOCRIT} ..............................................*/
1106/*! End an application-specific QS record WITHOUT exiting critical section */
1107#define QS_END_NOCRIT() } \
1108 QS_endRec_();\
1109}
1110
1111/*${QS-macros::QS_GLB_CHECK_} ..............................................*/
1112/*! Helper macro for checking the global QS filter */
1113#define QS_GLB_CHECK_(rec_) \
1114 (((uint_fast8_t)QS_priv_.glbFilter[(uint_fast8_t)(rec_) >> 3U] \
1115 & ((uint_fast8_t)1U << ((uint_fast8_t)(rec_) & 7U))) != 0U)
1116
1117/*${QS-macros::QS_LOC_CHECK_} ..............................................*/
1118/*! Helper macro for checking the local QS filter */
1119#define QS_LOC_CHECK_(qs_id_) \
1120 (((uint_fast8_t)QS_priv_.locFilter[(uint_fast8_t)(qs_id_) >> 3U] \
1121 & ((uint_fast8_t)1U << ((uint_fast8_t)(qs_id_) & 7U))) != 0U)
1122
1123/*${QS-macros::QS_REC_DONE} ................................................*/
1124#ifndef QS_REC_DONE
1125/*! Macro to execute user code when a QS record is produced
1126*
1127* @note
1128* This is a dummy definition in case this macro is undefined.
1129*/
1130#define QS_REC_DONE() ((void)0)
1131#endif /* ndef QS_REC_DONE */
1132
1133/*${QS-macros::QS_I8} ......................................................*/
1134/*! Output formatted int8_t to the QS record */
1135#define QS_I8(width_, data_) \
1136 (QS_u8_fmt_((uint8_t)(((width_) << 4U) & 0x7U) | (uint8_t)QS_I8_ENUM_T, \
1137 (data_)))
1138
1139/*${QS-macros::QS_U8} ......................................................*/
1140/*! Output formatted uint8_t to the QS record */
1141#define QS_U8(width_, data_) \
1142 (QS_u8_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))
1143
1144/*${QS-macros::QS_I16} .....................................................*/
1145/*! Output formatted int16_t to the QS record */
1146#define QS_I16(width_, data_) \
1147 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))
1148
1149/*${QS-macros::QS_U16} .....................................................*/
1150/*! Output formatted uint16_t to the QS record */
1151#define QS_U16(width_, data_) \
1152 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))
1153
1154/*${QS-macros::QS_I32} .....................................................*/
1155/*! Output formatted int32_t to the QS record */
1156#define QS_I32(width_, data_) \
1157 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))
1158
1159/*${QS-macros::QS_U32} .....................................................*/
1160/*! Output formatted uint32_t to the QS record */
1161#define QS_U32(width_, data_) \
1162 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))
1163
1164/*${QS-macros::QS_I64} .....................................................*/
1165/*! Output formatted int64_t to the QS record */
1166#define QS_I64(width_, data_) \
1167 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))
1168
1169/*${QS-macros::QS_U64} .....................................................*/
1170/*! Output formatted uint64_t to the QS record */
1171#define QS_U64(width_, data_) \
1172 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))
1173
1174/*${QS-macros::QS_F32} .....................................................*/
1175/*! Output formatted 32-bit floating point number to the QS record */
1176#define QS_F32(width_, data_) \
1177 (QS_f32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))
1178
1179/*${QS-macros::QS_F64} .....................................................*/
1180/*! Output formatted 64-bit floating point number to the QS record */
1181#define QS_F64(width_, data_) \
1182 (QS_f64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))
1183
1184/*${QS-macros::QS_STR} .....................................................*/
1185/*! Output formatted zero-terminated ASCII string to the QS record */
1186#define QS_STR(str_) (QS_str_fmt_((str_)))
1187
1188/*${QS-macros::QS_MEM} .....................................................*/
1189/*! Output formatted memory block of up to 255 bytes to the QS record */
1190#define QS_MEM(mem_, size_) (QS_mem_fmt_((mem_), (size_)))
1191
1192/*${QS-macros::QS_ENUM} ....................................................*/
1193/*! Output formatted enumeration to the QS record */
1194#define QS_ENUM(group_, value_) \
1195 (QS_u8_fmt_((uint8_t)(0x80U | ((group_) << 4U)) | (uint8_t)QS_I8_ENUM_T,\
1196 (uint8_t)(value_)))
1197
1198/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1199#if (QS_TIME_SIZE == 4U)
1200/*! Output time stamp to a QS record (used in predefined
1201* and application-specific trace records)
1202*/
1203#define QS_TIME_PRE_() (QS_u32_raw_(QS_onGetTime()))
1204#endif /* (QS_TIME_SIZE == 4U) */
1205
1206/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1207#if (QS_TIME_SIZE == 2U)
1208#define QS_TIME_PRE_() (QS_u16_raw_(QS_onGetTime()))
1209#endif /* (QS_TIME_SIZE == 2U) */
1210
1211/*${QS-macros::QS_TIME_PRE_} ...............................................*/
1212#if (QS_TIME_SIZE == 1U)
1213#define QS_TIME_PRE_() (QS_u8_raw_(QS_onGetTime()))
1214#endif /* (QS_TIME_SIZE == 1U) */
1215
1216/*${QS-macros::QS_OBJ} .....................................................*/
1217#if (QS_OBJ_PTR_SIZE == 4U)
1218/*! Output formatted object pointer to the QS record */
1219#define QS_OBJ(obj_) (QS_u32_fmt_(QS_OBJ_T, (uint32_t)(obj_)))
1220#endif /* (QS_OBJ_PTR_SIZE == 4U) */
1221
1222/*${QS-macros::QS_OBJ} .....................................................*/
1223#if (QS_OBJ_PTR_SIZE == 2U)
1224#define QS_OBJ(obj_) (QS_u16_fmt_(QS_OBJ_T, (uint16_t)(obj_)))
1225#endif /* (QS_OBJ_PTR_SIZE == 2U) */
1226
1227/*${QS-macros::QS_OBJ} .....................................................*/
1228#if (QS_OBJ_PTR_SIZE == 1U)
1229#define QS_OBJ(obj_) (QS_u8_fmt_(QS_OBJ_T, (uint8_t)(obj_)))
1230#endif /* (QS_OBJ_PTR_SIZE == 1U) */
1231
1232/*${QS-macros::QS_OBJ} .....................................................*/
1233#if (QS_OBJ_PTR_SIZE == 8U)
1234#define QS_OBJ(obj_) (QS_u64_fmt_(QS_OBJ_T, (uint64_t)(obj_)))
1235#endif /* (QS_OBJ_PTR_SIZE == 8U) */
1236
1237/*${QS-macros::QS_FUN} .....................................................*/
1238#if (QS_FUN_PTR_SIZE == 4U)
1239/* Output formatted function pointer to the QS record */
1240#define QS_FUN(fun_) (QS_u32_fmt_(QS_FUN_T, (uint32_t)(fun_)))
1241#endif /* (QS_FUN_PTR_SIZE == 4U) */
1242
1243/*${QS-macros::QS_FUN} .....................................................*/
1244#if (QS_FUN_PTR_SIZE == 2U)
1245#define QS_FUN(fun_) (QS_u16_fmt_(QS_FUN_T, (uint16_t)(fun_)))
1246#endif /* (QS_FUN_PTR_SIZE == 2U) */
1247
1248/*${QS-macros::QS_FUN} .....................................................*/
1249#if (QS_FUN_PTR_SIZE == 1U)
1250#define QS_FUN(fun_) (QS_u8_fmt_(QS_FUN_T, (uint8_t)(fun_)))
1251#endif /* (QS_FUN_PTR_SIZE == 1U) */
1252
1253/*${QS-macros::QS_FUN} .....................................................*/
1254#if (QS_FUN_PTR_SIZE == 8U)
1255#define QS_FUN(fun_) (QS_u64_fmt_(QS_FUN_T, (uint64_t)(fun_)))
1256#endif /* (QS_FUN_PTR_SIZE == 8U) */
1257
1258/*${QS-macros::QS_SIG} .....................................................*/
1259#if (Q_SIGNAL_SIZE == 4U)
1260/*! Output formatted event signal (of type ::QSignal) and
1261* the state machine object to the user QS record
1262*/
1263#define QS_SIG(sig_, obj_) \
1264 QS_u32_fmt_(QS_SIG_T, (sig_)); \
1265 QS_obj_raw_(obj_)
1266#endif /* (Q_SIGNAL_SIZE == 4U) */
1267
1268/*${QS-macros::QS_SIG} .....................................................*/
1269#if (Q_SIGNAL_SIZE == 2U)
1270#define QS_SIG(sig_, obj_) \
1271 QS_u16_fmt_(QS_SIG_T, (sig_)); \
1272 QS_obj_raw_(obj_)
1273#endif /* (Q_SIGNAL_SIZE == 2U) */
1274
1275/*${QS-macros::QS_SIG} .....................................................*/
1276#if (Q_SIGNAL_SIZE == 1U)
1277#define QS_SIG(sig_, obj_) \
1278 QS_u8_fmt_(QS_SIG_T, (sig_)); \
1279 QS_obj_raw_(obj_)
1280#endif /* (Q_SIGNAL_SIZE == 1U) */
1281
1282/*${QS-macros::QS_SIG_DICTIONARY} ..........................................*/
1283/*! Output QS signal dictionary record
1284*
1285* @details
1286* A signal dictionary record associates the numerical value of the signal
1287* and the binary address of the state machine that consumes that signal
1288* with the human-readable name of the signal.
1289*
1290* @param[in] sig_ event signal (typically enumerated, e.g. `TIMEOUT_SIG`)
1291* @param[in] obj_ pointer to the associated state machine object
1292* (might be `(void*)0` for globally recognized signals)
1293*
1294* A signal dictionary entry is associated with both the signal value `sig_`
1295* and the state machine `obj_`, because signals are required to be unique
1296* only within a given state machine and therefore the same numerical values
1297* can represent different signals in different state machines.
1298*
1299* For the "global" signals that have the same meaning in many state machines
1300* (such as globally published signals), you can specify a signal dictionary
1301* entry with the `obj_` parameter set to `(void*)0`.
1302*
1303* The following example shows the definition of signal dictionary entries
1304* in the initial transition of the Table active object. Please note that
1305* signals HUNGRY_SIG and DONE_SIG are associated with the Table state
1306* machine only ("me" `obj_` pointer). The EAT_SIG signal, on the other
1307* hand, is global (0 `obj_` pointer):
1308* @include qs_sigDic.c
1309*
1310* The following QSpy log example shows the signal dictionary records
1311* generated from the Table initial transition and subsequent records that
1312* show human-readable names of the signals:
1313* @include qs_sigLog.txt
1314*/
1315#define QS_SIG_DICTIONARY(sig_, obj_) \
1316 (QS_sig_dict_pre_((sig_), (obj_), #sig_))
1317
1318/*${QS-macros::QS_OBJ_DICTIONARY} ..........................................*/
1319/*! Output object dictionary record
1320*
1321* @details
1322* An object dictionary record associates the binary address of an object
1323* in the target's memory with the human-readable name of the object.
1324*
1325* @param[in] obj_ pointer to the object (any object)
1326*
1327* The following example shows the definition of object dictionary entry
1328* for the Table active object:
1329* @include qs_objDic.c
1330*/
1331#define QS_OBJ_DICTIONARY(obj_) \
1332 (QS_obj_dict_pre_((obj_), #obj_))
1333
1334/*${QS-macros::QS_OBJ_ARR_DICTIONARY} ......................................*/
1335/*! Output object-array dictionary record
1336*
1337* @details
1338* An object array dictionary record associates the binary address of the
1339* object element in the target's memory with the human-readable name
1340* of the object.
1341*
1342* @param[in] obj_ pointer to the object (any object)
1343* @param[in] idx_ array index
1344*
1345* The following example shows the definition of object array dictionary
1346* for `Philo::inst[n]` and `Philo::inst[n].m_timeEvt`:
1347* @include qs_objArrDic.c
1348*/
1349#define QS_OBJ_ARR_DICTIONARY(obj_, idx_) \
1350 (QS_obj_arr_dict_pre_((obj_), (idx_), #obj_))
1351
1352/*${QS-macros::QS_FUN_DICTIONARY} ..........................................*/
1353/*! Output function dictionary record
1354*
1355* @details
1356* A function dictionary record associates the binary address of a function
1357* in the target's memory with the human-readable name of the function.
1358*
1359* Providing a function dictionary QS record can vastly improve readability
1360* of the QS log, because instead of dealing with cryptic machine addresses
1361* the QSpy host utility can display human-readable function names.
1362*
1363* The example from #QS_SIG_DICTIONARY shows the definition of a function
1364* dictionary.
1365*/
1366#define QS_FUN_DICTIONARY(fun_) \
1367 (QS_fun_dict_pre_((void (*)(void))(fun_), #fun_))
1368
1369/*${QS-macros::QS_USR_DICTIONARY} ..........................................*/
1370/*! Output user QS record dictionary record
1371*
1372* @details
1373* A user QS record dictionary record associates the numerical value of a
1374* user record with the human-readable identifier.
1375*/
1376#define QS_USR_DICTIONARY(rec_) \
1377 (QS_usr_dict_pre_((rec_), #rec_))
1378
1379/*${QS-macros::QS_ENUM_DICTIONARY} .........................................*/
1380/*! Output enumeration dictionary record
1381*
1382* @details
1383* An enum QS record dictionary record associates the numerical value of
1384* an enumeration with the human-readable identifier.
1385*/
1386#define QS_ENUM_DICTIONARY(value_, group_) \
1387 (QS_enum_dict_pre_((value_), (group_), #value_))
1388
1389/*${QS-macros::QF_QS_CRIT_ENTRY} ...........................................*/
1390/*! Output the critical section entry record */
1392
1393/*${QS-macros::QF_QS_CRIT_EXIT} ............................................*/
1394/*! Output the critical section exit record */
1396
1397/*${QS-macros::QF_QS_ISR_ENTRY} ............................................*/
1398/*! Output the interrupt entry record */
1400 uint_fast8_t const isrnest,
1401 uint_fast8_t const prio_);
1402
1403/*${QS-macros::QF_QS_ISR_EXIT} .............................................*/
1404/*! Output the ISR exit trace record */
1406 uint_fast8_t isrnest,
1407 uint_fast8_t prio);
1408
1409/*${QS-macros::QF_QS_ACTION} ...............................................*/
1410/*! Execute an action that is only necessary for QS output */
1411#define QF_QS_ACTION(act_) (act_)
1412
1413/*${QS-macros::QS_EOD} .....................................................*/
1414/*! Constant representing End-Of-Data condition returned from the
1415* QS_getByte() function.
1416*/
1417#define QS_EOD ((uint16_t)0xFFFFU)
1418
1419/*${QS-macros::QS_CMD} .....................................................*/
1420/*! Constant representing command enumeration group
1421* in QS_ENUM_DICTIONARY() and QS_ENUM()
1422* @sa QS_onCommand()
1423*/
1424#define QS_CMD ((uint8_t)7U)
1425
1426/*${QS-macros::QS_HEX_FMT} .................................................*/
1427/*! Constant representing HEX format for the "width" filed
1428* in QS_U8(), QS_U16(), QS_U32(), and QS_U64().
1429*/
1430#define QS_HEX_FMT ((uint8_t)0x0FU)
1431/*$enddecl${QS-macros} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1432
1433/*==========================================================================*/
1434/* Facilities for QS critical section */
1435
1436/* QS-specific critical section */
1437#ifdef QS_CRIT_ENTRY /* separate QS critical section defined? */
1438
1439#ifndef QS_CRIT_STAT_TYPE
1440 #define QS_CRIT_STAT_
1441 #define QS_CRIT_E_() QS_CRIT_ENTRY(dummy)
1442 #define QS_CRIT_X_() QS_CRIT_EXIT(dummy); QS_REC_DONE()
1443#else
1444 #define QS_CRIT_STAT_ QS_CRIT_STAT_TYPE critStat_;
1445 #define QS_CRIT_E_() QS_CRIT_ENTRY(critStat_)
1446 #define QS_CRIT_X_() QS_CRIT_EXIT(critStat_); QS_REC_DONE()
1447#endif /* QS_CRIT_STAT_TYPE */
1448
1449#else /* separate QS critical section not defined--use the QF definition */
1450
1451#ifndef QF_CRIT_STAT_TYPE
1452 /*! This is an internal macro for defining the critical section
1453 * status type.
1454 * @details
1455 * The purpose of this macro is to enable writing the same code for the
1456 * case when critical section status type is defined and when it is not.
1457 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1458 * provides the definition of the critical section status variable.
1459 * Otherwise this macro is empty.
1460 * @sa #QF_CRIT_STAT_TYPE
1461 */
1462 #define QS_CRIT_STAT_
1463
1464 /*! This is an internal macro for entering a critical section.
1465 * @details
1466 * The purpose of this macro is to enable writing the same code for the
1467 * case when critical section status type is defined and when it is not.
1468 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1469 * invokes QF_CRIT_ENTRY() passing the key variable as the parameter.
1470 * Otherwise QF_CRIT_ENTRY() is invoked with a dummy parameter.
1471 * @sa QF_CRIT_ENTRY()
1472 */
1473 #define QS_CRIT_E_() QF_CRIT_ENTRY(dummy)
1474
1475 /*! This is an internal macro for exiting a critical section.
1476 * @details
1477 * The purpose of this macro is to enable writing the same code for the
1478 * case when critical section status type is defined and when it is not.
1479 * If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
1480 * invokes QF_CRIT_EXIT() passing the key variable as the parameter.
1481 * Otherwise QF_CRIT_EXIT() is invoked with a dummy parameter.
1482 * @sa QF_CRIT_EXIT()
1483 */
1484 #define QS_CRIT_X_() QF_CRIT_EXIT(dummy); QS_REC_DONE()
1485
1486#elif (!defined QS_CRIT_STAT_)
1487
1488 #define QS_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_;
1489 #define QS_CRIT_E_() QF_CRIT_ENTRY(critStat_)
1490 #define QS_CRIT_X_() QF_CRIT_EXIT(critStat_); QS_REC_DONE()
1491
1492#endif /* simple unconditional interrupt disabling used */
1493
1494#endif /* separate QS critical section not defined */
1495
1496/*==========================================================================*/
1497/* Macros for use in QUTest only */
1498#ifdef Q_UTEST
1499
1500/*$declare${QUTest} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1501
1502/*${QUTest::QS::TProbe} ....................................................*/
1503/*! @brief Test Probe attributes */
1506 uint32_t data;
1507 uint8_t idx;
1508};
1509
1510/*${QUTest::QS::TestData} ..................................................*/
1511/*! @brief QUTest data */
1513 struct QS_TProbe tpBuf[16]; /*!< buffer of Test-Probes received so far */
1514 uint8_t tpNum; /*!< current number of Test-Probes */
1515 QSTimeCtr testTime; /*!< test time (tick counter) */
1516};
1517
1518/*${QUTest::QS::testData} ..................................................*/
1519/*! QUTest data */
1520extern struct QS_TestData QS_testData;
1521
1522/*${QUTest::QS::test_pause_} ...............................................*/
1523/*! internal function to pause test and enter the test event loop */
1525
1526/*${QUTest::QS::getTestProbe_} .............................................*/
1527/*! get the test probe data for the given API */
1528uint32_t QS_getTestProbe_(QSpyFunPtr const api);
1529
1530/*${QUTest::QS::onTestSetup} ...............................................*/
1531/*! callback to setup a unit test inside the Target */
1533
1534/*${QUTest::QS::onTestTeardown} ............................................*/
1535/*! callback to teardown after a unit test inside the Target */
1537
1538/*${QUTest::QS::onTestEvt} .................................................*/
1539/*! callback to "massage" the test event before dispatching/posting it */
1540void QS_onTestEvt(QEvt * e);
1541
1542/*${QUTest::QS::onTestPost} ................................................*/
1543/*! callback to examine an event that is about to be posted */
1545 void const * sender,
1546 QActive * recipient,
1547 QEvt const * e,
1548 bool status);
1549
1550/*${QUTest::QS::onTestLoop} ................................................*/
1551/*! callback to run the test loop */
1552void QS_onTestLoop(void);
1553
1554/*${QUTest::QUTEST_ON_POST} ................................................*/
1555/*! record-ID for posting events */
1556#define QUTEST_ON_POST 124
1557/*$enddecl${QUTest} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1558
1559/*--------------------------------------------------------------------------*/
1560/* QP-stub for QUTest
1561* NOTE: The QP-stub is needed for unit testing QP applications,
1562* but might NOT be needed for testing QP itself.
1563*/
1564#if Q_UTEST != 0
1565/*$declare${QUTest-stub::QS} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1566
1567/*${QUTest-stub::QS::processTestEvts_} .....................................*/
1568/*! internal function to process posted events during test */
1570/*$enddecl${QUTest-stub::QS} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1571/*$declare${QUTest-stub::QHsmDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1572
1573/*${QUTest-stub::QHsmDummy} ................................................*/
1574/*! @brief QHsmDummy class
1575* @class QHsmDummy
1576* @extends QHsm
1577*
1578* @details
1579* ::QHsmDummy is a test double for the role of "Orthogonal Components"
1580* HSM objects in QUTest unit testing.
1581*/
1582typedef struct {
1583/* protected: */
1584 QHsm super;
1585} QHsmDummy;
1586
1587/* public: */
1588
1589/*! Constructor of the QHsmDummy HSM class
1590* @public @memberof QHsmDummy
1591*/
1592void QHsmDummy_ctor(QHsmDummy * const me);
1593
1594/*! override for QHsm_init_()
1595* @private @memberof QHsmDummy
1596*/
1598 QHsm * const me,
1599 void const * const par,
1600 uint_fast8_t const qs_id);
1601
1602/*! override for QHsm_dispatch_()
1603* @private @memberof QHsmDummy
1604*/
1606 QHsm * const me,
1607 QEvt const * const e,
1608 uint_fast8_t const qs_id);
1609/*$enddecl${QUTest-stub::QHsmDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1610/*$declare${QUTest-stub::QActiveDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
1611
1612/*${QUTest-stub::QActiveDummy} .............................................*/
1613/*! @brief QActiveDummy Object class
1614* @class QActiveDummy
1615* @extends QActive
1616*
1617* @details
1618* QActiveDummy is a test double for the role of collaborating active
1619* objects in QUTest unit testing.
1620*/
1621typedef struct {
1622/* protected: */
1623 QActive super;
1624} QActiveDummy;
1625
1626/* public: */
1627
1628/*! Constructor of the QActiveDummy Active Object class
1629* @public @memberof QActiveDummy
1630*/
1632
1633/*! override for QHsm_init_()
1634* @private @memberof QActiveDummy
1635*/
1637 QHsm * const me,
1638 void const * const par,
1639 uint_fast8_t const qs_id);
1640
1641/*! override for QHsm_dispatch_()
1642* @private @memberof QActiveDummy
1643*/
1645 QHsm * const me,
1646 QEvt const * const e,
1647 uint_fast8_t const qs_id);
1648
1649/*! override for QActive_start_()
1650* @private @memberof QActiveDummy
1651*/
1653 QActive * const me,
1654 QPrioSpec const prioSpec,
1655 QEvt const * * const qSto,
1656 uint_fast16_t const qLen,
1657 void * const stkSto,
1658 uint_fast16_t const stkSize,
1659 void const * const par);
1660
1661/*! override for QActive_post_()
1662* @private @memberof QActiveDummy
1663*/
1665 QActive * const me,
1666 QEvt const * const e,
1667 uint_fast16_t const margin,
1668 void const * const sender);
1669
1670/*! override for QActive_postLIFO_()
1671* @private @memberof QActiveDummy
1672*/
1674 QActive * const me,
1675 QEvt const * const e);
1676/*$enddecl${QUTest-stub::QActiveDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1677#endif /* Q_UTEST != 0 */
1678
1679/*! QS macro to define the Test-Probe for a given `fun_` */
1680#define QS_TEST_PROBE_DEF(fun_) \
1681 uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));
1682
1683/*! QS macro to apply a Test-Probe */
1684#define QS_TEST_PROBE(code_) \
1685 if (qs_tp_ != 0U) { code_ }
1686
1687/*! QS macro to apply a Test-Probe */
1688#define QS_TEST_PROBE_ID(id_, code_) \
1689 if (qs_tp_ == (uint32_t)(id_)) { code_ }
1690
1691/*! QS macro to pause test execution and enter the test event-loop */
1692#define QS_TEST_PAUSE() (QS_test_pause_())
1693
1694#else /* Q_UTEST not defined */
1695
1696/* dummy definitions when not building for QUTEST */
1697#define QS_TEST_PROBE_DEF(fun_)
1698#define QS_TEST_PROBE(code_)
1699#define QS_TEST_PROBE_ID(id_, code_)
1700#define QS_TEST_PAUSE() ((void)0)
1701
1702#endif /* Q_UTEST */
1703
1704#endif /* def QP_INC_QS_H_ */
@ 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:1506
@ 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:1507
QSFun addr
Definition: qpc_qs.h:1505
@ 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:397
@ QS_STR_T
Definition: qpc_qs.h:406
@ QS_U64_T
Definition: qpc_qs.h:412
@ QS_MEM_T
Definition: qpc_qs.h:407
@ QS_OBJ_T
Definition: qpc_qs.h:409
@ QS_F32_T
Definition: qpc_qs.h:404
@ QS_SIG_T
Definition: qpc_qs.h:408
@ QS_I8_ENUM_T
Definition: qpc_qs.h:398
@ QS_U8_T
Definition: qpc_qs.h:399
@ QS_I64_T
Definition: qpc_qs.h:411
@ QS_FUN_T
Definition: qpc_qs.h:410
@ QS_F64_T
Definition: qpc_qs.h:405
@ QS_U32_T
Definition: qpc_qs.h:403
@ QS_I32_T
Definition: qpc_qs.h:402
@ QS_I16_T
Definition: qpc_qs.h:400
@ QS_U16_T
Definition: qpc_qs.h:401
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:841
@ 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:844
@ 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:842
@ 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:1515
@ 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:1514
@ 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:845
@ 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:847
@ 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:846
@ 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:855
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:1513
@ 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:843
@ 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:1504
QUTest data.
Definition: qpc_qs.h:1512
QS ID type for applying local filtering.
Definition: qpc_qs.h:347
QActiveDummy Object class.
Definition: qpc_qs.h:1621
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:1623
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:1582
void QHsmDummy_ctor(QHsmDummy *const me)
QHsm super
Definition: qpc_qs.h:1584
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:817
void QS_onReset(void)
void QS_queryCurrObj(uint8_t const obj_kind)
uint8_t * buf
Definition: qpc_qs.h:820
void QS_rxParse(void)
QS_rx QS_rxPriv_
Definition: qpc_qs.h:834
void QS_rxInitBuf(uint8_t *const sto, uint16_t const stoSize)
QSCtr volatile tail
Definition: qpc_qs.h:823
static bool QS_rxPut(uint8_t const b)
Definition: qpc_qs.h:892
void QS_rxHandleGoodFrame_(uint8_t const state)
bool QS_RX_PUT(uint8_t const b)
bool inTestLoop
Definition: qpc_qs.h:826
void QS_doInput(void)
QSCtr end
Definition: qpc_qs.h:821
QSCtr volatile head
Definition: qpc_qs.h:822
QS_OSpyObjCombnation
Definition: qpc_qs.h:854
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:840
Software tracing, output QS-TX.
Definition: qpc_qs.h:355
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:386
void QS_endRec_(void)
void const * locFilter_AP
Definition: qpc_qs.h:365
void QS_onCleanup(void)
uint8_t * buf
Definition: qpc_qs.h:368
void QS_u16_raw_(uint16_t const d)
QSpyIdOffsets
Definition: qpc_qs.h:318
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:377
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:380
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:392
void QS_ASSERTION(char const *const module, int_t const loc, uint32_t const delay)
QSTimeCtr QS_onGetTime(void)
QSpyUserOffsets
Definition: qpc_qs.h:305
QSpyPre
Definition: qpc_qs.h:156
void QS_onFlush(void)
QSCtr end
Definition: qpc_qs.h:371
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:383
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:374
void QS_str_fmt_(char const *const str)
QSpyGroups
Definition: qpc_qs.h:282
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:389
void QS_f32_fmt_(uint8_t const format, float32_t const d)
QSpyIdGroups
Definition: qpc_qs.h:329