QP/C  6.8.1
qs_pkg.h File Reference

Internal (package scope) QS/C interface. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  QSrxPrivAttr
 Private QS-RX attributes to keep track of the current objects and the lock-free RX buffer. More...
 

Macros

#define QS_BEGIN_PRE_(rec_, objFilter_, obj_)
 Internal QS macro to begin a predefined QS record with entering critical section. More...
 
#define QS_END_PRE_()
 Internal QS macro to end a predefined QS record with exiting critical section. More...
 
#define QS_BEGIN_NOCRIT_PRE_(rec_, objFilter_, obj_)
 Internal macro to begin a predefined QS record without entering critical section. More...
 
#define QS_END_NOCRIT_PRE_()   QS_endRec_(); }
 Internal QS macro to end a predefined QS record without exiting critical section. More...
 
#define QS_U8_PRE_(data_)   (QS_u8_raw_((uint8_t)(data_)))
 Internal QS macro to output a predefined uint8_t data element. More...
 
#define QS_2U8_PRE_(data1_, data2_)   (QS_2u8_raw_((uint8_t)(data1_), (uint8_t)(data2_)))
 Internal QS macro to output 2 predefined uint8_t data elements. More...
 
#define QS_U16_PRE_(data_)   (QS_u16_raw_((uint16_t)(data_)))
 Internal QS macro to output an predefined uint16_t data element. More...
 
#define QS_U32_PRE_(data_)   (QS_u32_raw_((uint32_t)(data_)))
 Internal QS macro to output a predefined uint32_t data element. More...
 
#define QS_STR_PRE_(msg_)   (QS_str_raw_((msg_)))
 Internal QS macro to output a predefined zero-terminated string element. More...
 
#define QS_OBJ_PRE_(obj_)   (QS_obj_raw_(obj_))
 
#define QS_FUN_PRE_(fun_)   (QS_u32_raw_((uint32_t)(fun_)))
 Internal macro to output an unformatted function pointer. More...
 
#define QS_EQC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 Internal QS macro to output an unformatted event queue counter data element. More...
 
#define QS_EVS_PRE_(size_)   QS_u8_raw_((uint8_t)(size_))
 Internal QS macro to output an unformatted event size data element. More...
 
#define QS_MPS_PRE_(size_)   QS_u8_raw_((uint8_t)(size_))
 Internal QS macro to output an unformatted memory pool block-size data element. More...
 
#define QS_MPC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 Internal QS macro to output an unformatted memory pool block-counter data element. More...
 
#define QS_TEC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 Internal QS macro to output an unformatted time event tick-counter data element. More...
 
#define QS_INSERT_BYTE_(b_)
 Internal QS macro to insert an un-escaped byte into the QS buffer. More...
 
#define QS_INSERT_ESC_BYTE_(b_)
 Internal QS macro to insert an escaped byte into the QS buffer. More...
 
#define QS_FRAME   (0x7EU)
 Frame character of the QS output protocol. More...
 
#define QS_ESC   (0x7DU)
 Escape character of the QS output protocol. More...
 
#define QS_GOOD_CHKSUM   (0xFFU)
 The expected checksum value over an uncorrupted QS record. More...
 
#define QS_ESC_XOR   (0x20U)
 Escape modifier of the QS output protocol. More...
 

Functions

void QS_target_info_pre_ (uint8_t isReset)
 send the predefined target info trace record (object sizes, build time-stamp, QP version) More...
 

Variables

const char_t Q_BUILD_DATE [12]
 the calendar date of the last translation of the form: "Mmm dd yyyy" More...
 
const char_t Q_BUILD_TIME [9]
 the time of the last translation of the form: "hh:mm:ss" More...
 
QSrxPrivAttr QS_rxPriv_
 

Detailed Description

Internal (package scope) QS/C interface.

Definition in file qs_pkg.h.


Data Structure Documentation

◆ QSrxPrivAttr

struct QSrxPrivAttr

Private QS-RX attributes to keep track of the current objects and the lock-free RX buffer.

Definition at line 271 of file qs_pkg.h.

Collaboration diagram for QSrxPrivAttr:
Collaboration graph
Data Fields
void * currObj[MAX_OBJ] current objects
uint8_t * buf pointer to the start of the ring buffer
QSCtr end offset of the end of the ring buffer
QSCtr head offset to where next byte will be inserted
QSCtr tail offset of where next byte will be extracted
QPSet readySet QUTEST ready-set of active objects.
bool inTestLoop QUTEST event loop is running.

Macro Definition Documentation

◆ QS_BEGIN_PRE_

#define QS_BEGIN_PRE_ (   rec_,
  objFilter_,
  obj_ 
)
Value:
if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3] \
& (uint_fast8_t)(1U << ((uint8_t)(rec_) & 7U))) != 0U) \
&& (((objFilter_) == (void *)0) \
|| ((objFilter_) == (obj_)))) \
{ \
QS_CRIT_ENTRY_(); \
QS_beginRec_((uint_fast8_t)(rec_));

Internal QS macro to begin a predefined QS record with entering critical section.

Note
This macro is intended to use only inside QP components and NOT at the application level.
See also
QS_BEGIN

Definition at line 50 of file qs_pkg.h.

◆ QS_END_PRE_

#define QS_END_PRE_ ( )
Value:
QS_CRIT_EXIT_(); \
}

Internal QS macro to end a predefined QS record with exiting critical section.

Note
This macro is intended to use only inside QP components and NOT at the application level.
See also
QS_END

Definition at line 65 of file qs_pkg.h.

◆ QS_BEGIN_NOCRIT_PRE_

#define QS_BEGIN_NOCRIT_PRE_ (   rec_,
  objFilter_,
  obj_ 
)
Value:
if ((((uint_fast8_t)QS_priv_.glbFilter[(uint8_t)(rec_) >> 3]\
& (uint_fast8_t)(1U << ((uint8_t)(rec_) & 7U))) != 0U) \
&& (((objFilter_) == (void *)0) \
|| ((objFilter_) == (obj_)))) \
{ \
QS_beginRec_((uint_fast8_t)(rec_));

Internal macro to begin a predefined QS record without entering critical section.

Note
This macro is intended to use only inside QP components and NOT at the application level.
See also
QS_BEGIN_NOCRIT

Definition at line 76 of file qs_pkg.h.

◆ QS_END_NOCRIT_PRE_

#define QS_END_NOCRIT_PRE_ ( )    QS_endRec_(); }

Internal QS macro to end a predefined QS record without exiting critical section.

Note
This macro is intended to use only inside QP components and NOT at the application level.
See also
QS_END_NOCRIT

Definition at line 90 of file qs_pkg.h.

◆ QS_U8_PRE_

#define QS_U8_PRE_ (   data_)    (QS_u8_raw_((uint8_t)(data_)))

Internal QS macro to output a predefined uint8_t data element.

Definition at line 93 of file qs_pkg.h.

◆ QS_2U8_PRE_

#define QS_2U8_PRE_ (   data1_,
  data2_ 
)    (QS_2u8_raw_((uint8_t)(data1_), (uint8_t)(data2_)))

Internal QS macro to output 2 predefined uint8_t data elements.

Definition at line 96 of file qs_pkg.h.

◆ QS_U16_PRE_

#define QS_U16_PRE_ (   data_)    (QS_u16_raw_((uint16_t)(data_)))

Internal QS macro to output an predefined uint16_t data element.

Definition at line 100 of file qs_pkg.h.

◆ QS_U32_PRE_

#define QS_U32_PRE_ (   data_)    (QS_u32_raw_((uint32_t)(data_)))

Internal QS macro to output a predefined uint32_t data element.

Definition at line 103 of file qs_pkg.h.

◆ QS_STR_PRE_

#define QS_STR_PRE_ (   msg_)    (QS_str_raw_((msg_)))

Internal QS macro to output a predefined zero-terminated string element.

Definition at line 106 of file qs_pkg.h.

◆ QS_OBJ_PRE_

#define QS_OBJ_PRE_ (   obj_)    (QS_obj_raw_(obj_))

Definition at line 121 of file qs_pkg.h.

◆ QS_FUN_PRE_

#define QS_FUN_PRE_ (   fun_)    (QS_u32_raw_((uint32_t)(fun_)))

Internal macro to output an unformatted function pointer.

Note
the size of the pointer depends on the macro QS_FUN_PTR_SIZE. If the size is not defined the size of pointer is assumed 4-bytes.

Definition at line 136 of file qs_pkg.h.

◆ QS_EQC_PRE_

#define QS_EQC_PRE_ (   ctr_)    QS_u8_raw_((uint8_t)(ctr_))

Internal QS macro to output an unformatted event queue counter data element.

Note
the counter size depends on the macro QF_EQUEUE_CTR_SIZE.

Definition at line 148 of file qs_pkg.h.

◆ QS_EVS_PRE_

#define QS_EVS_PRE_ (   size_)    QS_u8_raw_((uint8_t)(size_))

Internal QS macro to output an unformatted event size data element.

Note
the event size depends on the macro QF_EVENT_SIZ_SIZE.

Definition at line 163 of file qs_pkg.h.

◆ QS_MPS_PRE_

#define QS_MPS_PRE_ (   size_)    QS_u8_raw_((uint8_t)(size_))

Internal QS macro to output an unformatted memory pool block-size data element.

Note
the block-size depends on the macro QF_MPOOL_SIZ_SIZE.

Definition at line 178 of file qs_pkg.h.

◆ QS_MPC_PRE_

#define QS_MPC_PRE_ (   ctr_)    QS_u8_raw_((uint8_t)(ctr_))

Internal QS macro to output an unformatted memory pool block-counter data element.

Note
the counter size depends on the macro QF_MPOOL_CTR_SIZE.

Definition at line 192 of file qs_pkg.h.

◆ QS_TEC_PRE_

#define QS_TEC_PRE_ (   ctr_)    QS_u8_raw_((uint8_t)(ctr_))

Internal QS macro to output an unformatted time event tick-counter data element.

Note
the counter size depends on the macro QF_TIMEEVT_CTR_SIZE.

Definition at line 207 of file qs_pkg.h.

◆ QS_INSERT_BYTE_

#define QS_INSERT_BYTE_ (   b_)
Value:
buf[head] = (b_); \
++head; \
if (head == end) { \
head = 0U; \
}

Internal QS macro to insert an un-escaped byte into the QS buffer.

Definition at line 217 of file qs_pkg.h.

◆ QS_INSERT_ESC_BYTE_

#define QS_INSERT_ESC_BYTE_ (   b_)
Value:
chksum = (uint8_t)(chksum + (b_)); \
if (((b_) != QS_FRAME) && ((b_) != QS_ESC)) { \
QS_INSERT_BYTE_(b_) \
} \
else { \
QS_INSERT_BYTE_(QS_ESC) \
QS_INSERT_BYTE_((uint8_t)((b_) ^ QS_ESC_XOR))\
}

Internal QS macro to insert an escaped byte into the QS buffer.

Definition at line 226 of file qs_pkg.h.

◆ QS_FRAME

#define QS_FRAME   (0x7EU)

Frame character of the QS output protocol.

Definition at line 239 of file qs_pkg.h.

◆ QS_ESC

#define QS_ESC   (0x7DU)

Escape character of the QS output protocol.

Definition at line 243 of file qs_pkg.h.

◆ QS_GOOD_CHKSUM

#define QS_GOOD_CHKSUM   (0xFFU)

The expected checksum value over an uncorrupted QS record.

Definition at line 247 of file qs_pkg.h.

◆ QS_ESC_XOR

#define QS_ESC_XOR   (0x20U)

Escape modifier of the QS output protocol.

Description
The escaped byte is XOR-ed with the escape modifier before it is inserted into the QS buffer.

Definition at line 256 of file qs_pkg.h.

Function Documentation

◆ QS_target_info_pre_()

void QS_target_info_pre_ ( uint8_t  isReset)

send the predefined target info trace record (object sizes, build time-stamp, QP version)

Definition at line 342 of file qs.c.

Variable Documentation

◆ Q_BUILD_DATE

const char_t Q_BUILD_DATE[12]

the calendar date of the last translation of the form: "Mmm dd yyyy"

Definition at line 16 of file qstamp.c.

◆ Q_BUILD_TIME

const char_t Q_BUILD_TIME[9]

the time of the last translation of the form: "hh:mm:ss"

Definition at line 19 of file qstamp.c.

◆ QS_rxPriv_

QSrxPrivAttr QS_rxPriv_

Definition at line 48 of file qs_rx.c.

uint8_t
unsigned char uint8_t
exact-width 8-bit unsigned int
Definition: 16bit/stdint.h:29
QS_endRec_
void QS_endRec_(void)
Mark the end of a QS record rec.
Definition: qs.c:312
QSPrivAttr::glbFilter
uint8_t glbFilter[16]
global on/off QS filter
Definition: qs.h:986
QS_FRAME
#define QS_FRAME
Frame character of the QS output protocol.
Definition: qs_pkg.h:239
uint_fast8_t
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
Definition: 16bit/stdint.h:36
QS_ESC
#define QS_ESC
Escape character of the QS output protocol.
Definition: qs_pkg.h:243
QS_ESC_XOR
#define QS_ESC_XOR
Escape modifier of the QS output protocol.
Definition: qs_pkg.h:256
QSPrivAttr::used
QSCtr used
number of bytes currently in the ring buffer
Definition: qs.h:992
QS_priv_
QSPrivAttr QS_priv_
Definition: qs.c:48