Software tracing instrumentation, target-resident component (QS namespace emulated as a "class" in C) More...
#include "qs.h"
Public Types | |
enum | QSpyPre |
enum | QSpyGroups |
enum | QSpyUserOffsets |
enum | QSpyIdOffsets |
enum | QSpyIdGroups |
enum | QS_QSpyObjKind |
enum | QS_OSpyObjComb |
Static Public Member Functions | |
void | QS_initBuf (uint8_t *const sto, uint_fast32_t const stoSize) |
uint16_t | QS_getByte (void) |
uint8_t const * | QS_getBlock (uint16_t *const pNbytes) |
void | QS_doOutput (void) |
uint8_t | QS_onStartup (void const *arg) |
void | QS_onCleanup (void) |
void | QS_onFlush (void) |
Flush the QS output buffer. | |
QSTimeCtr | QS_onGetTime (void) |
Return the current timestamp for QS trace records. | |
void | QS_onTestSetup (void) |
void | QS_onTestTeardown (void) |
void | QS_onTestEvt (QEvt *e) |
void | QS_onTestPost (void const *sender, QActive *recipient, QEvt const *e, bool status) |
void | QS_onTestLoop (void) |
void | QS_rxInitBuf (uint8_t *const sto, uint16_t const stoSize) |
static bool | QS_rxPut (uint8_t const b) |
void | QS_rxParse (void) |
void | QS_setCurrObj (uint8_t const obj_kind, void *const obj_ptr) |
uint16_t | QS_rxGetNfree (void) |
void | QS_doInput (void) |
void | QS_onReset (void) |
void | QS_onCommand (uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) |
Static Private Member Functions | |
typedef void(* | QSpyFunPtr) (void) |
Private Attributes | |
QS_Filter | QS_filt_ |
QS_RxAttr | QS_rxPriv_ |
Software tracing instrumentation, target-resident component (QS namespace emulated as a "class" in C)
This namespace groups together QP/Spy services for target-resident software tracing instrumentation.
enum QSpyGroups |
QS-TX record groups for QS_GLB_FILTER()
enum QSpyUserOffsets |
QS user record group offsets for QS_GLB_FILTER()
enum QSpyIdOffsets |
QS ID offsets for QS_LOC_FILTER()
enum QSpyIdGroups |
QS ID groups for QS_LOC_FILTER()
enum QS_QSpyObjKind |
enum QS_OSpyObjComb |
|
static |
Initialize the QS-TX data buffer
This function should be called from QS_onStartup() to provide QS-TX (transmit channel) with the data buffer.
[in] | sto | pointer to the storage for the transmit buffer |
[in] | stoSize | size in [bytes] of the storage buffer. Currently the size of the QS buffer cannot exceed 64KB. |
|
static |
Byte-oriented interface to the QS-TX data buffer
This function delivers one byte at a time from the QS data buffer.
|
static |
Block-oriented interface to the QS-TX data buffer
This function delivers a contiguous block of data from the QS data buffer. The function returns the pointer to the beginning of the block, and writes the number of bytes in the block to the location pointed to by pNbytes
. The argument pNbytes
is also used as input to provide the maximum size of the data block that the caller can accept.
[in,out] | pNbytes | pointer to the number of bytes to send. On input, pNbytes specifies the maximum number of bytes that the function can provide. On output, pNbytes contains the actual number of bytes available. |
pNbytes
to the # available bytes. If data is available at the time the function is called, the function returns NULL pointer and sets the value pointed to by pNbytes
to zero.
|
static |
|
static |
|
static |
|
static |
Flush the QS output buffer.
This function is used at the end of QS dictionaries and other QS records that need to be transmitted immediately. QS_onFlush() is typically used only during the initial transient and should NOT be used thereafter because it is busy-waiting for the transmission of the data.
|
static |
Return the current timestamp for QS trace records.
This function is defined in the application and is called for every QS trace record that requires a timestamp. The function shall return the current timestamp as an unsigned integer of the type QSTimeCtr. The dynamic range of QSTimeCtr is configurable by the macro QS_TIME_SIZE, which can take values 1-byte (256 counts), 2-bytes (64K counts) and 4-bytes (4G counts).
As this is a callback from QS to the application, the properties of the timestamp depend entirely on the application. Typically, the function requires a hardware timer with the following properties:
The following code implements QS_onGetTime() with a free-running, 32-bit timer in STM32U545 MCU:
|
static |
|
static |
|
static |
|
static |
|
static |
Initialize the QS-RX data buffer
This function should be called from QS_onStartup() to provide QS-RX (receive channel) with the data buffer. The QS-RX channel requires the initialization of the QS-TX channel (see QS_initBuf()). The QS-RX channel is optional and does not need to be initialized when not needed.
[in] | sto | pointer to the storage for the QS-RX receive buffer |
[in] | stoSize | size in [bytes] of the storage buffer |
|
inlinestatic |
Put a byte into the QS-RX (receive channel) input buffer
[in] | b | data byte to insert into the QS-RX receive buffer |
This function is called (typically from an ISR) to put a new incoming byte into the QS-RX input buffer. Typically, this function is called by means of the macro QS_RX_PUT().
|
static |
Parse and process QS-RX (receive channel) data bytes
The application must call this function repeatedly to process the incoming commands from the QS-RX input channel. The frequency of the calls must be high enough to avoid overflowing the QS-RX input buffer (see QS_rxInitBuf(), QS_rxPut(), and QS_RX_PUT()).
|
static |
Set the "current object" inside the Target
[in] | obj_kind | kind of "current object" to set The possible values are:
|
[in] | obj_ptr | pointer to the object to set as "current" |
This function sets the "current object" selected object kind inside the QS-RX target-resident component. This "current object" is subsequently used in all commands that pertain to that object.
|
static |
|
static |
|
static |
|
private |
|
private |