1 | /* |
2 | * Academic License - for use in teaching, academic research, and meeting |
3 | * course requirements at degree granting institutions only. Not for |
4 | * government, commercial, or other organizational use. |
5 | * |
6 | * File: integ_accel.h |
7 | * |
8 | * Code generated for Simulink model 'integ_accel'. |
9 | * |
10 | * Model version : 1.6 |
11 | * Simulink Coder version : 8.12 (R2017a) 16-Feb-2017 |
12 | * C/C++ source code generated on : Tue Dec 05 15:11:10 2017 |
13 | * |
14 | * Target selection: ert.tlc |
15 | * Embedded hardware selection: ARM Compatible->ARM Cortex |
16 | * Code generation objectives: Unspecified |
17 | * Validation result: Not run |
18 | */ |
19 | |
20 | #ifndef RTW_HEADER_integ_accel_h_ |
21 | #define RTW_HEADER_integ_accel_h_ |
22 | #include <string.h> |
23 | #include <float.h> |
24 | #include <stddef.h> |
25 | #ifndef integ_accel_COMMON_INCLUDES_ |
26 | # define integ_accel_COMMON_INCLUDES_ |
27 | #include <stddef.h> |
28 | #include "rtwtypes.h" |
29 | #include "rtw_extmode.h" |
30 | #include "sysran_types.h" |
31 | #include "rtw_continuous.h" |
32 | #include "rtw_solver.h" |
33 | #include "dt_info.h" |
34 | #include "ext_work.h" |
35 | #include "MW_I2C.h" |
36 | #endif /* integ_accel_COMMON_INCLUDES_ */ |
37 | |
38 | #include "integ_accel_types.h" |
39 | |
40 | /* Shared type includes */ |
41 | #include "multiword_types.h" |
42 | |
43 | /* Macros for accessing real-time model data structure */ |
44 | #ifndef rtmGetFinalTime |
45 | # define rtmGetFinalTime(rtm) ((rtm)->Timing.tFinal) |
46 | #endif |
47 | |
48 | #ifndef rtmGetRTWExtModeInfo |
49 | # define rtmGetRTWExtModeInfo(rtm) ((rtm)->extModeInfo) |
50 | #endif |
51 | |
52 | #ifndef rtmGetErrorStatus |
53 | # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) |
54 | #endif |
55 | |
56 | #ifndef rtmSetErrorStatus |
57 | # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) |
58 | #endif |
59 | |
60 | #ifndef rtmGetStopRequested |
61 | # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) |
62 | #endif |
63 | |
64 | #ifndef rtmSetStopRequested |
65 | # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) |
66 | #endif |
67 | |
68 | #ifndef rtmGetStopRequestedPtr |
69 | # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) |
70 | #endif |
71 | |
72 | #ifndef rtmGetT |
73 | # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0]) |
74 | #endif |
75 | |
76 | #ifndef rtmGetTFinal |
77 | # define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal) |
78 | #endif |
79 | |
80 | /* Block signals (auto storage) */ |
81 | typedef struct { |
82 | real_T dv0[16]; |
83 | real_T dv1[16]; |
84 | real_T y[8]; /* '<S12>/Forward Substitution' */ |
85 | real_T BackwardSubstitution[8]; /* '<S12>/Backward Substitution' */ |
86 | real_T dv2[8]; |
87 | real_T LDLFactorization[4]; /* '<S12>/LDL Factorization' */ |
88 | real_T ZHX_prd[2]; /* '<S7>/Z-H*X_prd' */ |
89 | uint32_T i2cname; |
90 | real_T DiscreteTimeIntegrator6; /* '<S2>/Discrete-Time Integrator6' */ |
91 | real_T DiscreteTimeIntegrator7; /* '<S2>/Discrete-Time Integrator7' */ |
92 | real_T DiscreteTimeIntegrator2; /* '<S2>/Discrete-Time Integrator2' */ |
93 | real_T DiscreteTimeIntegrator3; /* '<S2>/Discrete-Time Integrator3' */ |
94 | real_T P_prd_Reshape[16]; /* '<S7>/P_prd_Reshape' */ |
95 | real_T Assignment[16]; /* '<S8>/Assignment' */ |
96 | real_T Assignment_o[4]; /* '<S9>/Assignment' */ |
97 | real_T Assignment_c[4]; /* '<S10>/Assignment' */ |
98 | real_T FXOS87006AxesSensor[3]; /* '<Root>/FXOS8700 6-Axes Sensor' */ |
99 | real_T currentTime; |
100 | real_T DiscreteTimeIntegrator1; /* '<S2>/Discrete-Time Integrator1' */ |
101 | real_T DiscreteTimeIntegrator; /* '<S2>/Discrete-Time Integrator' */ |
102 | real_T DiscreteTimeIntegrator5; /* '<S2>/Discrete-Time Integrator5' */ |
103 | real_T DiscreteTimeIntegrator4; /* '<S2>/Discrete-Time Integrator4' */ |
104 | real_T mYTmp; |
105 | real_T mYTmpR; |
106 | } B_integ_accel_T; |
107 | |
108 | /* Block states (auto storage) for system '<Root>' */ |
109 | typedef struct { |
110 | freedomk64f_fxos8700_integ_ac_T obj; /* '<Root>/FXOS8700 6-Axes Sensor' */ |
111 | real_T UnitDelay2_DSTATE[4]; /* '<S3>/Unit Delay2' */ |
112 | real_T UnitDelay3_DSTATE[16]; /* '<S3>/Unit Delay3' */ |
113 | real_T DiscreteTimeIntegrator4_DSTATE;/* '<S2>/Discrete-Time Integrator4' */ |
114 | real_T DiscreteTimeIntegrator6_DSTATE;/* '<S2>/Discrete-Time Integrator6' */ |
115 | real_T DiscreteTimeIntegrator5_DSTATE;/* '<S2>/Discrete-Time Integrator5' */ |
116 | real_T DiscreteTimeIntegrator7_DSTATE;/* '<S2>/Discrete-Time Integrator7' */ |
117 | real_T DiscreteTimeIntegrator_DSTATE;/* '<S2>/Discrete-Time Integrator' */ |
118 | real_T DiscreteTimeIntegrator2_DSTATE;/* '<S2>/Discrete-Time Integrator2' */ |
119 | real_T DiscreteTimeIntegrator1_DSTATE;/* '<S2>/Discrete-Time Integrator1' */ |
120 | real_T DiscreteTimeIntegrator3_DSTATE;/* '<S2>/Discrete-Time Integrator3' */ |
121 | real_T LDLFactorization_VMX[2]; /* '<S12>/LDL Factorization' */ |
122 | struct { |
123 | void *LoggedData[3]; |
124 | } Scope_PWORK; /* '<Root>/Scope' */ |
125 | |
126 | struct { |
127 | void *LoggedData; |
128 | } Scope1_PWORK; /* '<Root>/Scope1' */ |
129 | |
130 | struct { |
131 | void *LoggedData[2]; |
132 | } filtered_PWORK; /* '<Root>/filtered' */ |
133 | |
134 | struct { |
135 | void *LoggedData[2]; |
136 | } measured_PWORK; /* '<Root>/measured' */ |
137 | |
138 | void *FXOS87006AxesSensor_PWORK; /* '<Root>/FXOS8700 6-Axes Sensor' */ |
139 | int8_T Subsystem1_SubsysRanBC; /* '<Root>/Subsystem1' */ |
140 | boolean_T LDLFactorization_STATE; /* '<S12>/LDL Factorization' */ |
141 | boolean_T Subsystem1_MODE; /* '<Root>/Subsystem1' */ |
142 | } DW_integ_accel_T; |
143 | |
144 | /* Parameters (auto storage) */ |
145 | struct P_integ_accel_T_ { |
146 | real_T FXOS87006AxesSensor_SampleTime;/* Expression: -1 |
147 | * Referenced by: '<Root>/FXOS8700 6-Axes Sensor' |
148 | */ |
149 | real_T Z_est_Y0; /* Computed Parameter: Z_est_Y0 |
150 | * Referenced by: '<S5>/Z_est' |
151 | */ |
152 | real_T X_est_Y0; /* Computed Parameter: X_est_Y0 |
153 | * Referenced by: '<S5>/X_est' |
154 | */ |
155 | real_T X_prd_Y0; /* Computed Parameter: X_prd_Y0 |
156 | * Referenced by: '<S5>/X_prd' |
157 | */ |
158 | real_T P_prd_Y0; /* Computed Parameter: P_prd_Y0 |
159 | * Referenced by: '<S5>/P_prd' |
160 | */ |
161 | real_T Constant3_Value[16]; /* Expression: param.A |
162 | * Referenced by: '<S7>/Constant3' |
163 | */ |
164 | real_T Hcst_Value[8]; /* Expression: param.H |
165 | * Referenced by: '<S7>/Hcst' |
166 | */ |
167 | real_T Hcst_t_Value[8]; /* Expression: param.Ht |
168 | * Referenced by: '<S7>/Hcst_t' |
169 | */ |
170 | real_T Constant2_Value[4]; /* Expression: param.R |
171 | * Referenced by: '<S7>/Constant2' |
172 | */ |
173 | real_T Constant4_Value[16]; /* Expression: param.At |
174 | * Referenced by: '<S7>/Constant4' |
175 | */ |
176 | real_T Constant5_Value[16]; /* Expression: param.Q |
177 | * Referenced by: '<S7>/Constant5' |
178 | */ |
179 | real_T x_filter_Y0; /* Computed Parameter: x_filter_Y0 |
180 | * Referenced by: '<S2>/x_filter' |
181 | */ |
182 | real_T y_filter_Y0; /* Computed Parameter: y_filter_Y0 |
183 | * Referenced by: '<S2>/y_filter' |
184 | */ |
185 | real_T x_meas_Y0; /* Computed Parameter: x_meas_Y0 |
186 | * Referenced by: '<S2>/x_meas' |
187 | */ |
188 | real_T y_meas_Y0; /* Computed Parameter: y_meas_Y0 |
189 | * Referenced by: '<S2>/y_meas' |
190 | */ |
191 | real_T DiscreteTimeIntegrator4_gainval;/* Computed Parameter: DiscreteTimeIntegrator4_gainval |
192 | * Referenced by: '<S2>/Discrete-Time Integrator4' |
193 | */ |
194 | real_T DiscreteTimeIntegrator4_IC; /* Expression: 0 |
195 | * Referenced by: '<S2>/Discrete-Time Integrator4' |
196 | */ |
197 | real_T DiscreteTimeIntegrator6_gainval;/* Computed Parameter: DiscreteTimeIntegrator6_gainval |
198 | * Referenced by: '<S2>/Discrete-Time Integrator6' |
199 | */ |
200 | real_T DiscreteTimeIntegrator6_IC; /* Expression: 0 |
201 | * Referenced by: '<S2>/Discrete-Time Integrator6' |
202 | */ |
203 | real_T DiscreteTimeIntegrator5_gainval;/* Computed Parameter: DiscreteTimeIntegrator5_gainval |
204 | * Referenced by: '<S2>/Discrete-Time Integrator5' |
205 | */ |
206 | real_T DiscreteTimeIntegrator5_IC; /* Expression: 0 |
207 | * Referenced by: '<S2>/Discrete-Time Integrator5' |
208 | */ |
209 | real_T DiscreteTimeIntegrator7_gainval;/* Computed Parameter: DiscreteTimeIntegrator7_gainval |
210 | * Referenced by: '<S2>/Discrete-Time Integrator7' |
211 | */ |
212 | real_T DiscreteTimeIntegrator7_IC; /* Expression: 0 |
213 | * Referenced by: '<S2>/Discrete-Time Integrator7' |
214 | */ |
215 | real_T DiscreteTimeIntegrator_gainval;/* Computed Parameter: DiscreteTimeIntegrator_gainval |
216 | * Referenced by: '<S2>/Discrete-Time Integrator' |
217 | */ |
218 | real_T DiscreteTimeIntegrator_IC; /* Expression: 0 |
219 | * Referenced by: '<S2>/Discrete-Time Integrator' |
220 | */ |
221 | real_T DiscreteTimeIntegrator2_gainval;/* Computed Parameter: DiscreteTimeIntegrator2_gainval |
222 | * Referenced by: '<S2>/Discrete-Time Integrator2' |
223 | */ |
224 | real_T DiscreteTimeIntegrator2_IC; /* Expression: 0 |
225 | * Referenced by: '<S2>/Discrete-Time Integrator2' |
226 | */ |
227 | real_T DiscreteTimeIntegrator1_gainval;/* Computed Parameter: DiscreteTimeIntegrator1_gainval |
228 | * Referenced by: '<S2>/Discrete-Time Integrator1' |
229 | */ |
230 | real_T DiscreteTimeIntegrator1_IC; /* Expression: 0 |
231 | * Referenced by: '<S2>/Discrete-Time Integrator1' |
232 | */ |
233 | real_T DiscreteTimeIntegrator3_gainval;/* Computed Parameter: DiscreteTimeIntegrator3_gainval |
234 | * Referenced by: '<S2>/Discrete-Time Integrator3' |
235 | */ |
236 | real_T DiscreteTimeIntegrator3_IC; /* Expression: 0 |
237 | * Referenced by: '<S2>/Discrete-Time Integrator3' |
238 | */ |
239 | real_T UnitDelay2_InitialCondition[4];/* Expression: param.XAll |
240 | * Referenced by: '<S3>/Unit Delay2' |
241 | */ |
242 | real_T UnitDelay3_InitialCondition[16];/* Expression: param.PAll |
243 | * Referenced by: '<S3>/Unit Delay3' |
244 | */ |
245 | real_T Step_Time; /* Expression: 10 |
246 | * Referenced by: '<Root>/Step' |
247 | */ |
248 | real_T Step_Y0; /* Expression: 0 |
249 | * Referenced by: '<Root>/Step' |
250 | */ |
251 | real_T Step_YFinal; /* Expression: 1 |
252 | * Referenced by: '<Root>/Step' |
253 | */ |
254 | int32_T Iterator_IterationLimit; /* Computed Parameter: Iterator_IterationLimit |
255 | * Referenced by: '<S5>/Iterator' |
256 | */ |
257 | }; |
258 | |
259 | /* Real-time Model Data Structure */ |
260 | struct tag_RTM_integ_accel_T { |
261 | const char_T *errorStatus; |
262 | RTWExtModeInfo *extModeInfo; |
263 | RTWSolverInfo solverInfo; |
264 | |
265 | /* |
266 | * Sizes: |
267 | * The following substructure contains sizes information |
268 | * for many of the model attributes such as inputs, outputs, |
269 | * dwork, sample times, etc. |
270 | */ |
271 | struct { |
272 | uint32_T checksums[4]; |
273 | } Sizes; |
274 | |
275 | /* |
276 | * SpecialInfo: |
277 | * The following substructure contains special information |
278 | * related to other components that are dependent on RTW. |
279 | */ |
280 | struct { |
281 | const void *mappingInfo; |
282 | } SpecialInfo; |
283 | |
284 | /* |
285 | * Timing: |
286 | * The following substructure contains information regarding |
287 | * the timing information for the model. |
288 | */ |
289 | struct { |
290 | uint32_T clockTick0; |
291 | time_T stepSize0; |
292 | uint32_T clockTick1; |
293 | uint32_T clockTick2; |
294 | struct { |
295 | uint16_T TID[3]; |
296 | } TaskCounters; |
297 | |
298 | time_T tFinal; |
299 | SimTimeStep simTimeStep; |
300 | boolean_T stopRequestedFlag; |
301 | time_T *t; |
302 | time_T tArray[3]; |
303 | } Timing; |
304 | }; |
305 | |
306 | /* Block parameters (auto storage) */ |
307 | extern P_integ_accel_T integ_accel_P; |
308 | |
309 | /* Block signals (auto storage) */ |
310 | extern B_integ_accel_T integ_accel_B; |
311 | |
312 | /* Block states (auto storage) */ |
313 | extern DW_integ_accel_T integ_accel_DW; |
314 | |
315 | /* Model entry point functions */ |
316 | extern void integ_accel_initialize(void); |
317 | extern void integ_accel_step(void); |
318 | extern void integ_accel_terminate(void); |
319 | |
320 | /* Real-time Model object */ |
321 | extern RT_MODEL_integ_accel_T *const integ_accel_M; |
322 | |
323 | /*- |
324 | * These blocks were eliminated from the model due to optimizations: |
325 | * |
326 | * Block '<S4>/Check Signal Attributes' : Unused code path elimination |
327 | * Block '<S13>/Check Signal Attributes' : Unused code path elimination |
328 | * Block '<S14>/Check Signal Attributes' : Unused code path elimination |
329 | * Block '<S15>/Check Signal Attributes' : Unused code path elimination |
330 | * Block '<S7>/Z_est_Multiply' : Unused code path elimination |
331 | * Block '<S11>/Assignment' : Unused code path elimination |
332 | * Block '<S1>/Sum' : Unused code path elimination |
333 | * Block '<S7>/P_Reshape' : Reshape block reduction |
334 | * Block '<S1>/Zero-Order Hold' : Eliminated since input and output rates are identical |
335 | */ |
336 | |
337 | /*- |
338 | * The generated code includes comments that allow you to trace directly |
339 | * back to the appropriate location in the model. The basic format |
340 | * is <system>/block_name, where system is the system number (uniquely |
341 | * assigned by Simulink) and block_name is the name of the block. |
342 | * |
343 | * Use the MATLAB hilite_system command to trace the generated code back |
344 | * to the model. For example, |
345 | * |
346 | * hilite_system('<S3>') - opens system 3 |
347 | * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 |
348 | * |
349 | * Here is the system hierarchy for this model |
350 | * |
351 | * '<Root>' : 'integ_accel' |
352 | * '<S1>' : 'integ_accel/KF1' |
353 | * '<S2>' : 'integ_accel/Subsystem1' |
354 | * '<S3>' : 'integ_accel/KF1/Kalman Filter1' |
355 | * '<S4>' : 'integ_accel/KF1/Kalman Filter1/Check Signal Attributes' |
356 | * '<S5>' : 'integ_accel/KF1/Kalman Filter1/Control' |
357 | * '<S6>' : 'integ_accel/KF1/Kalman Filter1/Control/Options' |
358 | * '<S7>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Core' |
359 | * '<S8>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/P_prd_Assign' |
360 | * '<S9>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/X_est_Assign' |
361 | * '<S10>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/X_prd_Assign' |
362 | * '<S11>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Z_est_Assign' |
363 | * '<S12>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Core/LDL Solver' |
364 | * '<S13>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes' |
365 | * '<S14>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes1' |
366 | * '<S15>' : 'integ_accel/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes2' |
367 | */ |
368 | #endif /* RTW_HEADER_integ_accel_h_ */ |
369 | |
370 | /* |
371 | * File trailer for generated code. |
372 | * |
373 | * [EOF] |
374 | */ |
375 | |