QTools  7.2.1
Collection of Host-Based Tools
Loading...
Searching...
No Matches
QS_tx Struct Reference

#include <qpc_qs.h>

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_glbFilter_ (int_fast16_t const filter)
 
void QS_locFilter_ (int_fast16_t const filter)
 
void QS_doOutput (void)
 
void QS_ASSERTION (char const *const module, int_t const loc, uint32_t const delay)
 
uint8_t QS_onStartup (void const *arg)
 
void QS_onCleanup (void)
 
void QS_onFlush (void)
 
QSTimeCtr QS_onGetTime (void)
 

Public Attributes

uint8_t glbFilter [16]
 
uint8_t locFilter [16]
 
void const * locFilter_AP
 
uint8_t * buf
 
QSCtr end
 
QSCtr volatile head
 
QSCtr volatile tail
 
QSCtr volatile used
 
uint8_t volatile seq
 
uint8_t volatile chksum
 
uint8_t volatile critNest
 
uint8_t flags
 

Static Private Member Functions

void QS_beginRec_ (uint_fast8_t const rec)
 
void QS_endRec_ (void)
 
void QS_u8_raw_ (uint8_t const d)
 
void QS_2u8_raw_ (uint8_t const d1, uint8_t const d2)
 
void QS_u16_raw_ (uint16_t const d)
 
void QS_u32_raw_ (uint32_t const d)
 
void QS_obj_raw_ (void const *const obj)
 
void QS_str_raw_ (char const *const str)
 
void QS_u8_fmt_ (uint8_t const format, uint8_t const d)
 
void QS_u16_fmt_ (uint8_t const format, uint16_t const d)
 
void QS_u32_fmt_ (uint8_t const format, uint32_t const d)
 
void QS_str_fmt_ (char const *const str)
 
void QS_mem_fmt_ (uint8_t const *const blk, uint8_t const size)
 
void QS_sig_dict_pre_ (enum_t const sig, void const *const obj, char const *const name)
 
void QS_obj_dict_pre_ (void const *const obj, char const *const name)
 
void QS_obj_arr_dict_pre_ (void const *const obj, uint_fast16_t const idx, char const *const name)
 
void QS_fun_dict_pre_ (QSpyFunPtr const fun, char const *const name)
 
void QS_usr_dict_pre_ (enum_t const rec, char const *const name)
 
void QS_enum_dict_pre_ (enum_t const value, uint8_t const group, char const *const name)
 
void QS_target_info_pre_ (uint8_t const isReset)
 
void QS_u64_raw_ (uint64_t d)
 
void QS_u64_fmt_ (uint8_t format, uint64_t d)
 
void QS_f32_fmt_ (uint8_t const format, float32_t const d)
 
void QS_f64_fmt_ (uint8_t const format, float64_t const d)
 

Detailed Description

Definition at line 356 of file qpc_qs.h.

Member Function Documentation

◆ QS_initBuf()

void QS_initBuf ( uint8_t *const  sto,
uint_fast32_t const  stoSize 
)
static

Initialize the QS-TX data buffer

This function should be called from QS_onStartup() to provide QS with the data buffer. The first argument sto is the address of the memory block, and the second argument stoSize is the size of this block [in bytes]. Currently the size of the QS buffer cannot exceed 64KB.

Parameters
[in]stopointer to the storage for the transmit buffer
[in]stoSizesize in [bytes] of the storage buffer
Remarks
QS can work with quite small data buffers, but you will start losing data if the buffer is too small for the bursts of tracing activity. The right size of the buffer depends on the data production rate and the data output rate. QS offers flexible filtering to reduce the data production rate.
Note
If the data output rate cannot keep up with the production rate, QS will start overwriting the older data with newer data. This is consistent with the "last-is-best" QS policy. The record sequence counters and check sums on each record allow the QSPY host utility to easily detect any data loss.

◆ QS_getByte()

uint16_t QS_getByte ( void  )
static

Byte-oriented interface to the QS-TX data buffer

This function delivers one byte at a time from the QS data buffer.

Returns
the byte in the least-significant 8-bits of the 16-bit return value if the byte is available. If no more data is available at the time, the function returns QS_EOD (End-Of-Data).
Note
QS_getByte() is NOT protected with a critical section.

◆ QS_getBlock()

uint8_t const * QS_getBlock ( uint16_t *const  pNbytes)
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.

Parameters
[in,out]pNbytespointer 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.
Returns
if data is available, the function returns pointer to the contiguous block of data and sets the value pointed to by 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.
Note
Only the NULL return from QS_getBlock() indicates that the QS buffer is empty at the time of the call. The non-NULL return often means that the block is at the end of the buffer and you need to call QS_getBlock() again to obtain the rest of the data that "wrapped around" to the beginning of the QS data buffer.
QS_getBlock() is not protected with a critical section.

◆ QS_glbFilter_()

void QS_glbFilter_ ( int_fast16_t const  filter)
static

Set/clear the global Filter for a given QS record or a group of records

This function sets up the QS filter to enable record types specified in the filter parameter. The value QS_ALL_RECORDS specifies to filter-in all records. This function should be called indirectly through the macro QS_GLB_FILTER()

Parameters
[in]filterthe QS record-d or group to enable in the filter, if positive or disable, if negative. The record-id numbers must be in the range -127..127.
Note
Filtering based on the record-type is only the first layer of filtering. The second layer is based on the object-type. Both filter layers must be enabled for the QS record to be inserted in the QS buffer.
See also
QS_locFilter_()

◆ QS_locFilter_()

void QS_locFilter_ ( int_fast16_t const  filter)
static

Set/clear the local Filter for a given object-id or a group of object-ids

This function sets up the local QS filter to enable or disable the given QS object-id or a group of object-ids filter. This function should be called indirectly through the macro QS_LOC_FILTER()

Parameters
[in]filterthe QS object-id or group to enable in the filter, if positive or disable, if negative. The qs_id numbers must be in the range 1..127.
Note
Filtering based on the object-id (local filter) is the second layer of filtering. The first layer is based on the QS record-type (global filter). Both filter layers must be enabled for the QS record to be inserted into the QS buffer.
See also
QS_glbFilter_()

◆ QS_doOutput()

void QS_doOutput ( void  )
static

Perform the QS-TX output (implemented in some QS ports)

◆ QS_beginRec_()

void QS_beginRec_ ( uint_fast8_t const  rec)
staticprivate

Mark the begin of a QS record rec

This function must be called at the beginning of each QS record. This function should be called indirectly through the macro QS_BEGIN_ID(), or QS_BEGIN_NOCRIT(), depending if it's called in a normal code or from a critical section.

◆ QS_endRec_()

void QS_endRec_ ( void  )
staticprivate

Mark the end of a QS record rec

This function must be called at the end of each QS record. This function should be called indirectly through the macro QS_END(), or QS_END_NOCRIT(), depending if it's called in a normal code or from a critical section.

◆ QS_u8_raw_()

void QS_u8_raw_ ( uint8_t const  d)
staticprivate

output uint8_t data element without format information

◆ QS_2u8_raw_()

void QS_2u8_raw_ ( uint8_t const  d1,
uint8_t const  d2 
)
staticprivate

output two uint8_t data elements without format information

◆ QS_u16_raw_()

void QS_u16_raw_ ( uint16_t const  d)
staticprivate

output uint16_t data element without format information

◆ QS_u32_raw_()

void QS_u32_raw_ ( uint32_t const  d)
staticprivate

output uint32_t data element without format information

◆ QS_obj_raw_()

void QS_obj_raw_ ( void const *const  obj)
staticprivate

Output obj pointer data element without format information

Note
This function is only to be used through macros, never in the client code directly.

◆ QS_str_raw_()

void QS_str_raw_ ( char const *const  str)
staticprivate

Output raw zero-terminated string element (without format information)

Note
This function is only to be used through macros, never in the client code directly.

◆ QS_u8_fmt_()

void QS_u8_fmt_ ( uint8_t const  format,
uint8_t const  d 
)
staticprivate

Output uint8_t data element with format information

Note
This function is only to be used through macros, never in the client code directly.

◆ QS_u16_fmt_()

void QS_u16_fmt_ ( uint8_t const  format,
uint16_t const  d 
)
staticprivate

output uint16_t data element with format information

This function is only to be used through macros, never in the client code directly.

◆ QS_u32_fmt_()

void QS_u32_fmt_ ( uint8_t const  format,
uint32_t const  d 
)
staticprivate

Output uint32_t data element with format information

Note
This function is only to be used through macros, never in the client code directly.

◆ QS_str_fmt_()

void QS_str_fmt_ ( char const *const  str)
staticprivate

Output formatted zero-terminated ASCII string to the QS record

◆ QS_mem_fmt_()

void QS_mem_fmt_ ( uint8_t const *const  blk,
uint8_t const  size 
)
staticprivate

Output formatted memory block of up to 255 bytes to the QS record

◆ QS_sig_dict_pre_()

void QS_sig_dict_pre_ ( enum_t const  sig,
void const *const  obj,
char const *const  name 
)
staticprivate

Output predefined signal-dictionary record

Note
This function is only to be used through macro QS_SIG_DICTIONARY()

◆ QS_obj_dict_pre_()

void QS_obj_dict_pre_ ( void const *const  obj,
char const *const  name 
)
staticprivate

Output predefined object-dictionary record

Note
This function is only to be used through macro QS_OBJ_DICTIONARY()

◆ QS_obj_arr_dict_pre_()

void QS_obj_arr_dict_pre_ ( void const *const  obj,
uint_fast16_t const  idx,
char const *const  name 
)
staticprivate

Output predefined object-array dictionary record

Note
This function is only to be used through macro QS_OBJ_ARR_DICTIONARY()

◆ QS_fun_dict_pre_()

void QS_fun_dict_pre_ ( QSpyFunPtr const  fun,
char const *const  name 
)
staticprivate

Output predefined function-dictionary record

Note
This function is only to be used through macro QS_FUN_DICTIONARY()

◆ QS_usr_dict_pre_()

void QS_usr_dict_pre_ ( enum_t const  rec,
char const *const  name 
)
staticprivate

Output predefined user-dictionary record

Note
This function is only to be used through macro QS_USR_DICTIONARY()

◆ QS_enum_dict_pre_()

void QS_enum_dict_pre_ ( enum_t const  value,
uint8_t const  group,
char const *const  name 
)
staticprivate

Output predefined enum-dictionary record

Note
This function is only to be used through macro QS_ENUM_DICTIONARY()

◆ QS_ASSERTION()

void QS_ASSERTION ( char const *const  module,
int_t const  loc,
uint32_t const  delay 
)
static

Output the predefined assertion failure trace record

This trace record is intended to use from the Q_onAssert() callback.

◆ QS_target_info_pre_()

void QS_target_info_pre_ ( uint8_t const  isReset)
staticprivate

Helper function to output the predefined Target-info trace record

◆ QS_onStartup()

uint8_t QS_onStartup ( void const *  arg)
static

Callback to startup the QS facility

◆ QS_onCleanup()

void QS_onCleanup ( void  )
static

Callback to cleanup the QS facility

◆ QS_onFlush()

void QS_onFlush ( void  )
static

Callback to flush the QS trace data to the host

◆ QS_onGetTime()

QSTimeCtr QS_onGetTime ( void  )
static

Callback to obtain a timestamp for a QS record

◆ QS_u64_raw_()

void QS_u64_raw_ ( uint64_t  d)
staticprivate

Output uint64_t data element without format information

◆ QS_u64_fmt_()

void QS_u64_fmt_ ( uint8_t  format,
uint64_t  d 
)
staticprivate

Output uint64_t data element with format information

See also
QS_U64(), QS_I64()

◆ QS_f32_fmt_()

void QS_f32_fmt_ ( uint8_t const  format,
float32_t const  d 
)
staticprivate

Output 32-bit floating point data element with format information

See also
QS_F32()

◆ QS_f64_fmt_()

void QS_f64_fmt_ ( uint8_t const  format,
float64_t const  d 
)
staticprivate

Output 64-bit floating point data element with format information

See also
QS_F64()

Member Data Documentation

◆ glbFilter

uint8_t glbFilter[16]

global on/off QS filter

Definition at line 360 of file qpc_qs.h.

◆ locFilter

uint8_t locFilter[16]

local on/off QS filter

Definition at line 363 of file qpc_qs.h.

◆ locFilter_AP

void const* locFilter_AP
Deprecated:
old local QS filter

Definition at line 366 of file qpc_qs.h.

◆ buf

uint8_t* buf

pointer to the start of the QS-TX ring buffer

Definition at line 369 of file qpc_qs.h.

◆ end

QSCtr end

offset of the end of the ring buffer

Definition at line 372 of file qpc_qs.h.

◆ head

QSCtr volatile head

offset to where next byte will be inserted

Definition at line 375 of file qpc_qs.h.

◆ tail

QSCtr volatile tail

offset of where next record will be extracted

Definition at line 378 of file qpc_qs.h.

◆ used

QSCtr volatile used

number of bytes currently in the ring buffer

Definition at line 381 of file qpc_qs.h.

◆ seq

uint8_t volatile seq

sequence number of the last inserted QS record

Definition at line 384 of file qpc_qs.h.

◆ chksum

uint8_t volatile chksum

checksum of the currently inserted record

Definition at line 387 of file qpc_qs.h.

◆ critNest

uint8_t volatile critNest

critical section nesting level

Definition at line 390 of file qpc_qs.h.

◆ flags

uint8_t flags

Definition at line 393 of file qpc_qs.h.


The documentation for this struct was generated from the following file: