1/*
2 * RaspberryMagmanModelTest.h
3 *
4 * Classroom License -- for classroom instructional use only. Not for
5 * government, commercial, academic research, or other organizational use.
6 *
7 * Code generation for model "RaspberryMagmanModelTest".
8 *
9 * Model version : 1.19
10 * Simulink Coder version : 8.11 (R2016b) 25-Aug-2016
11 * C source code generated on : Wed Dec 21 17:46:56 2016
12 *
13 * Target selection: ert.tlc
14 * Note: GRT includes extra infrastructure and instrumentation for prototyping
15 * Embedded hardware selection: ARM Compatible->ARM Cortex
16 * Code generation objectives: Unspecified
17 * Validation result: Not run
18 */
19
20#ifndef RTW_HEADER_RaspberryMagmanModelTest_h_
21#define RTW_HEADER_RaspberryMagmanModelTest_h_
22#include <string.h>
23#include <math.h>
24#include <float.h>
25#include <stddef.h>
26#ifndef RaspberryMagmanModelTest_COMMON_INCLUDES_
27# define RaspberryMagmanModelTest_COMMON_INCLUDES_
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#endif /* RaspberryMagmanModelTest_COMMON_INCLUDES_ */
36
37#include "RaspberryMagmanModelTest_types.h"
38
39/* Shared type includes */
40#include "multiword_types.h"
41#include "rt_nonfinite.h"
42#include "rtGetInf.h"
43
44/* Macros for accessing real-time model data structure */
45#ifndef rtmGetFinalTime
46# define rtmGetFinalTime(rtm) ((rtm)->Timing.tFinal)
47#endif
48
49#ifndef rtmGetRTWExtModeInfo
50# define rtmGetRTWExtModeInfo(rtm) ((rtm)->extModeInfo)
51#endif
52
53#ifndef rtmGetErrorStatus
54# define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
55#endif
56
57#ifndef rtmSetErrorStatus
58# define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
59#endif
60
61#ifndef rtmGetStopRequested
62# define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag)
63#endif
64
65#ifndef rtmSetStopRequested
66# define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val))
67#endif
68
69#ifndef rtmGetStopRequestedPtr
70# define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag))
71#endif
72
73#ifndef rtmGetT
74# define rtmGetT(rtm) (rtmGetTPtr((rtm))[0])
75#endif
76
77#ifndef rtmGetTFinal
78# define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal)
79#endif
80
81/* Block signals for system '<S1>/Position transformation1' */
82typedef struct {
83 real_T X; /* '<S1>/Position transformation1' */
84 real_T Y; /* '<S1>/Position transformation1' */
85} B_Positiontransformation1_Ras_T;
86
87/* Block signals (auto storage) */
88typedef struct {
89 real_T Switch[16]; /* '<Root>/Switch' */
90 real_T MagManFoilwitherror_o1; /* '<S4>/MagMan Foil with error' */
91 real_T MagManFoilwitherror_o2; /* '<S4>/MagMan Foil with error' */
92 real_T MagManFoilwitherror_o3; /* '<S4>/MagMan Foil with error' */
93 real_T DataTypeConversion1; /* '<S5>/Data Type Conversion1' */
94 real_T DataTypeConversion2; /* '<S5>/Data Type Conversion2' */
95 real_T DiscreteStateSpace[2]; /* '<Root>/Discrete State-Space' */
96 real_T Gain[2]; /* '<S2>/Gain' */
97 real_T PWM[16]; /* '<Root>/Currents to PWM' */
98 real_T minval[16];
99 real_T b_a;
100 int32_T MagManFoilwitherror_o4; /* '<S4>/MagMan Foil with error' */
101 int32_T Sharedmemorycameraposition_o1;/* '<S5>/Shared memory camera position' */
102 int32_T Sharedmemorycameraposition_o2;/* '<S5>/Shared memory camera position' */
103 B_Positiontransformation1_Ras_T sf_Positiontransformation;/* '<S4>/Position transformation' */
104 B_Positiontransformation1_Ras_T sf_Positiontransformation1;/* '<S1>/Position transformation1' */
105} B_RaspberryMagmanModelTest_T;
106
107/* Block states (auto storage) for system '<Root>' */
108typedef struct {
109 real_T MagManFoilwitherror_DSTATE; /* '<S4>/MagMan Foil with error' */
110 real_T Sharedmemorycameraposition_DSTA;/* '<S5>/Shared memory camera position' */
111 real_T DiscreteStateSpace_DSTATE[4]; /* '<Root>/Discrete State-Space' */
112 real_T MagManCoils_DSTATE; /* '<Root>/MagMan Coils' */
113 struct {
114 void *LoggedData[3];
115 } Position_PWORK; /* '<Root>/Position' */
116
117 struct {
118 void *LoggedData[2];
119 } Nomalizedposition1_PWORK; /* '<S1>/Nomalized position1' */
120
121 struct {
122 void *LoggedData[2];
123 } Rawposition_PWORK; /* '<S1>/Raw position' */
124
125 struct {
126 void *LoggedData[2];
127 } Nomalizedposition_PWORK; /* '<S4>/Nomalized position' */
128
129 struct {
130 void *LoggedData[3];
131 } Scope1_PWORK; /* '<S4>/Scope1' */
132} DW_RaspberryMagmanModelTest_T;
133
134/* Parameters (auto storage) */
135struct P_RaspberryMagmanModelTest_T_ {
136 real_T km4pi[9]; /* Variable: km4pi
137 * Referenced by: '<S4>/Sentinel Calibration matrix'
138 */
139 real_T km4piCam[9]; /* Variable: km4piCam
140 * Referenced by: '<S1>/Sentinel Calibration matrix1'
141 */
142 real_T Coilexcitationfactors_Value[16];/* Expression: [0 0 0 0;0 0 0 0;0 1 0 0;0 0 0 0]
143 * Referenced by: '<Root>/Coil excitation factors'
144 */
145 real_T Step_Time; /* Expression: 3
146 * Referenced by: '<Root>/Step'
147 */
148 real_T Step_Y0; /* Expression: 0
149 * Referenced by: '<Root>/Step'
150 */
151 real_T Step_YFinal; /* Expression: 1
152 * Referenced by: '<Root>/Step'
153 */
154 real_T Coilexcitationfactors1_Value[16];/* Expression: [0 0 0 0;0 1 0 0;0 0 0 0;0 0 0 0]
155 * Referenced by: '<Root>/Coil excitation factors1'
156 */
157 real_T Switch_Threshold; /* Expression: 0
158 * Referenced by: '<Root>/Switch'
159 */
160 real_T DiscreteStateSpace_A[6]; /* Computed Parameter: DiscreteStateSpace_A
161 * Referenced by: '<Root>/Discrete State-Space'
162 */
163 real_T DiscreteStateSpace_B[4]; /* Computed Parameter: DiscreteStateSpace_B
164 * Referenced by: '<Root>/Discrete State-Space'
165 */
166 real_T DiscreteStateSpace_C[2]; /* Computed Parameter: DiscreteStateSpace_C
167 * Referenced by: '<Root>/Discrete State-Space'
168 */
169 real_T DiscreteStateSpace_X0[4]; /* Expression: [0,2,0,2]
170 * Referenced by: '<Root>/Discrete State-Space'
171 */
172 real_T Gain_Gain; /* Expression: 1/68
173 * Referenced by: '<S2>/Gain'
174 */
175};
176
177/* Real-time Model Data Structure */
178struct tag_RTM_RaspberryMagmanModelT_T {
179 const char_T *errorStatus;
180 RTWExtModeInfo *extModeInfo;
181 RTWSolverInfo solverInfo;
182
183 /*
184 * Sizes:
185 * The following substructure contains sizes information
186 * for many of the model attributes such as inputs, outputs,
187 * dwork, sample times, etc.
188 */
189 struct {
190 uint32_T checksums[4];
191 } Sizes;
192
193 /*
194 * SpecialInfo:
195 * The following substructure contains special information
196 * related to other components that are dependent on RTW.
197 */
198 struct {
199 const void *mappingInfo;
200 } SpecialInfo;
201
202 /*
203 * Timing:
204 * The following substructure contains information regarding
205 * the timing information for the model.
206 */
207 struct {
208 uint32_T clockTick0;
209 uint32_T clockTickH0;
210 time_T stepSize0;
211 uint32_T clockTick1;
212 uint32_T clockTickH1;
213 time_T tFinal;
214 SimTimeStep simTimeStep;
215 boolean_T stopRequestedFlag;
216 time_T *t;
217 time_T tArray[2];
218 } Timing;
219};
220
221/* Block parameters (auto storage) */
222extern P_RaspberryMagmanModelTest_T RaspberryMagmanModelTest_P;
223
224/* Block signals (auto storage) */
225extern B_RaspberryMagmanModelTest_T RaspberryMagmanModelTest_B;
226
227/* Block states (auto storage) */
228extern DW_RaspberryMagmanModelTest_T RaspberryMagmanModelTest_DW;
229
230/* Model entry point functions */
231extern void RaspberryMagmanModelTest_initialize(void);
232extern void RaspberryMagmanModelTest_step(void);
233extern void RaspberryMagmanModelTest_terminate(void);
234
235/* Real-time Model object */
236extern RT_MODEL_RaspberryMagmanModel_T *const RaspberryMagmanModelTest_M;
237
238/*-
239 * The generated code includes comments that allow you to trace directly
240 * back to the appropriate location in the model. The basic format
241 * is <system>/block_name, where system is the system number (uniquely
242 * assigned by Simulink) and block_name is the name of the block.
243 *
244 * Use the MATLAB hilite_system command to trace the generated code back
245 * to the model. For example,
246 *
247 * hilite_system('<S3>') - opens system 3
248 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
249 *
250 * Here is the system hierarchy for this model
251 *
252 * '<Root>' : 'RaspberryMagmanModelTest'
253 * '<S1>' : 'RaspberryMagmanModelTest/Camera position'
254 * '<S2>' : 'RaspberryMagmanModelTest/Currents to Force1'
255 * '<S3>' : 'RaspberryMagmanModelTest/Currents to PWM'
256 * '<S4>' : 'RaspberryMagmanModelTest/Foil position '
257 * '<S5>' : 'RaspberryMagmanModelTest/Camera position/Camera position from shared memory'
258 * '<S6>' : 'RaspberryMagmanModelTest/Camera position/Position transformation1'
259 * '<S7>' : 'RaspberryMagmanModelTest/Currents to Force1/Nonlinearity of magnetic force'
260 * '<S8>' : 'RaspberryMagmanModelTest/Foil position /Position transformation'
261 */
262#endif /* RTW_HEADER_RaspberryMagmanModelTest_h_ */
263