QP/C++ 6.9.3
qs_pkg.hpp 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.

Namespaces

 QP
 namespace associated with the QP/C++ framework
 

Macros

#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_BEGIN_PRE_(rec_, qs_id_)
 Internal QS macro to begin a predefined QS record with critical section. More...
 
#define QS_END_PRE_()
 Internal QS macro to end a predefined QS record with critical section. More...
 
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
 Internal QS macro to begin a predefined QS record without critical section. More...
 
#define QS_END_NOCRIT_PRE_()
 Internal QS macro to end a predefiend QS record without critical section. More...
 
#define QS_U8_PRE_(data_)    (QP::QS::u8_raw_(static_cast<std::uint8_t>(data_)))
 Internal QS macro to output an unformatted uint8_t data element. More...
 
#define QS_2U8_PRE_(data1_, data2_)
 Internal QS macro to output 2 unformatted uint8_t data elements. More...
 
#define QS_U16_PRE_(data_)    (QP::QS::u16_raw_(static_cast<std::uint16_t>(data_)))
 Internal QS macro to output an unformatted uint16_t data element. More...
 
#define QS_U32_PRE_(data_)    (QP::QS::u32_raw_(static_cast<std::uint32_t>(data_)))
 Internal QS macro to output an unformatted uint32_t data element. More...
 
#define QS_STR_PRE_(msg_)   (QP::QS::str_raw_(msg_))
 Internal QS macro to output a zero-terminated ASCII string data element. More...
 
#define QS_OBJ_PRE_(obj_)   (QP::QS::obj_raw_(obj_))
 Internal QS macro to output object pointer data element. More...
 
#define QS_FUN_PRE_(fun_)    (QP::QS::u32_raw_(reinterpret_cast<std::uint32_t>(fun_)))
 Internal QS macro to output an unformatted function pointer data element. More...
 
#define QS_EQC_PRE_(ctr_)    QS::u8_raw_(static_cast<std::uint8_t>(ctr_))
 Internal QS macro to output an unformatted event queue counter data element. More...
 
#define QS_EVS_PRE_(size_)    QS::u8_raw_(static_cast<std::uint8_t>(size_))
 Internal QS macro to output an unformatted event size data element. More...
 
#define QS_MPS_PRE_(size_)    QS::u8_raw_(static_cast<std::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_(static_cast<std::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_(static_cast<std::uint8_t>(ctr_))
 Internal QS macro to output an unformatted time event tick-counter data element. More...
 
#define QS_REC_NUM_(enum_)   (static_cast<std::uint_fast8_t>(enum_))
 Internal QS macro to cast enumerated QS record number to uint8_t. More...
 

Functions

void QS_target_info_ (std::uint8_t const isReset) noexcept
 send the Target info (object sizes, build time-stamp, QP version) More...
 

Variables

constexpr std::uint8_t QS_FRAME = 0x7EU
 Frame character of the QS output protocol. More...
 
constexpr std::uint8_t QS_ESC = 0x7DU
 Escape character of the QS output protocol. More...
 
constexpr std::uint8_t QS_ESC_XOR = 0x20U
 Escape modifier of the QS output protocol. More...
 
constexpr std::uint8_t QS_GOOD_CHKSUM = 0xFFU
 Escape character of the QS output protocol. More...
 

Detailed Description

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

Definition in file qs_pkg.hpp.

Macro Definition Documentation

◆ 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 43 of file qs_pkg.hpp.

◆ QS_INSERT_ESC_BYTE_

#define QS_INSERT_ESC_BYTE_ (   b_)
Value:
chksum_ += (b_); \
if (((b_) != QS_FRAME) && ((b_) != QS_ESC)) { \
QS_INSERT_BYTE_(b_) \
} \
else { \
QS_INSERT_BYTE_(QS_ESC) \
QS_INSERT_BYTE_(static_cast<std::uint8_t>((b_) ^ QS_ESC_XOR)) \
++priv_.used; \
}
unsigned char uint8_t
exact-width 8-bit unsigned int
Definition: 16bit/stdint.h:29
constexpr std::uint8_t QS_ESC
Escape character of the QS output protocol.
Definition: qs_pkg.hpp:258
constexpr std::uint8_t QS_ESC_XOR
Escape modifier of the QS output protocol.
Definition: qs_pkg.hpp:264
constexpr std::uint8_t QS_FRAME
Frame character of the QS output protocol.
Definition: qs_pkg.hpp:255

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

Definition at line 51 of file qs_pkg.hpp.

◆ QS_BEGIN_PRE_

#define QS_BEGIN_PRE_ (   rec_,
  qs_id_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
QS_CRIT_E_(); \
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
Definition: 16bit/stdint.h:36
static void beginRec_(std::uint_fast8_t const rec) noexcept
Mark the begin of a QS record rec.
Definition: qs.cpp:410
#define QS_LOC_CHECK_(qs_id_)
helper macro for checking the local QS filter
Definition: qs.hpp:750
#define QS_GLB_CHECK_(rec_)
helper macro for checking the global QS filter
Definition: qs.hpp:744

Internal QS macro to begin a predefined QS record with 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 71 of file qs_pkg.hpp.

◆ QS_END_PRE_

#define QS_END_PRE_ ( )
Value:
QS_CRIT_X_(); \
}
static void endRec_(void) noexcept
Mark the end of a QS record rec.
Definition: qs.cpp:436

Internal QS macro to end a predefined QS record with 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 82 of file qs_pkg.hpp.

◆ QS_BEGIN_NOCRIT_PRE_

#define QS_BEGIN_NOCRIT_PRE_ (   rec_,
  qs_id_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \

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

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

Definition at line 92 of file qs_pkg.hpp.

◆ QS_END_NOCRIT_PRE_

#define QS_END_NOCRIT_PRE_ ( )
Value:

Internal QS macro to end a predefiend QS record without 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 100 of file qs_pkg.hpp.

◆ QS_U8_PRE_

#define QS_U8_PRE_ (   data_)     (QP::QS::u8_raw_(static_cast<std::uint8_t>(data_)))

Internal QS macro to output an unformatted uint8_t data element.

Definition at line 119 of file qs_pkg.hpp.

◆ QS_2U8_PRE_

#define QS_2U8_PRE_ (   data1_,
  data2_ 
)
Value:
(QP::QS::u8u8_raw_(static_cast<std::uint8_t>(data1_), \
static_cast<std::uint8_t>(data2_)))
static void u8u8_raw_(std::uint8_t const d1, std::uint8_t const d2) noexcept
output two std::uint8_t data elements without format information
Definition: qs.cpp:739

Internal QS macro to output 2 unformatted uint8_t data elements.

Definition at line 123 of file qs_pkg.hpp.

◆ QS_U16_PRE_

#define QS_U16_PRE_ (   data_)     (QP::QS::u16_raw_(static_cast<std::uint16_t>(data_)))

Internal QS macro to output an unformatted uint16_t data element.

Definition at line 128 of file qs_pkg.hpp.

◆ QS_U32_PRE_

#define QS_U32_PRE_ (   data_)     (QP::QS::u32_raw_(static_cast<std::uint32_t>(data_)))

Internal QS macro to output an unformatted uint32_t data element.

Definition at line 132 of file qs_pkg.hpp.

◆ QS_STR_PRE_

#define QS_STR_PRE_ (   msg_)    (QP::QS::str_raw_(msg_))

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

Definition at line 137 of file qs_pkg.hpp.

◆ QS_OBJ_PRE_

#define QS_OBJ_PRE_ (   obj_)    (QP::QS::obj_raw_(obj_))

Internal QS macro to output object pointer data element.

Definition at line 140 of file qs_pkg.hpp.

◆ QS_FUN_PRE_

#define QS_FUN_PRE_ (   fun_)     (QP::QS::u32_raw_(reinterpret_cast<std::uint32_t>(fun_)))

Internal QS macro to output an unformatted function pointer data element.

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 161 of file qs_pkg.hpp.

◆ QS_EQC_PRE_

#define QS_EQC_PRE_ (   ctr_)     QS::u8_raw_(static_cast<std::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 170 of file qs_pkg.hpp.

◆ QS_EVS_PRE_

#define QS_EVS_PRE_ (   size_)     QS::u8_raw_(static_cast<std::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 188 of file qs_pkg.hpp.

◆ QS_MPS_PRE_

#define QS_MPS_PRE_ (   size_)     QS::u8_raw_(static_cast<std::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 204 of file qs_pkg.hpp.

◆ QS_MPC_PRE_

#define QS_MPC_PRE_ (   ctr_)     QS::u8_raw_(static_cast<std::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 219 of file qs_pkg.hpp.

◆ QS_TEC_PRE_

#define QS_TEC_PRE_ (   ctr_)     QS::u8_raw_(static_cast<std::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 235 of file qs_pkg.hpp.

◆ QS_REC_NUM_

#define QS_REC_NUM_ (   enum_)    (static_cast<std::uint_fast8_t>(enum_))

Internal QS macro to cast enumerated QS record number to uint8_t.

Note
Casting from enum to unsigned char violates the MISRA-C++ 2008 rules 5-2-7, 5-2-8 and 5-2-9. Encapsulating this violation in a macro allows to selectively suppress this specific deviation.

Definition at line 250 of file qs_pkg.hpp.