TriggerGuardExpressions.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef TRIGGERGUARDEXPRESSIONS_H_
  2. #define TRIGGERGUARDEXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'TriggerGuardExpressions'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. TriggerGuardExpressions_main_region_A,
  13. TriggerGuardExpressions_main_region_B,
  14. TriggerGuardExpressions_last_state
  15. } TriggerGuardExpressionsStates;
  16. /*! Type definition of the data structure for the TriggerGuardExpressionsIface interface scope. */
  17. typedef struct
  18. {
  19. sc_boolean e1_raised;
  20. sc_boolean e2_raised;
  21. sc_boolean b;
  22. } TriggerGuardExpressionsIface;
  23. /*! Define dimension of the state configuration vector for orthogonal states. */
  24. #define TRIGGERGUARDEXPRESSIONS_MAX_ORTHOGONAL_STATES 1
  25. /*!
  26. * Type definition of the data structure for the TriggerGuardExpressions state machine.
  27. * This data structure has to be allocated by the client code.
  28. */
  29. typedef struct
  30. {
  31. TriggerGuardExpressionsStates stateConfVector[TRIGGERGUARDEXPRESSIONS_MAX_ORTHOGONAL_STATES];
  32. sc_ushort stateConfVectorPosition;
  33. TriggerGuardExpressionsIface iface;
  34. } TriggerGuardExpressions;
  35. /*! Initializes the TriggerGuardExpressions state machine data structures. Must be called before first usage.*/
  36. extern void triggerGuardExpressions_init(TriggerGuardExpressions* handle);
  37. /*! Activates the state machine */
  38. extern void triggerGuardExpressions_enter(TriggerGuardExpressions* handle);
  39. /*! Deactivates the state machine */
  40. extern void triggerGuardExpressions_exit(TriggerGuardExpressions* handle);
  41. /*! Performs a 'run to completion' step. */
  42. extern void triggerGuardExpressions_runCycle(TriggerGuardExpressions* handle);
  43. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  44. extern void triggerGuardExpressionsIface_raise_e1(TriggerGuardExpressions* handle);
  45. /*! Raises the in event 'e2' that is defined in the default interface scope. */
  46. extern void triggerGuardExpressionsIface_raise_e2(TriggerGuardExpressions* handle);
  47. /*! Gets the value of the variable 'b' that is defined in the default interface scope. */
  48. extern sc_boolean triggerGuardExpressionsIface_get_b(const TriggerGuardExpressions* handle);
  49. /*! Sets the value of the variable 'b' that is defined in the default interface scope. */
  50. extern void triggerGuardExpressionsIface_set_b(TriggerGuardExpressions* handle, sc_boolean value);
  51. /*!
  52. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  53. * A state machine is active if it was entered. It is inactive if it has not been entered at all or if it has been exited.
  54. */
  55. extern sc_boolean triggerGuardExpressions_isActive(const TriggerGuardExpressions* handle);
  56. /*!
  57. * Checks if all active states are final.
  58. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  59. */
  60. extern sc_boolean triggerGuardExpressions_isFinal(const TriggerGuardExpressions* handle);
  61. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  62. extern sc_boolean triggerGuardExpressions_isStateActive(const TriggerGuardExpressions* handle, TriggerGuardExpressionsStates state);
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* TRIGGERGUARDEXPRESSIONS_H_ */