RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rkhitl.h File Reference

RKH engine interface.This header file is directly included in RKH interface file, rkh.h. More...

#include "rkhdef.h"
#include "rkhcfg.h"
#include "rkhplat.h"
#include "rkhtype.h"
#include "rkhtrc.h"
#include "rkhevt.h"

Go to the source code of this file.

Data Structures

struct  RKH_SMAI_T
 Defines the data structure into which the collected performance information for state machine is stored. More...
 
struct  RKH_ROM_T
 Constant parameters of state machine. More...
 
struct  RKH_SM_T
 Describes the state machine. More...
 
struct  RKH_SMA_T
 Describes the SMA (active object in UML). More...
 
struct  RKHSmaVtbl
 Virtual table for the RKH_SMA_T structure. More...
 
struct  RKH_BASE_T
 Maintains the basic information of a state. More...
 
struct  RKH_TR_T
 Describes the state transition. More...
 
struct  RKH_ST_T
 Describes the common properties of regular states (basic, composite, and submachine). More...
 
struct  RKH_SBSC_T
 Describes a basic state. More...
 
struct  RKH_SCMP_T
 Describes a composite state. More...
 
struct  RKH_FINAL_T
 Describes a final state. More...
 
struct  RKH_EXPCN_T
 Describes the exit point connection. More...
 
struct  RKH_ENPCN_T
 Describes the entry point connection. More...
 
struct  RKH_SSBM_T
 Describes a submachine state. More...
 
struct  RKH_RSM_T
 Describes a (referenced) submachine state machine. More...
 
struct  RKH_SENP_T
 Describes the entry point pseudostate. More...
 
struct  RKH_SEXP_T
 Describes the exit point pseudostate. More...
 
struct  RKH_SCOND_T
 Describes the conditional pseudostate. More...
 
struct  RKH_SCHOICE_T
 Describes the choice pseudostate. More...
 
struct  RKH_SHIST_T
 Describes the history pseudostate. More...
 

Macros

#define RKH_VERSION_CODE   0x2406u
 This macro expands to the binary representation of the RKH version. More...
 
#define RKH_RELEASE   rkh_version
 This macro retrieves a pointer to string describing the RKH version. For example, "2.2.04".
 
#define RKH_VERSION(a, b, c)
 This is the macro used to build an integer version code from the individual numbers that build up a version number. More...
 
#define RKH_ANY   ((RKH_SIG_T)(-1))
 This macro is used to indicate the end of a transition table.
 
#define RKH_COMPLETION_EVENT   (RKH_ANY - 1)
 This macro is used to indicate the completion event. More...
 
#define RKH_LOWEST_PRIO   (RKH_CFG_FWK_MAX_SMA - 1)
 RKH allows up to RKH_CFG_FWK_MAX_SMA different priority levels (see rkhcfg.h). More...
 
#define RKH_SMA_ACCESS_STATE(me_)   ((RKH_SM_T *)me_)->state
 Macro for accessing to state member of state machine structure. More...
 
#define RKH_SMA_ACCESS_CONST(me_, member_)   ((RKH_SM_T *)me_)->romrkh->member_
 Macro for accessing to members of state machine structure. More...
 
#define RKH_DCLR_PTR_TYPE(type_, me_)   extern type_ * const me_
 This macro declares a typed and external pointer to previously defined object. More...
 
#define RKH_TICK_RATE_MS   ((RKH_TNT_T)(1000 / RKH_CFG_FWK_TICK_RATE_HZ))
 
#define RKH_CFGPORT_SMA_THREAD_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_THREAD_EN is set to 1, each SMA (active object) has its own thread of execution. More...
 
#define RKH_CFGPORT_SMA_THREAD_DATA_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_THREAD_EN and RKH_CFGPORT_SMA_THREAD_DATA_EN are set to 1, each SMA (active object) has its own thread of execution and its own object data. More...
 
#define RKH_CFGPORT_NATIVE_SCHEDULER_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_SCHEDULER_EN is set to 1 then RKH will include the simple, cooperative, and nonpreemptive scheduler RKHS. When RKH_CFGPORT_NATIVE_SCHEDULER_EN is enabled RKH also will automatically define RKH_EQ_TYPE, RKH_SMA_BLOCK(), RKH_SMA_READY(), RKH_SMA_UNREADY(), and assume the native priority scheme. More...
 
#define RKH_CFGPORT_NATIVE_EQUEUE_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_EQUEUE_EN is set to 1 and the native event queue is enabled (see RKH_CFG_RQ_EN) then RKH will include its own implementation of rkh_sma_post_fifo(), rkh_sma_post_lifo(), and rkh_sma_get() functions. More...
 
#define RKH_CFGPORT_NATIVE_DYN_EVT_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_DYN_EVT_EN is set to 1 and the native fixed-size memory block facility is enabled (see RKH_CFG_MP_EN) then RKH will include its own implementation of dynamic memory management. When RKH_CFGPORT_NATIVE_DYN_EVT_EN is enabled RKH also will automatically define RKH_DYNE_TYPE, RKH_DYNE_INIT(), RKH_DYNE_GET_ESIZE(), RKH_DYNE_GET(), and RKH_DYNE_PUT(). More...
 
#define RKH_CFGPORT_REENTRANT_EN   RKH_ENABLED
 If the RKH_CFGPORT_REENTRANT_EN is set to 1, the RKH event dispatch allows to be invoked from several threads of executions. Enable this only if the application is based on a multi-thread architecture. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_PTR   32u
 Specify the size of void pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TRC_SYM() macro. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_FUN_PTR   32u
 Specify the size of function pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TUSR_FUN() and RKH_TRC_FUN() macros. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_TSTAMP   32u
 Specify the number of bytes (size) used by the trace record timestamp. The valid values [in bits] are 8, 16 or 32. Default is 16. More...
 
#define RKH_CFGPORT_SMA_QSTO_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_QSTO_EN is set to 1 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the external event queue storage argument, qs. More...
 
#define RKH_CFGPORT_SMA_STK_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_STK_EN is set to 0 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the thread's stack related arguments, stks and stksize. More...
 
#define RKH_EQ_TYPE
 Defines the data type of the event queue for active objects. The event queue can be implemented with a message queue of the RTOS/OS. But it is also possible to use the native RKH queue RKH_RQ_T type if the underlying RTOS/OS does not provide an adequate queue. More...
 
#define RKH_THREAD_TYPE
 Frequently, the active object has its own task processing loop that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued. The RKH_SMA_POST_FIFO() macro enqueues an event and signals the OS that an event has arrived. In this case, os_signal holds the OS object used to signal that an event has been queued. The data type RKH_THREAD_TYPE holds the thread handle associated with the active object. More...
 
#define RKH_OSSIGNAL_TYPE
 The os_signal member of RKH_SMA_T is necessary when the underlying OS does not provide an adequate queue facility, so the native RKH queue RKH_RQ_T must be used. In this case the RKH_OSSIGNAL_TYPE indicates an operating system specific primitive to efficiently block the native RKH event queue when the queue is empty. Frequently, the active object has its own task processing loop that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued. The RKH_SMA_POST_FIFO() macro enqueues an event and signals the OS that an event has arrived. In this case, os_signal holds the OS object used to signal that an event has been queued. More...
 
#define RKH_DIS_INTERRUPT()
 RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done. This allows RKH to protect critical code from being entered simultaneously. To hide the implementation method chosen by the processor, compiler, etc, RKH defines two macros to unconditionally disable and enable interrupts: RKH_DIS_INTERRUPT() and RKH_ENA_INTERRUPT() respectively. Obviously, they resides in rkhport.h file, which the user always need to provide. More...
 
#define RKH_CPUSR_TYPE
 RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done. More...
 
#define RKH_SMA_BLOCK(sma)
 Encapsulates the mechanism of blocking the event queue. More...
 
#define RKH_SMA_READY(rg, sma)
 Encapsulates the mechanism of signaling the thread waiting on the used event queue. Thus, the SMA is inserted in the ready list as ready-to-dispatch. More...
 
#define RKH_SMA_UNREADY(rg, sma)
 Informs the underlying kernel that the SMA event queue is becoming empty. Thus, the SMA is removed from the ready list. More...
 
#define RKH_DYNE_TYPE
 Defines the data type of the fixed-size memory block for dynamic event support. More...
 
#define RKH_DYNE_INIT(mp, sstart, ssize, esize)
 Encapsulates the creation of a event pool. More...
 
#define RKH_DYNE_GET_ESIZE(mp)
 Encapsulates how RKH should obtain the block size of pool. More...
 
#define RKH_DYNE_GET(mp, e)
 Encapsulates how RKH should obtain an event e from the event pool mp. More...
 
#define RKH_DYNE_PUT(mp, e)
 Encapsulates how RKH should return an event e to the event pool mp. More...
 
#define RKH_TIME_MS(ms_)   ((ms_) / RKH_TICK_RATE_MS)
 It can be used to convert ticks to time. More...
 
#define RKH_TIME_SEC(s_)   ((s_) * 1000u / RKH_TICK_RATE_MS)
 It can be used to convert ticks to time. More...
 
#define RKH_TIME_MIN(m_)   ((m_) * 60 * 1000u / RKH_TICK_RATE_MS)
 It can be used to convert ticks to time. More...
 

Typedefs

typedef void(* RKH_INIT_ACT_T )(const RKH_SM_T *me, const struct RKH_EVT_T *e)
 Initialization action. More...
 
typedef void(* RKHActivate )(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_RQNE_T qSize, void *stkSto, rui32_t stkSize)
 
typedef void(* RKHTask )(RKH_SMA_T *me, void *arg)
 
typedef void(* RKHPostFifo )(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
 
typedef void(* RKHPostLifo )(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
 
typedef void(* RKH_ENT_ACT_T )(const RKH_SM_T *me)
 Entry action. More...
 
typedef void(* RKH_EXT_ACT_T )(const RKH_SM_T *me)
 Exit action. More...
 
typedef RKH_SIG_T(* RKH_PPRO_T )(const RKH_SM_T *sma, RKH_EVT_T *pe)
 Event preprocessor. More...
 
typedef void(* RKH_TRN_ACT_T )(const RKH_SM_T *me, RKH_EVT_T *pe)
 Transition action. More...
 
typedef rbool_t(* RKH_GUARD_T )(const RKH_SM_T *me, RKH_EVT_T *pe)
 Guard. More...
 

Variables

const RKHSmaVtbl rkhSmaVtbl
 

Detailed Description

RKH engine interface.This header file is directly included in RKH interface file, rkh.h.

Definition in file rkhitl.h.

Macro Definition Documentation

#define RKH_VERSION_CODE   0x2406u

This macro expands to the binary representation of the RKH version.

Defines standard constants and macros. Application specific configuration options. Specific definitions to the platform being used. Trace facility. Event data type and related macros. The version number is composed as 0xABCC, where: the number A (1-digit) denoted the major revision, the number B (1-digit) denoted the minor revision, and the number C (2-digit) indicated the release number. For example, the code for 2.2.04 is 0x2204.

Release Date: 12/14/2016

Definition at line 102 of file rkhitl.h.

#define RKH_VERSION (   a,
  b,
 
)
Value:
(((((a) << 12) & 0xF000) | \
(((b) << 8) & 0x0F00) | \
(((c) & 0xFF) & 0x00FF)) & 0xFFFF)

This is the macro used to build an integer version code from the individual numbers that build up a version number.

For example, RKH_VERSION(2,2,04) expands to 0x2204. This macro is very useful when needs to compare the current version (RKH_VERSION_CODE) and a known checkpoint version at compile-time.

Parameters
[in]amajor revision
[in]bminor revision
[in]crelease number
Usage
#if RKH_VERSION_CODE <= RKH_VERSION(1, 2, 03)
...
#else
...
#endif

Definition at line 133 of file rkhitl.h.

#define RKH_COMPLETION_EVENT   (RKH_ANY - 1)

This macro is used to indicate the completion event.

A special kind of transition is a completion transition, which has an implicit trigger. The event that enables this trigger is called a completion event and it signifies that all behaviors associated with the source state of the completion transition have completed execution.

Definition at line 153 of file rkhitl.h.

#define RKH_LOWEST_PRIO   (RKH_CFG_FWK_MAX_SMA - 1)

RKH allows up to RKH_CFG_FWK_MAX_SMA different priority levels (see rkhcfg.h).

In RKH, a low-priority number corresponds to a high-priority level. Priority level zero (0) is thus the highest priority level. Priority RKH_LOWEST_PRIO (RKH_CFG_FWK_MAX_SMA - 1) is the lowest priority level.

Definition at line 164 of file rkhitl.h.

#define RKH_SMA_ACCESS_STATE (   me_)    ((RKH_SM_T *)me_)->state

Macro for accessing to state member of state machine structure.

Parameters
[in]me_Pointer to object of state machine.

Definition at line 213 of file rkhitl.h.

#define RKH_SMA_ACCESS_CONST (   me_,
  member_ 
)    ((RKH_SM_T *)me_)->romrkh->member_

Macro for accessing to members of state machine structure.

Parameters
[in]me_Pointer to object of state machine.
[in]member_Member of state machine structure.

Definition at line 224 of file rkhitl.h.

#define RKH_DCLR_PTR_TYPE (   type_,
  me_ 
)    extern type_ * const me_

This macro declares a typed and external pointer to previously defined object.

Parameters
[in]type_Data type of the defined object.
[in]me_Pointer to previously defined object.
See also
RKH_SMA_DCLR_TYPE(), RKH_SM_DCLR_TYPE().

Definition at line 249 of file rkhitl.h.

#define RKH_TICK_RATE_MS   ((RKH_TNT_T)(1000 / RKH_CFG_FWK_TICK_RATE_HZ))

It can be used to convert ticks to milliseconds. This format is more convenient and natural than ticks. This configuration constant is not used by RKH, it is just a value to allow an application to deal with time when using timer services. You can use the global constant RKH_CFG_FWK_TICK_RATE_HZ (see rkhcfg.h) to convert time to ticks using the macros like RKH_TIME_MS(), RKH_TIME_SEC(), and RKH_TIME_MIN().

Definition at line 1633 of file rkhitl.h.

#define RKH_TIME_MS (   ms_)    ((ms_) / RKH_TICK_RATE_MS)

It can be used to convert ticks to time.

This format is more convenient and natural than ticks. You can use the global constant RKH_CFG_FWK_TICK_RATE_HZ (see rkhcfg.h) to convert time to ticks using the macros like RKH_TIME_MS(), RKH_TIME_SEC(), and RKH_TIME_MIN().

Definition at line 1645 of file rkhitl.h.

#define RKH_TIME_SEC (   s_)    ((s_) * 1000u / RKH_TICK_RATE_MS)

It can be used to convert ticks to time.

This format is more convenient and natural than ticks. You can use the global constant RKH_CFG_FWK_TICK_RATE_HZ (see rkhcfg.h) to convert time to ticks using the macros like RKH_TIME_MS(), RKH_TIME_SEC(), and RKH_TIME_MIN().

Definition at line 1646 of file rkhitl.h.

#define RKH_TIME_MIN (   m_)    ((m_) * 60 * 1000u / RKH_TICK_RATE_MS)

It can be used to convert ticks to time.

This format is more convenient and natural than ticks. You can use the global constant RKH_CFG_FWK_TICK_RATE_HZ (see rkhcfg.h) to convert time to ticks using the macros like RKH_TIME_MS(), RKH_TIME_SEC(), and RKH_TIME_MIN().

Definition at line 1647 of file rkhitl.h.

#define RKH_EQ_TYPE

Defines the data type of the event queue for active objects. The event queue can be implemented with a message queue of the RTOS/OS. But it is also possible to use the native RKH queue RKH_RQ_T type if the underlying RTOS/OS does not provide an adequate queue.

Example for using the native queue

// RKH's native queue
#define RKH_EQ_TYPE RKH_RQ_T
// Message queue of ucos/II
#define RKH_EQ_TYPE OS_EVENT
// Message queue of FreeRTOS
#define RKH_EQ_TYPE xQueueHandle

Definition at line 2212 of file rkhitl.h.

#define RKH_THREAD_TYPE

Frequently, the active object has its own task processing loop that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued. The RKH_SMA_POST_FIFO() macro enqueues an event and signals the OS that an event has arrived. In this case, os_signal holds the OS object used to signal that an event has been queued. The data type RKH_THREAD_TYPE holds the thread handle associated with the active object.

Example for using the uCOS/II, FreeRTOS, Linux (Posix) and Win32

// For uCOS/II
#define RKH_THREAD_TYPE INT8U
// For FreeRTOS
#define RKH_THREAD_TYPE xTaskHandle
// For Linux (Posix)
#define RKH_THREAD_TYPE pthread_t
// For Win32
#define RKH_THREAD_TYPE void*

Definition at line 2238 of file rkhitl.h.

#define RKH_OSSIGNAL_TYPE

The os_signal member of RKH_SMA_T is necessary when the underlying OS does not provide an adequate queue facility, so the native RKH queue RKH_RQ_T must be used. In this case the RKH_OSSIGNAL_TYPE indicates an operating system specific primitive to efficiently block the native RKH event queue when the queue is empty. Frequently, the active object has its own task processing loop that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued. The RKH_SMA_POST_FIFO() macro enqueues an event and signals the OS that an event has arrived. In this case, os_signal holds the OS object used to signal that an event has been queued.

Example for using the Linux (Posix) and Win32

// For Linux (Posix)
#define RKH_OSSIGNAL_TYPE pthread_cond_t
// For Win32
#define RKH_OSSIGNAL_TYPE void*

Definition at line 2262 of file rkhitl.h.

#define RKH_SMA_BLOCK (   sma)

Encapsulates the mechanism of blocking the event queue.

Parameters
[in]smapointer to SMA.

Definition at line 2338 of file rkhitl.h.

#define RKH_SMA_READY (   rg,
  sma 
)

Encapsulates the mechanism of signaling the thread waiting on the used event queue. Thus, the SMA is inserted in the ready list as ready-to-dispatch.

Parameters
[in]rgready group.
[in]smapointer to SMA.

Definition at line 2349 of file rkhitl.h.

#define RKH_SMA_UNREADY (   rg,
  sma 
)

Informs the underlying kernel that the SMA event queue is becoming empty. Thus, the SMA is removed from the ready list.

Parameters
[in]rgready group.
[in]smapointer to SMA.

Definition at line 2359 of file rkhitl.h.

#define RKH_DYNE_TYPE

Defines the data type of the fixed-size memory block for dynamic event support.

The fixed-size memory block can be implemented with a RTOS/OS service provided to that. But it's also possible to use the native RKH fixed-size memory block RKH_MP_T type if the underlying RTOS/OS does not provide an adequate support.

Definition at line 2371 of file rkhitl.h.

#define RKH_DYNE_INIT (   mp,
  sstart,
  ssize,
  esize 
)

Encapsulates the creation of a event pool.

Platform-dependent macro. Typically, must be define it in the specific port file (rkhport.h).

Parameters
[in]mppointer to previously allocated memory pool structure.
[in]sstartstorage start. Pointer to memory from which memory blocks are allocated.
[in]ssizestorage size. Size of the memory pool storage in bytes.
[in]esizeevent size. This number determines the size of each memory block in the pool.

Definition at line 2389 of file rkhitl.h.

#define RKH_DYNE_GET_ESIZE (   mp)

Encapsulates how RKH should obtain the block size of pool.

Platform-dependent macro. Typically, must be define it in the specific port file (rkhport.h).

Parameters
[in]mppointer to previously allocated memory pool structure.

Definition at line 2401 of file rkhitl.h.

#define RKH_DYNE_GET (   mp,
 
)

Encapsulates how RKH should obtain an event e from the event pool mp.

Platform-dependent macro. Typically, must be define it in the specific port file (rkhport.h).

Parameters
[in]mppointer to previously allocated memory pool structure.
[in]epointer to a new event or NULL if the pool runs out of blocks.

Definition at line 2416 of file rkhitl.h.

#define RKH_DYNE_PUT (   mp,
 
)

Encapsulates how RKH should return an event e to the event pool mp.

Platform-dependent macro. Typically, must be define it in the specific port file (rkhport.h).

Parameters
[in]mppointer to previously allocated memory pool structure.
[in]epointer to the returned event.

Definition at line 2430 of file rkhitl.h.

Typedef Documentation

typedef void(* RKH_INIT_ACT_T)(const RKH_SM_T *me, const struct RKH_EVT_T *e)

Initialization action.

Frequently, the state transition originating at the black ball is called the initial transition. Such transition designates the first active state after the state machine object is created. An initial transition can have associated actions, which in the UML notation are enlisted after the forward slash (/). In RKH framework, the application code must trigger the initial transition explicitly by invoking rkh_sma_activate() function.

Definition at line 2692 of file rkhitl.h.

typedef void(* RKHActivate)(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_RQNE_T qSize, void *stkSto, rui32_t stkSize)

Virtual function to activate the active object (thread)

See also
RKH_SMA_ACTIVATE()

Definition at line 3015 of file rkhitl.h.

typedef void(* RKHTask)(RKH_SMA_T *me, void *arg)

Frequently, the active object has its own task processing loop, also as known as thread of control, that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued.

Definition at line 3020 of file rkhitl.h.

typedef void(* RKHPostFifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)

Virtual function to asynchronously post (FIFO) an event to an AO

See also
RKH_SMA_POST_FIFO()

Definition at line 3024 of file rkhitl.h.

typedef void(* RKHPostLifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)

Virtual function to asynchronously post (LIFO) an event to an AO

See also
RKH_SMA_POST_LIFO()

Definition at line 3032 of file rkhitl.h.

typedef void(* RKH_ENT_ACT_T)(const RKH_SM_T *me)

Entry action.

The actions that are always executed when a state is entered should be specified as entry actions. UML statecharts provide optional entry and exit actions, which are associated with states rather than transitions, as in a Moore automaton. An entry function takes the state machine pointer as argument. This argument is optional, thus it could be eliminated in compile-time by means of RKH_CFG_SMA_ENT_ARG_SMA_EN.

The RKH implementation preserves the transition sequence imposed by Harel's Statechart and UML. Specifically, the implemented transition sequence is as follows:

  • Execute exit actions of the source state.
  • Execute the transition actions.
  • Execute entry actions of the target state.
Note
This callback is referenced from RKH_CREATE_COMP_STATE() and RKH_CREATE_BASIC_STATE() macros. RKH_CFG_SMA_ENT_ARG_SMA_EN macro.

Definition at line 3099 of file rkhitl.h.

typedef void(* RKH_EXT_ACT_T)(const RKH_SM_T *me)

Exit action.

The actions that are always execute when a state is exited should be exit actions. UML statecharts provide optional entry and exit actions, which are associated with states rather than transitions, as in a Moore automaton. An exit function takes the state machine pointer as argument. This argument is optional, thus it could be eliminated in compile-time by means of RKH_CFG_SMA_EXT_ARG_SMA_EN.

The RKH implementation preserves the transition sequence imposed by Harel's Statechart and UML. Specifically, the implemented transition sequence is as follows:

  • Execute exit actions of the source state.
  • Execute the transition actions.
  • Execute entry actions of the target state.
Note
This callback is referenced from RKH_CREATE_COMP_STATE() and RKH_CREATE_BASIC_STATE() macros.

Definition at line 3139 of file rkhitl.h.

typedef RKH_SIG_T(* RKH_PPRO_T)(const RKH_SM_T *sma, RKH_EVT_T *pe)

Event preprocessor.

Before sending the arrived event to state machine, it can be previously processed using the event preprocessor function. The RKH framework provides optional event preprocessor action, which are associated with states rather than transitions, as in a Moore automaton. This action takes the state machine pointer and the event pointer as arguments. This argument is optional, thus it could be eliminated in compile-time by means of RKH_CFG_SMA_PPRO_ARG_SMA_EN.

Note
This callback is referenced from RKH_CREATE_COMP_STATE() and RKH_CREATE_BASIC_STATE() macros.

Definition at line 3168 of file rkhitl.h.

typedef void(* RKH_TRN_ACT_T)(const RKH_SM_T *me, RKH_EVT_T *pe)

Transition action.

Transition actions are small atomic behaviors executed at specified points in a state machine. This actions are assumed to take an insignificant amount of time to execute and are noninterruptible. UML statecharts are extended state machines with characteristics of both Mealy and Moore automata. In statecharts, actions generally depend on both the state of the system and the triggering event, as in a Mealy automaton. Additionally, UML statecharts provide optional entry and exit actions, which are associated with states rather than transitions, as in a Moore automaton. An action function takes the state machine pointer and the event pointer as arguments. These arguments are optional, thus they could be eliminated in compile-time by means of RKH_CFG_SMA_ACT_ARG_EVT_EN and RKH_CFG_SMA_ACT_ARG_SMA_EN.

The RKH implementation preserves the transition sequence imposed by Harel's Statechart and UML. Specifically, the implemented transition sequence is as follows:

  • Execute exit actions of the source state.
  • Execute the transition actions.
  • Execute entry actions of the target state.
Note
This callback is referenced from RKH_TRREG() and RKH_TRINT()macro.

Definition at line 3207 of file rkhitl.h.

typedef rbool_t(* RKH_GUARD_T)(const RKH_SM_T *me, RKH_EVT_T *pe)

Guard.

A guard is a boolean condition that returns a true (RKH_GTRUE) or false (RKH_GFALSE) value that controls whether or not a transition is taken following the receipt of a triggering event. A transition with a guard is only take if the triggering event occurs and the guard evaluates to true. As long as the guard evaluated to false, the triggering event would be discarded and the transition would not be taken. Each condition connector can have one special branch with a guard labeled rkh_else, which is taken if all the guards on the other branches are false. A guard function takes the state machine pointer and the event pointer as arguments. These arguments are optional, thus they could be eliminated in compile-time by means of RKH_CFG_SMA_GRD_ARG_EVT_EN and RKH_CFG_SMA_GRD_ARG_SMA_EN.

Note
This callback is referenced from RKH_BRANCH() macro.

Definition at line 3246 of file rkhitl.h.

Variable Documentation

const RKHSmaVtbl rkhSmaVtbl

Default virtual table for the RKH_SMA_T structure