QP/C  7.0.0
Real-Time Embedded Framework
qs_pkg.h File Reference

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

Go to the source code of this file.

Data Structures

struct  QSrxPrivAttr
 

Macros

#define QS_FRAME   (0x7EU)
 
#define QS_ESC   (0x7DU)
 
#define QS_GOOD_CHKSUM   (0xFFU)
 
#define QS_ESC_XOR   (0x20U)
 
#define QS_BEGIN_PRE_(rec_, qs_id_)
 
#define QS_END_PRE_()
 
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
 
#define QS_END_NOCRIT_PRE_()   QS_endRec_(); }
 
#define QS_U8_PRE_(data_)   (QS_u8_raw_((uint8_t)(data_)))
 
#define QS_2U8_PRE_(data1_, data2_)    (QS_2u8_raw_((uint8_t)(data1_), (uint8_t)(data2_)))
 
#define QS_U16_PRE_(data_)   (QS_u16_raw_((uint16_t)(data_)))
 
#define QS_U32_PRE_(data_)   (QS_u32_raw_((uint32_t)(data_)))
 
#define QS_STR_PRE_(msg_)   (QS_str_raw_((msg_)))
 
#define QS_SIG_PRE_(sig_)   (QS_u8_raw_((uint8_t)sig_))
 
#define QS_OBJ_PRE_(obj_)   (QS_obj_raw_(obj_))
 
#define QS_FUN_PRE_(fun_)   (QS_u8_raw_((uint8_t)(fun_)))
 
#define QS_EQC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 
#define QS_EVS_PRE_(size_)   QS_u8_raw_((uint8_t)(size_))
 
#define QS_MPS_PRE_(size_)   QS_u8_raw_((uint8_t)(size_))
 
#define QS_MPC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 
#define QS_TEC_PRE_(ctr_)   QS_u8_raw_((uint8_t)(ctr_))
 
#define QS_INSERT_BYTE_(b_)
 
#define QS_INSERT_ESC_BYTE_(b_)
 

Enumerations

enum  QSpyRxRecords {
  QS_RX_INFO , QS_RX_COMMAND , QS_RX_RESET , QS_RX_TICK ,
  QS_RX_PEEK , QS_RX_POKE , QS_RX_FILL , QS_RX_TEST_SETUP ,
  QS_RX_TEST_TEARDOWN , QS_RX_TEST_PROBE , QS_RX_GLB_FILTER , QS_RX_LOC_FILTER ,
  QS_RX_AO_FILTER , QS_RX_CURR_OBJ , QS_RX_TEST_CONTINUE , QS_RX_QUERY_CURR ,
  QS_RX_EVENT
}
 

Functions

void QS_target_info_pre_ (uint8_t isReset)
 

Variables

QSrxPrivAttr QS_rxPriv_
 

Detailed Description

Date
Last updated on: 2021-12-23
Version
Last updated for: Version 7.0.0, 2022-04-30

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

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 volatile head

offset to where next byte will be inserted

QSCtr volatile 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_FRAME

#define QS_FRAME   (0x7EU)

Frame character of the QS output protocol

Definition at line 67 of file qs_pkg.h.

◆ QS_ESC

#define QS_ESC   (0x7DU)

Escape character of the QS output protocol

Definition at line 70 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 73 of file qs_pkg.h.

◆ QS_ESC_XOR

#define QS_ESC_XOR   (0x20U)

Escape modifier of the QS output protocol

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

Definition at line 81 of file qs_pkg.h.

◆ 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_));
#define QS_LOC_CHECK_(qs_id_)
Definition: qs.h:568
#define QS_GLB_CHECK_(rec_)
Definition: qs.h:563

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

◆ QS_END_PRE_

#define QS_END_PRE_ ( )
Value:
QS_CRIT_X_(); \
}
void QS_endRec_(void)
Definition: qs.c:399

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 126 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 138 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 148 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 151 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 154 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 158 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 161 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 164 of file qs_pkg.h.

◆ QS_SIG_PRE_

#define QS_SIG_PRE_ (   sig_)    (QS_u8_raw_((uint8_t)sig_))

Internal macro to output an unformatted event signal data element

Note
the size of the pointer depends on the macro Q_SIGNAL_SIZE.

Definition at line 172 of file qs_pkg.h.

◆ QS_OBJ_PRE_

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

Definition at line 179 of file qs_pkg.h.

◆ QS_FUN_PRE_

#define QS_FUN_PRE_ (   fun_)    (QS_u8_raw_((uint8_t)(fun_)))

Definition at line 182 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 205 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 220 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 235 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 249 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 264 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 273 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))\
}
QSPrivAttr QS_priv_
Definition: qs.c:41
QSCtr volatile used
Definition: qs.h:918
#define QS_ESC
Definition: qs_pkg.h:70
#define QS_ESC_XOR
Definition: qs_pkg.h:81
#define QS_FRAME
Definition: qs_pkg.h:67

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

Definition at line 281 of file qs_pkg.h.

Enumeration Type Documentation

◆ QSpyRxRecords

QS received record types (RX channel)

This enumeration specifies the record types for the QS receive channel

Enumerator
QS_RX_INFO 

query Target info (ver, config, tstamp)

QS_RX_COMMAND 

execute a user-defined command in the Target

QS_RX_RESET 

reset the Target

QS_RX_TICK 

call QF_TICK_X() in the Target

QS_RX_PEEK 

peek Target memory

QS_RX_POKE 

poke Target memory

QS_RX_FILL 

fill Target memory

QS_RX_TEST_SETUP 

test setup

QS_RX_TEST_TEARDOWN 

test teardown

QS_RX_TEST_PROBE 

set a Test-Probe in the Target

QS_RX_GLB_FILTER 

set global filters in the Target

QS_RX_LOC_FILTER 

set local filters in the Target

QS_RX_AO_FILTER 

set local AO filter in the Target

QS_RX_CURR_OBJ 

set the "current-object" in the Target

QS_RX_TEST_CONTINUE 

continue a test after QS_TEST_PAUSE()

QS_RX_QUERY_CURR 

query the "current object" in the Target

QS_RX_EVENT 

inject an event to the Target

Definition at line 45 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)

Variable Documentation

◆ QS_rxPriv_

QSrxPrivAttr QS_rxPriv_
extern

Definition at line 40 of file qs_rx.c.