QP/C
Defines | Typedefs | Variables
qs_pkg.h File Reference

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

#include "qs_port.h"

Go to the source code of this file.

Defines

#define QS_INSERT_BYTE(b_)
 Internal QS macro to insert an un-escaped byte into the QS buffer.
#define QS_INSERT_ESC_BYTE(b_)
 Internal QS macro to insert an escaped byte into the QS buffer.
#define QS_INSERT_CHKSUM_BYTE()
 Internal QS macro to insert a escaped checksum byte into the QS buffer.
#define QS_PTR_AT_(i_)   (QS_ring_[(i_)])
 Internal QS macro to access the QS ring buffer.
#define QS_PTR_INC_(ptr_)   (++(ptr_))
 Internal QS macro to increment the given pointer argument ptr_.
#define QS_FRAME   ((uint8_t)0x7E)
 Frame character of the QS output protocol.
#define QS_ESC   ((uint8_t)0x7D)
 Escape character of the QS output protocol.
#define QS_ESC_XOR   ((uint8_t)0x20)
 Escape modifier of the QS output protocol.

Typedefs

typedef uint16_t QSCtr
 QS ring buffer counter and offset type.

Variables

uint8_t * QS_ring_
QSCtr QS_end_
QSCtr QS_head_
QSCtr QS_tail_
QSCtr QS_used_
uint8_t QS_seq_
uint8_t QS_chksum_
uint8_t QS_full_

Detailed Description

Internal (package scope) QS/C interface.

Definition in file qs_pkg.h.


Define Documentation

#define QS_ESC_XOR   ((uint8_t)0x20)

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

#define QS_PTR_AT_ (   i_)    (QS_ring_[(i_)])

Internal QS macro to access the QS ring buffer.

Note:
The QS buffer is allocated by the user and is accessed through the pointer QS_ring_, which violates the MISRA-C 2004 Rule 17.4(req), pointer arithmetic other than array indexing. Encapsulating this violation in a macro allows to selectively suppress this specific deviation.

Definition at line 92 of file qs_pkg.h.

Referenced by QS_getBlock(), and QS_getByte().

#define QS_PTR_INC_ (   ptr_)    (++(ptr_))

Internal QS macro to increment the given pointer argument ptr_.

Note:
Incrementing a pointer violates the MISRA-C 2004 Rule 17.4(req), pointer arithmetic other than array indexing. Encapsulating this violation in a macro allows to selectively suppress this specific deviation.

Definition at line 100 of file qs_pkg.h.

Referenced by QS_mem(), QS_str(), QS_str_(), QS_str_ROM(), and QS_str_ROM_().


Variable Documentation

uint8_t QS_chksum_

the checksum of the current record

Definition at line 54 of file qs.c.

Referenced by QS_begin(), QS_mem(), QS_str(), QS_str_(), QS_str_ROM(), and QS_str_ROM_().

offset of the end of the ring buffer

Definition at line 49 of file qs.c.

Referenced by QS_end(), QS_getBlock(), QS_getByte(), and QS_initBuf().

uint8_t QS_full_

the ring buffer is temporarily full

Definition at line 55 of file qs.c.

offset to where next byte will be inserted

Definition at line 50 of file qs.c.

Referenced by QS_end().

uint8_t* QS_ring_

pointer to the start of the ring buffer

Definition at line 48 of file qs.c.

Referenced by QS_initBuf().

uint8_t QS_seq_

the record sequence number

Definition at line 53 of file qs.c.

Referenced by QS_begin().

offset of where next event will be extracted

Definition at line 51 of file qs.c.

Referenced by QS_end(), QS_getBlock(), and QS_getByte().

number of bytes currently in the ring buffer

Definition at line 52 of file qs.c.

Referenced by QS_end(), QS_getBlock(), and QS_getByte().