1 | /* |
2 | * File: spring4.h |
3 | * |
4 | * Code generated for Simulink model 'spring4'. |
5 | * |
6 | * Model version : 1.5 |
7 | * Simulink Coder version : 8.10 (R2016a) 10-Feb-2016 |
8 | * C/C++ source code generated on : Sun Jun 05 15:18:00 2016 |
9 | * |
10 | * Target selection: ert.tlc |
11 | * Embedded hardware selection: ARM Compatible->ARM Cortex |
12 | * Emulation hardware selection: |
13 | * Differs from embedded hardware (MATLAB Host) |
14 | * Code generation objectives: |
15 | * 1. Execution efficiency |
16 | * 2. RAM efficiency |
17 | * Validation result: Not run |
18 | */ |
19 | |
20 | #ifndef RTW_HEADER_spring4_h_ |
21 | #define RTW_HEADER_spring4_h_ |
22 | #include <math.h> |
23 | #include <string.h> |
24 | #ifndef spring4_COMMON_INCLUDES_ |
25 | # define spring4_COMMON_INCLUDES_ |
26 | #include "rtwtypes.h" |
27 | #include "rtw_continuous.h" |
28 | #include "rtw_solver.h" |
29 | #endif /* spring4_COMMON_INCLUDES_ */ |
30 | |
31 | /* Macros for accessing real-time model data structure */ |
32 | #ifndef rtmGetErrorStatus |
33 | # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) |
34 | #endif |
35 | |
36 | #ifndef rtmSetErrorStatus |
37 | # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) |
38 | #endif |
39 | |
40 | #ifndef rtmGetStopRequested |
41 | # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) |
42 | #endif |
43 | |
44 | #ifndef rtmSetStopRequested |
45 | # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) |
46 | #endif |
47 | |
48 | #ifndef rtmGetStopRequestedPtr |
49 | # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) |
50 | #endif |
51 | |
52 | #ifndef rtmGetT |
53 | # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0]) |
54 | #endif |
55 | |
56 | /* Forward declaration for rtModel */ |
57 | typedef struct tag_RTM RT_MODEL; |
58 | |
59 | /* Block signals and states (auto storage) for system '<Root>' */ |
60 | typedef struct { |
61 | real_T Sum[2]; /* '<Root>/Sum' */ |
62 | } DW; |
63 | |
64 | /* Continuous states (auto storage) */ |
65 | typedef struct { |
66 | real_T Integrator_CSTATE[2]; /* '<Root>/Integrator' */ |
67 | } X; |
68 | |
69 | /* State derivatives (auto storage) */ |
70 | typedef struct { |
71 | real_T Integrator_CSTATE[2]; /* '<Root>/Integrator' */ |
72 | } XDot; |
73 | |
74 | /* State disabled */ |
75 | typedef struct { |
76 | boolean_T Integrator_CSTATE[2]; /* '<Root>/Integrator' */ |
77 | } XDis; |
78 | |
79 | #ifndef ODE3_INTG |
80 | #define ODE3_INTG |
81 | |
82 | /* ODE3 Integration Data */ |
83 | typedef struct { |
84 | real_T *y; /* output */ |
85 | real_T *f[3]; /* derivatives */ |
86 | } ODE3_IntgData; |
87 | |
88 | #endif |
89 | |
90 | /* Real-time Model Data Structure */ |
91 | struct tag_RTM { |
92 | const char_T *errorStatus; |
93 | RTWSolverInfo solverInfo; |
94 | |
95 | /* |
96 | * ModelData: |
97 | * The following substructure contains information regarding |
98 | * the data used in the model. |
99 | */ |
100 | struct { |
101 | X *contStates; |
102 | int_T *periodicContStateIndices; |
103 | real_T *periodicContStateRanges; |
104 | real_T *derivs; |
105 | boolean_T *contStateDisabled; |
106 | boolean_T zCCacheNeedsReset; |
107 | boolean_T derivCacheNeedsReset; |
108 | boolean_T blkStateChange; |
109 | real_T odeY[2]; |
110 | real_T odeF[3][2]; |
111 | ODE3_IntgData intgData; |
112 | } ModelData; |
113 | |
114 | /* |
115 | * Sizes: |
116 | * The following substructure contains sizes information |
117 | * for many of the model attributes such as inputs, outputs, |
118 | * dwork, sample times, etc. |
119 | */ |
120 | struct { |
121 | int_T numContStates; |
122 | int_T numPeriodicContStates; |
123 | int_T numSampTimes; |
124 | } Sizes; |
125 | |
126 | /* |
127 | * Timing: |
128 | * The following substructure contains information regarding |
129 | * the timing information for the model. |
130 | */ |
131 | struct { |
132 | uint32_T clockTick0; |
133 | time_T stepSize0; |
134 | uint32_T clockTick1; |
135 | SimTimeStep simTimeStep; |
136 | boolean_T stopRequestedFlag; |
137 | time_T *t; |
138 | time_T tArray[2]; |
139 | } Timing; |
140 | }; |
141 | |
142 | /* Continuous states (auto storage) */ |
143 | extern X rtX; |
144 | |
145 | /* Block signals and states (auto storage) */ |
146 | extern DW rtDW; |
147 | |
148 | /* Model entry point functions */ |
149 | extern void spring4_initialize(void); |
150 | extern void spring4_step(void); |
151 | |
152 | /* Real-time Model object */ |
153 | extern RT_MODEL *const rtM; |
154 | |
155 | /*- |
156 | * These blocks were eliminated from the model due to optimizations: |
157 | * |
158 | * Block '<Root>/Scope' : Unused code path elimination |
159 | */ |
160 | |
161 | /*- |
162 | * The generated code includes comments that allow you to trace directly |
163 | * back to the appropriate location in the model. The basic format |
164 | * is <system>/block_name, where system is the system number (uniquely |
165 | * assigned by Simulink) and block_name is the name of the block. |
166 | * |
167 | * Use the MATLAB hilite_system command to trace the generated code back |
168 | * to the model. For example, |
169 | * |
170 | * hilite_system('<S3>') - opens system 3 |
171 | * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 |
172 | * |
173 | * Here is the system hierarchy for this model |
174 | * |
175 | * '<Root>' : 'spring4' |
176 | */ |
177 | #endif /* RTW_HEADER_spring4_h_ */ |
178 | |
179 | /* |
180 | * File trailer for generated code. |
181 | * |
182 | * [EOF] |
183 | */ |
184 |