QP/C  7.2.2
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qep.h
Go to the documentation of this file.
1/*$file${include::qep.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
2/*
3* Model: qpc.qm
4* File: ${include::qep.h}
5*
6* This code has been generated by QM 5.2.5 <www.state-machine.com/qm>.
7* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8*
9* This code is covered by the following QP license:
10* License # : LicenseRef-QL-dual
11* Issued to : Any user of the QP/C real-time embedded framework
12* Framework(s) : qpc
13* Support ends : 2023-12-31
14* License scope:
15*
16* Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17*
18* SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
19*
20* This software is dual-licensed under the terms of the open source GNU
21* General Public License version 3 (or any later version), or alternatively,
22* under the terms of one of the closed source Quantum Leaps commercial
23* licenses.
24*
25* The terms of the open source GNU General Public License version 3
26* can be found at: <www.gnu.org/licenses/gpl-3.0>
27*
28* The terms of the closed source Quantum Leaps commercial licenses
29* can be found at: <www.state-machine.com/licensing>
30*
31* Redistributions in source code must retain this top-level comment block.
32* Plagiarizing this software to sidestep the license obligations is illegal.
33*
34* Contact information:
35* <www.state-machine.com/licensing>
36* <info@state-machine.com>
37*/
38/*$endhead${include::qep.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
39/*! @file
40* @brief QEP/C platform-independent public interface.
41*
42* @trace
43* - @tr{DVP-QP-MC3-D04_08}
44*/
45#ifndef QEP_H_
46#define QEP_H_
47
48/*==========================================================================*/
49/*! The current QP version as an unsigned number
50*
51* @details
52* ::QP_VERSION is a decimal constant, where XX is a 1-digit or 2-digit
53* major version number, Y is a 1-digit minor version number, and Z is
54* a 1-digit release number.
55*/
56#define QP_VERSION 722U
57
58/*! The current QP version as a zero terminated string literal.
59*
60* @details
61* ::QP_VERSION_STR is of the form "XX.Y.Z", where XX is a 1-or 2-digit
62* major version number, Y is a 1-digit minor version number, and Z is
63* a 1-digit release number.
64*/
65#define QP_VERSION_STR "7.2.2"
66
67/*! Encrypted current QP release (7.2.2) and date (2023-03-01) */
68#define QP_RELEASE 0x76BAD85DU
69
70/*==========================================================================*/
71/*$declare${glob-types} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
72
73/*${glob-types::int_t} .....................................................*/
74/*! alias for line numbers in assertions and return from QF_run() */
75typedef int int_t;
76
77/*${glob-types::enum_t} ....................................................*/
78/*! alias for enumerations used for event signals */
79typedef int enum_t;
80
81/*${glob-types::float32_t} .................................................*/
82/*! alias for IEEE 754 32-bit floating point number,
83* MISRA-C 2012 Dir 4.6(A)
84*
85* @note
86* QP does not use floating-point types anywhere in the internal
87* implementation, except in QS software tracing, where utilities for
88* output of floating-point numbers are provided for application-specific
89* trace records.
90*/
91typedef float float32_t;
92
93/*${glob-types::float64_t} .................................................*/
94/*! alias for IEEE 754 64-bit floating point number,
95* MISRA-C 2012 Dir 4.6(A)
96*
97* @note
98* QP does not use floating-point types anywhere in the internal
99* implementation, except in QS software tracing, where utilities for
100* output of floating-point numbers are provided for application-specific
101* trace records.
102*/
103typedef double float64_t;
104/*$enddecl${glob-types} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
105/*$declare${QEP-config} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
106
107/*${QEP-config::Q_SIGNAL_SIZE} .............................................*/
108#ifndef Q_SIGNAL_SIZE
109/*! The size (in bytes) of the signal of an event. Valid values:
110* 1U, 2U, or 4U; default 2U
111*
112* @details
113* This macro can be defined in the QEP port file (qep_port.h) to
114* configure the ::QSignal type. When the macro is not defined, the
115* default of 2 bytes is applied.
116*/
117#define Q_SIGNAL_SIZE 2U
118#endif /* ndef Q_SIGNAL_SIZE */
119/*$enddecl${QEP-config} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
120
121/*==========================================================================*/
122/*$declare${QEP} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
123
124/*${QEP::QP_versionStr[8]} .................................................*/
125/*! the current QP version number string in ROM, based on #QP_VERSION_STR */
126extern char const QP_versionStr[8];
127
128/*${QEP::QSignal} ..........................................................*/
129#if (Q_SIGNAL_SIZE == 2U)
130/*! ::QSignal represents the signal of an event
131*
132* @details
133* The relationship between an event and a signal is as follows. A signal
134* in UML is the specification of an asynchronous stimulus that triggers
135* reactions, and as such is an essential part of an event. (The signal
136* conveys the type of the occurrence--what happened?) However, an event
137* can also contain additional quantitative information about the
138* occurrence in form of event parameters.
139*/
140typedef uint16_t QSignal;
141#endif /* (Q_SIGNAL_SIZE == 2U) */
142
143/*${QEP::QSignal} ..........................................................*/
144#if (Q_SIGNAL_SIZE == 1U)
145typedef uint8_t QSignal;
146#endif /* (Q_SIGNAL_SIZE == 1U) */
147
148/*${QEP::QSignal} ..........................................................*/
149#if (Q_SIGNAL_SIZE == 4U)
150typedef uint32_t QSignal;
151#endif /* (Q_SIGNAL_SIZE == 4U) */
152
153/*${QEP::QEvt} .............................................................*/
154/*! @brief Event class
155* @class QEvt
156*
157* @details
158* ::QEvt represents events without parameters and serves as the base class
159* for derivation of events with parameters.
160*
161* @trace
162* - @tr{REQ-QP-01_00}
163* - @tr{ARC-QP-02_10}
164*
165* @usage
166* The following example illustrates how to add an event parameter by
167* derivation of the ::QEvt class. Please note that the ::QEvt member
168* super is defined as the FIRST member of the derived struct.
169* @include qep_qevt.c
170*/
171typedef struct {
172/* public: */
173
174 /*! Signal of the event.
175 * @public @memberof QEvt
176 *
177 * @trace
178 * - @tr{REQ-QP-01_20}
179 */
181
182/* private: */
183
184 /*! Pool ID (==0 for immutable event)
185 * @private @memberof QEvt
186 *
187 * @trace
188 * - @tr{REQ-QP-01_30}
189 */
190 uint8_t poolId_;
191
192 /*! Reference counter (for mutable events)
193 * @private @memberof QEvt
194 *
195 * @trace
196 * - @tr{REQ-QP-01_30}
197 */
198 uint8_t volatile refCtr_;
199} QEvt;
200
201/* public: */
202
203#ifdef Q_EVT_CTOR
204/*! Custom event constructor
205* @public @memberof QEvt
206*
207* @note
208* Available only when the macro #Q_EVT_CTOR is defined
209*
210* @trace
211* - @tr{REQ-QP-01_40}
212*/
213void QEvt_ctor(QEvt * const me,
214 enum_t const sig);
215#endif /* def Q_EVT_CTOR */
216
217/*${QEP::QStateRet} ........................................................*/
218/*! All possible values returned from state/action handlers
219*
220* @note
221* The order matters for algorithmic correctness.
222*/
224 /* unhandled and need to "bubble up" */
225 Q_RET_SUPER, /*!< event passed to superstate to handle */
226 Q_RET_SUPER_SUB, /*!< event passed to submachine superstate */
227 Q_RET_UNHANDLED, /*!< event unhandled due to a guard */
228
229 /* handled and do not need to "bubble up" */
230 Q_RET_HANDLED, /*!< event handled (internal transition) */
231 Q_RET_IGNORED, /*!< event silently ignored (bubbled up to top) */
232
233 /* entry/exit */
234 Q_RET_ENTRY, /*!< state entry action executed */
235 Q_RET_EXIT, /*!< state exit action executed */
236
237 /* no side effects */
238 Q_RET_NULL, /*!< return value without any effect */
239
240 /* transitions need to execute transition-action table in ::QMsm */
241 Q_RET_TRAN, /*!< regular transition */
242 Q_RET_TRAN_INIT, /*!< initial transition in a state or submachine */
243 Q_RET_TRAN_EP, /*!< entry-point transition into a submachine */
244
245 /* transitions that additionally clobber me->state */
246 Q_RET_TRAN_HIST, /*!< transition to history of a given state */
247 Q_RET_TRAN_XP /*!< exit-point transition out of a submachine */
249
250/*${QEP::QState} ...........................................................*/
251/*! Type returned from state-handler functions */
252typedef enum QStateRet QState;
253
254/*${QEP::QStateHandler} ....................................................*/
255/*! Pointer to a state-handler function. */
256typedef QState (* QStateHandler )(void * const me, QEvt const * const e);
257
258/*${QEP::QActionHandler} ...................................................*/
259/*! Pointer to an action-handler function. */
260typedef QState (* QActionHandler )(void * const me);
261
262/*${QEP::QXThread} .........................................................*/
263/* forward declaration */
264struct QXThread;
265
266/*${QEP::QXThreadHandler} ..................................................*/
267/*! Pointer to an eXthended thread handler function */
268typedef void (* QXThreadHandler )(struct QXThread * const me);
269
270/*${QEP::QMState} ..........................................................*/
271/*! @brief State object for the ::QMsm class (QM State Machine).
272*
273* @details
274* This class groups together the attributes of a ::QMsm state, such as the
275* parent state (state nesting), the associated state handler function and
276* the exit action handler function. These attributes are used inside the
277* QMsm_dispatch() and QMsm_init() functions.
278*
279* @trace
280* - @tr{REQ-QP-02_21}
281*
282* @attention
283* The ::QMState class is only intended for the QM code generator and should
284* not be used in hand-crafted code.
285*/
286typedef struct QMState {
287 struct QMState const *superstate; /*!< superstate of this state */
288 QStateHandler const stateHandler; /*!< state handler function */
289 QActionHandler const entryAction; /*!< entry action handler function */
290 QActionHandler const exitAction; /*!< exit action handler function */
291 QActionHandler const initAction; /*!< init action handler function */
292} QMState;
293
294/*${QEP::QMTranActTable} ...................................................*/
295/*! @brief Transition-Action Table for the ::QMsm State Machine. */
296typedef struct QMTranActTable {
297 QMState const *target; /*!< target of the transition */
298 QActionHandler const act[1]; /*!< array of actions */
300
301/*${QEP::QHsmAttr} .........................................................*/
302/*! @brief Attribute of for the ::QHsm class (Hierarchical State Machine).
303*
304* @details
305* This union represents possible values stored in the 'state' and 'temp'
306* attributes of the ::QHsm class.
307*
308* @trace
309* - @tr{DVP-QS-MC3-R19_02}
310*/
311union QHsmAttr {
312 QStateHandler fun; /*!< @private pointer to a state-handler */
313 QActionHandler act; /*!< @private pointer to an action-handler */
314 QXThreadHandler thr; /*!< @private pointer to an thread-handler */
315 QMTranActTable const *tatbl; /*!< @private transition-action table */
316 struct QMState const *obj; /*!< @private pointer to QMState object */
317#ifndef Q_NSSM
318 uintptr_t uint; /*!< @private unsidend int for SSM */
319#endif
320};
321
322/*${QEP::QReservedSig} .....................................................*/
323/*! Reserved signals by the HSM-style state machine
324* implementation strategy.
325*/
327 Q_EMPTY_SIG, /*!< signal to execute the default case */
328 Q_ENTRY_SIG, /*!< signal for coding entry actions */
329 Q_EXIT_SIG, /*!< signal for coding exit actions */
330 Q_INIT_SIG, /*!< signal for coding initial transitions */
331 Q_USER_SIG /*!< offset for the user signals (QP Application) */
333
334/*${QEP::QHsm} .............................................................*/
335/*! @brief Hierarchical State Machine class
336* @class QHsm
337*
338* @details
339* ::QHsm represents a Hierarchical State Machine (HSM) with full support for
340* hierarchical nesting of states, entry/exit actions, initial transitions,
341* and transitions to history in any composite state. This class is designed
342* for ease of manual coding of HSMs in C, but it is also supported by the
343* QM modeling tool.<br>
344*
345* ::QHsm is also the base class for the QMsm state machine, which provides
346* a superior efficiency, but requires the use of the QM modeling tool to
347* generate code.
348*
349* @note
350* ::QHsm is not intended to be instantiated directly, but rather serves as the
351* abstract base class for derivation of state machines in the QP application.
352*
353* @trace
354* - @tr{REQ-QP-02_00}
355* - @tr{REQ-QP-02_10}
356* - @tr{ARC-QP-02_20}
357*
358* @usage
359* The following example illustrates how to derive a state machine class
360* from QHsm. Please note that the QHsm member `super` is defined as the
361* FIRST member of the derived class.
362* @include qep_qhsm.c
363*/
364typedef struct {
365/* private: */
366
367 /*! Virtual pointer
368 * @private @memberof QHsm
369 *
370 * @trace
371 * - @tr{REQ-QP-02_10}
372 */
373 struct QHsmVtable const * vptr;
374
375/* protected: */
376
377 /*! Current active state (state-variable).
378 * @private @memberof QHsm
379 */
380 union QHsmAttr state;
381
382 /*! Temporary: target/act-table, etc.
383 * @private @memberof QHsm
384 *
385 * The `temp` data member is used for passing information from the
386 * QP Application to the "event processor" of QP. The `temp` member
387 * is also used as a redundant copy of the `state` variable in between
388 * transitions (part of QP Safety Instrumented System).
389 */
390 union QHsmAttr temp;
391} QHsm;
392
393/* public: */
394
395/*! Tests if a given state is part of the current active state
396* configuration in ::QHsm subclasses.
397* @public @memberof QHsm
398*
399* @details
400* Tests if a state machine derived from QHsm is-in a given state.
401*
402* @note For a HSM, to "be in a state" means also to be in a superstate of
403* of the state.
404*
405* @param[in] me current instance pointer (see @ref oop)
406* @param[in] state pointer to the state-handler function to be tested
407*
408* @returns
409*'true' if the HSM "is in" the `state` and 'false' otherwise
410*
411* @precondition{qep_hsm,602}
412* - the internal integrity must hold (Software Self-Monitoring (SSM))
413*
414* @trace
415* - @tr{REQ-QP-02_25}
416*/
417bool QHsm_isIn(QHsm * const me,
418 QStateHandler const state);
419
420/*! Obtain the current active state from a HSM (read only).
421* @public @memberof QHsm
422*
423* @param[in] me current instance pointer (see @ref oop)
424*
425* @returns the current active state of the QHsm class
426*
427* @note
428* This function is used in QM for auto-generating code for state history.
429*/
430static inline QStateHandler QHsm_state(QHsm * const me) {
431 return me->state.fun;
432}
433
434/*! Obtain the current active child state of a given parent in ::QHsm
435* @public @memberof QHsm
436*
437* @details
438* Finds the child state of the given `parent`, such that this child state
439* is an ancestor of the currently active state. The main purpose of this
440* function is to support **shallow history** transitions in state machines
441* derived from QHsm.
442*
443* @param[in] me current instance pointer (see @ref oop)
444* @param[in] parent pointer to the state-handler function
445*
446* @returns
447* the child of a given `parent` state, which is an ancestor of the current
448* active state. For the corner case when the currently active state is the
449* given `parent` state, function returns the `parent` state.
450*
451* @postcondition{qep_hsm,890}
452* - the child must be found
453*
454* @note
455* this function is designed to be called during state transitions, so it
456* does not necessarily start in a stable state configuration.
457* However, the function establishes stable state configuration upon exit.
458*
459* @trace
460* - @tr{REQ-QP-02_39}
461*/
462QStateHandler QHsm_childState(QHsm * const me,
463 QStateHandler const parent);
464
465/* protected: */
466
467/*! Protected "constructor" of ::QHsm
468* @protected @memberof QHsm
469*
470* @details
471* Performs the first step of HSM initialization by assigning the initial
472* pseudostate to the currently active state of the state machine.
473*
474* @param[in,out] me current instance pointer (see @ref oop)
475* @param[in] initial pointer to the top-most initial state-handler
476* function in the derived state machine
477*
478* @note Must be called only by the constructors of the derived state
479* machines.
480*
481* @note Must be called only ONCE before QHSM_INIT().
482*
483* @usage
484* The following example illustrates how to invoke QHsm_ctor() in the
485* "constructor" of a derived state machine:
486* @include qep_qhsm_ctor.c
487*
488* @trace
489* - @tr{REQ-QP-02_00}
490* - @tr{REQ-QP-02_10}
491*/
492void QHsm_ctor(QHsm * const me,
493 QStateHandler const initial);
494
495/*! The top-state of QHsm.
496* @protected @memberof QHsm
497*
498* @details
499* QHsm_top() is the ultimate root of state hierarchy in all HSMs derived
500* from ::QHsm.
501*
502* @param[in] me current instance pointer (see @ref oop)
503* @param[in] e pointer to the event to be dispatched to the FSM
504*
505* @returns
506* Always returns ::Q_RET_IGNORED, which means that the top state ignores
507* all events.
508*
509* @note The parameters to this state handler are not used. They are provided
510* for conformance with the state-handler function signature ::QStateHandler.
511*
512* @trace
513* - @tr{REQ-QP-02_40}
514*/
515QState QHsm_top(QHsm const * const me,
516 QEvt const * const e);
517
518/*! Implementation of the top-most initial tran. in ::QHsm.
519* @protected @memberof QHsm
520*
521* @details
522* Executes the top-most initial transition in a HSM.
523*
524* @param[in,out] me current instance pointer (see @ref oop)
525* @param[in] e pointer to an extra parameter (might be NULL)
526* @param[in] qs_id QS-id of this state machine (for QS local filter)
527*
528* @precondition{qep_hsm,200}
529* - the virtual pointer must be initialized,
530* - the top-most initial transition must be initialized,
531* - the initial transition must not be taken yet.
532*
533* @note Must be called only ONCE after the QHsm_ctor().
534*
535* @trace
536* - @tr{REQ-QP-02_10}
537* - @tr{REQ-QP-02_38}
538*/
539void QHsm_init_(QHsm * const me,
540 void const * const e,
541 uint_fast8_t const qs_id);
542
543/*! Implementation of dispatching events to a ::QHsm
544* @protected @memberof QHsm
545*
546* @details
547* Dispatches an event for processing to a hierarchical state machine (HSM).
548* The processing of an event represents one run-to-completion (RTC) step.
549*
550* @param[in,out] me current instance pointer (see @ref oop)
551* @param[in] e pointer to the event to be dispatched to the HSM
552* @param[in] qs_id QS-id of this state machine (for QS local filter)
553*
554* @precondition{qep_hsm,302}
555* - the current state must be initialized and
556* - the internal integrity must hold on (Software Self-Monitoring (SSM))
557*
558* @note
559* This function should be called only via the virtual table (see
560* QHSM_DISPATCH()) and should NOT be called directly in the applications.
561*
562* @trace
563* - @tr{REQ-QP-02_10}
564*/
565void QHsm_dispatch_(QHsm * const me,
566 QEvt const * const e,
567 uint_fast8_t const qs_id);
568
569/* private: */
570
571#ifdef Q_SPY
572/*! Implementation of getting the state handler in a ::QHsm subclass
573* @private @memberof QHsm
574*/
575QStateHandler QHsm_getStateHandler_(QHsm * const me);
576#endif /* def Q_SPY */
577
578/*! Helper function to execute transition sequence in a hierarchical state
579* machine (HSM).
580*
581* @param[in] me current instance pointer (see @ref oop)
582* @param[in,out] path array of pointers to state-handler functions
583* to execute the entry actions
584* @param[in] qs_id QS-id of this state machine (for QS local filter)
585*
586* @returns
587* the depth of the entry path stored in the `path` parameter.
588*
589* @trace
590* - @tr{REQ-QP-02_35}
591*/
592int_fast8_t QHsm_tran_(QHsm * const me,
593 QStateHandler * const path,
594 uint_fast8_t const qs_id);
595
596/*! Helper function to execute entry into a given state in a
597* hierarchical state machine (HSM).
598* @private @memberof QHsm
599*
600* @param[in,out] me current instance pointer (see @ref oop)
601* @param[in] state state handler function
602* @param[in] qs_id QS-id of this state machine (for QS local filter)
603*/
604void QHsm_state_entry_(QHsm * const me,
605 QStateHandler const state,
606 uint_fast8_t const qs_id);
607
608/*! Helper function to execute exit from a given state in a
609* hierarchical state machine (HSM).
610* @private @memberof QHsm
611*
612* @param[in,out] me current instance pointer (see @ref oop)
613* @param[in] state state handler function
614* @param[in] qs_id QS-id of this state machine (for QS local filter)
615*
616* @returns
617* 'true' if the exit action has been found in the state and
618* 'flase' otherwise.
619*/
620bool QHsm_state_exit_(QHsm * const me,
621 QStateHandler const state,
622 uint_fast8_t const qs_id);
623
624/*${QEP::QHsmVtable} .......................................................*/
625/*! @brief Virtual table for the ::QHsm class.
626*
627* @trace
628* - @tr{REQ-QP-02_10}
629*/
631 /*! Triggers the top-most initial transition in the HSM. */
632 void (*init)(QHsm * const me, void const * const e,
633 uint_fast8_t const qs_id);
634
635 /*! Dispatches an event to the HSM. */
636 void (*dispatch)(QHsm * const me, QEvt const * const e,
637 uint_fast8_t const qs_id);
638
639#ifdef Q_SPY
640 /*! Get the current state handler of the HSM. */
642#endif /* Q_SPY */
643};
644
645/*${QEP::QMsm} .............................................................*/
646/*! @brief QM state machine implementation strategy
647* @class QMsm
648* @extends QHsm
649*
650* @details
651* QMsm (QM State Machine) provides a more efficient state machine
652* implementation strategy than ::QHsm, but requires the use of the QM
653* modeling tool, but are the fastest and need the least run-time
654* support (the smallest event-processor taking up the least code space).
655*
656* @note
657* QMsm is not intended to be instantiated directly, but rather serves
658* as the abstrace base class for derivation of state machines in the
659* application code.
660*
661* @trace
662* - @tr{REQ-QP-02_21}
663* - @tr{ARC-QP-02_40}
664*
665* @usage
666* The following example illustrates how to derive a state machine class
667* from QMsm. Please note that the QMsm member `super` is defined
668* as the *first* member of the derived struct.
669* @include qep_qmsm.c
670*/
671typedef struct {
672/* protected: */
674} QMsm;
675
676/* public: */
677
678/*! Tests if a given state is part of the current active state
679* configuration in a MSM.
680* @public @memberof QMsm
681*
682* @details
683* Tests if a state machine derived from QMsm is-in a given state.
684*
685* @note
686* For a MSM, to "be-in" a state means also to "be-in" a superstate of
687* of the state.
688*
689* @param[in] me current instance pointer (see @ref oop)
690* @param[in] state pointer to the QMState object that corresponds to the
691* tested state.
692* @returns
693* 'true' if the MSM "is in" the `state` and 'false' otherwise
694*/
695bool QMsm_isInState(QMsm const * const me,
696 QMState const * const state);
697
698/*! Obtain the current active state from a MSM (read only)
699* @public @memberof QMsm
700*
701* @param[in] me current instance pointer (see @ref oop)
702*
703* @returns the current active state-object
704*
705* @note
706* This function is used in QM for auto-generating code for state history
707*/
708QMState const * QMsm_stateObj(QHsm const * const me);
709
710/*! Obtain the current active child state of a given parent in ::QMsm
711* @public @memberof QMsm
712*
713* @details
714* Finds the child state of the given @c parent, such that this child state
715* is an ancestor of the currently active state. The main purpose of this
716* function is to support **shallow history** transitions in state machines
717* derived from QMsm.
718*
719* @param[in] me current instance pointer (see @ref oop)
720* @param[in] parent pointer to the state-handler object
721*
722* @returns
723* the child of a given @c parent state, which is an ancestor of
724* the currently active state. For the corner case when the currently active
725* state is the given @c parent state, function returns the @c parent state.
726*
727* @postcondition{qep_msm,890}
728* - the child must be found
729*
730* @sa QMsm_childStateObj()
731*/
732QMState const * QMsm_childStateObj(
733 QHsm const * const me,
734 QMState const * const parent);
735
736/* protected: */
737
738/*! Constructor of ::QMsm
739* @protected @memberof QMsm
740*
741* @details
742* Performs the first step of QMsm initialization by assigning the initial
743* pseudostate to the currently active state of the state machine.
744*
745* @param[in,out] me current instance pointer (see @ref oop)
746* @param[in] initial the top-most initial transition for the MSM.
747*
748* @note
749* Must be called only ONCE before QHSM_INIT().
750*
751* @note
752* QMsm inherits QHsm, so by the @ref oop convention it should call the
753* constructor of the superclass, i.e., QHsm_ctor(). However, this would pull
754* in the QHsmVtable, which in turn will pull in the code for QHsm_init_() and
755* QHsm_dispatch_() implemetations. To avoid this code size penalty, in case
756* ::QHsm is not used in a given project, the QMsm_ctor() performs direct
757* intitialization of the Vtable, which avoids pulling in the code for QMsm.
758*
759* @usage
760* The following example illustrates how to invoke QMsm_ctor() in the
761* "constructor" of a derived state machine:
762* @include qep_qmsm_ctor.c
763*/
764void QMsm_ctor(QMsm * const me,
765 QStateHandler const initial);
766
767/* public: */
768
769/*! Implementation of the top-most initial tran. in ::QMsm.
770* @private @memberof QMsm
771*
772* @details
773* Executes the top-most initial transition in a MSM.
774*
775* @param[in,out] me current instance pointer (see @ref oop)
776* @param[in] e pointer to an extra parameter (might be NULL)
777* @param[in] qs_id QS-id of this state machine (for QS local filter)
778*
779* @precondition{qep_msm,200}
780* - the virtual pointer must be initialized,
781* - the top-most initial transition must be initialized,
782* - the initial transition must not be taken yet.
783*
784* @note
785* This function should be called only via the virtual table (see
786* QHSM_INIT()) and should NOT be called directly in the applications.
787*/
788void QMsm_init_(
789 QHsm * const me,
790 void const * const e,
791 uint_fast8_t const qs_id);
792
793/* private: */
794
795/*! Implementation of dispatching events to a ::QMsm
796* @private @memberof QMsm
797*
798* @details
799* Dispatches an event for processing to a meta state machine (MSM).
800* The processing of an event represents one run-to-completion (RTC) step.
801*
802* @param[in,out] me current instance pointer (see @ref oop)
803* @param[in] e pointer to the event to be dispatched to the MSM
804* @param[in] qs_id QS-id of this state machine (for QS local filter)
805*
806* @precondition{qep_msm,302}
807* - current state must be initialized
808* - the internal integrity must hold on (Software Self-Monitoring (SSM))
809*
810* @note
811* This function should be called only via the virtual table (see
812* QHSM_DISPATCH()) and should NOT be called directly in the applications.
813*/
814void QMsm_dispatch_(
815 QHsm * const me,
816 QEvt const * const e,
817 uint_fast8_t const qs_id);
818
819/* public: */
820
821#ifdef Q_SPY
822/*! Implementation of getting the state handler in a ::QMsm subclass
823* @public @memberof QMsm
824*/
825QStateHandler QMsm_getStateHandler_(QHsm * const me);
826#endif /* def Q_SPY */
827
828/* private: */
829
830/*! Execute transition-action table
831* @private @memberof QMsm
832*
833* @details
834* Helper function to execute transition sequence in a transition-action table.
835*
836* @param[in,out] me current instance pointer (see @ref oop)
837* @param[in] tatbl pointer to the transition-action table
838* @param[in] qs_id QS-id of this state machine (for QS local filter)
839*
840* @returns
841* status of the last action from the transition-action table.
842*
843* @note
844* This function is for internal use inside the QEP event processor and
845* should **not** be called directly from the applications.
846*/
847QState QMsm_execTatbl_(
848 QHsm * const me,
849 QMTranActTable const * const tatbl,
850 uint_fast8_t const qs_id);
851
852/*! Exit the current state up to the explicit transition source
853* @private @memberof QMsm
854*
855* @details
856* Static helper function to exit the current state configuration to the
857* transition source, which in a hierarchical state machine might be a
858* superstate of the current state.
859*
860* @param[in,out] me current instance pointer (see @ref oop)
861* @param[in] cs pointer to the current state
862* @param[in] ts pointer to the transition source state
863* @param[in] qs_id QS-id of this state machine (for QS local filter)
864*/
865void QMsm_exitToTranSource_(
866 QHsm * const me,
867 QMState const * const cs,
868 QMState const * const ts,
869 uint_fast8_t const qs_id);
870
871/*! Enter history of a composite state
872* @private @memberof QMsm
873*
874* @details
875* Static helper function to execute the segment of transition to history
876* after entering the composite state and
877*
878* @param[in,out] me current instance pointer (see @ref oop)
879* @param[in] hist pointer to the history substate
880* @param[in] qs_id QS-id of this state machine (for QS local filter)
881*
882* @returns
883* #Q_RET_TRAN_INIT, if an initial transition has been executed in the last
884* entered state or #Q_RET_NULL if no such transition was taken.
885*/
886QState QMsm_enterHistory_(
887 QHsm * const me,
888 QMState const *const hist,
889 uint_fast8_t const qs_id);
890/*$enddecl${QEP} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
891
892/*==========================================================================*/
893/*$declare${QEP-macros} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
894
895/*${QEP-macros::QHSM_INIT} .................................................*/
896#ifdef Q_SPY
897/*! Virtual call to the top-most initial transition in a HSM.
898*
899* @param[in,out] me_ current instance pointer (see @ref oop)
900* @param[in] par_ pointer the optional initialization parameter
901* @param[in] qs_id_ QS local filter ID (used only when Q_SPY is defined)
902*
903* @note Must be called only ONCE after the SM "constructor".
904*
905* @trace
906* - @tr{REQ-QP-02_38}
907*
908* @usage
909* The following example illustrates how to initialize a SM, and dispatch
910* events to it:
911* @include qep_qhsm_use.c
912*/
913#define QHSM_INIT(me_, par_, qs_id_) do { \
914 Q_ASSERT((me_)->vptr); \
915 (*(me_)->vptr->init)((me_), (par_), (qs_id_)); \
916} while (false)
917#endif /* def Q_SPY */
918
919/*${QEP-macros::QHSM_INIT} .................................................*/
920#ifndef Q_SPY
921#define QHSM_INIT(me_, par_, dummy) do { \
922 Q_ASSERT((me_)->vptr); \
923 (*(me_)->vptr->init)((me_), (par_), 0U); \
924} while (false)
925#endif /* ndef Q_SPY */
926
927/*${QEP-macros::QHSM_DISPATCH} .............................................*/
928#ifdef Q_SPY
929/*! Virtual call to dispatch an event to a HSM
930*
931* @details
932* Processes one event at a time in Run-to-Completion fashion.
933*
934* @param[in,out] me_ current instance pointer (see @ref oop)
935* @param[in] e_ constant pointer the ::QEvt or a class
936* derived from ::QEvt (see @ref oop)
937* @param[in] qs_id_ QS local filter ID (used only when Q_SPY is defined)
938*
939* @note Must be called after the "constructor" and after QHSM_INIT().
940*
941* @trace
942* - @tr{REQ-QP-02_10}
943*/
944#define QHSM_DISPATCH(me_, e_, qs_id_) \
945 ((*(me_)->vptr->dispatch)((me_), (e_), (qs_id_)))
946#endif /* def Q_SPY */
947
948/*${QEP-macros::QHSM_DISPATCH} .............................................*/
949#ifndef Q_SPY
950#define QHSM_DISPATCH(me_, e_, dummy) \
951 ((*(me_)->vptr->dispatch)((me_), (e_), 0U))
952#endif /* ndef Q_SPY */
953
954/*${QEP-macros::Q_HSM_UPCAST} ..............................................*/
955/*! Perform upcast from a subclass of ::QHsm to the base class ::QHsm
956*
957* @details
958* Upcasting from a subclass to superclass is a very frequent and **safe**
959* operation in object-oriented programming and object-oriented languages
960* (such as C++) perform such upcasting automatically. However, OOP is
961* implemented in C just as a set of coding conventions (see @ref oop),
962* and the C compiler does not "know" that certain types are related by
963* inheritance. Therefore for C, the upcast must be performed explicitly.
964* Unfortunately, pointer casting violates the advisory MISRA-C 2012
965* Rule 11.3(req) "A cast shall not be performed between a pointer to object
966* type and a pointer to a different object type". This macro encapsulates
967* this deviation and provides a descriptive name for the reason of this cast.
968*
969* @trace
970* - @tr{DVP-QP-MC3-R11_03A} (upcast)
971*/
972#define Q_HSM_UPCAST(ptr_) ((QHsm *)(ptr_))
973
974/*${QEP-macros::Q_TRAN} ....................................................*/
975/*! Perform upcast from a subclass of ::QHsm to the base class ::QHsm
976*
977* @details
978* Upcasting from a subclass to superclass is a very frequent and **safe**
979* operation in object-oriented programming and object-oriented languages
980* (such as C++) perform such upcasting automatically. However, OOP is
981* implemented in C just as a set of coding conventions (see @ref oop),
982* and the C compiler does not "know" that certain types are related by
983* inheritance. Therefore for C, the upcast must be performed explicitly.
984* Unfortunately, pointer casting violates the advisory MISRA-C 2012
985* Rule 11.3(req) "A cast shall not be performed between a pointer to object
986* type and a pointer to a different object type". This macro encapsulates
987* this deviation and provides a descriptive name for the reason of this cast.
988*
989* @trace
990* - @tr{DVP-QP-MC3-R11_01}
991* - @tr{DVP-QP-MC3-R12_03}
992* - @tr{DVP-QP-MC3-R13_04}
993*/
994#define Q_TRAN(target_) \
995 ((Q_HSM_UPCAST(me))->temp.fun = Q_STATE_CAST(target_), \
996 (QState)Q_RET_TRAN)
997
998/*${QEP-macros::Q_TRAN_HIST} ...............................................*/
999/*! Macro to call in a state-handler when it executes a transition
1000* to history. Applicable only to HSMs.
1001*
1002* @trace
1003* - @tr{REQ-QP-02_39}
1004* - @tr{DVP-QP-MC3-R11_01}
1005* - @tr{DVP-QP-MC3-R12_03}
1006*
1007* @usage
1008* @include qep_qhist.c
1009*/
1010#define Q_TRAN_HIST(hist_) \
1011 ((Q_HSM_UPCAST(me))->temp.fun = (hist_), \
1012 (QState)Q_RET_TRAN_HIST)
1013
1014/*${QEP-macros::Q_SUPER} ...................................................*/
1015/*! Macro to call in a state-handler when it designates the superstate
1016* of a given state. Applicable only to ::QHsm subclasses.
1017*
1018* @trace
1019* - @tr{REQ-QP-02_31}
1020* - @tr{DVP-QP-MC3-R11_01}
1021* - @tr{DVP-QP-MC3-R12_03}
1022* - @tr{DVP-QP-MC3-R13_04}
1023*
1024* @usage
1025* @include qep_qsuper.c
1026*/
1027#define Q_SUPER(super_) \
1028 ((Q_HSM_UPCAST(me))->temp.fun = Q_STATE_CAST(super_), \
1029 (QState)Q_RET_SUPER)
1030
1031/*${QEP-macros::Q_HANDLED} .................................................*/
1032/*! Macro to call in a state-handler when it handles an event.
1033*
1034* @trace
1035* - @tr{REQ-QP-02_32}
1036* - @tr{REQ-QP-02_33}
1037* - @tr{REQ-QP-02_36}
1038*/
1039#define Q_HANDLED() ((QState)Q_RET_HANDLED)
1040
1041/*${QEP-macros::Q_UNHANDLED} ...............................................*/
1042/*! Macro to call in a state-handler when it attempts to handle
1043* an event but a guard condition evaluates to 'false' and there is no other
1044* explicit way of handling the event. Applicable only to ::QHsm subclasses.
1045*/
1046#define Q_UNHANDLED() ((QState)Q_RET_UNHANDLED)
1047
1048/*${QEP-macros::Q_ACTION_NULL} .............................................*/
1049/*! Macro to provide strictly-typed zero-action to terminate action lists
1050*! in the transition-action-tables
1051*/
1052#define Q_ACTION_NULL ((QActionHandler)0)
1053
1054/*${QEP-macros::Q_EVT_CAST} ................................................*/
1055/*! Perform downcast of an event onto a subclass of ::QEvt `class_`
1056*
1057* @details
1058* This macro encapsulates the downcast of ::QEvt pointers, which violates
1059* MISRA-C 2012 Rule 11.3(R) "A cast shall not be performed between a
1060* pointer to object type and a pointer to a different object type". This
1061* macro helps to localize this deviation.
1062*
1063* @param class_ a subclass of ::QEvt
1064*
1065* @trace
1066* - @tr{REQ-QP-01_30}
1067* - @tr{DVP-QP-MC3-D04_09A} (false-positive)
1068* - @tr{DVP-QP-MC3-R11_03B} (downcast)
1069* - @tr{DVP-QP-PCLP-826}
1070*/
1071#define Q_EVT_CAST(class_) ((class_ const *)(e))
1072
1073/*${QEP-macros::Q_STATE_CAST} ..............................................*/
1074/*! Perform cast to ::QStateHandler.
1075*
1076* @details
1077* This macro encapsulates the cast of a specific state handler function
1078* pointer to ::QStateHandler, which violates MISRA:C-2012 Rule 11.1(req)
1079* "Conversions shall not be performed between a pointer to function and
1080* any other type". This macro helps to localize this deviation.
1081*
1082* @trace
1083* - @tr{DVP-QP-MC3-D04_09A} (false-positive)
1084* - @tr{DVP-QP-MC3-R11_01}
1085*
1086* @usage
1087* @include qep_qhsm_ctor.c
1088*/
1089#define Q_STATE_CAST(handler_) ((QStateHandler)(handler_))
1090
1091/*${QEP-macros::Q_ACTION_CAST} .............................................*/
1092/*! Perform cast to ::QActionHandler.
1093*
1094* @details
1095* This macro encapsulates the cast of a specific action handler function
1096* pointer to ::QActionHandler, which violates MISRA:C-2012 Rule 11.1(R)
1097* "Conversions shall not be performed between a pointer to function and
1098* any other type". This macro helps to localize this deviation.
1099*
1100* @trace
1101* - @tr{DVP-QP-MC3-D04_09A} (false-positive)
1102* - @tr{DVP-QP-MC3-R11_01}
1103*/
1104#define Q_ACTION_CAST(action_) ((QActionHandler)(action_))
1105
1106/*${QEP-macros::Q_UNUSED_PAR} ..............................................*/
1107/*! Helper macro to clearly mark unused parameters of functions. */
1108#define Q_UNUSED_PAR(par_) ((void)(par_))
1109
1110/*${QEP-macros::Q_DIM} .....................................................*/
1111/*! Helper macro to calculate static dimension of a 1-dim `array_`
1112*
1113* @param array_ 1-dimensional array
1114* @returns the length of the array (number of elements it can hold)
1115*/
1116#define Q_DIM(array_) (sizeof(array_) / sizeof((array_)[0U]))
1117
1118/*${QEP-macros::Q_UINT2PTR_CAST} ...........................................*/
1119/*! Perform cast from unsigned integer `uint_` to pointer of type `type_`
1120*
1121* @details
1122* This macro encapsulates the cast to (type_ *), which QP ports or
1123* application might use to access embedded hardware registers.
1124* Such uses can trigger PC-Lint "Note 923: cast from int to pointer"
1125* and this macro helps to encapsulate this deviation.
1126*/
1127#define Q_UINT2PTR_CAST(type_, uint_) ((type_ *)(uint_))
1128
1129/*${QEP-macros::QEVT_INITIALIZER} ..........................................*/
1130/*! Initializer of static constant QEvt instances
1131*
1132* @details
1133* This macro encapsulates the ugly casting of enumerated signals
1134* to QSignal and constants for QEvt.poolID and QEvt.refCtr_.
1135*/
1136#define QEVT_INITIALIZER(sig_) { (QSignal)(sig_), 0U, 0U }
1137
1138/*${QEP-macros::QM_ENTRY} ..................................................*/
1139#ifdef Q_SPY
1140/*! Macro to call in a QM action-handler when it executes
1141* an entry action. Applicable only to ::QMsm subclasses.
1142*
1143* @trace
1144* - @tr{DVP-QP-MC3-R11_01}
1145* - @tr{DVP-QP-MC3-R12_03}
1146* - @tr{DVP-QP-MC3-R13_04}
1147*/
1148#define QM_ENTRY(state_) \
1149 ((Q_HSM_UPCAST(me))->temp.obj = (state_), \
1150 (QState)Q_RET_ENTRY)
1151#endif /* def Q_SPY */
1152
1153/*${QEP-macros::QM_ENTRY} ..................................................*/
1154#ifndef Q_SPY
1155#define QM_ENTRY(dummy) ((QState)Q_RET_ENTRY)
1156#endif /* ndef Q_SPY */
1157
1158/*${QEP-macros::QM_EXIT} ...................................................*/
1159#ifdef Q_SPY
1160/*! Macro to call in a QM action-handler when it executes
1161* an exit action. Applicable only to ::QMsm subclasses.
1162*
1163* @trace
1164* - @tr{DVP-QP-MC3-R11_01}
1165* - @tr{DVP-QP-MC3-R12_03}
1166* - @tr{DVP-QP-MC3-R13_04}
1167*/
1168#define QM_EXIT(state_) \
1169 ((Q_HSM_UPCAST(me))->temp.obj = (state_), \
1170 (QState)Q_RET_EXIT)
1171#endif /* def Q_SPY */
1172
1173/*${QEP-macros::QM_EXIT} ...................................................*/
1174#ifndef Q_SPY
1175#define QM_EXIT(dummy) ((QState)Q_RET_EXIT)
1176#endif /* ndef Q_SPY */
1177
1178/*${QEP-macros::QM_SM_EXIT} ................................................*/
1179/*! Macro to call in a QM submachine exit-handler.
1180* Applicable only to subclasses of ::QMsm.
1181*
1182* @trace
1183* - @tr{DVP-QP-MC3-R11_01}
1184* - @tr{DVP-QP-MC3-R12_03}
1185* - @tr{DVP-QP-MC3-R13_04}
1186*/
1187#define QM_SM_EXIT(state_) \
1188 ((Q_HSM_UPCAST(me))->temp.obj = (state_), \
1189 (QState)Q_RET_EXIT)
1190
1191/*${QEP-macros::QM_TRAN} ...................................................*/
1192/*! Macro to call in a QM state-handler when it executes a regular
1193* transition. Applicable only to ::QMsm subclasses.
1194*
1195* @trace
1196* - @tr{DVP-QP-MC3-R11_01}
1197* - @tr{DVP-QP-MC3-R11_03A} (upcast)
1198* - @tr{DVP-QP-MC3-R12_03}
1199* - @tr{DVP-QP-MC3-R13_04}
1200*/
1201#define QM_TRAN(tatbl_) ((Q_HSM_UPCAST(me))->temp.tatbl \
1202 = (struct QMTranActTable const *)(tatbl_), \
1203 (QState)Q_RET_TRAN)
1204
1205/*${QEP-macros::QM_TRAN_INIT} ..............................................*/
1206/*! Macro to call in a QM state-handler when it executes an initial
1207* transition. Applicable only to ::QMsm subclasses.
1208*
1209* @trace
1210* - @tr{DVP-QP-MC3-R11_01}
1211* - @tr{DVP-QP-MC3-R11_03A} (upcast)
1212* - @tr{DVP-QP-MC3-R12_03}
1213* - @tr{DVP-QP-MC3-R13_04}
1214*/
1215#define QM_TRAN_INIT(tatbl_) ((Q_HSM_UPCAST(me))->temp.tatbl \
1216 = (struct QMTranActTable const *)(tatbl_), \
1217 (QState)Q_RET_TRAN_INIT)
1218
1219/*${QEP-macros::QM_TRAN_HIST} ..............................................*/
1220/*! Macro to call in a QM state-handler when it executes a transition
1221* to history. Applicable only to ::QMsm subclasses.
1222*
1223* @trace
1224* - @tr{DVP-QP-MC3-R11_01}
1225* - @tr{DVP-QP-MC3-R12_03}
1226* - @tr{DVP-QP-MC3-R13_04}
1227*/
1228#define QM_TRAN_HIST(history_, tatbl_) \
1229 ((((Q_HSM_UPCAST(me))->state.obj = (history_)), \
1230 ((Q_HSM_UPCAST(me))->temp.tatbl = \
1231 (struct QMTranActTable const *)(tatbl_))), \
1232 (QState)Q_RET_TRAN_HIST)
1233
1234/*${QEP-macros::QM_TRAN_EP} ................................................*/
1235/*! Macro to call in a QM state-handler when it executes a transition
1236* to the submachine via an entry point.
1237*
1238* @trace
1239* - @tr{DVP-QP-MC3-R11_01}
1240* - @tr{DVP-QP-MC3-R11_03A} (upcast)
1241* - @tr{DVP-QP-MC3-R12_03}
1242* - @tr{DVP-QP-MC3-R13_04}
1243*/
1244#define QM_TRAN_EP(tatbl_) ((Q_HSM_UPCAST(me))->temp.tatbl \
1245 = (struct QMTranActTable const *)(tatbl_), \
1246 (QState)Q_RET_TRAN_EP)
1247
1248/*${QEP-macros::QM_TRAN_XP} ................................................*/
1249/*! Macro to call in a QM state-handler when it executes a transition
1250* to exit point. Applicable only to ::QMsm subclasses.
1251*
1252* @trace
1253* - @tr{DVP-QP-MC3-R11_01}
1254* - @tr{DVP-QP-MC3-R12_03}
1255* - @tr{DVP-QP-MC3-R13_04}
1256*/
1257#define QM_TRAN_XP(xp_, tatbl_) \
1258 ((((Q_HSM_UPCAST(me))->state.act = (xp_)), \
1259 ((Q_HSM_UPCAST(me))->temp.tatbl = \
1260 (struct QMTranActTable const *)(tatbl_))), \
1261 (QState)Q_RET_TRAN_XP)
1262
1263/*${QEP-macros::QM_HANDLED} ................................................*/
1264/*! Macro to call in a QM state-handler when it handled an event.
1265* Applicable only to ::QMsm subclasses.
1266*/
1267#define QM_HANDLED() ((QState)Q_RET_HANDLED)
1268
1269/*${QEP-macros::QM_UNHANDLED} ..............................................*/
1270/*! Macro to call in a QM state-handler when when it attempts to
1271* handle an event but a guard condition evaluates to 'false' and there is
1272* no other explicit way of handling the event. Applicable only to
1273* ::QMsm subclasses.
1274*/
1275#define QM_UNHANDLED() ((QState)Q_RET_UNHANDLED)
1276
1277/*${QEP-macros::QM_SUPER} ..................................................*/
1278/*! Macro to call in a QM state-handler when it designates the
1279* superstate to handle an event. Applicable only to QMSMs.
1280*/
1281#define QM_SUPER() ((QState)Q_RET_SUPER)
1282
1283/*${QEP-macros::QM_SUPER_SUB} ..............................................*/
1284/*! Macro to call in a QM submachine-handler when it designates the
1285* host state to handle an event. Applicable only to subclasses of ::QMsm.
1286*
1287* @trace
1288* - @tr{DVP-QP-MC3-R12_03}
1289* - @tr{DVP-QP-MC3-R13_04}
1290*/
1291#define QM_SUPER_SUB(host_) \
1292 ((Q_HSM_UPCAST(me))->temp.obj = (host_), \
1293 (QState)Q_RET_SUPER_SUB)
1294
1295/*${QEP-macros::QM_STATE_NULL} .............................................*/
1296/*! Macro to provide strictly-typed zero-state to use for submachines.
1297*! Applicable to subclasses of ::QMsm.
1298*/
1299#define QM_STATE_NULL ((QMState *)0)
1300/*$enddecl${QEP-macros} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
1301
1302#endif /* QEP_H_ */
QActionHandler const initAction
Definition: qep.h:291
QStateRet
Definition: qep.h:223
@ Q_RET_ENTRY
Definition: qep.h:234
@ Q_RET_HANDLED
Definition: qep.h:230
@ Q_RET_TRAN_XP
Definition: qep.h:247
@ Q_RET_IGNORED
Definition: qep.h:231
@ Q_RET_TRAN_INIT
Definition: qep.h:242
@ Q_RET_TRAN
Definition: qep.h:241
@ Q_RET_UNHANDLED
Definition: qep.h:227
@ Q_RET_SUPER
Definition: qep.h:225
@ Q_RET_NULL
Definition: qep.h:238
@ Q_RET_TRAN_HIST
Definition: qep.h:246
@ Q_RET_SUPER_SUB
Definition: qep.h:226
@ Q_RET_TRAN_EP
Definition: qep.h:243
@ Q_RET_EXIT
Definition: qep.h:235
int_fast8_t QHsm_tran_(QHsm *const me, QStateHandler *const path, uint_fast8_t const qs_id)
QStateHandler const stateHandler
Definition: qep.h:288
QActionHandler const act[1]
Definition: qep.h:298
float float32_t
Definition: qep.h:91
void(* QXThreadHandler)(struct QXThread *const me)
Definition: qep.h:268
char const QP_versionStr[8]
QState(* QStateHandler)(void *const me, QEvt const *const e)
Definition: qep.h:256
enum QStateRet QState
Definition: qep.h:252
QMState const * target
Definition: qep.h:297
QReservedSig
Definition: qep.h:326
@ Q_INIT_SIG
Definition: qep.h:330
@ Q_EMPTY_SIG
Definition: qep.h:327
@ Q_USER_SIG
Definition: qep.h:331
@ Q_EXIT_SIG
Definition: qep.h:329
@ Q_ENTRY_SIG
Definition: qep.h:328
int int_t
Definition: qep.h:75
double float64_t
Definition: qep.h:103
int enum_t
Definition: qep.h:79
QActionHandler const entryAction
Definition: qep.h:289
QState(* QActionHandler)(void *const me)
Definition: qep.h:260
QActionHandler const exitAction
Definition: qep.h:290
uint16_t QSignal
Definition: qep.h:140
struct QMState const * superstate
Definition: qep.h:287
State object for the QMsm class (QM State Machine).
Definition: qep.h:286
Transition-Action Table for the QMsm State Machine.
Definition: qep.h:296
Event class.
Definition: qep.h:171
void QEvt_ctor(QEvt *const me, enum_t const sig)
QSignal sig
Definition: qep.h:180
uint8_t poolId_
Definition: qep.h:190
uint8_t volatile refCtr_
Definition: qep.h:198
Hierarchical State Machine class.
Definition: qep.h:364
struct QHsmVtable const * vptr
Definition: qep.h:373
static QStateHandler QHsm_state(QHsm *const me)
Definition: qep.h:430
union QHsmAttr state
Definition: qep.h:380
Virtual table for the QHsm class.
Definition: qep.h:630
void(* init)(QHsm *const me, void const *const e, uint_fast8_t const qs_id)
Definition: qep.h:632
QStateHandler(* getStateHandler)(QHsm *const me)
Definition: qep.h:641
void(* dispatch)(QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
Definition: qep.h:636
QM state machine implementation strategy.
Definition: qep.h:671
QHsm super
Definition: qep.h:673
eXtended (blocking) thread of the QXK preemptive kernel
Definition: qxk.h:299
Attribute of for the QHsm class (Hierarchical State Machine).
Definition: qep.h:311
QStateHandler fun
Definition: qep.h:312
QActionHandler act
Definition: qep.h:313
struct QMState const * obj
Definition: qep.h:316
uintptr_t uint
Definition: qep.h:318
QMTranActTable const * tatbl
Definition: qep.h:315
QXThreadHandler thr
Definition: qep.h:314