QP/C 6.9.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_, qs_id_)
 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_, qs_id_)
 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

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 262 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_,
  qs_id_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
QS_CRIT_E_(); \
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_ID()

Definition at line 51 of file qs_pkg.h.

◆ QS_END_PRE_

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

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 63 of file qs_pkg.h.

◆ QS_BEGIN_NOCRIT_PRE_

#define QS_BEGIN_NOCRIT_PRE_ (   rec_,
  qs_id_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
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 75 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 85 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 88 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 91 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 95 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 98 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 101 of file qs_pkg.h.

◆ QS_OBJ_PRE_

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

Definition at line 116 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 131 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 143 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 158 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 173 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 187 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 202 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 212 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 221 of file qs_pkg.h.

◆ QS_FRAME

#define QS_FRAME   (0x7EU)

Frame character of the QS output protocol.

Definition at line 234 of file qs_pkg.h.

◆ QS_ESC

#define QS_ESC   (0x7DU)

Escape character of the QS output protocol.

Definition at line 238 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 242 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 251 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 433 of file qs.c.

Variable Documentation

◆ QS_rxPriv_

QSrxPrivAttr QS_rxPriv_
extern

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:403
QS_FRAME
#define QS_FRAME
Frame character of the QS output protocol.
Definition: qs_pkg.h:234
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:238
QS_ESC_XOR
#define QS_ESC_XOR
Escape modifier of the QS output protocol.
Definition: qs_pkg.h:251
QSPrivAttr::used
QSCtr used
number of bytes currently in the ring buffer
Definition: qs.h:880
QS_GLB_CHECK_
#define QS_GLB_CHECK_(rec_)
helper macro for checking the global QS filter
Definition: qs.h:555
QS_priv_
QSPrivAttr QS_priv_
Definition: qs.c:49
QS_LOC_CHECK_
#define QS_LOC_CHECK_(qs_id_)
helper macro for checking the local QS filter
Definition: qs.h:560