StatechartKeywordsRequired.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef STATECHARTKEYWORDSREQUIRED_H_
  2. #define STATECHARTKEYWORDSREQUIRED_H_
  3. #include "sc_types.h"
  4. #include "StatechartKeywords.h"
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. /*! \file This header defines prototypes for all functions that are required by the state machine implementation.
  10. This is a state machine uses time events which require access to a timing service. Thus the function prototypes:
  11. - statechartKeywords_setTimer and
  12. - statechartKeywords_unsetTimer
  13. are defined.
  14. This state machine makes use of operations declared in the state machines interface or internal scopes. Thus the function prototypes:
  15. - statechartKeywordsIfaceIf_myOperation
  16. - statechartKeywordsInternal_myOperation
  17. are defined.
  18. These functions will be called during a 'run to completion step' (runCycle) of the statechart.
  19. There are some constraints that have to be considered for the implementation of these functions:
  20. - never call the statechart API functions from within these functions.
  21. - make sure that the execution time is as short as possible.
  22. */
  23. extern void statechartKeywordsIfaceIf_myOperation(const StatechartKeywords* handle);
  24. extern void statechartKeywordsInternal_myOperation(const StatechartKeywords* handle);
  25. /*!
  26. * This is a timed state machine that requires timer services
  27. */
  28. /*! This function has to set up timers for the time events that are required by the state machine. */
  29. /*!
  30. This function will be called for each time event that is relevant for a state when a state will be entered.
  31. \param evid An unique identifier of the event.
  32. \time_ms The time in milli seconds
  33. \periodic Indicates the the time event must be raised periodically until the timer is unset
  34. */
  35. extern void statechartKeywords_setTimer(StatechartKeywords* handle, const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic);
  36. /*! This function has to unset timers for the time events that are required by the state machine. */
  37. /*!
  38. This function will be called for each time event taht is relevant for a state when a state will be left.
  39. \param evid An unique identifier of the event.
  40. */
  41. extern void statechartKeywords_unsetTimer(StatechartKeywords* handle, const sc_eventid evid);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif /* STATECHARTKEYWORDSREQUIRED_H_ */