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_and_Gyro.h
7 *
8 * Code generated for Simulink model 'integ_Accel_and_Gyro'.
9 *
10 * Model version : 1.7
11 * Simulink Coder version : 8.12 (R2017a) 16-Feb-2017
12 * C/C++ source code generated on : Tue Dec 05 16:13:16 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_and_Gyro_h_
21#define RTW_HEADER_integ_Accel_and_Gyro_h_
22#include <string.h>
23#include <float.h>
24#include <stddef.h>
25#ifndef integ_Accel_and_Gyro_COMMON_INCLUDES_
26# define integ_Accel_and_Gyro_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_and_Gyro_COMMON_INCLUDES_ */
37
38#include "integ_Accel_and_Gyro_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) ((rtm)->Timing.taskTime0)
74#endif
75
76#ifndef rtmGetTFinal
77# define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal)
78#endif
79
80/* Block states (auto storage) for system '<S17>/i2cWr' */
81typedef struct {
82 freedomk64f_I2CMasterWrite_in_T obj; /* '<S19>/I2C Master Write' */
83 void *I2CMasterWrite_PWORK; /* '<S19>/I2C Master Write' */
84 int8_T i2cWr_SubsysRanBC; /* '<S17>/i2cWr' */
85} DW_i2cWr_integ_Accel_and_Gyro_T;
86
87/* Block signals (auto storage) */
88typedef struct {
89 real32_T Assignment_m[16]; /* '<S9>/Assignment' */
90 real32_T fv0[16];
91 real32_T y[8]; /* '<S13>/Forward Substitution' */
92 real32_T BackwardSubstitution[8]; /* '<S13>/Backward Substitution' */
93 real32_T fv1[8];
94 real_T FXOS87006AxesSensor[3]; /* '<Root>/FXOS8700 6-Axes Sensor' */
95 real32_T X_prdKZHX_prd[4]; /* '<S8>/X_prd+K*(Z-H*X_prd)' */
96 real32_T Assignment_c[4]; /* '<S11>/Assignment' */
97 uint8_T output_raw[14];
98 uint16_T output[7];
99 real32_T Gain2[3]; /* '<S2>/Gain2' */
100 real32_T Gain[3]; /* '<S2>/Gain' */
101 uint32_T i2cname;
102 real32_T ZHX_prd[2]; /* '<S8>/Z-H*X_prd' */
103 uint8_T output_raw_c[6];
104 int16_T output_k[3];
105 real32_T Sum; /* '<S2>/Sum' */
106 real32_T P_prd_Reshape[16]; /* '<S8>/P_prd_Reshape' */
107 real32_T Assignment[4]; /* '<S10>/Assignment' */
108 int16_T acc[3]; /* '<S2>/MPU6050' */
109 int16_T gyro[3]; /* '<S2>/MPU6050' */
110 real32_T accTmp;
111 int32_T idxV;
112 int32_T s6_iter;
113 int16_T temp; /* '<S2>/MPU6050' */
114 int16_T DataTypeConversion[7]; /* '<S18>/Data Type Conversion' */
115 uint16_T dataw; /* '<S2>/MPU6050' */
116} B_integ_Accel_and_Gyro_T;
117
118/* Block states (auto storage) for system '<Root>' */
119typedef struct {
120 freedomk64f_fxos8700_integ_Ac_T obj; /* '<Root>/FXOS8700 6-Axes Sensor' */
121 freedomk64f_I2CMasterRead_int_T obj_d;/* '<S18>/I2C Master Read' */
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[3];
132 } accelerometer_PWORK; /* '<Root>/accelerometer' */
133
134 struct {
135 void *LoggedData;
136 } temp_PWORK; /* '<Root>/temp' */
137
138 void *I2CMasterRead_PWORK; /* '<S18>/I2C Master Read' */
139 void *FXOS87006AxesSensor_PWORK; /* '<Root>/FXOS8700 6-Axes Sensor' */
140 real32_T UnitDelay2_DSTATE[4]; /* '<S4>/Unit Delay2' */
141 real32_T UnitDelay3_DSTATE[16]; /* '<S4>/Unit Delay3' */
142 real32_T LDLFactorization_VMX[2]; /* '<S13>/LDL Factorization' */
143 int8_T i2cRd_SubsysRanBC; /* '<S17>/i2cRd' */
144 uint8_T is_active_c3_integ_Accel_and_Gy;/* '<S2>/MPU6050' */
145 uint8_T is_c3_integ_Accel_and_Gyro; /* '<S2>/MPU6050' */
146 uint8_T n; /* '<S2>/MPU6050' */
147 boolean_T LDLFactorization_STATE; /* '<S13>/LDL Factorization' */
148 DW_i2cWr_integ_Accel_and_Gyro_T i2cWr;/* '<S17>/i2cWr' */
149} DW_integ_Accel_and_Gyro_T;
150
151/* Parameters (auto storage) */
152struct P_integ_Accel_and_Gyro_T_ {
153 real_T FXOS87006AxesSensor_SampleTime;/* Expression: -1
154 * Referenced by: '<Root>/FXOS8700 6-Axes Sensor'
155 */
156 real_T I2CMasterRead_SampleTime; /* Expression: -1
157 * Referenced by: '<S18>/I2C Master Read'
158 */
159 real32_T Z_est_Y0; /* Computed Parameter: Z_est_Y0
160 * Referenced by: '<S6>/Z_est'
161 */
162 real32_T X_est_Y0; /* Computed Parameter: X_est_Y0
163 * Referenced by: '<S6>/X_est'
164 */
165 real32_T X_prd_Y0; /* Computed Parameter: X_prd_Y0
166 * Referenced by: '<S6>/X_prd'
167 */
168 real32_T P_prd_Y0; /* Computed Parameter: P_prd_Y0
169 * Referenced by: '<S6>/P_prd'
170 */
171 real32_T Constant3_Value[16]; /* Computed Parameter: Constant3_Value
172 * Referenced by: '<S8>/Constant3'
173 */
174 real32_T Hcst_Value[8]; /* Computed Parameter: Hcst_Value
175 * Referenced by: '<S8>/Hcst'
176 */
177 real32_T Hcst_t_Value[8]; /* Computed Parameter: Hcst_t_Value
178 * Referenced by: '<S8>/Hcst_t'
179 */
180 real32_T Constant2_Value[4]; /* Computed Parameter: Constant2_Value
181 * Referenced by: '<S8>/Constant2'
182 */
183 real32_T Constant4_Value[16]; /* Computed Parameter: Constant4_Value
184 * Referenced by: '<S8>/Constant4'
185 */
186 real32_T Constant5_Value[16]; /* Computed Parameter: Constant5_Value
187 * Referenced by: '<S8>/Constant5'
188 */
189 real32_T UnitDelay2_InitialCondition[4];/* Computed Parameter: UnitDelay2_InitialCondition
190 * Referenced by: '<S4>/Unit Delay2'
191 */
192 real32_T UnitDelay3_InitialCondition[16];/* Computed Parameter: UnitDelay3_InitialCondition
193 * Referenced by: '<S4>/Unit Delay3'
194 */
195 real32_T Constant_Value; /* Computed Parameter: Constant_Value
196 * Referenced by: '<S2>/Constant'
197 */
198 int32_T Iterator_IterationLimit; /* Computed Parameter: Iterator_IterationLimit
199 * Referenced by: '<S6>/Iterator'
200 */
201 int16_T datar_Y0; /* Computed Parameter: datar_Y0
202 * Referenced by: '<S18>/datar'
203 */
204 int16_T Gain_Gain; /* Computed Parameter: Gain_Gain
205 * Referenced by: '<S2>/Gain'
206 */
207 int16_T Gain2_Gain; /* Computed Parameter: Gain2_Gain
208 * Referenced by: '<S2>/Gain2'
209 */
210 int16_T Gain1_Gain; /* Computed Parameter: Gain1_Gain
211 * Referenced by: '<S2>/Gain1'
212 */
213};
214
215/* Real-time Model Data Structure */
216struct tag_RTM_integ_Accel_and_Gyro_T {
217 const char_T *errorStatus;
218 RTWExtModeInfo *extModeInfo;
219
220 /*
221 * Sizes:
222 * The following substructure contains sizes information
223 * for many of the model attributes such as inputs, outputs,
224 * dwork, sample times, etc.
225 */
226 struct {
227 uint32_T checksums[4];
228 } Sizes;
229
230 /*
231 * SpecialInfo:
232 * The following substructure contains special information
233 * related to other components that are dependent on RTW.
234 */
235 struct {
236 const void *mappingInfo;
237 } SpecialInfo;
238
239 /*
240 * Timing:
241 * The following substructure contains information regarding
242 * the timing information for the model.
243 */
244 struct {
245 time_T taskTime0;
246 uint32_T clockTick0;
247 time_T stepSize0;
248 uint32_T clockTick1;
249 struct {
250 uint8_T TID[2];
251 } TaskCounters;
252
253 time_T tFinal;
254 boolean_T stopRequestedFlag;
255 } Timing;
256};
257
258/* Block parameters (auto storage) */
259extern P_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_P;
260
261/* Block signals (auto storage) */
262extern B_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_B;
263
264/* Block states (auto storage) */
265extern DW_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_DW;
266
267/* Model entry point functions */
268extern void integ_Accel_and_Gyro_initialize(void);
269extern void integ_Accel_and_Gyro_step(void);
270extern void integ_Accel_and_Gyro_terminate(void);
271
272/* Real-time Model object */
273extern RT_MODEL_integ_Accel_and_Gyro_T *const integ_Accel_and_Gyro_M;
274
275/*-
276 * These blocks were eliminated from the model due to optimizations:
277 *
278 * Block '<S5>/Check Signal Attributes' : Unused code path elimination
279 * Block '<S14>/Check Signal Attributes' : Unused code path elimination
280 * Block '<S15>/Check Signal Attributes' : Unused code path elimination
281 * Block '<S16>/Check Signal Attributes' : Unused code path elimination
282 * Block '<S8>/Z_est_Multiply' : Unused code path elimination
283 * Block '<S12>/Assignment' : Unused code path elimination
284 * Block '<S1>/Sum' : Unused code path elimination
285 * Block '<S8>/P_Reshape' : Reshape block reduction
286 * Block '<S1>/Zero-Order Hold' : Eliminated since input and output rates are identical
287 */
288
289/*-
290 * The generated code includes comments that allow you to trace directly
291 * back to the appropriate location in the model. The basic format
292 * is <system>/block_name, where system is the system number (uniquely
293 * assigned by Simulink) and block_name is the name of the block.
294 *
295 * Use the MATLAB hilite_system command to trace the generated code back
296 * to the model. For example,
297 *
298 * hilite_system('<S3>') - opens system 3
299 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
300 *
301 * Here is the system hierarchy for this model
302 *
303 * '<Root>' : 'integ_Accel_and_Gyro'
304 * '<S1>' : 'integ_Accel_and_Gyro/KF1'
305 * '<S2>' : 'integ_Accel_and_Gyro/MPU6050 sensor'
306 * '<S3>' : 'integ_Accel_and_Gyro/Subsystem1'
307 * '<S4>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1'
308 * '<S5>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Check Signal Attributes'
309 * '<S6>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control'
310 * '<S7>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options'
311 * '<S8>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core'
312 * '<S9>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/P_prd_Assign'
313 * '<S10>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/X_est_Assign'
314 * '<S11>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/X_prd_Assign'
315 * '<S12>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Z_est_Assign'
316 * '<S13>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core/LDL Solver'
317 * '<S14>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes'
318 * '<S15>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes1'
319 * '<S16>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core/LDL Solver/Check Signal Attributes2'
320 * '<S17>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050'
321 * '<S18>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050/i2cRd'
322 * '<S19>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050/i2cWr'
323 */
324#endif /* RTW_HEADER_integ_Accel_and_Gyro_h_ */
325
326/*
327 * File trailer for generated code.
328 *
329 * [EOF]
330 */
331