B+IMU+SD
Dependencies: BMI160 RTC SDFileSystem USBDevice max32630fthr
Fork of MPSMAXbutton by
src/DefaultRequired.h@0:769c5a7b3939, 2018-05-07 (annotated)
- Committer:
- FaizanAhmad
- Date:
- Mon May 07 21:28:03 2018 +0000
- Revision:
- 0:769c5a7b3939
button map
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FaizanAhmad | 0:769c5a7b3939 | 1 | |
FaizanAhmad | 0:769c5a7b3939 | 2 | #ifndef DEFAULTREQUIRED_H_ |
FaizanAhmad | 0:769c5a7b3939 | 3 | #define DEFAULTREQUIRED_H_ |
FaizanAhmad | 0:769c5a7b3939 | 4 | |
FaizanAhmad | 0:769c5a7b3939 | 5 | #include "sc_types.h" |
FaizanAhmad | 0:769c5a7b3939 | 6 | #include "Default.h" |
FaizanAhmad | 0:769c5a7b3939 | 7 | |
FaizanAhmad | 0:769c5a7b3939 | 8 | #ifdef __cplusplus |
FaizanAhmad | 0:769c5a7b3939 | 9 | extern "C" |
FaizanAhmad | 0:769c5a7b3939 | 10 | { |
FaizanAhmad | 0:769c5a7b3939 | 11 | #endif |
FaizanAhmad | 0:769c5a7b3939 | 12 | |
FaizanAhmad | 0:769c5a7b3939 | 13 | /*! \file This header defines prototypes for all functions that are required by the state machine implementation. |
FaizanAhmad | 0:769c5a7b3939 | 14 | |
FaizanAhmad | 0:769c5a7b3939 | 15 | This is a state machine uses time events which require access to a timing service. Thus the function prototypes: |
FaizanAhmad | 0:769c5a7b3939 | 16 | - default_setTimer and |
FaizanAhmad | 0:769c5a7b3939 | 17 | - default_unsetTimer |
FaizanAhmad | 0:769c5a7b3939 | 18 | are defined. |
FaizanAhmad | 0:769c5a7b3939 | 19 | |
FaizanAhmad | 0:769c5a7b3939 | 20 | This state machine makes use of operations declared in the state machines interface or internal scopes. Thus the function prototypes: |
FaizanAhmad | 0:769c5a7b3939 | 21 | - defaultIface_menu |
FaizanAhmad | 0:769c5a7b3939 | 22 | - defaultIface_function |
FaizanAhmad | 0:769c5a7b3939 | 23 | - defaultIface_execute |
FaizanAhmad | 0:769c5a7b3939 | 24 | - defaultIfaceFunc_ready |
FaizanAhmad | 0:769c5a7b3939 | 25 | - defaultIfaceFunc_active |
FaizanAhmad | 0:769c5a7b3939 | 26 | - defaultIfaceFunc_alarm |
FaizanAhmad | 0:769c5a7b3939 | 27 | - defaultIfaceFunc_moveDownAct |
FaizanAhmad | 0:769c5a7b3939 | 28 | - defaultIfaceFunc_moveUpAct |
FaizanAhmad | 0:769c5a7b3939 | 29 | - defaultIfaceFunc_return |
FaizanAhmad | 0:769c5a7b3939 | 30 | are defined. |
FaizanAhmad | 0:769c5a7b3939 | 31 | |
FaizanAhmad | 0:769c5a7b3939 | 32 | These functions will be called during a 'run to completion step' (runCycle) of the statechart. |
FaizanAhmad | 0:769c5a7b3939 | 33 | There are some constraints that have to be considered for the implementation of these functions: |
FaizanAhmad | 0:769c5a7b3939 | 34 | - never call the statechart API functions from within these functions. |
FaizanAhmad | 0:769c5a7b3939 | 35 | - make sure that the execution time is as short as possible. |
FaizanAhmad | 0:769c5a7b3939 | 36 | |
FaizanAhmad | 0:769c5a7b3939 | 37 | */ |
FaizanAhmad | 0:769c5a7b3939 | 38 | extern void defaultIface_menu(const Default* handle, const sc_integer select1); |
FaizanAhmad | 0:769c5a7b3939 | 39 | extern void defaultIface_function(const Default* handle, const sc_integer select2); |
FaizanAhmad | 0:769c5a7b3939 | 40 | extern void defaultIface_execute(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 41 | |
FaizanAhmad | 0:769c5a7b3939 | 42 | extern void defaultIfaceFunc_ready(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 43 | extern void defaultIfaceFunc_active(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 44 | extern void defaultIfaceFunc_alarm(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 45 | extern void defaultIfaceFunc_moveDownAct(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 46 | extern void defaultIfaceFunc_moveUpAct(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 47 | extern void defaultIfaceFunc_return(const Default* handle); |
FaizanAhmad | 0:769c5a7b3939 | 48 | |
FaizanAhmad | 0:769c5a7b3939 | 49 | |
FaizanAhmad | 0:769c5a7b3939 | 50 | /*! |
FaizanAhmad | 0:769c5a7b3939 | 51 | * This is a timed state machine that requires timer services |
FaizanAhmad | 0:769c5a7b3939 | 52 | */ |
FaizanAhmad | 0:769c5a7b3939 | 53 | |
FaizanAhmad | 0:769c5a7b3939 | 54 | /*! This function has to set up timers for the time events that are required by the state machine. */ |
FaizanAhmad | 0:769c5a7b3939 | 55 | /*! |
FaizanAhmad | 0:769c5a7b3939 | 56 | This function will be called for each time event that is relevant for a state when a state will be entered. |
FaizanAhmad | 0:769c5a7b3939 | 57 | \param evid An unique identifier of the event. |
FaizanAhmad | 0:769c5a7b3939 | 58 | \time_ms The time in milli seconds |
FaizanAhmad | 0:769c5a7b3939 | 59 | \periodic Indicates the the time event must be raised periodically until the timer is unset |
FaizanAhmad | 0:769c5a7b3939 | 60 | */ |
FaizanAhmad | 0:769c5a7b3939 | 61 | extern void default_setTimer(Default* handle, const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic); |
FaizanAhmad | 0:769c5a7b3939 | 62 | |
FaizanAhmad | 0:769c5a7b3939 | 63 | /*! This function has to unset timers for the time events that are required by the state machine. */ |
FaizanAhmad | 0:769c5a7b3939 | 64 | /*! |
FaizanAhmad | 0:769c5a7b3939 | 65 | This function will be called for each time event taht is relevant for a state when a state will be left. |
FaizanAhmad | 0:769c5a7b3939 | 66 | \param evid An unique identifier of the event. |
FaizanAhmad | 0:769c5a7b3939 | 67 | */ |
FaizanAhmad | 0:769c5a7b3939 | 68 | extern void default_unsetTimer(Default* handle, const sc_eventid evid); |
FaizanAhmad | 0:769c5a7b3939 | 69 | |
FaizanAhmad | 0:769c5a7b3939 | 70 | |
FaizanAhmad | 0:769c5a7b3939 | 71 | |
FaizanAhmad | 0:769c5a7b3939 | 72 | #ifdef __cplusplus |
FaizanAhmad | 0:769c5a7b3939 | 73 | } |
FaizanAhmad | 0:769c5a7b3939 | 74 | #endif |
FaizanAhmad | 0:769c5a7b3939 | 75 | |
FaizanAhmad | 0:769c5a7b3939 | 76 | #endif /* DEFAULTREQUIRED_H_ */ |
FaizanAhmad | 0:769c5a7b3939 | 77 |