1/*
2 * File: ADM_Integrated_Logic.h
3 *
4 * Code generated for Simulink model 'ADM_Integrated_Logic'.
5 *
6 * Model version : 7.13
7 * Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
8 * C/C++ source code generated on : Wed Jul 16 16:53:18 2025
9 *
10 * Target selection: ert.tlc
11 * Embedded hardware selection: NXP->Cortex-M4
12 * Code generation objectives:
13 * 1. Execution efficiency
14 * 2. RAM efficiency
15 * 3. Debugging
16 * Validation result: Not run
17 */
18
19#ifndef RTW_HEADER_ADM_Integrated_Logic_h_
20#define RTW_HEADER_ADM_Integrated_Logic_h_
21#include <math.h>
22#ifndef ADM_Integrated_Logic_COMMON_INCLUDES_
23#define ADM_Integrated_Logic_COMMON_INCLUDES_
24#include "rtwtypes.h"
25#endif /* ADM_Integrated_Logic_COMMON_INCLUDES_ */
26
27/* Model Code Variants */
28
29/* Macros for accessing real-time model data structure */
30#ifndef rtmGetErrorStatus
31#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
32#endif
33
34#ifndef rtmSetErrorStatus
35#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
36#endif
37
38/* Forward declaration for rtModel */
39typedef struct tag_RTM_ADM_Integrated_Logic_T RT_MODEL_ADM_Integrated_Logic_T;
40
41/* Block signals and states (default storage) for system '<Root>' */
42typedef struct {
43 real_T Delay_DSTATE[2]; /* '<S38>/Delay' */
44 real_T Delay3_DSTATE[2]; /* '<S38>/Delay3' */
45 real_T Delay_DSTATE_p[2]; /* '<S30>/Delay' */
46 real_T Delay3_DSTATE_h[2]; /* '<S30>/Delay3' */
47 real_T Memory_DSTATE; /* '<S7>/Memory' */
48 real_T DelayInput2_DSTATE; /* '<S49>/Delay Input2' */
49 real_T DelayInput2_DSTATE_m; /* '<S50>/Delay Input2' */
50 real_T Integrator_2_DSTATE; /* '<S8>/Integrator_2' */
51 real_T DiscreteTransferFcn_states; /* '<S1>/Discrete Transfer Fcn' */
52 real_T d1_DSTATE; /* '<S44>/d1' */
53 real_T d_DSTATE; /* '<S44>/d' */
54 real_T d1_DSTATE_i; /* '<S45>/d1' */
55 real_T d_DSTATE_p; /* '<S45>/d' */
56 real_T d1_DSTATE_o; /* '<S46>/d1' */
57 real_T d_DSTATE_n; /* '<S46>/d' */
58 real_T Integrator_1_DSTATE; /* '<S8>/Integrator_1' */
59 real_T d1_DSTATE_a; /* '<S47>/d1' */
60 real_T d_DSTATE_d; /* '<S47>/d' */
61 real_T d1_DSTATE_c; /* '<S24>/d1' */
62 real_T d_DSTATE_l; /* '<S24>/d' */
63 real_T d_DSTATE_i; /* '<S34>/d' */
64 real_T d1_DSTATE_p; /* '<S34>/d1' */
65 real_T d_DSTATE_c; /* '<S35>/d' */
66 real_T d1_DSTATE_h; /* '<S35>/d1' */
67 real_T d_DSTATE_db; /* '<S36>/d' */
68 real_T d1_DSTATE_l; /* '<S36>/d1' */
69 real_T Delay1_DSTATE; /* '<S38>/Delay1' */
70 real_T Delay2_DSTATE; /* '<S38>/Delay2' */
71 real_T d1_DSTATE_e; /* '<S37>/d1' */
72 real_T d_DSTATE_ij; /* '<S37>/d' */
73 real_T d_DSTATE_ir; /* '<S26>/d' */
74 real_T d1_DSTATE_of; /* '<S26>/d1' */
75 real_T d_DSTATE_m; /* '<S27>/d' */
76 real_T d1_DSTATE_hm; /* '<S27>/d1' */
77 real_T d_DSTATE_mw; /* '<S28>/d' */
78 real_T d1_DSTATE_g; /* '<S28>/d1' */
79 real_T d1_DSTATE_ej; /* '<S29>/d1' */
80 real_T d_DSTATE_j; /* '<S29>/d' */
81 real_T Delay1_DSTATE_c; /* '<S30>/Delay1' */
82 real_T Delay2_DSTATE_n; /* '<S30>/Delay2' */
83 real_T DelayInput2_DSTATE_c; /* '<S16>/Delay Input2' */
84 real_T DelayInput2_DSTATE_i; /* '<S17>/Delay Input2' */
85 real_T PrevY; /* '<S18>/Input_Vx_RateLimiter' */
86 real_T PrevY_o; /* '<S4>/Brake_Out_RateLimiter' */
87 real_T PrevY_a; /* '<S4>/TargetSpd_RateLimiter' */
88 real_T Memory_PreviousInput; /* '<S4>/Memory' */
89 real_T HAC_ON_FLAG; /* '<S8>/HAC_OFF_OK_Func' */
90 real_T Smoothed_Torque; /* '<S8>/HAC_OFF_OK_Func' */
91 real_T HAC_Desired_Torque; /* '<S8>/HAC_OFF_OK_Func' */
92 real_T HAC_ON_Timer; /* '<S8>/HAC_OFF_OK_Func' */
93 uint8_T is_active_c6_ADM_Integrated_Log;/* '<S8>/Chart' */
94 uint8_T is_c6_ADM_Integrated_Logic; /* '<S8>/Chart' */
95} DW_ADM_Integrated_Logic_T;
96
97/* Invariant block signals (default storage) */
98typedef struct {
99 const real_T W_value; /* '<S43>/Multiply' */
100 const real_T W_Value_for_Brake; /* '<S43>/Multiply4' */
101} ConstB_ADM_Integrated_Logic_T;
102
103/* External inputs (root inport signals with default storage) */
104typedef struct {
105 real_T GV_MCU_RPM; /* '<Root>/GV_MCU_RPM' */
106 real_T GV_BrakeTorqueCommand; /* '<Root>/GV_BrakeTorqueCommand' */
107 real_T GV_IMU_AX_Val; /* '<Root>/GV_IMU_AX_Val' */
108 real_T GV_IMU_AY_Val; /* '<Root>/GV_IMU_AY_Val' */
109 real_T GV_IMU_AZ_Val; /* '<Root>/GV_IMU_AZ_Val' */
110 real_T GV_IMU_PitchRtVal; /* '<Root>/GV_IMU_PitchRtVal' */
111 real_T GV_Vx_Command; /* '<Root>/GV_Vx_Command' */
112 real_T GV_VCU_GearSelStat; /* '<Root>/GV_VCU_GearSelStat' */
113 real_T GV_MCU_EstTrq; /* '<Root>/GV_MCU_EstTrq' */
114 real_T GV_Vx_Limit; /* '<Root>/GV_Vx_Limit' */
115 real_T GV_Vx_Fbk; /* '<Root>/GV_Vx_Fbk' */
116 real_T GV_RWA_RackAngleCommand; /* '<Root>/GV_RWA_RackAngleCommand' */
117 real_T GV_RWS_RackAngleCommand; /* '<Root>/GV_RWS_RackAngleCommand' */
118 real_T GV_Operation_Mode; /* '<Root>/GV_Operation_Mode' */
119 real_T GV_ACU_Fault_Flag; /* '<Root>/GV_ACU_Fault_Flag' */
120 real_T GV_MCU_Actuator_Fault_Flag; /* '<Root>/GV_MCU_Actuator_Fault_Flag' */
121 real_T GV_IDB_ECU_Fault_Flag; /* '<Root>/GV_IDB_ECU_Fault_Flag' */
122 real_T GV_RCU_ECU_Fault_Flag; /* '<Root>/GV_RCU_ECU_Fault_Flag' */
123 real_T GV_RWA1_ECU_Fault_Flag; /* '<Root>/GV_RWA1_ECU_Fault_Flag' */
124 real_T GV_RWA2_ECU_Fault_Flag; /* '<Root>/GV_RWA2_ECU_Fault_Flag' */
125 real_T GV_RWA_Actuator_Fault; /* '<Root>/GV_RWA_Actuator_Fault' */
126} ExtU_ADM_Integrated_Logic_T;
127
128/* External outputs (root outports fed by signals with default storage) */
129typedef struct {
130 real_T GV_Brake_Command; /* '<Root>/GV_Brake_Command' */
131 real_T GV_Master_Rack_Angle_Cmd; /* '<Root>/GV_Master_Rack_Angle_Cmd' */
132 real_T GV_Hill_Torque_Assist; /* '<Root>/GV_Hill_Torque_Assist' */
133 real_T GV_Motor_Torque_Cmd; /* '<Root>/GV_Motor_Torque_Cmd' */
134 real_T Debug_HAC_FLAG; /* '<Root>/Debug_HAC_FLAG' */
135 real_T Debug_HAC_RPM_Decision; /* '<Root>/Debug_HAC_RPM_Decision' */
136 real_T Debug_HAC_Pitch_angle; /* '<Root>/Debug_HAC_Pitch_angle' */
137 real_T Debug_HAC_Brake_Output; /* '<Root>/Debug_HAC_Brake_Output' */
138 real_T Debug_CC_Brake_Output; /* '<Root>/Debug_CC_Brake_Output' */
139 real_T GV_RWS_RackAngleCmd1; /* '<Root>/GV_RWS_RackAngleCmd1' */
140 real_T GV_Speed_Limit; /* '<Root>/GV_Speed_Limit' */
141 real_T GV_Gear_Postion_Out; /* '<Root>/GV_Gear_Postion_Out' */
142 real_T Act_Fault_Exist; /* '<Root>/Act_Fault_Exist' */
143 real_T Target_RWA_Out; /* '<Root>/Target_RWA_Out' */
144 real_T Target_IDB_Out; /* '<Root>/Target_IDB_Out' */
145 real_T Target_MCU_Out; /* '<Root>/Target_MCU_Out' */
146} ExtY_ADM_Integrated_Logic_T;
147
148/* Real-time Model Data Structure */
149struct tag_RTM_ADM_Integrated_Logic_T {
150 const char_T * volatile errorStatus;
151};
152
153/* Block signals and states (default storage) */
154extern DW_ADM_Integrated_Logic_T ADM_Integrated_Logic_DW;
155
156/* External inputs (root inport signals with default storage) */
157extern ExtU_ADM_Integrated_Logic_T ADM_Integrated_Logic_U;
158
159/* External outputs (root outports fed by signals with default storage) */
160extern ExtY_ADM_Integrated_Logic_T ADM_Integrated_Logic_Y;
161extern const ConstB_ADM_Integrated_Logic_T ADM_Integrated_Logic_ConstB;/* constant block i/o */
162
163/* Model entry point functions */
164extern void ADM_Integrated_Logic_initialize(void);
165extern void ADM_Integrated_Logic_step(void);
166
167/* Real-time Model object */
168extern RT_MODEL_ADM_Integrated_Logic_T *const ADM_Integrated_Logic_M;
169
170/*-
171 * These blocks were eliminated from the model due to optimizations:
172 *
173 * Block '<S21>/BW_PI' : Unused code path elimination
174 * Block '<S21>/Constant1' : Unused code path elimination
175 * Block '<S21>/Constant16' : Unused code path elimination
176 * Block '<S21>/Constant17' : Unused code path elimination
177 * Block '<S21>/Constant2' : Unused code path elimination
178 * Block '<S43>/Brake_Saturation' : Unused code path elimination
179 * Block '<S43>/Multiply5' : Unused code path elimination
180 * Block '<S43>/Radius1' : Unused code path elimination
181 * Block '<S49>/FixPt Data Type Duplicate' : Unused code path elimination
182 * Block '<S54>/Data Type Duplicate' : Unused code path elimination
183 * Block '<S54>/Data Type Propagation' : Unused code path elimination
184 * Block '<S50>/FixPt Data Type Duplicate' : Unused code path elimination
185 * Block '<S55>/Data Type Duplicate' : Unused code path elimination
186 * Block '<S55>/Data Type Propagation' : Unused code path elimination
187 * Block '<S8>/Scope2' : Unused code path elimination
188 * Block '<S16>/FixPt Data Type Duplicate' : Unused code path elimination
189 * Block '<S56>/Data Type Duplicate' : Unused code path elimination
190 * Block '<S56>/Data Type Propagation' : Unused code path elimination
191 * Block '<S17>/FixPt Data Type Duplicate' : Unused code path elimination
192 * Block '<S57>/Data Type Duplicate' : Unused code path elimination
193 * Block '<S57>/Data Type Propagation' : Unused code path elimination
194 * Block '<S4>/ControlFlag' : Eliminated nontunable gain of 1
195 * Block '<S21>/FBGain' : Eliminated nontunable gain of 1
196 * Block '<S32>/FFGain' : Eliminated nontunable gain of 1
197 * Block '<S1>/Data Type Conversion1' : Eliminate redundant data type conversion
198 * Block '<S1>/Data Type Conversion3' : Eliminate redundant data type conversion
199 * Block '<S43>/HAC_Gain' : Eliminated nontunable gain of 1
200 */
201
202/*-
203 * The generated code includes comments that allow you to trace directly
204 * back to the appropriate location in the model. The basic format
205 * is <system>/block_name, where system is the system number (uniquely
206 * assigned by Simulink) and block_name is the name of the block.
207 *
208 * Use the MATLAB hilite_system command to trace the generated code back
209 * to the model. For example,
210 *
211 * hilite_system('<S3>') - opens system 3
212 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
213 *
214 * Here is the system hierarchy for this model
215 *
216 * '<Root>' : 'ADM_Integrated_Logic'
217 * '<S1>' : 'ADM_Integrated_Logic/Delivery_Mobility'
218 * '<S2>' : 'ADM_Integrated_Logic/Delivery_Mobility/Actuator_Fault_Decision'
219 * '<S3>' : 'ADM_Integrated_Logic/Delivery_Mobility/Compare To Constant'
220 * '<S4>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1'
221 * '<S5>' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Brake_Func'
222 * '<S6>' : 'ADM_Integrated_Logic/Delivery_Mobility/Emergency_Motor_Func'
223 * '<S7>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position'
224 * '<S8>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1'
225 * '<S9>' : 'ADM_Integrated_Logic/Delivery_Mobility/IDB_Fault_Injection'
226 * '<S10>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function1'
227 * '<S11>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function2'
228 * '<S12>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function5'
229 * '<S13>' : 'ADM_Integrated_Logic/Delivery_Mobility/MATLAB Function6'
230 * '<S14>' : 'ADM_Integrated_Logic/Delivery_Mobility/MCU_Fault_Injection'
231 * '<S15>' : 'ADM_Integrated_Logic/Delivery_Mobility/RWA_Actuator_Fault_Injection'
232 * '<S16>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic'
233 * '<S17>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1'
234 * '<S18>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic'
235 * '<S19>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB'
236 * '<S20>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB_Gain'
237 * '<S21>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller'
238 * '<S22>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/GearCondition_Brake'
239 * '<S23>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Gear_pos_out'
240 * '<S24>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/LPFM'
241 * '<S25>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/Target_RPM'
242 * '<S26>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot3'
243 * '<S27>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot4'
244 * '<S28>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Dot5'
245 * '<S29>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/LPFM'
246 * '<S30>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/DOB/Second order LPF'
247 * '<S31>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB'
248 * '<S32>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF'
249 * '<S33>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FB/P'
250 * '<S34>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot'
251 * '<S35>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot2'
252 * '<S36>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Dot3'
253 * '<S37>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/LPFM'
254 * '<S38>' : 'ADM_Integrated_Logic/Delivery_Mobility/Cruise_Control1/FF_PID_Controller/FF/Second order LPF'
255 * '<S39>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Compare To Constant'
256 * '<S40>' : 'ADM_Integrated_Logic/Delivery_Mobility/Gear_Position/Gear_FUNCTION1'
257 * '<S41>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Chart'
258 * '<S42>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/HAC_OFF_OK_Func'
259 * '<S43>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2'
260 * '<S44>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM'
261 * '<S45>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM1'
262 * '<S46>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM2'
263 * '<S47>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/LPFM3'
264 * '<S48>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Pitch_calculate'
265 * '<S49>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic'
266 * '<S50>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1'
267 * '<S51>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_R'
268 * '<S52>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c'
269 * '<S53>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Hill_Required_Torque2/Calculate_F_c1'
270 * '<S54>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic/Saturation Dynamic'
271 * '<S55>' : 'ADM_Integrated_Logic/Delivery_Mobility/HAC_Logic1/Rate Limiter Dynamic1/Saturation Dynamic'
272 * '<S56>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic/Saturation Dynamic'
273 * '<S57>' : 'ADM_Integrated_Logic/Delivery_Mobility/Rate Limiter Dynamic1/Saturation Dynamic'
274 * '<S58>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Compare To Constant'
275 * '<S59>' : 'ADM_Integrated_Logic/Delivery_Mobility/Vx_Logic/Vx_OutPut_Function'
276 */
277
278/*-
279 * Requirements for '<Root>': ADM_Integrated_Logic
280 */
281#endif /* RTW_HEADER_ADM_Integrated_Logic_h_ */
282
283/*
284 * File trailer for generated code.
285 *
286 * [EOF]
287 */
288