QP/C  6.5.1
qs.h
Go to the documentation of this file.
1 
40 #ifndef qs_h
41 #define qs_h
42 
43 #ifndef Q_SPY
44  #error "Q_SPY must be defined to include qs.h"
45 #endif
46 
47 /****************************************************************************/
66  /* [0] QS session (not maskable) */
69  /* [1] SM records */
80  /* [10] AO records */
91  /* [19] EQ records */
98 
99  /* [24] MP records */
103  /* [26] QF records */
111  /* [32] TE records */
119  /* [38] QF records */
128  /* [45] AO records */
131  /* [46] EQ records */
134  /* [47] MP records */
137  /* [48] SC records */
146  /* [55] QEP records */
151  /* [58] Miscellaneous QS records (not maskable) */
165  /* [70] Application-specific (User) QS records */
167 };
168 
185 };
186 
194 };
195 
196 #ifndef QS_TIME_SIZE
197 
207  #define QS_TIME_SIZE 4
208 #endif
209 
210 #if (QS_TIME_SIZE == 1)
211  typedef uint8_t QSTimeCtr;
212  #define QS_TIME_() (QS_u8_(QS_onGetTime()))
213 #elif (QS_TIME_SIZE == 2)
214  typedef uint16_t QSTimeCtr;
215  #define QS_TIME_() (QS_u16_(QS_onGetTime()))
216 #elif (QS_TIME_SIZE == 4)
217 
221 
223  #define QS_TIME_() (QS_u32_(QS_onGetTime()))
224 #else
225  #error "QS_TIME_SIZE defined incorrectly, expected 1, 2, or 4"
226 #endif
227 
234 #define QS_PTR_AT_(base_, i_) (base_[i_])
235 
236 
237 /****************************************************************************/
238 /* QS services. */
239 
241 void QS_initBuf(uint8_t sto[], uint_fast16_t stoSize);
242 
244 void QS_filterOn(uint_fast8_t rec);
245 
247 void QS_filterOff(uint_fast8_t rec);
248 
250 void QS_beginRec(uint_fast8_t rec);
251 
253 void QS_endRec(void);
254 
255 /* unformatted data elements output ........................................*/
256 void QS_u8_(uint8_t d);
257 
259 void QS_u8u8_(uint8_t d1, uint8_t d2);
260 
262 void QS_u16_(uint16_t d);
263 
265 void QS_u32_(uint32_t d);
266 
268 void QS_str_(char_t const *s);
269 
270 /* formatted data elements output ..........................................*/
272 void QS_u8(uint8_t format, uint8_t d);
273 
275 void QS_u16(uint8_t format, uint16_t d);
276 
278 void QS_u32(uint8_t format, uint32_t d);
279 
281 void QS_f32(uint8_t format, float32_t f);
282 
284 void QS_f64(uint8_t format, float64_t d);
285 
287 void QS_str(char_t const *s);
288 
290 void QS_mem(uint8_t const *blk, uint8_t size);
291 
292 #if (QS_OBJ_PTR_SIZE == 8) || (QS_FUN_PTR_SIZE == 8)
293 
294  void QS_u64_(uint64_t d);
295 
297  void QS_u64(uint8_t format, uint64_t d);
298 #endif
299 
301 void QS_sig_dict(enum_t const sig, void const * const obj,
302  char_t const *name);
303 
305 void QS_obj_dict(void const * const obj,
306  char_t const *name);
307 
309 void QS_fun_dict(void (* const fun)(void),
310  char_t const *name);
311 
313 void QS_usr_dict(enum_t const rec,
314  char_t const * const name);
315 
316 /* QS buffer access *********************************************************/
318 uint16_t QS_getByte(void);
319 
321 #define QS_EOD ((uint16_t)0xFFFF)
322 
324 uint8_t const *QS_getBlock(uint16_t *pNbytes);
325 
326 
327 /* platform-specific callback functions, need to be implemented by clients */
328 
346 uint8_t QS_onStartup(void const *arg);
347 
356 void QS_onCleanup(void);
357 
366 void QS_onFlush(void);
367 
386 QSTimeCtr QS_onGetTime(void);
387 
388 /****************************************************************************/
389 /* Macros for adding QS instrumentation to the client code */
390 
398 #define QS_INIT(arg_) (QS_onStartup(arg_))
399 
407 #define QS_EXIT() (QS_onCleanup())
408 
418 #define QS_FILTER_ON(rec_) (QS_filterOn((uint_fast8_t)(rec_)))
419 
431 #define QS_FILTER_OFF(rec_) (QS_filterOff((uint_fast8_t)(rec_)))
432 
459 #define QS_FILTER_SM_OBJ(obj_) (QS_priv_.locFilter[SM_OBJ] = (obj_))
460 
481 #define QS_FILTER_AO_OBJ(obj_) (QS_priv_.locFilter[AO_OBJ] = (obj_))
482 
501 #define QS_FILTER_MP_OBJ(obj_) (QS_priv_.locFilter[MP_OBJ] = (obj_))
502 
521 #define QS_FILTER_EQ_OBJ(obj_) (QS_priv_.locFilter[EQ_OBJ] = (obj_))
522 
542 #define QS_FILTER_TE_OBJ(obj_) (QS_priv_.locFilter[TE_OBJ] = (obj_))
543 
559 #define QS_FILTER_AP_OBJ(obj_) (QS_priv_.locFilter[AP_OBJ] = (obj_))
560 
561 /****************************************************************************/
562 /* Macros to generate user QS records */
563 
565 #define QS_BEGIN_NOCRIT(rec_, obj_) \
566  if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3] \
567  & (uint_fast8_t)(1U << ((uint8_t)(rec_) & (uint8_t)7))) \
568  != (uint_fast8_t)0) \
569  && ((QS_priv_.locFilter[AP_OBJ] == (void *)0) \
570  || (QS_priv_.locFilter[AP_OBJ] == (obj_)))) \
571  { \
572  QS_beginRec((uint_fast8_t)(rec_)); \
573  QS_TIME_(); {
574 
576 #define QS_END_NOCRIT() } \
577  QS_END_NOCRIT_()
578 
579 #ifndef QS_REC_DONE
580 
581  #define QS_REC_DONE() ((void)0)
582 #endif /* QS_REC_DONE */
583 
584 /* QS-specific critical section *********************************************/
585 #ifdef QS_CRIT_ENTRY /* separate QS critical section defined? */
586 
587 #ifndef QS_CRIT_STAT_TYPE
588  #define QS_CRIT_STAT_
589  #define QS_CRIT_ENTRY_() QS_CRIT_ENTRY(dummy)
590  #define QS_CRIT_EXIT_() QS_CRIT_EXIT(dummy); QS_REC_DONE()
591 #else
592  #define QS_CRIT_STAT_ QS_CRIT_STAT_TYPE critStat_;
593  #define QS_CRIT_ENTRY_() QS_CRIT_ENTRY(critStat_)
594  #define QS_CRIT_EXIT_() QS_CRIT_EXIT(critStat_); QS_REC_DONE()
595 #endif /* QS_CRIT_STAT_TYPE */
596 
597 #else /* separate QS critical section not defined--use the QF definition */
598 
599 #ifndef QF_CRIT_STAT_TYPE
600 
611  #define QS_CRIT_STAT_
612 
623  #define QS_CRIT_ENTRY_() QF_CRIT_ENTRY(dummy)
624 
635  #define QS_CRIT_EXIT_() QF_CRIT_EXIT(dummy); QS_REC_DONE()
636 
637 #else /* simple unconditional interrupt disabling used */
638  #define QS_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_;
639  #define QS_CRIT_ENTRY_() QF_CRIT_ENTRY(critStat_)
640  #define QS_CRIT_EXIT_() QF_CRIT_EXIT(critStat_); QS_REC_DONE()
641 #endif /* simple unconditional interrupt disabling used */
642 
643 #endif /* separate QS critical section not defined */
644 
654 #define QS_BEGIN(rec_, obj_) \
655  if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3] \
656  & (uint_fast8_t)((uint_fast8_t)1 << ((uint8_t)(rec_) & (uint8_t)7))) \
657  != (uint_fast8_t)0) \
658  && ((QS_priv_.locFilter[AP_OBJ] == (void *)0) \
659  || (QS_priv_.locFilter[AP_OBJ] == (obj_)))) \
660  { \
661  QS_CRIT_STAT_ \
662  QS_CRIT_ENTRY_(); \
663  QS_beginRec((uint_fast8_t)(rec_)); \
664  QS_TIME_(); {
665 
670 #define QS_END() } \
671  QS_END_()
672 
673 /****************************************************************************/
674 
680 #define QS_BEGIN_(rec_, objFilter_, obj_) \
681  if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3] \
682  & (uint_fast8_t)((uint_fast8_t)1 << ((uint8_t)(rec_) & (uint8_t)7))) \
683  != (uint_fast8_t)0) \
684  && (((objFilter_) == (void *)0) \
685  || ((objFilter_) == (obj_)))) \
686  { \
687  QS_CRIT_ENTRY_(); \
688  QS_beginRec((uint_fast8_t)(rec_));
689 
695 #define QS_END_() \
696  QS_endRec(); \
697  QS_CRIT_EXIT_(); \
698  }
699 
705 #define QS_BEGIN_NOCRIT_(rec_, objFilter_, obj_) \
706  if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3] \
707  & (uint_fast8_t)((uint_fast8_t)1 << ((uint8_t)(rec_) & (uint8_t)7))) \
708  != (uint_fast8_t)0) \
709  && (((objFilter_) == (void *)0) \
710  || ((objFilter_) == (obj_)))) \
711  { \
712  QS_beginRec((uint_fast8_t)(rec_));
713 
719 #define QS_END_NOCRIT_() \
720  QS_endRec(); \
721  }
722 
724 #define QS_U8_(data_) (QS_u8_((uint8_t)(data_)))
725 
727 #define QS_2U8_(data1_, data2_) (QS_u8u8_((data1_), (data2_)))
728 
730 #define QS_U16_(data_) (QS_u16_((uint16_t)(data_)))
731 
733 #define QS_U32_(data_) (QS_u32_((uint32_t)(data_)))
734 
736 #define QS_STR_(msg_) (QS_str_((msg_)))
737 
738 
739 #if (Q_SIGNAL_SIZE == 1)
740 
744  #define QS_SIG_(sig_) (QS_u8_(sig_))
745 #elif (Q_SIGNAL_SIZE == 2)
746  #define QS_SIG_(sig_) (QS_u16_(sig_))
747 #elif (Q_SIGNAL_SIZE == 4)
748  #define QS_SIG_(sig_) (QS_u32_(sig_))
749 #endif
750 
751 
752 #if (QS_OBJ_PTR_SIZE == 1)
753  #define QS_OBJ_(obj_) (QS_u8_((uint8_t)(obj_)))
754 #elif (QS_OBJ_PTR_SIZE == 2)
755  #define QS_OBJ_(obj_) (QS_u16_((uint16_t)(obj_)))
756 #elif (QS_OBJ_PTR_SIZE == 4)
757  #define QS_OBJ_(obj_) (QS_u32_((uint32_t)(obj_)))
758 #elif (QS_OBJ_PTR_SIZE == 8)
759  #define QS_OBJ_(obj_) (QS_u64_((uint64_t)(obj_)))
760 #else
761 
766  #define QS_OBJ_(obj_) (QS_u32_((uint32_t)(obj_))
767 #endif
768 
769 
770 #if (QS_FUN_PTR_SIZE == 1)
771  #define QS_FUN_(fun_) (QS_u8_((uint8_t)(fun_)))
772 #elif (QS_FUN_PTR_SIZE == 2)
773  #define QS_FUN_(fun_) (QS_u16_((uint16_t)(fun_)))
774 #elif (QS_FUN_PTR_SIZE == 4)
775  #define QS_FUN_(fun_) (QS_u32_((uint32_t)(fun_)))
776 #elif (QS_FUN_PTR_SIZE == 8)
777  #define QS_FUN_(fun_) (QS_u64_((uint64_t)(fun_)))
778 #else
779 
784  #define QS_FUN_(fun_) (QS_u32_((uint32_t)(fun_)))
785 #endif
786 
787 /****************************************************************************/
788 /* Macros for use in the client code */
789 
796 enum {
813 };
814 
816 #define QS_I8(width_, data_) \
817  (QS_u8((uint8_t)(((width_) << 4)) | (uint8_t)QS_I8_T, (data_)))
818 
820 #define QS_U8(width_, data_) \
821  (QS_u8((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))
822 
824 #define QS_I16(width_, data_) \
825  (QS_u16((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))
826 
828 #define QS_U16(width_, data_) \
829  (QS_u16((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))
830 
832 #define QS_I32(width_, data_) \
833  (QS_u32((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))
834 
836 #define QS_U32(width_, data_) \
837  (QS_u32((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))
838 
840 #define QS_F32(width_, data_) \
841  (QS_f32((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))
842 
844 #define QS_F64(width_, data_) \
845  (QS_f64((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))
846 
848 #define QS_I64(width_, data_) \
849  (QS_u64((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))
850 
852 #define QS_U64(width_, data_) \
853  (QS_u64((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))
854 
856 #define QS_U32_HEX(width_, data_) \
857  (QS_u32((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_HEX_T, (data_)))
858 
860 #define QS_STR(str_) (QS_str((str_)))
861 
863 #define QS_MEM(mem_, size_) (QS_mem((mem_), (size_)))
864 
865 
866 #if (QS_OBJ_PTR_SIZE == 1)
867  #define QS_OBJ(obj_) (QS_u8(QS_OBJ_T, (uint8_t)(obj_)))
868 #elif (QS_OBJ_PTR_SIZE == 2)
869  #define QS_OBJ(obj_) (QS_u16(QS_OBJ_T, (uint16_t)(obj_)))
870 #elif (QS_OBJ_PTR_SIZE == 4)
871  #define QS_OBJ(obj_) (QS_u32(QS_OBJ_T, (uint32_t)(obj_)))
872 #elif (QS_OBJ_PTR_SIZE == 8)
873  #define QS_OBJ(obj_) (QS_u64(QS_OBJ_T, (uint64_t)(obj_)))
874 #else
875 
876  #define QS_OBJ(obj_) (QS_u32(QS_OBJ_T, (uint32_t)(obj_)))
877 #endif
878 
879 
880 #if (QS_FUN_PTR_SIZE == 1)
881  #define QS_FUN(fun_) (QS_u8(QS_FUN_T, (uint8_t)(fun_)))
882 #elif (QS_FUN_PTR_SIZE == 2)
883  #define QS_FUN(fun_) (QS_u16(QS_FUN_T, (uint16_t)(fun_)))
884 #elif (QS_FUN_PTR_SIZE == 4)
885  #define QS_FUN(fun_) (QS_u32(QS_FUN_T, (uint32_t)(fun_)))
886 #elif (QS_FUN_PTR_SIZE == 8)
887  #define QS_FUN(fun_) (QS_u64(QS_FUN_T, (uint64_t)(fun_)))
888 #else
889 
890  #define QS_FUN(fun_) (QS_u32(QS_FUN_T, (uint32_t)(fun_)))
891 #endif
892 
893 
894 #if (Q_SIGNAL_SIZE == 1)
895  #define QS_SIG(sig_, obj_) \
896  QS_u8(QS_SIG_T, (sig_)); \
897  QS_OBJ_(obj_)
898 #elif (Q_SIGNAL_SIZE == 2)
899  #define QS_SIG(sig_, obj_) \
900  QS_u16(QS_SIG_T, (sig_)); \
901  QS_OBJ_(obj_)
902 #elif (Q_SIGNAL_SIZE == 4)
903  #define QS_SIG(sig_, obj_) \
904  QS_u32(QS_SIG_T, (sig_)); \
905  QS_OBJ_(obj_)
906 #else
907 
910  #define QS_SIG(sig_, obj_) \
911  QS_u16(QS_SIG_T, (sig_)); \
912  QS_OBJ_(obj_)
913 #endif
914 
915 /****************************************************************************/
916 /* Dictionary records */
917 
959 #define QS_SIG_DICTIONARY(sig_, obj_) do { \
960  static char_t const sig_name_[] = #sig_; \
961  QS_sig_dict((sig_), (obj_), &sig_name_[0]); \
962 } while (0)
963 
978 #define QS_OBJ_DICTIONARY(obj_) do { \
979  static char_t const obj_name_[] = #obj_; \
980  QS_obj_dict((obj_), &obj_name_[0]); \
981 } while (0)
982 
996 #define QS_FUN_DICTIONARY(fun_) do { \
997  static char_t const fun_name_[] = #fun_; \
998  QS_fun_dict((void (*)(void))(fun_), &fun_name_[0]); \
999 } while (0)
1000 
1007 #define QS_USR_DICTIONARY(rec_) do { \
1008  static char_t const usr_name_[] = #rec_; \
1009  QS_usr_dict((rec_), &usr_name_[0]); \
1010 } while (0)
1011 
1017 #define QS_ASSERTION(module_, loc_, delay_) do { \
1018  uint32_t volatile delay_ctr_; \
1019  QS_BEGIN_NOCRIT_(QS_ASSERT_FAIL, (void *)0, (void *)0) \
1020  QS_TIME_(); \
1021  QS_U16_((uint16_t)(loc_)); \
1022  QS_STR_(((module_) != (char_t *)0) ? (module_) : "?"); \
1023  QS_END_NOCRIT_() \
1024  QS_onFlush(); \
1025  for (delay_ctr_ = (delay_); delay_ctr_ > (uint32_t)0; --delay_ctr_) {} \
1026  QS_onCleanup(); \
1027 } while (0)
1028 
1037 #define QS_FLUSH() (QS_onFlush())
1038 
1040 #define QF_QS_CRIT_ENTRY() \
1041  QS_BEGIN_NOCRIT_(QS_QF_CRIT_ENTRY, (void *)0, (void *)0) \
1042  QS_TIME_(); \
1043  QS_U8_(++QS_priv_.critNest); \
1044  QS_END_NOCRIT_()
1045 
1047 #define QF_QS_CRIT_EXIT() \
1048  QS_BEGIN_NOCRIT_(QS_QF_CRIT_EXIT, (void *)0, (void *)0) \
1049  QS_TIME_(); \
1050  QS_U8_(QS_priv_.critNest--); \
1051  QS_END_NOCRIT_()
1052 
1054 #define QF_QS_ISR_ENTRY(isrnest_, prio_) \
1055  QS_BEGIN_NOCRIT_(QS_QF_ISR_ENTRY, (void *)0, (void *)0) \
1056  QS_TIME_(); \
1057  QS_2U8_(isrnest_, prio_); \
1058  QS_END_NOCRIT_()
1059 
1061 #define QF_QS_ISR_EXIT(isrnest_, prio_) \
1062  QS_BEGIN_NOCRIT_(QS_QF_ISR_EXIT, (void *)0, (void *)0) \
1063  QS_TIME_(); \
1064  QS_2U8_(isrnest_, prio_); \
1065  QS_END_NOCRIT_()
1066 
1068 #define QF_QS_ACTION(act_) (act_)
1069 
1071 #define QS_getVersion() (QP_versionStr)
1072 
1073 
1074 /****************************************************************************/
1075 /* QS private data (the transmit channel) */
1087 };
1088 
1091 };
1092 
1094 typedef struct {
1095  uint8_t glbFilter[16];
1096  void const *locFilter[MAX_OBJ];
1106 } QSPriv;
1107 
1108 extern QSPriv QS_priv_;
1109 
1110 
1111 /****************************************************************************/
1112 /* QS receive channel */
1113 
1137 };
1138 
1140 void QS_rxInitBuf(uint8_t sto[], uint16_t stoSize);
1141 
1143 void QS_rxParse(void);
1144 
1148 typedef struct {
1149  void *currObj[MAX_OBJ];
1154 #ifdef Q_UTEST
1156  bool inTestLoop;
1157 #endif
1158 } QSrxPriv;
1159 
1160 extern QSrxPriv QS_rxPriv_;
1161 
1163 #define QS_RX_PUT(b_) do { \
1164  if (QS_rxPriv_.head != (QSCtr)0) { \
1165  if ((QS_rxPriv_.head - QS_rxPriv_.tail) != (QSCtr)1) { \
1166  QS_PTR_AT_(QS_rxPriv_.buf, QS_rxPriv_.head) = (uint8_t)(b_); \
1167  --QS_rxPriv_.head; \
1168  } \
1169  } \
1170  else { \
1171  if (QS_rxPriv_.tail != QS_rxPriv_.end) { \
1172  QS_PTR_AT_(QS_rxPriv_.buf, 0) = (uint8_t)(b_); \
1173  QS_rxPriv_.head = QS_rxPriv_.end; \
1174  } \
1175  } \
1176 } while (0)
1177 
1179 uint16_t QS_rxGetNfree(void);
1180 
1182 void QS_onReset(void);
1183 
1185 void QS_onCommand(uint8_t cmdId, uint32_t param1,
1186  uint32_t param2, uint32_t param3);
1187 
1191 #define QS_OUTPUT() (QS_output())
1192 
1196 #define QS_RX_INPUT() (QS_rx_input())
1197 
1198 /****************************************************************************/
1199 /* Facilities for use in QUTest only */
1200 #ifdef Q_UTEST
1201 
1202  void QS_onTestSetup(void);
1203 
1205  void QS_onTestTeardown(void);
1206 
1208  void QS_onTestLoop(void);
1209 
1211  void QS_onTestEvt(QEvt *e);
1212 
1214  void QS_onTestPost(void const *sender, QActive *recipient,
1215  QEvt const *e, bool status);
1216 
1218  void QS_processTestEvts_(void);
1219 
1221  void QS_tickX_(uint_fast8_t const tickRate, void const * const sender);
1222 
1224  uint32_t QS_getTestProbe_(void (* const api)(void));
1225 
1227  #define QS_TEST_PROBE_DEF(fun_) \
1228  uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));
1229 
1231  #define QS_TEST_PROBE(code_) \
1232  if (qs_tp_ != (uint32_t)0) { code_ }
1233 
1235  #define QS_TEST_PROBE_ID(id_, code_) \
1236  if (qs_tp_ == (uint32_t)(id_)) { code_ }
1237 
1239  #define QS_TEST_PAUSE() do { \
1240  QS_beginRec((uint_fast8_t)QS_TEST_PAUSED); \
1241  QS_endRec(); \
1242  QS_onTestLoop(); \
1243  } while (0)
1244 
1247  };
1248 
1249  /************************************************************************/
1256  typedef struct {
1257  QActive super; /* inherit QActive */
1258  } QActiveDummy;
1259 
1261  void QActiveDummy_ctor(QActiveDummy * const me);
1262 
1263 #else /* Q_UTEST not defined */
1264 
1265  /* dummy definitions when not building for QUTEST */
1266  #define QS_TEST_PROBE_DEF(fun_)
1267  #define QS_TEST_PROBE(code_)
1268  #define QS_TEST_PROBE_ID(id_, code_)
1269  #define QS_TEST_PAUSE() ((void)0)
1270 
1271 #endif /* Q_UTEST */
1272 
1273 #endif /* qs_h */
1274 
an event reference is about to be deleted
Definition: qs.h:120
AO attempted to recall an event.
Definition: qs.h:89
AO recalled an event.
Definition: qs.h:82
attempt to post an evt to QEQueue failed
Definition: qs.h:132
OSpyObjCombnation
Definition: qs.h:1089
void QS_onTestEvt(QEvt *e)
callback to "massage" the test event before dispatching/posting it
a memory block was removed from memory pool
Definition: qs.h:100
QSpyUserRecords
QS user record group offsets.
Definition: qs.h:188
rearming of a time event
Definition: qs.h:116
critical section was exited
Definition: qs.h:122
uint16_t QS_getByte(void)
Byte-oriented interface to the QS data buffer.
Definition: qs.c:670
reports the data from the PEEK query
Definition: qs.h:162
generic Application-specific object
Definition: qs.h:1085
an AO subscribed to an event
Definition: qs.h:83
set a Test-Probe in the Target
Definition: qs.h:1129
unsigned 8-bit integer format
Definition: qs.h:798
void QS_onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3)
callback function to execute user commands (to be implemented in BSP)
uint16_t QS_rxGetNfree(void)
Obtain the number of free bytes in the QS RX data buffer.
Definition: qs_rx.c:292
void QS_onFlush(void)
Callback to flush the QS trace data to the host.
User Group 90-99 records.
Definition: qs.h:181
reports the data from "current object" query
Definition: qs.h:161
QF QS records.
Definition: qs.h:177
void QS_initBuf(uint8_t sto[], uint_fast16_t stoSize)
Initialize the QS data buffer.
Definition: qs.c:80
void QS_processTestEvts_(void)
QS internal function to process posted events during test.
Definition: qutest.c:275
void QS_rxParse(void)
Parse all bytes present in the QS RX data buffer.
Definition: qs_rx.c:308
User Group 100-109 records.
Definition: qs.h:182
true disarming of an armed time event
Definition: qs.h:115
void QS_f32(uint8_t format, float32_t f)
Output 32-bit floating point data element with format information.
Definition: qs_fp.c:49
signed 64-bit integer format
Definition: qs.h:810
new event was created
Definition: qs.h:106
zero-terminated ASCII string format
Definition: qs.h:805
QActiveDummy Object class.
Definition: qs.h:1256
void QS_u32(uint8_t format, uint32_t d)
Output uint32_t data element with format information.
Definition: qs.c:528
continue a test after QS_TEST_PAUSE()
Definition: qs.h:1134
signed 32-bit integer format
Definition: qs.h:801
void QS_str_(char_t const *s)
Output zero-terminated ASCII string element without format information.
Definition: qs.c:636
void QS_beginRec(uint_fast8_t rec)
Mark the begin of a QS record rec.
Definition: qs.c:306
QSpyRecordGroups
QS record groups for QS_FILTER_ON() and QS_FILTER_OFF()
Definition: qs.h:170
QActive super
Definition: qs.h:1257
Memory Pools QS records.
Definition: qs.h:175
AO got an event and its queue is empty.
Definition: qs.h:88
set local AO filter in the Target
Definition: qs.h:1132
an event was ignored (silently discarded)
Definition: qs.h:76
a tran to history was taken
Definition: qs.h:147
object dictionary entry
Definition: qs.h:155
AO got an event and its queue is not empty.
Definition: qs.h:87
set global filters in the Target
Definition: qs.h:1130
test teardown
Definition: qs.h:1128
an event was dispatched (begin of RTC step)
Definition: qs.h:77
an event was posted (FIFO) directly to AO
Definition: qs.h:85
execute a user-defined command in the Target
Definition: qs.h:1121
unsigned short uint16_t
exact-width 16-bit unsigned int
Definition: stdint.h:30
void QS_onTestTeardown(void)
callback to teardown after a unit test inside the Target
inject an event to the Target
Definition: qs.h:1136
scheduler became idle
Definition: qs.h:143
void QS_onTestSetup(void)
callback to setup a unit test inside the Target
the first record available to QS users
Definition: qs.h:166
set the "current-object" in the Target
Definition: qs.h:1133
32-bit floating point format
Definition: qs.h:803
a time event was armed
Definition: qs.h:112
unsigned char uint8_t
exact-width 8-bit unsigned int
Definition: stdint.h:29
reports QS data receive status
Definition: qs.h:160
Scheduler QS records.
Definition: qs.h:178
uint32_t QS_getTestProbe_(void(*const api)(void))
QS internal function to get the Test-Probe for a given API.
Definition: qs_rx.c:1235
an initial transition was taken in a state
Definition: qs.h:72
interrupts were enabled
Definition: qs.h:126
event pool object
Definition: qs.h:1082
a state was entered
Definition: qs.h:70
void QS_rxInitBuf(uint8_t sto[], uint16_t stoSize)
Initialize the QS RX data buffer.
Definition: qs_rx.c:253
64-bit floating point format
Definition: qs.h:804
User Group 110-124 records.
Definition: qs.h:183
void QS_filterOn(uint_fast8_t rec)
Turn the global Filter on for a given record type rec.
Definition: qs.c:125
QSPriv QS_priv_
Definition: qs.c:53
Event Queues QS records.
Definition: qs.h:174
attempt to disarm a disarmed QTimeEvt
Definition: qs.h:114
signed 8-bit integer format
Definition: qs.h:797
State Machine QS records.
Definition: qs.h:172
offset for User Group 3
Definition: qs.h:192
void QS_endRec(void)
Mark the end of a QS record rec.
Definition: qs.c:333
uint8_t critNest
critical section nesting level
Definition: qs.h:1105
Time Events QS records.
Definition: qs.h:176
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
Definition: stdint.h:36
QSCtr used
number of bytes currently in the ring buffer
Definition: qs.h:1101
int enum_t
typedef for enumerations used for event signals
Definition: qep.h:76
assertion failed in the code
Definition: qs.h:163
QSrxPriv QS_rxPriv_
Definition: qs_rx.c:48
an event was published
Definition: qs.h:104
uint32_t QSTimeCtr
The type of the QS time stamp.
Definition: qs.h:220
void QS_u16(uint8_t format, uint16_t d)
output uint16_t data element with format information
Definition: qs.c:502
state machine object
Definition: qs.h:1080
all maskable QS records
Definition: qs.h:171
Event structure.
Definition: qep.h:153
an event was unhandled due to a guard
Definition: qs.h:78
QF_tickX() was called.
Definition: qs.h:109
unsigned long long uint64_t
exact-width 64-bit unsigned int
Definition: stdint.h:32
void QS_obj_dict(void const *const obj, char_t const *name)
Output object dictionary record.
Definition: qs.c:769
uint8_t QS_onStartup(void const *arg)
Callback to startup the QS facility.
set local filters in the Target
Definition: qs.h:1131
attempt to post an evt to AO failed
Definition: qs.h:129
unsigned long uint32_t
exact-width 32-bit unsigned int
Definition: stdint.h:31
void QS_u8u8_(uint8_t d1, uint8_t d2)
output two uint8_t data elements without format information
Definition: qs.c:571
char char_t
typedef for character strings.
Definition: qassert.h:77
raw queue object
Definition: qs.h:1083
void QS_fun_dict(void(*const fun)(void), char_t const *name)
Output function dictionary record.
Definition: qs.c:789
an event was posted (FIFO) to a raw queue
Definition: qs.h:92
reports completion of a user callback
Definition: qs.h:159
combination of SM and AO
Definition: qs.h:1090
an ISR was entered
Definition: qs.h:123
attempt to get a memory block failed
Definition: qs.h:135
query Target info (ver, config, tstamp)
Definition: qs.h:1120
QSpyObjKind
Kinds of objects used in QS.
Definition: qs.h:1079
active object
Definition: qs.h:1081
void QS_onCleanup(void)
Callback to cleanup the QS facility.
the top-most initial transition was taken
Definition: qs.h:73
test has been paused
Definition: qs.h:152
reports that Test-Probe has been used
Definition: qs.h:153
new event reference was created
Definition: qs.h:105
unsigned int uint_fast16_t
fast at-least 16-bit unsigned int
Definition: stdint.h:38
QS record for cleanly starting a session.
Definition: qs.h:67
Private QS-RX data to keep track of the current objects and the lock-free RX buffer.
Definition: qs.h:1148
void QS_sig_dict(enum_t const sig, void const *const obj, char_t const *name)
Output signal dictionary record.
Definition: qs.c:748
User Group 70-79 records.
Definition: qs.h:179
an event was posted (LIFO) to a raw queue
Definition: qs.h:93
a mutex was unlocked
Definition: qs.h:139
unsigned 64-bit integer format
Definition: qs.h:811
offset for User Group 4
Definition: qs.h:193
QPSet readySet
QUTEST ready-set of active objects.
Definition: qs.h:1155
peek Target memory
Definition: qs.h:1124
function dictionary entry
Definition: qs.h:156
a tran to exit point out of a submachine
Definition: qs.h:149
void QS_usr_dict(enum_t const rec, char_t const *const name)
Output user dictionary record.
Definition: qs.c:807
offset for User Group 1
Definition: qs.h:190
void QS_tickX_(uint_fast8_t const tickRate, void const *const sender)
internal function to process armed time events during test
Definition: qutest.c:310
interrupts were disabled
Definition: qs.h:125
scheduler was unlocked
Definition: qs.h:141
get the last event from the queue
Definition: qs.h:95
Private QS data to keep track of the filters and the trace buffer.
Definition: qs.h:1094
scheduler was locked
Definition: qs.h:140
Priority Set of up to 32 elements.
Definition: qpset.h:63
All User records.
Definition: qs.h:184
reports the Target information
Definition: qs.h:158
void QS_onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
callback to examine an event that is about to be posted
uint8_t seq
the record sequence number
Definition: qs.h:1102
void QS_onTestLoop(void)
callback to run the test loop
an event was posted (LIFO) directly to AO
Definition: qs.h:86
a regular transition was taken
Definition: qs.h:75
test setup
Definition: qs.h:1127
uint8_t * buf
pointer to the start of the ring buffer
Definition: qs.h:1097
signal dictionary entry
Definition: qs.h:154
uint_fast16_t QSCtr
QS ring buffer counter and offset type.
Definition: qs.h:1076
garbage collection attempt
Definition: qs.h:107
Definition: qs.h:1086
void QS_str(char_t const *s)
Output zero-terminated ASCII string element with format information.
Definition: qs.c:854
a memory block was returned to memory pool
Definition: qs.h:101
unsigned 32-bit integer format
Definition: qs.h:802
an ISR was exited
Definition: qs.h:124
unsigned 16-bit integer format
Definition: qs.h:800
AO deferred an event.
Definition: qs.h:81
QUTestUserRecords
Definition: qs.h:1245
void QS_onReset(void)
callback function to reset the Target (to be implemented in the BSP)
poke Target memory
Definition: qs.h:1125
float float32_t
IEEE 754 32-bit floating point number, MISRA-C 2004 rule 6.3(req)
Definition: qep.h:85
User Group 80-89 records.
Definition: qs.h:180
void QS_filterOff(uint_fast8_t rec)
Turn the global Filter off for a given record type rec.
Definition: qs.c:215
function pointer format
Definition: qs.h:809
a state was exited
Definition: qs.h:71
a mutex was locked
Definition: qs.h:138
fill Target memory
Definition: qs.h:1126
garbage collection
Definition: qs.h:108
Active Object QS records.
Definition: qs.h:173
scheduler resumed previous task (not idle)
Definition: qs.h:144
call QF_TICK_X() in the Target
Definition: qs.h:1123
QSpyRecords
Quantum Spy record types.
Definition: qs.h:65
void QS_mem(uint8_t const *blk, uint8_t size)
Output memory block of up to 255-bytes with format information.
Definition: qs.c:825
uint8_t chksum
the checksum of the current record
Definition: qs.h:1103
up to 255-bytes memory block format
Definition: qs.h:806
void QS_u16_(uint16_t d)
Output uint16_t data element without format information.
Definition: qs.c:590
QSCtr head
offset to where next byte will be inserted
Definition: qs.h:1099
critical section was entered
Definition: qs.h:121
void QS_u8(uint8_t format, uint8_t d)
Output uint8_t data element with format information.
Definition: qs.c:481
Active Object (based on QHsm implementation)
Definition: qf.h:114
time event object
Definition: qs.h:1084
QSCtr tail
offset of where next byte will be extracted
Definition: qs.h:1100
get an event and queue still not empty
Definition: qs.h:94
a tran to entry point into a submachine
Definition: qs.h:148
void QS_u8_(uint8_t d)
output uint8_t data element without format information
Definition: qs.c:554
a time event posted itself directly to an AO
Definition: qs.h:117
double float64_t
IEEE 754 64-bit floating point number, MISRA-C 2004 rule 6.3(req)
Definition: qep.h:94
offset for User Group 0
Definition: qs.h:189
user QS record dictionary entry
Definition: qs.h:157
offset for User Group 2
Definition: qs.h:191
void QS_u32_(uint32_t d)
Output uint32_t data element without format information.
Definition: qs.c:613
void QS_f64(uint8_t format, float64_t d)
Output 64-bit floating point data element with format information.
Definition: qs_fp.c:82
QSTimeCtr QS_onGetTime(void)
Callback to obtain a timestamp for a QS record.
Definition: qs_rx.c:1259
void QActiveDummy_ctor(QActiveDummy *const me)
Constructor of the QActiveDummy Active Object class.
Definition: qutest.c:117
bool inTestLoop
QUTEST event loop is running.
Definition: qs.h:1156
object pointer format
Definition: qs.h:808
uint8_t const * QS_getBlock(uint16_t *pNbytes)
Block-oriented interface to the QS data buffer.
Definition: qs.c:712
signed 16-bit integer format
Definition: qs.h:799
QSCtr end
offset of the end of the ring buffer
Definition: qs.h:1098
event signal format
Definition: qs.h:807
reset the Target
Definition: qs.h:1122
an internal transition was taken
Definition: qs.h:74
scheduler found next task to execute
Definition: qs.h:142
an AO unsubscribed to an event
Definition: qs.h:84
a time event expired and was disarmed
Definition: qs.h:113
unsigned 32-bit integer in hex format
Definition: qs.h:812
query the "current object" in the Target
Definition: qs.h:1135
QSpyRxRecords
Quantum Spy Receive (RX) record types:
Definition: qs.h:1119