B+IMU+SD

Dependencies:   BMI160 RTC SDFileSystem USBDevice max32630fthr

Fork of MPSMAXbutton by Faizan Ahmad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DefaultRequired.h Source File

DefaultRequired.h

00001 
00002 #ifndef DEFAULTREQUIRED_H_
00003 #define DEFAULTREQUIRED_H_
00004 
00005 #include "sc_types.h"
00006 #include "Default.h"
00007 
00008 #ifdef __cplusplus
00009 extern "C"
00010 {
00011 #endif 
00012 
00013 /*! \file This header defines prototypes for all functions that are required by the state machine implementation.
00014 
00015 This is a state machine uses time events which require access to a timing service. Thus the function prototypes:
00016     - default_setTimer and
00017     - default_unsetTimer
00018 are defined.
00019 
00020 This state machine makes use of operations declared in the state machines interface or internal scopes. Thus the function prototypes:
00021     - defaultIface_menu
00022     - defaultIface_function
00023     - defaultIface_execute
00024     - defaultIfaceFunc_ready
00025     - defaultIfaceFunc_active
00026     - defaultIfaceFunc_alarm
00027     - defaultIfaceFunc_moveDownAct
00028     - defaultIfaceFunc_moveUpAct
00029     - defaultIfaceFunc_return
00030 are defined.
00031 
00032 These functions will be called during a 'run to completion step' (runCycle) of the statechart. 
00033 There are some constraints that have to be considered for the implementation of these functions:
00034     - never call the statechart API functions from within these functions.
00035     - make sure that the execution time is as short as possible.
00036  
00037 */
00038 extern void defaultIface_menu(const Default * handle, const sc_integer select1);
00039 extern void defaultIface_function(const Default * handle, const sc_integer select2);
00040 extern void defaultIface_execute(const Default * handle);
00041 
00042 extern void defaultIfaceFunc_ready(const Default * handle);
00043 extern void defaultIfaceFunc_active(const Default * handle);
00044 extern void defaultIfaceFunc_alarm(const Default * handle);
00045 extern void defaultIfaceFunc_moveDownAct(const Default * handle);
00046 extern void defaultIfaceFunc_moveUpAct(const Default * handle);
00047 extern void defaultIfaceFunc_return(const Default * handle);
00048 
00049 
00050 /*!
00051  * This is a timed state machine that requires timer services
00052  */ 
00053 
00054 /*! This function has to set up timers for the time events that are required by the state machine. */
00055 /*! 
00056     This function will be called for each time event that is relevant for a state when a state will be entered.
00057     \param evid An unique identifier of the event.
00058     \time_ms The time in milli seconds
00059     \periodic Indicates the the time event must be raised periodically until the timer is unset 
00060 */
00061 extern void default_setTimer(Default * handle, const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic);
00062 
00063 /*! This function has to unset timers for the time events that are required by the state machine. */
00064 /*! 
00065     This function will be called for each time event taht is relevant for a state when a state will be left.
00066     \param evid An unique identifier of the event.
00067 */
00068 extern void default_unsetTimer(Default * handle, const sc_eventid evid);
00069 
00070 
00071 
00072 #ifdef __cplusplus
00073 }
00074 #endif 
00075 
00076 #endif /* DEFAULTREQUIRED_H_ */
00077