QP/C  6.9.3
Real-Time Embedded Framework
QXThread Struct Reference

#include <qxthread.h>

Inheritance diagram for QXThread:
Inheritance graph
Collaboration diagram for QXThread:
Collaboration graph

Data Fields

QActive super
 
QTimeEvt timeEvt
 
- Data Fields inherited from QActive
QHsm super
 
uint8_t prio
 
- Data Fields inherited from QHsm
struct QHsmVtable const * vptr
 
union QHsmAttr state
 
union QHsmAttr temp
 

Additional Inherited Members

- Public Member Functions inherited from QActive
#define QACTIVE_START(me_, prio_, qSto_, qLen_, stkSto_, stkLen_, par_)
 
#define QACTIVE_POST(me_, e_, sender_)
 
#define QACTIVE_POST_X(me_, e_, margin_, sender_)
 
#define QACTIVE_POST_LIFO(me_, e_)
 
- Public Member Functions inherited from QHsm
#define QHSM_INIT(me_, par_, qs_id_)
 
#define QHSM_DISPATCH(me_, e_, qs_id_)    ((*(me_)->vptr->dispatch)((me_), (e_), (qs_id_)))
 
#define QHsm_state(me_)   (Q_STATE_CAST(Q_HSM_UPCAST(me_)->state.fun))
 
#define QHsm_childState(me_, parent_)    QHsm_childState_(Q_HSM_UPCAST(me_), Q_STATE_CAST(parent_))
 
bool QHsm_isIn (QHsm *const me, QStateHandler const state)
 
- Protected Member Functions inherited from QActive
void QActive_ctor (QActive *const me, QStateHandler initial)
 
void QActive_stop (QActive *const me)
 
void QActive_subscribe (QActive const *const me, enum_t const sig)
 
void QActive_unsubscribe (QActive const *const me, enum_t const sig)
 
void QActive_unsubscribeAll (QActive const *const me)
 
bool QActive_defer (QActive const *const me, QEQueue *const eq, QEvt const *const e)
 
bool QActive_recall (QActive *const me, QEQueue *const eq)
 
uint_fast16_t QActive_flushDeferred (QActive const *const me, QEQueue *const eq)
 
void QActive_setAttr (QActive *const me, uint32_t attr1, void const *attr2)
 
- Protected Member Functions inherited from QHsm
void QHsm_ctor (QHsm *const me, QStateHandler initial)
 
QState QHsm_top (void const *const me, QEvt const *const e)
 

Detailed Description

eXtended (blocking) thread of the QXK preemptive kernel

Description
QXThread represents the eXtended (blocking) thread of the QXK preemptive kernel. Each extended thread in the application must be represented by the corresponding QXThread instance
Note
Typically, QXThread is instantiated directly in the application code. The customization of the thread occurs in the QXThread_ctor(), where you provide the thred-handler function as the parameter.
See also
Usage
The following example illustrates how to instantiate and use an extended thread in your application.
#include "qpc.h"
QXThread blinky; /* QXK extended-thread object */
uint32_t stack_blinky[80]; /* stack for the thread */
void main_blinky(QXThread * const me) { /* thread function */
while (1) {
uint32_t volatile i;
for (i = 1500U; i != 0U; --i) {
BSP_ledGreenOn();
BSP_ledGreenOff();
}
QXThread_delay(1U); /* block for 1 tick */
}
}
int main() {
. . .
/* initialize and start blinky thread */
QXThread_ctor(&blinky, &main_blinky, 0);
QXTHREAD_START(&blinky,
5U, /* priority */
(void *)0, 0, /* message queue (not used) */
stack_blinky, sizeof(stack_blinky), /* stack */
(void *)0); /* extra parameter (not used) */
. . .
return QF_run(); /* run the application */
}
unsigned long int uint32_t
Definition: 16bit/stdint.h:31
#define Q_DEFINE_THIS_FILE
Definition: qassert.h:104
int_t QF_run(void)
Definition: qk.c:133
QP/C public interface including backwards-compatibility layer.
bool QXThread_delay(uint_fast16_t const nTicks)
Definition: qxk_xthr.c:648
#define QXTHREAD_START(me_, prio_, qSto_, qLen_, stkSto_, stkSize_, par_)
Definition: qxthread.h:103
void QXThread_ctor(QXThread *const me, QXThreadHandler handler, uint_fast8_t tickRate)
Definition: qxk_xthr.c:113

Definition at line 73 of file qxthread.h.

Field Documentation

◆ super

QActive super

inherited QActive

Definition at line 74 of file qxthread.h.

◆ timeEvt

QTimeEvt timeEvt

time event to handle blocking timeouts

Definition at line 75 of file qxthread.h.


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