qevent.h File Reference

QEvent class and basic macros used by all QP components. More...

Go to the source code of this file.

Data Structures

struct  QEvent
 Event structure. More...

Defines

#define QP_VERSION   0x4104
 The current QP version number.
#define Q_ROM
 Macro to specify compiler-specific directive for placing a constant object in ROM.
#define Q_ROM_VAR
 Macro to specify compiler-specific directive for accessing a constant object in ROM.
#define Q_ROM_BYTE(rom_var_)   (rom_var_)
 Macro to access a byte allocated in ROM.
#define Q_SIGNAL_SIZE   1
 The size (in bytes) of the signal of an event. Valid values: 1, 2, or 4; default 1.
#define Q_DIM(array_)   (sizeof(array_) / sizeof(array_[0]))

Detailed Description

QEvent class and basic macros used by all QP components.

This header file must be included, perhaps indirectly, in all modules (*.c files) that use any component of QP/C (such as QEP, QF, or QK).

Definition in file qevent.h.


Define Documentation

#define Q_DIM ( array_   )     (sizeof(array_) / sizeof(array_[0]))

helper macro to calculate static dimension of a 1-dim array array_

Definition at line 157 of file qevent.h.

Referenced by QF_poolInit(), and QF_publish().

#define Q_ROM

Macro to specify compiler-specific directive for placing a constant object in ROM.

Many compilers for 8-bit Harvard-architecture MCUs provide non-stanard extensions to support placement of objects in different memories. In order to conserve the precious RAM, QP uses the Q_ROM macro for all constant objects that can be allocated in ROM.

To override the following empty definition, you need to define the Q_ROM macro in the qep_port.h header file. Some examples of valid Q_ROM macro definitions are: __code (IAR 8051 compiler), code (Keil Cx51 compiler), PROGMEM (gcc for AVR), __flash (IAR for AVR).

Definition at line 63 of file qevent.h.

Referenced by QEP_getVersion(), QF_getPortVersion(), QF_getVersion(), QK_getVersion(), and QS_getVersion().

#define Q_ROM_BYTE ( rom_var_   )     (rom_var_)

Macro to access a byte allocated in ROM.

Some compilers for Harvard-architecture MCUs, such as gcc for AVR, do not generate correct code for accessing data allocated in the program space (ROM). The workaround for such compilers is to explictly add assembly code to access each data element allocated in the program space. The macro Q_ROM_BYTE() retrieves a byte from the given ROM address.

The Q_ROM_BYTE() macro should be defined for the compilers that cannot handle correctly data allocated in ROM (such as the gcc). If the macro is left undefined, the default definition simply returns the argument and lets the compiler generate the correct code.

Definition at line 98 of file qevent.h.

Referenced by QActive_subscribe(), QActive_unsubscribe(), QActive_unsubscribeAll(), QF_publish(), QS_str_ROM(), and QS_str_ROM_().

#define Q_ROM_VAR

Macro to specify compiler-specific directive for accessing a constant object in ROM.

Many compilers for 8-bit MCUs provide different size pointers for accessing objects in various memories. Constant objects allocated in ROM (see Q_ROM macro) often mandate the use of specific-size pointers (e.g., far pointers) to get access to ROM objects. The macro Q_ROM_VAR specifies the kind of the pointer to be used to access the ROM objects.

To override the following empty definition, you need to define the Q_ROM_VAR macro in the qep_port.h header file. An example of valid Q_ROM_VAR macro definition is: __far (Freescale HC(S)08 compiler).

Definition at line 81 of file qevent.h.

Referenced by QEP_getVersion(), QF_getPortVersion(), QF_getVersion(), QK_getVersion(), and QS_getVersion().

#define Q_SIGNAL_SIZE   1

The size (in bytes) of the signal of an event. Valid values: 1, 2, or 4; default 1.

This macro can be defined in the QEP port file (qep_port.h) to configure the QSignal type. When the macro is not defined, the default of 1 byte is chosen.

Definition at line 111 of file qevent.h.

#define QP_VERSION   0x4104

The current QP version number.

Returns:
version of the QP as a hex constant constant 0xXYZZ, where X is a 1-digit major version number, Y is a 1-digit minor version number, and ZZ is a 2-digit release number.

Definition at line 47 of file qevent.h.

Referenced by QEP_getVersion(), QF_getVersion(), QK_getVersion(), and QS_getVersion().

Generated on Tue Mar 16 19:38:10 2010 for QP/C by  doxygen 1.6.3