QP/C  7.2.2
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qf_port.h File Reference

QF/C sample port with all configurable options. More...

#include "qk_port.h"
#include "qf.h"

Go to the source code of this file.

Macros

#define QF_THREAD_TYPE   void*
 
#define QF_EQUEUE_TYPE   QEQueue
 
#define QF_OS_OBJECT_TYPE   pthread_cond_t
 
#define QF_EPOOL_TYPE_   QMPool
 
#define QF_MAX_ACTIVE   64U
 
#define QF_MAX_TICK_RATE   1U
 
#define QF_TIMEEVT_CTR_SIZE   4U
 
#define QF_MAX_EPOOL   3U
 
#define QF_EVENT_SIZ_SIZE   2U
 
#define QF_EQUEUE_CTR_SIZE   1U
 
#define QF_MPOOL_SIZ_SIZE   2U
 
#define QF_MPOOL_CTR_SIZE   2U
 
#define QF_INT_DISABLE()   intDisable()
 
#define QF_INT_ENABLE()   intEnable()
 
#define QF_CRIT_STAT_TYPE   crit_stat_t
 
#define QF_CRIT_ENTRY(stat_)   ((stat_) = critEntry())
 
#define QF_CRIT_EXIT(stat_)   critExit(stat_)
 
#define QF_CRIT_EXIT_NOP()   __asm volatile ("isb")
 

Detailed Description

Date
Last updated on: 2022-11-23
Version
Last updated for: Version 7.2.0, 2023-01-06

Definition in file qf_port.h.

Macro Definition Documentation

◆ QF_THREAD_TYPE

#define QF_THREAD_TYPE   void*

This macro defines the type of the thread handle used for AOs

Definition at line 36 of file qf_port.h.

◆ QF_EQUEUE_TYPE

#define QF_EQUEUE_TYPE   QEQueue

This macro defines the type of the event-queue used for AOs

Definition at line 39 of file qf_port.h.

◆ QF_OS_OBJECT_TYPE

#define QF_OS_OBJECT_TYPE   pthread_cond_t

This macro defines the type of the OS-Object used for blocking the native QEQueue when the queue is empty

Description
This macro is used when QEQueue is used as the event-queue for AOs but also the AO queue must block when the queue is empty. In that case, QF_OS_OBJECT_TYPE specifies the blocking mechanism. For example, in the POSIX port, the blocking mechanism is a condition variable.

Definition at line 51 of file qf_port.h.

◆ QF_EPOOL_TYPE_

#define QF_EPOOL_TYPE_   QMPool

This macro defines the type of the event pool used in the port.

Description
This is a specific implementation for the QK-port of QF. In other QF ports you need to define the macro appropriately for the underlying kernel/OS you're using.

Definition at line 60 of file qf_port.h.

◆ QF_MAX_ACTIVE

#define QF_MAX_ACTIVE   64U

The maximum number of active objects in the application.

Description
This macro must be defined in the qf_port.h header file and should be in range of 1U..64U, inclusive. The value of this macro determines the maximum priority level of an active object in the system. Not all priority levels must be used, but the maximum priority cannot exceed QF_MAX_ACTIVE. Defining the value below the maximum limit of 64 saves some memory (RAM).

Definition at line 71 of file qf_port.h.

◆ QF_MAX_TICK_RATE

#define QF_MAX_TICK_RATE   1U

The maximum number of clock tick rates in the application.

Description
This macro can be defined in the qf_port.h header file and should be in range of 1U..15U, inclusive. The value of this macro determines the maximum number of clock tick rates for time events (QTimeEvt).

If the macro is not defined, the qf.h header file sets the default value to 1U.

Definition at line 83 of file qf_port.h.

◆ QF_TIMEEVT_CTR_SIZE

#define QF_TIMEEVT_CTR_SIZE   4U

The size (in bytes) of the time event-counter representation in the QTimeEvt struct. Valid values: 1U, 2U, or 4U; default 2U.

Description
This macro can be defined in the qf_port.h header file to configure the internal tick counters of Time Events. If the macro is not defined, the default of 4 bytes will be chosen in qf.h. The valid QF_TIMEEVT_CTR_SIZE values of 1, 2, or 4, correspond to tick counters of uint8_t, uint16_t, and uint32_t, respectively. The tick counter representation determines the dynamic range of time delays that a Time Event can handle.
See also
QTimeEvt

Definition at line 97 of file qf_port.h.

◆ QF_MAX_EPOOL

#define QF_MAX_EPOOL   3U

The maximum number of event pools in the application.

Description
This macro can be defined in the qf_port.h header file and should be in range of 1U..255U, inclusive. The value of this macro determines the maximum number of event pools in the system. Not all event pools must be actually used, but the maximum number of pools cannot exceed QF_MAX_EPOOL.

If the macro is not defined, the qf.h header file sets the default value to 3U. Defining QF_MAX_EPOOL below the maximum limit of 255 saves some memory (RAM).

Definition at line 111 of file qf_port.h.

◆ QF_EVENT_SIZ_SIZE

#define QF_EVENT_SIZ_SIZE   2U

The size (in bytes) of the event-size representation in the QF. Valid values: 1U, 2U, or 4U; default 2U

Description
This macro can be defined in the QF ports to configure the size of the event-size.

Definition at line 120 of file qf_port.h.

◆ QF_EQUEUE_CTR_SIZE

#define QF_EQUEUE_CTR_SIZE   1U

The size (in bytes) of the ring-buffer counters used in the native QF event queue implementation. Valid values: 1U, 2U, or 4U; default 1U

Description
This macro can be defined in the qf_port.h header file to configure the QEQueueCtr type. If the macro is not defined, the default of 1 byte will be chosen in qequeue.h. The valid QF_EQUEUE_CTR_SIZE values of 1U, 2U, or 4U, correspond to QEQueueCtr of uint8_t, uint16_t, and uint32_t, respectively. The::QEQueueCtr data type determines the dynamic range of numerical values of ring-buffer counters inside event queues, or, in other words, the maximum number of events that the native QF event queue can manage.
See also
QEQueue

Definition at line 136 of file qf_port.h.

◆ QF_MPOOL_SIZ_SIZE

#define QF_MPOOL_SIZ_SIZE   2U

The size (in bytes) of the block-size representation in the native QF event pool. Valid values: 1U, 2U, or 4U; default QF_EVENT_SIZ_SIZE.

Description
This macro can be defined in the qf_port.h header file to configure the QMPoolSize type. If the macro is not defined, the default of QF_EVENT_SIZ_SIZE will be chosen in qmpool.h, because the memory pool is primarily used for implementing event pools.

The valid QF_MPOOL_SIZ_SIZE values of 1U, 2U, or 4U, correspond to QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively. The QMPoolSize data type determines the dynamic range of block-sizes that the native QMPool can handle.

See also
QF_EVENT_SIZ_SIZE, QMPool

Definition at line 153 of file qf_port.h.

◆ QF_MPOOL_CTR_SIZE

#define QF_MPOOL_CTR_SIZE   2U

The size (in bytes) of the block-counter representation in the native QF event pool. Valid values: 1U, 2U, or 4U; default 2U.

Description
This macro can be defined in the qf_port.h header file to configure the QMPoolCtr type. If the macro is not defined, the default of 2 bytes will be chosen in qmpool.h. The valid QF_MPOOL_CTR_SIZE values of 1U, 2U, or 4U, correspond to QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively. The QMPoolCtr data type determines the dynamic range of block-counters that the native QMPool can handle, or, in other words, the maximum number of blocks that the native QF event pool can manage.
See also
QMPool

Definition at line 168 of file qf_port.h.

◆ QF_INT_DISABLE

#define QF_INT_DISABLE ( )    intDisable()

Define the interrupt disabling policy.

Description
This macro encapsulates platform-specific way of disabling interrupts from "C" for a given CPU and compiler.
Note
the QF_INT_DISABLE macro should always be used in pair with the macro QF_INT_ENABLE.

Definition at line 180 of file qf_port.h.

◆ QF_INT_ENABLE

#define QF_INT_ENABLE ( )    intEnable()

Define the interrupt enabling policy.

Description
This macro encapsulates platform-specific way of enabling interrupts from "C" for a given CPU and compiler.
Note
the QF_INT_DISABLE macro should always be used in pair with the macro QF_INT_ENABLE.

Definition at line 191 of file qf_port.h.

◆ QF_CRIT_STAT_TYPE

#define QF_CRIT_STAT_TYPE   crit_stat_t

Define the type of the critical section status.

Description
Defining this macro configures the "saving and restoring critical section status" policy. Conversely, if this macro is not defined, the simple "unconditional critical section exit" is used.

Definition at line 200 of file qf_port.h.

◆ QF_CRIT_ENTRY

#define QF_CRIT_ENTRY (   stat_)    ((stat_) = critEntry())

Define the critical section entry policy.

Description
This macro enters a critical section (often by means of disabling interrupts). When the "saving and restoring critical section status" policy is used, the macro sets the status_ argument to the critical section status just before the entry. When the policy of "unconditional critical section exit" is used, the macro does not use the status_ argument.
Note
the QF_CRIT_ENTRY macro should always be used in pair with the macro QF_CRIT_EXIT.

Definition at line 215 of file qf_port.h.

◆ QF_CRIT_EXIT

#define QF_CRIT_EXIT (   stat_)    critExit(stat_)

Define the critical section exit policy.

Description
This macro enters a critical section (often by means of disabling interrupts). When the "saving and restoring critical section status" policy is used, the macro restores the critical section status from the status_ argument. When the policy of "unconditional critical section exit" is used, the macro does not use the status argument and exits the critical section unconditionally (often by means of enabling interrupts).
Note
the QF_CRIT_ENTRY macro should always be used in pair with the macro QF_CRIT_EXIT.

Definition at line 231 of file qf_port.h.

◆ QF_CRIT_EXIT_NOP

#define QF_CRIT_EXIT_NOP ( )    __asm volatile ("isb")

Define No-Operation (NOP) implementation to prevent joining adjacent critical sections.

Definition at line 236 of file qf_port.h.