1 | /* |
2 | * Prerelease License - for engineering feedback and testing purposes |
3 | * only. Not for sale. |
4 | * |
5 | * File: fuel_rate_control.h |
6 | * |
7 | * Code generated for Simulink model 'fuel_rate_control'. |
8 | * |
9 | * Model version : 1.742 |
10 | * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 |
11 | * C/C++ source code generated on : Wed Nov 27 12:21:15 2019 |
12 | * |
13 | * Target selection: ert.tlc |
14 | * Embedded hardware selection: Specified |
15 | * Code generation objectives: Unspecified |
16 | * Validation result: Not run |
17 | */ |
18 | |
19 | #ifndef RTW_HEADER_fuel_rate_control_h_ |
20 | #define RTW_HEADER_fuel_rate_control_h_ |
21 | #ifndef fuel_rate_control_COMMON_INCLUDES_ |
22 | # define fuel_rate_control_COMMON_INCLUDES_ |
23 | #include "rtwtypes.h" |
24 | #endif /* fuel_rate_control_COMMON_INCLUDES_ */ |
25 | |
26 | #include "fuel_rate_control_types.h" |
27 | |
28 | /* Macros for accessing real-time model data structure */ |
29 | #ifndef rtmGetErrorStatus |
30 | # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) |
31 | #endif |
32 | |
33 | #ifndef rtmSetErrorStatus |
34 | # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) |
35 | #endif |
36 | |
37 | /* Block signals (default storage) */ |
38 | typedef struct { |
39 | EngSensors es_o; /* '<S1>/control_logic' */ |
40 | sld_FuelModes fuel_mode; /* '<S1>/control_logic' */ |
41 | struct { |
42 | uint_T O2_normal:1; /* '<S1>/control_logic' */ |
43 | } bitsForTID0; |
44 | } BlockIO; |
45 | |
46 | /* Block states (default storage) for system '<Root>' */ |
47 | typedef struct { |
48 | real32_T DiscreteIntegrator_DSTATE; /* '<S2>/Discrete Integrator' */ |
49 | real32_T ThrottleTransient_states; /* '<S2>/Throttle Transient' */ |
50 | real32_T DiscreteFilter_states; /* '<S14>/Discrete Filter' */ |
51 | real32_T DiscreteFilter_states_i; /* '<S13>/Discrete Filter' */ |
52 | uint16_T temporalCounter_i1; /* '<S1>/control_logic' */ |
53 | uint8_T is_active_c1_fuel_rate_control;/* '<S1>/control_logic' */ |
54 | uint8_T is_O2; /* '<S1>/control_logic' */ |
55 | uint8_T is_active_O2; /* '<S1>/control_logic' */ |
56 | uint8_T is_A; /* '<S1>/control_logic' */ |
57 | uint8_T is_Pressure; /* '<S1>/control_logic' */ |
58 | uint8_T is_active_Pressure; /* '<S1>/control_logic' */ |
59 | uint8_T is_Throttle; /* '<S1>/control_logic' */ |
60 | uint8_T is_active_Throttle; /* '<S1>/control_logic' */ |
61 | uint8_T is_Speed; /* '<S1>/control_logic' */ |
62 | uint8_T is_active_Speed; /* '<S1>/control_logic' */ |
63 | uint8_T is_Fail; /* '<S1>/control_logic' */ |
64 | uint8_T is_active_Fail; /* '<S1>/control_logic' */ |
65 | uint8_T is_Multi; /* '<S1>/control_logic' */ |
66 | uint8_T is_Fueling_Mode; /* '<S1>/control_logic' */ |
67 | uint8_T is_active_Fueling_Mode; /* '<S1>/control_logic' */ |
68 | uint8_T is_Fuel_Disabled; /* '<S1>/control_logic' */ |
69 | uint8_T is_Running; /* '<S1>/control_logic' */ |
70 | uint8_T was_Running; /* '<S1>/control_logic' */ |
71 | uint8_T is_Low_Emissions; /* '<S1>/control_logic' */ |
72 | uint8_T was_Low_Emissions; /* '<S1>/control_logic' */ |
73 | uint8_T is_Rich_Mixture; /* '<S1>/control_logic' */ |
74 | } D_Work; |
75 | |
76 | /* Constant parameters (default storage) */ |
77 | typedef struct { |
78 | /* Computed Parameter: RampRateKi_tableData |
79 | * Referenced by: '<S2>/Ramp Rate Ki' |
80 | */ |
81 | real32_T RampRateKi_tableData[36]; |
82 | |
83 | /* Computed Parameter: RampRateKi_bp01Data |
84 | * Referenced by: '<S2>/Ramp Rate Ki' |
85 | */ |
86 | real32_T RampRateKi_bp01Data[6]; |
87 | |
88 | /* Computed Parameter: RampRateKi_bp02Data |
89 | * Referenced by: '<S2>/Ramp Rate Ki' |
90 | */ |
91 | real32_T RampRateKi_bp02Data[6]; |
92 | |
93 | /* Computed Parameter: PressureEstimation_tableData |
94 | * Referenced by: '<S7>/Pressure Estimation' |
95 | */ |
96 | real32_T PressureEstimation_tableData[306]; |
97 | |
98 | /* Pooled Parameter (Expression: SpeedVect) |
99 | * Referenced by: |
100 | * '<S2>/Pumping Constant' |
101 | * '<S7>/Pressure Estimation' |
102 | * '<S9>/Throttle Estimation' |
103 | */ |
104 | real32_T pooled1[18]; |
105 | |
106 | /* Pooled Parameter (Expression: ThrotVect) |
107 | * Referenced by: |
108 | * '<S7>/Pressure Estimation' |
109 | * '<S8>/Speed Estimation' |
110 | */ |
111 | real32_T pooled2[17]; |
112 | |
113 | /* Computed Parameter: ThrottleEstimation_tableData |
114 | * Referenced by: '<S9>/Throttle Estimation' |
115 | */ |
116 | real32_T ThrottleEstimation_tableData[342]; |
117 | |
118 | /* Computed Parameter: SpeedEstimation_tableData |
119 | * Referenced by: '<S8>/Speed Estimation' |
120 | */ |
121 | real32_T SpeedEstimation_tableData[323]; |
122 | |
123 | /* Pooled Parameter (Expression: PressVect) |
124 | * Referenced by: |
125 | * '<S2>/Pumping Constant' |
126 | * '<S8>/Speed Estimation' |
127 | * '<S9>/Throttle Estimation' |
128 | */ |
129 | real32_T pooled3[19]; |
130 | |
131 | /* Computed Parameter: PumpingConstant_tableData |
132 | * Referenced by: '<S2>/Pumping Constant' |
133 | */ |
134 | real32_T PumpingConstant_tableData[342]; |
135 | |
136 | /* Computed Parameter: RampRateKi_maxIndex |
137 | * Referenced by: '<S2>/Ramp Rate Ki' |
138 | */ |
139 | uint32_T RampRateKi_maxIndex[2]; |
140 | |
141 | /* Computed Parameter: PressureEstimation_maxIndex |
142 | * Referenced by: '<S7>/Pressure Estimation' |
143 | */ |
144 | uint32_T PressureEstimation_maxIndex[2]; |
145 | |
146 | /* Pooled Parameter (Expression: ) |
147 | * Referenced by: |
148 | * '<S2>/Pumping Constant' |
149 | * '<S9>/Throttle Estimation' |
150 | */ |
151 | uint32_T pooled8[2]; |
152 | |
153 | /* Computed Parameter: SpeedEstimation_maxIndex |
154 | * Referenced by: '<S8>/Speed Estimation' |
155 | */ |
156 | uint32_T SpeedEstimation_maxIndex[2]; |
157 | } ConstParam; |
158 | |
159 | /* External inputs (root inport signals with default storage) */ |
160 | typedef struct { |
161 | EngSensors sensors; /* '<Root>/sensors' */ |
162 | } ExternalInputs; |
163 | |
164 | /* External outputs (root outports fed by signals with default storage) */ |
165 | typedef struct { |
166 | real32_T fuel_rate; /* '<Root>/fuel_rate' */ |
167 | } ExternalOutputs; |
168 | |
169 | /* Real-time Model Data Structure */ |
170 | struct tag_RTM { |
171 | const char_T * volatile errorStatus; |
172 | }; |
173 | |
174 | /* Block signals (default storage) */ |
175 | extern BlockIO rtB; |
176 | |
177 | /* Block states (default storage) */ |
178 | extern D_Work rtDWork; |
179 | |
180 | /* External inputs (root inport signals with default storage) */ |
181 | extern ExternalInputs rtU; |
182 | |
183 | /* External outputs (root outports fed by signals with default storage) */ |
184 | extern ExternalOutputs rtY; |
185 | |
186 | /* Constant parameters (default storage) */ |
187 | extern const ConstParam rtConstP; |
188 | |
189 | /* Model entry point functions */ |
190 | extern void fuel_rate_control_initialize(void); |
191 | extern void fuel_rate_control_step(void); |
192 | |
193 | /* Real-time Model object */ |
194 | extern RT_MODEL *const rtM; |
195 | |
196 | /*- |
197 | * The generated code includes comments that allow you to trace directly |
198 | * back to the appropriate location in the model. The basic format |
199 | * is <system>/block_name, where system is the system number (uniquely |
200 | * assigned by Simulink) and block_name is the name of the block. |
201 | * |
202 | * Note that this particular code originates from a subsystem build, |
203 | * and has its own system numbers different from the parent model. |
204 | * Refer to the system hierarchy for this subsystem below, and use the |
205 | * MATLAB hilite_system command to trace the generated code back |
206 | * to the parent model. For example, |
207 | * |
208 | * hilite_system('msldemo_fuelsys_initial/fuel_rate_control') - opens subsystem msldemo_fuelsys_initial/fuel_rate_control |
209 | * hilite_system('msldemo_fuelsys_initial/fuel_rate_control/Kp') - opens and selects block Kp |
210 | * |
211 | * Here is the system hierarchy for this model |
212 | * |
213 | * '<Root>' : 'msldemo_fuelsys_initial' |
214 | * '<S1>' : 'msldemo_fuelsys_initial/fuel_rate_control' |
215 | * '<S2>' : 'msldemo_fuelsys_initial/fuel_rate_control/airflow_calc' |
216 | * '<S3>' : 'msldemo_fuelsys_initial/fuel_rate_control/control_logic' |
217 | * '<S4>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc' |
218 | * '<S5>' : 'msldemo_fuelsys_initial/fuel_rate_control/validate_sample_time' |
219 | * '<S6>' : 'msldemo_fuelsys_initial/fuel_rate_control/airflow_calc/Enumerated Constant' |
220 | * '<S7>' : 'msldemo_fuelsys_initial/fuel_rate_control/control_logic/Pressure.map_estimate' |
221 | * '<S8>' : 'msldemo_fuelsys_initial/fuel_rate_control/control_logic/Speed.speed_estimate' |
222 | * '<S9>' : 'msldemo_fuelsys_initial/fuel_rate_control/control_logic/Throttle.throttle_estimate' |
223 | * '<S10>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc/feedforward_fuel_rate' |
224 | * '<S11>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc/switchable_compensation' |
225 | * '<S12>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc/switchable_compensation/disabled_mode' |
226 | * '<S13>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc/switchable_compensation/low_mode' |
227 | * '<S14>' : 'msldemo_fuelsys_initial/fuel_rate_control/fuel_calc/switchable_compensation/rich_mode' |
228 | * '<S15>' : 'msldemo_fuelsys_initial/fuel_rate_control/validate_sample_time/CheckRange' |
229 | */ |
230 | |
231 | /*- |
232 | * Requirements for '<Root>': fuel_rate_control |
233 | */ |
234 | #endif /* RTW_HEADER_fuel_rate_control_h_ */ |
235 | |
236 | /* |
237 | * File trailer for generated code. |
238 | * |
239 | * [EOF] |
240 | */ |
241 |