TimedTransitionsRequired.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef TIMEDTRANSITIONSREQUIRED_H_
  2. #define TIMEDTRANSITIONSREQUIRED_H_
  3. #include "sc_types.h"
  4. #include "TimedTransitions.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. - timedTransitions_setTimer and
  12. - timedTransitions_unsetTimer
  13. are defined.
  14. These functions will be called during a 'run to completion step' (runCycle) of the statechart.
  15. There are some constraints that have to be considered for the implementation of these functions:
  16. - never call the statechart API functions from within these functions.
  17. - make sure that the execution time is as short as possible.
  18. */
  19. /*!
  20. * This is a timed state machine that requires timer services
  21. */
  22. /*! This function has to set up timers for the time events that are required by the state machine. */
  23. /*!
  24. This function will be called for each time event that is relevant for a state when a state will be entered.
  25. \param evid An unique identifier of the event.
  26. \time_ms The time in milli seconds
  27. \periodic Indicates the the time event must be raised periodically until the timer is unset
  28. */
  29. extern void timedTransitions_setTimer(TimedTransitions* handle, const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic);
  30. /*! This function has to unset timers for the time events that are required by the state machine. */
  31. /*!
  32. This function will be called for each time event taht is relevant for a state when a state will be left.
  33. \param evid An unique identifier of the event.
  34. */
  35. extern void timedTransitions_unsetTimer(TimedTransitions* handle, const sc_eventid evid);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* TIMEDTRANSITIONSREQUIRED_H_ */