TrafficLightCtrlRequired.h 2.1 KB

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