AlwaysOncycle.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef ALWAYSONCYCLE_H_
  2. #define ALWAYSONCYCLE_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'AlwaysOncycle'.
  8. */
  9. //! enumeration of all states
  10. typedef enum {
  11. AlwaysOncycle_main_region_StateA ,
  12. AlwaysOncycle_main_region_StateB ,
  13. AlwaysOncycle_last_state
  14. } AlwaysOncycleStates;
  15. //! Type definition of the data structure for the AlwaysOncycleIface interface scope.
  16. typedef struct {
  17. sc_integer value;
  18. } AlwaysOncycleIface;
  19. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  20. #define ALWAYSONCYCLE_MAX_ORTHOGONAL_STATES 1
  21. /*! Type definition of the data structure for the AlwaysOncycle state machine.
  22. This data structure has to be allocated by the client code. */
  23. typedef struct {
  24. AlwaysOncycleStates stateConfVector[ALWAYSONCYCLE_MAX_ORTHOGONAL_STATES];
  25. sc_ushort stateConfVectorPosition;
  26. AlwaysOncycleIface iface;
  27. } AlwaysOncycle;
  28. /*! Initializes the AlwaysOncycle state machine data structures. Must be called before first usage.*/
  29. extern void alwaysOncycle_init(AlwaysOncycle* handle);
  30. /*! Activates the state machine */
  31. extern void alwaysOncycle_enter(AlwaysOncycle* handle);
  32. /*! Deactivates the state machine */
  33. extern void alwaysOncycle_exit(AlwaysOncycle* handle);
  34. /*! Performs a 'run to completion' step. */
  35. extern void alwaysOncycle_runCycle(AlwaysOncycle* handle);
  36. /*! Gets the value of the variable 'value' that is defined in the default interface scope. */
  37. extern sc_integer alwaysOncycleIface_get_value(AlwaysOncycle* handle);
  38. /*! Sets the value of the variable 'value' that is defined in the default interface scope. */
  39. extern void alwaysOncycleIface_set_value(AlwaysOncycle* handle, sc_integer value);
  40. /*! Checks if the specified state is active. */
  41. extern sc_boolean alwaysOncycle_isActive(AlwaysOncycle* handle, AlwaysOncycleStates state);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif /* ALWAYSONCYCLE_H_ */