    1/*

    2 * File: Inverter_000_test.h

    3 *

    4 * Code generated for Simulink model 'Inverter_000_test'.

    5 *

    6 * Model version                  : 1.126

    7 * Simulink Coder version         : 8.14 (R2018a) 06-Feb-2018

    8 * C/C++ source code generated on : Wed Apr 14 17:29:45 2021

    9 *

    10 * Target selection: ert.tlc

    11 * Embedded hardware selection: Texas Instruments->C2000

    12 * Code generation objectives: Unspecified

    13 * Validation result: Not run

    14 */

    15

    16#ifndef RTW_HEADER_Inverter_000_test_h_

    17#define RTW_HEADER_Inverter_000_test_h_

    18#include <math.h>

    19#include <string.h>

    20#include <stddef.h>

    21#ifndef Inverter_000_test_COMMON_INCLUDES_

    22# define Inverter_000_test_COMMON_INCLUDES_

    23#include <IQmathLib.h>

    24#include "rtwtypes.h"

    25#include "F2837xD_device.h"

    26#include "F2837xD_gpio.h"

    27#include "F2837xD_Examples.h"

    28#include "IQmathLib.h"

    29#include "MW_c2000DAC.h"

    30#endif                                 /* Inverter_000_test_COMMON_INCLUDES_ */

    31

    32#include "Inverter_000_test_types.h"

    33#include "MW_target_hardware_resources.h"

    34#include "IQmathLib.h"

    35

    36/* Macros for accessing real-time model data structure */

    37#ifndef rtmGetErrorStatus

    38# define rtmGetErrorStatus(rtm)        ((rtm)->errorStatus)

    39#endif

    40

    41#ifndef rtmSetErrorStatus

    42# define rtmSetErrorStatus(rtm, val)   ((rtm)->errorStatus = (val))

    43#endif

    44

    45#ifndef rtmStepTask

    46# define rtmStepTask(rtm, idx)         ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)

    47#endif

    48

    49#ifndef rtmTaskCounter

    50# define rtmTaskCounter(rtm, idx)      ((rtm)->Timing.TaskCounters.TID[(idx)])

    51#endif

    52

    53extern void config_ePWM_GPIO (void);

    54

    55/* Block signals (default storage) */

    56typedef struct {

    57  real32_T RateTransition1;            /* '<Root>/Rate Transition1' */

    58  real32_T RateTransition5[3];         /* '<Root>/Rate Transition5' */

    59  int32_T RateTransition60[3];         /* '<Root>/Rate Transition60' */

    60  boolean_T RelationalOperator2[3];    /* '<Root>/Relational Operator2' */

    61} B_Inverter_000_test_T;

    62

    63/* Block states (default storage) for system '<Root>' */

    64typedef struct {

    65  int32_T UnitDelay_DSTATE;            /* '<S12>/Unit Delay' */

    66  real32_T RateTransition1_Buffer0;    /* '<Root>/Rate Transition1' */

    67} DW_Inverter_000_test_T;

    68

    69/* Parameters (default storage) */

    70struct P_Inverter_000_test_T_ {

    71  real_T FloattoIQN2_P1;               /* Expression: Q_value

    72                                        * Referenced by: '<S4>/Float to IQN2'

    73                                        */

    74  real_T FloattoIQN_P1;                /* Expression: Q_value

    75                                        * Referenced by: '<S4>/Float to IQN'

    76                                        */

    77  real_T FloattoIQN1_P1;               /* Expression: Q_value

    78                                        * Referenced by: '<S4>/Float to IQN1'

    79                                        */

    80  real_T FloattoIQN_P1_j;              /* Expression: Q_value

    81                                        * Referenced by: '<S11>/Float to IQN'

    82                                        */

    83  real_T FloattoIQN1_P1_b;             /* Expression: Q_value

    84                                        * Referenced by: '<S2>/Float to IQN1'

    85                                        */

    86  real_T Constant_Value;               /* Expression: 4096

    87                                        * Referenced by: '<Root>/Constant'

    88                                        */

    89  int32_T Saturation4_UpperSat;        /* Computed Parameter: Saturation4_UpperSat

    90                                        * Referenced by: '<Root>/Saturation4'

    91                                        */

    92  int32_T Saturation4_LowerSat;        /* Computed Parameter: Saturation4_LowerSat

    93                                        * Referenced by: '<Root>/Saturation4'

    94                                        */

    95  int32_T Constant8_Value;             /* Computed Parameter: Constant8_Value

    96                                        * Referenced by: '<Root>/Constant8'

    97                                        */

    98  int32_T Saturation5_UpperSat;        /* Computed Parameter: Saturation5_UpperSat

    99                                        * Referenced by: '<Root>/Saturation5'

    100                                        */

    101  int32_T Saturation5_LowerSat;        /* Computed Parameter: Saturation5_LowerSat

    102                                        * Referenced by: '<Root>/Saturation5'

    103                                        */

    104  int32_T Constant3_Value;             /* Computed Parameter: Constant3_Value

    105                                        * Referenced by: '<Root>/Constant3'

    106                                        */

    107  int32_T Constant11_Value;            /* Computed Parameter: Constant11_Value

    108                                        * Referenced by: '<S4>/Constant11'

    109                                        */

    110  int32_T Constant8_Value_e;           /* Computed Parameter: Constant8_Value_e

    111                                        * Referenced by: '<S4>/Constant8'

    112                                        */

    113  int32_T Constant9_Value;             /* Computed Parameter: Constant9_Value

    114                                        * Referenced by: '<S4>/Constant9'

    115                                        */

    116  int32_T UnitDelay_InitialCondition;  /* Computed Parameter: UnitDelay_InitialCondition

    117                                        * Referenced by: '<S12>/Unit Delay'

    118                                        */

    119  int32_T u_Value;                     /* Computed Parameter: u_Value

    120                                        * Referenced by: '<S14>/1'

    121                                        */

    122  int32_T u_Value_e;                   /* Computed Parameter: u_Value_e

    123                                        * Referenced by: '<S14>/-1'

    124                                        */

    125  int32_T u_Value_f;                   /* Computed Parameter: u_Value_f

    126                                        * Referenced by: '<S15>/1'

    127                                        */

    128  int32_T u_Value_c;                   /* Computed Parameter: u_Value_c

    129                                        * Referenced by: '<S15>/-1'

    130                                        */

    131  int32_T Gain_Gain;                   /* Computed Parameter: Gain_Gain

    132                                        * Referenced by: '<S2>/Gain'

    133                                        */

    134  int32_T Gain_Gain_h;                 /* Computed Parameter: Gain_Gain_h

    135                                        * Referenced by: '<S5>/Gain'

    136                                        */

    137  int32_T Gain1_Gain;                  /* Computed Parameter: Gain1_Gain

    138                                        * Referenced by: '<S5>/Gain1'

    139                                        */

    140  real32_T RateTransition1_InitialConditio;/* Computed Parameter: RateTransition1_InitialConditio

    141                                            * Referenced by: '<Root>/Rate Transition1'

    142                                            */

    143  real32_T Gain3_Gain;                 /* Computed Parameter: Gain3_Gain

    144                                        * Referenced by: '<S4>/Gain3'

    145                                        */

    146  real32_T Constant13_Value;           /* Computed Parameter: Constant13_Value

    147                                        * Referenced by: '<S4>/Constant13'

    148                                        */

    149  real32_T Constant14_Value;           /* Computed Parameter: Constant14_Value

    150                                        * Referenced by: '<S4>/Constant14'

    151                                        */

    152  real32_T Constant10_Value;           /* Computed Parameter: Constant10_Value

    153                                        * Referenced by: '<S4>/Constant10'

    154                                        */

    155  real32_T Gain2_Gain;                 /* Computed Parameter: Gain2_Gain

    156                                        * Referenced by: '<S4>/Gain2'

    157                                        */

    158  real32_T Constant_Value_j;           /* Computed Parameter: Constant_Value_j

    159                                        * Referenced by: '<S11>/Constant'

    160                                        */

    161  real32_T Gain2_Gain_f;               /* Computed Parameter: Gain2_Gain_f

    162                                        * Referenced by: '<Root>/Gain2'

    163                                        */

    164  real32_T Bias1_Bias;                 /* Computed Parameter: Bias1_Bias

    165                                        * Referenced by: '<Root>/Bias1'

    166                                        */

    167  real32_T Constant15_Value;           /* Computed Parameter: Constant15_Value

    168                                        * Referenced by: '<S1>/Constant15'

    169                                        */

    170  real32_T Constant13_Value_a;         /* Computed Parameter: Constant13_Value_a

    171                                        * Referenced by: '<S1>/Constant13'

    172                                        */

    173  real32_T Constant14_Value_m;         /* Computed Parameter: Constant14_Value_m

    174                                        * Referenced by: '<S1>/Constant14'

    175                                        */

    176  real32_T Constant2_Value;            /* Computed Parameter: Constant2_Value

    177                                        * Referenced by: '<Root>/Constant2'

    178                                        */

    179  real32_T Bias2_Bias;                 /* Computed Parameter: Bias2_Bias

    180                                        * Referenced by: '<Root>/Bias2'

    181                                        */

    182  real32_T Constant14_Value_mo;        /* Computed Parameter: Constant14_Value_mo

    183                                        * Referenced by: '<Root>/Constant14'

    184                                        */

    185};

    186

    187/* Real-time Model Data Structure */

    188struct tag_RTM_Inverter_000_test_T {

    189  const char_T *errorStatus;

    190

    191  /*

    192   * Timing:

    193   * The following substructure contains information regarding

    194   * the timing information for the model.

    195   */

    196  struct {

    197    struct {

    198      uint8_T TID[2];

    199    } TaskCounters;

    200

    201    struct {

    202      boolean_T TID0_1;

    203    } RateInteraction;

    204  } Timing;

    205};

    206

    207/* Block parameters (default storage) */

    208extern P_Inverter_000_test_T Inverter_000_test_P;

    209

    210/* Block signals (default storage) */

    211extern B_Inverter_000_test_T Inverter_000_test_B;

    212

    213/* Block states (default storage) */

    214extern DW_Inverter_000_test_T Inverter_000_test_DW;

    215

    216/* External function called from main */

    217extern void Inverter_000_test_SetEventsForThisBaseStep(boolean_T *eventFlags);

    218

    219/* Model entry point functions */

    220extern void Inverter_000_test_SetEventsForThisBaseStep(boolean_T *eventFlags);

    221extern void Inverter_000_test_initialize(void);

    222extern void Inverter_000_test_step0(void);

    223extern void Inverter_000_test_step1(void);

    224extern void Inverter_000_test_terminate(void);

    225

    226/* Real-time Model object */

    227extern RT_MODEL_Inverter_000_test_T *const Inverter_000_test_M;

    228

    229/*-

    230 * These blocks were eliminated from the model due to optimizations:

    231 *

    232 * Block '<Root>/Rate Transition61' : Unused code path elimination

    233 * Block '<Root>/Rate Transition62' : Unused code path elimination

    234 * Block '<S17>/Data Type Duplicate' : Unused code path elimination

    235 * Block '<Root>/Rate Transition4' : Eliminated since input and output rates are identical

    236 * Block '<S17>/Conversion' : Eliminate redundant data type conversion

    237 */

    238

    239/*-

    240 * The generated code includes comments that allow you to trace directly

    241 * back to the appropriate location in the model.  The basic format

    242 * is <system>/block_name, where system is the system number (uniquely

    243 * assigned by Simulink) and block_name is the name of the block.

    244 *

    245 * Use the MATLAB hilite_system command to trace the generated code back

    246 * to the model.  For example,

    247 *

    248 * hilite_system('<S3>')    - opens system 3

    249 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3

    250 *

    251 * Here is the system hierarchy for this model

    252 *

    253 * '<Root>' : 'Inverter_000_test'

    254 * '<S1>'   : 'Inverter_000_test/InverterPWM'

    255 * '<S2>'   : 'Inverter_000_test/Modulation1'

    256 * '<S3>'   : 'Inverter_000_test/Modulation3'

    257 * '<S4>'   : 'Inverter_000_test/Reference'

    258 * '<S5>'   : 'Inverter_000_test/Modulation1/Carrier1'

    259 * '<S6>'   : 'Inverter_000_test/Modulation1/Carrier2'

    260 * '<S7>'   : 'Inverter_000_test/Modulation1/Carrier1/MATLAB Function'

    261 * '<S8>'   : 'Inverter_000_test/Modulation1/Carrier2/MATLAB Function'

    262 * '<S9>'   : 'Inverter_000_test/Modulation1/Carrier2/MATLAB Function1'

    263 * '<S10>'  : 'Inverter_000_test/Modulation3/Carrier1'

    264 * '<S11>'  : 'Inverter_000_test/Reference/Inverse Park Transformation'

    265 * '<S12>'  : 'Inverter_000_test/Reference/Ramp Generator1'

    266 * '<S13>'  : 'Inverter_000_test/Reference/Ramp Generator1/Convert Param To fix-pt with floor  rounding mode'

    267 * '<S14>'  : 'Inverter_000_test/Reference/Ramp Generator1/Subsystem'

    268 * '<S15>'  : 'Inverter_000_test/Reference/Ramp Generator1/Subsystem1'

    269 * '<S16>'  : 'Inverter_000_test/Reference/Ramp Generator1/Convert Param To fix-pt with floor  rounding mode/Embedded MATLAB Function'

    270 * '<S17>'  : 'Inverter_000_test/Reference/Ramp Generator1/Subsystem/Data Type Conversion Inherited'

    271 */

    272#endif                                 /* RTW_HEADER_Inverter_000_test_h_ */

    273

    274/*

    275 * File trailer for generated code.

    276 *

    277 * [EOF]

    278 */

    279