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.8
11 * Simulink Coder version : 8.12 (R2017a) 16-Feb-2017
12 * C/C++ source code generated on : Wed Dec 06 13:43:27 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 '<S14>/i2cWr' */
81typedef struct {
82 freedomk64f_I2CMasterWrite_in_T obj; /* '<S16>/I2C Master Write' */
83 void *I2CMasterWrite_PWORK; /* '<S16>/I2C Master Write' */
84 int8_T i2cWr_SubsysRanBC; /* '<S14>/i2cWr' */
85} DW_i2cWr_integ_Accel_and_Gyro_T;
86
87/* Block signals (auto storage) */
88typedef struct {
89 real_T FXOS87006AxesSensor[3]; /* '<Root>/FXOS8700 6-Axes Sensor' */
90 uint16_T output[7];
91 real32_T Gain[3]; /* '<S2>/Gain' */
92 real32_T Gain2[3]; /* '<S2>/Gain2' */
93 real32_T Sum; /* '<S2>/Sum' */
94 real32_T DiscreteTimeIntegrator; /* '<Root>/Discrete-Time Integrator' */
95 real32_T DiscreteTimeIntegrator1; /* '<Root>/Discrete-Time Integrator1' */
96 int16_T acc[3]; /* '<S2>/MPU6050' */
97 int16_T gyro[3]; /* '<S2>/MPU6050' */
98 int16_T temp; /* '<S2>/MPU6050' */
99 int16_T DataTypeConversion[7]; /* '<S15>/Data Type Conversion' */
100 uint16_T dataw; /* '<S2>/MPU6050' */
101} B_integ_Accel_and_Gyro_T;
102
103/* Block states (auto storage) for system '<Root>' */
104typedef struct {
105 freedomk64f_fxos8700_integ_Ac_T obj; /* '<Root>/FXOS8700 6-Axes Sensor' */
106 freedomk64f_I2CMasterRead_int_T obj_d;/* '<S15>/I2C Master Read' */
107 struct {
108 void *LoggedData[3];
109 } Scope_PWORK; /* '<Root>/Scope' */
110
111 struct {
112 void *LoggedData[3];
113 } accelerometer_PWORK; /* '<Root>/accelerometer' */
114
115 struct {
116 void *LoggedData[2];
117 } gyro_PWORK; /* '<Root>/gyro' */
118
119 struct {
120 void *LoggedData;
121 } temp_PWORK; /* '<Root>/temp' */
122
123 struct {
124 void *LoggedData;
125 } xang_PWORK; /* '<Root>/xang' */
126
127 struct {
128 void *LoggedData;
129 } yang_PWORK; /* '<Root>/yang' */
130
131 void *I2CMasterRead_PWORK; /* '<S15>/I2C Master Read' */
132 void *FXOS87006AxesSensor_PWORK; /* '<Root>/FXOS8700 6-Axes Sensor' */
133 real32_T DiscreteTimeIntegrator_DSTATE;/* '<Root>/Discrete-Time Integrator' */
134 real32_T DiscreteTimeIntegrator1_DSTATE;/* '<Root>/Discrete-Time Integrator1' */
135 int8_T i2cRd_SubsysRanBC; /* '<S14>/i2cRd' */
136 uint8_T is_active_c3_integ_Accel_and_Gy;/* '<S2>/MPU6050' */
137 uint8_T is_c3_integ_Accel_and_Gyro; /* '<S2>/MPU6050' */
138 uint8_T n; /* '<S2>/MPU6050' */
139 DW_i2cWr_integ_Accel_and_Gyro_T i2cWr;/* '<S14>/i2cWr' */
140} DW_integ_Accel_and_Gyro_T;
141
142/* Parameters (auto storage) */
143struct P_integ_Accel_and_Gyro_T_ {
144 real_T FXOS87006AxesSensor_SampleTime;/* Expression: -1
145 * Referenced by: '<Root>/FXOS8700 6-Axes Sensor'
146 */
147 real_T I2CMasterRead_SampleTime; /* Expression: -1
148 * Referenced by: '<S15>/I2C Master Read'
149 */
150 real32_T Constant_Value; /* Computed Parameter: Constant_Value
151 * Referenced by: '<S2>/Constant'
152 */
153 real32_T DiscreteTimeIntegrator_gainval;/* Computed Parameter: DiscreteTimeIntegrator_gainval
154 * Referenced by: '<Root>/Discrete-Time Integrator'
155 */
156 real32_T DiscreteTimeIntegrator_IC; /* Computed Parameter: DiscreteTimeIntegrator_IC
157 * Referenced by: '<Root>/Discrete-Time Integrator'
158 */
159 real32_T DiscreteTimeIntegrator1_gainval;/* Computed Parameter: DiscreteTimeIntegrator1_gainval
160 * Referenced by: '<Root>/Discrete-Time Integrator1'
161 */
162 real32_T DiscreteTimeIntegrator1_IC; /* Computed Parameter: DiscreteTimeIntegrator1_IC
163 * Referenced by: '<Root>/Discrete-Time Integrator1'
164 */
165 int16_T datar_Y0; /* Computed Parameter: datar_Y0
166 * Referenced by: '<S15>/datar'
167 */
168 int16_T Gain_Gain; /* Computed Parameter: Gain_Gain
169 * Referenced by: '<S2>/Gain'
170 */
171 int16_T Gain2_Gain; /* Computed Parameter: Gain2_Gain
172 * Referenced by: '<S2>/Gain2'
173 */
174 int16_T Gain1_Gain; /* Computed Parameter: Gain1_Gain
175 * Referenced by: '<S2>/Gain1'
176 */
177};
178
179/* Real-time Model Data Structure */
180struct tag_RTM_integ_Accel_and_Gyro_T {
181 const char_T *errorStatus;
182 RTWExtModeInfo *extModeInfo;
183
184 /*
185 * Sizes:
186 * The following substructure contains sizes information
187 * for many of the model attributes such as inputs, outputs,
188 * dwork, sample times, etc.
189 */
190 struct {
191 uint32_T checksums[4];
192 } Sizes;
193
194 /*
195 * SpecialInfo:
196 * The following substructure contains special information
197 * related to other components that are dependent on RTW.
198 */
199 struct {
200 const void *mappingInfo;
201 } SpecialInfo;
202
203 /*
204 * Timing:
205 * The following substructure contains information regarding
206 * the timing information for the model.
207 */
208 struct {
209 time_T taskTime0;
210 uint32_T clockTick0;
211 time_T stepSize0;
212 time_T tFinal;
213 boolean_T stopRequestedFlag;
214 } Timing;
215};
216
217/* Block parameters (auto storage) */
218extern P_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_P;
219
220/* Block signals (auto storage) */
221extern B_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_B;
222
223/* Block states (auto storage) */
224extern DW_integ_Accel_and_Gyro_T integ_Accel_and_Gyro_DW;
225
226/* Model entry point functions */
227extern void integ_Accel_and_Gyro_initialize(void);
228extern void integ_Accel_and_Gyro_step(void);
229extern void integ_Accel_and_Gyro_terminate(void);
230
231/* Real-time Model object */
232extern RT_MODEL_integ_Accel_and_Gyro_T *const integ_Accel_and_Gyro_M;
233
234/*-
235 * The generated code includes comments that allow you to trace directly
236 * back to the appropriate location in the model. The basic format
237 * is <system>/block_name, where system is the system number (uniquely
238 * assigned by Simulink) and block_name is the name of the block.
239 *
240 * Use the MATLAB hilite_system command to trace the generated code back
241 * to the model. For example,
242 *
243 * hilite_system('<S3>') - opens system 3
244 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
245 *
246 * Here is the system hierarchy for this model
247 *
248 * '<Root>' : 'integ_Accel_and_Gyro'
249 * '<S1>' : 'integ_Accel_and_Gyro/KF1'
250 * '<S2>' : 'integ_Accel_and_Gyro/MPU6050 sensor'
251 * '<S3>' : 'integ_Accel_and_Gyro/Subsystem1'
252 * '<S4>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1'
253 * '<S5>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Check Signal Attributes'
254 * '<S6>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control'
255 * '<S7>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options'
256 * '<S8>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core'
257 * '<S9>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/P_prd_Assign'
258 * '<S10>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/X_est_Assign'
259 * '<S11>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/X_prd_Assign'
260 * '<S12>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Z_est_Assign'
261 * '<S13>' : 'integ_Accel_and_Gyro/KF1/Kalman Filter1/Control/Options/Core/LDL Solver'
262 * '<S14>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050'
263 * '<S15>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050/i2cRd'
264 * '<S16>' : 'integ_Accel_and_Gyro/MPU6050 sensor/MPU6050/i2cWr'
265 */
266#endif /* RTW_HEADER_integ_Accel_and_Gyro_h_ */
267
268/*
269 * File trailer for generated code.
270 *
271 * [EOF]
272 */
273