#### File: D:\bobes\0 skola\_car4\my matlab\HIL - PID speed\firmware\Vejlupek_Car4_HIL_PIDSpeed_dspic\sources\Vejlupek_Car4_HIL_PIDSpeed.h
        1   /*
        2    * File: Vejlupek_Car4_HIL_PIDSpeed.h
        3    *
        4    * Real-Time Workshop code generated for Simulink model Vejlupek_Car4_HIL_PIDSpeed.
        5    *
        6    * Model version                        : 1.460
        7    * Real-Time Workshop file version      : 7.3  (R2009a)  15-Jan-2009
        8    * Real-Time Workshop file generated on : Fri Apr 30 16:12:44 2010
        9    * TLC version                          : 7.3 (Jan 18 2009)
       10    * C source code generated on           : Fri Apr 30 16:12:44 2010
       11    *--------------------------------------------------------------
       12    *   Embedded Coder for Microchip dsPIC family.                 |
       13    *   Generate .c and .h files from your Matlab/simulink model   |
       14    *   and compile the diagram to .hex and .coff file that can be |
       15    *   downloaded directly into the microcontroller               |
       16    *                                                              |
       17    * Licence Accorded to Ing. Robert Grepl, Ph.D.                 |
       18    *                     Technical University Brno                |
       19    *                                                              |
       20    *   Written by Lubin KERHUEL -  http://www.kerhuel.eu          |
       21    *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
       22    *   Version 3.1                               26-Nov-2009      |
       23    *   For Matlab 7.8             R2009a                          |
       24    *--------------------------------------------------------------
       25    */
       26
       27   #ifndef RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_
       28   #define RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_
       29   #ifndef Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_
       30   # define Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_
       31   #include <math.h>
       32   #include <string.h>
       33   #include "rtwtypes.h"
       34   #include "rtGetInf.h"
       35   #include "rtGetNaN.h"
       36   #include "rt_ABS.h"
       37   #include "rt_SATURATE.h"
       38   #include "rt_nonfinite.h"
       39   #endif                                 /* Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_ */
       40
       41   #include "Vejlupek_Car4_HIL_PIDSpeed_types.h"
       42
       43   /* Macros for accessing real-time model data structure */
       44   #ifndef rtmGetErrorStatus
       45   # define rtmGetErrorStatus(rtm)        ((void*) 0)
       46   #endif
       47
       48   #ifndef rtmSetErrorStatus
       49   # define rtmSetErrorStatus(rtm, val)   ((void) 0)
       50   #endif
       51
       52   #ifndef rtmStepTask
       53   # define rtmStepTask(rtm, idx)         ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)
       54   #endif
       55
       56   #ifndef rtmGetStopRequested
       57   # define rtmGetStopRequested(rtm)      ((void*) 0)
       58   #endif
       59
       60   #ifndef rtmTaskCounter
       61   # define rtmTaskCounter(rtm, idx)      ((rtm)->Timing.TaskCounters.TID[(idx)])
       62   #endif
       63
       64   /* Block signals (auto storage) */
       65   typedef struct {
       66     uint16_T AngleCountby1roll1000QEI500mode;/* '<S6>/Angle => Count by 1 roll = 1000 QEI 500 mode x2 without index chx' */
       67     uint16_T DataTypeConversion;         /* '<Root>/Data Type Conversion' */
       68     uint16_T DataTypeConversion1;        /* '<Root>/Data Type Conversion1' */
       69     uint16_T DataTypeConversion2;        /* '<Root>/Data Type Conversion2' */
       70     uint16_T DataTypeConversion3;        /* '<Root>/Data Type Conversion3' */
       71     uint16_T DataTypeConversion4;        /* '<Root>/Data Type Conversion4' */
       72     uint16_T DataTypeConversion5;        /* '<Root>/Data Type Conversion5' */
       73     uint16_T proud;                      /* '<S6>/proud' */
       74     uint16_T Gain;                       /* '<S16>/Gain' */
       75     uint8_T RxInput1;                    /* '<Root>/Rx Input1' */
       76     boolean_T Termal_Flag;               /* '<S6>/Termal_Flag' */
       77     boolean_T Switch;                    /* '<S16>/Switch' */
       78     boolean_T DataTypeConversion_e;      /* '<S1>/Data Type Conversion' */
       79   } BlockIO_Vejlupek_Car4_HIL_PIDSp;
       80
       81   /* Block states (auto storage) for system '<Root>' */
       82   typedef struct {
       83     real_T DiscreteTimeIntegrator_DSTATE;/* '<S3>/Discrete-Time Integrator' */
       84     real_T UD_DSTATE;                    /* '<S15>/UD' */
       85     int32_T DiscreteFilter2_DSTATE;      /* '<S4>/Discrete Filter2' */
       86     int32_T DiscreteFilter1_DSTATE;      /* '<S4>/Discrete Filter1' */
       87     int32_T DiscreteFilter2_tmp;         /* '<S4>/Discrete Filter2' */
       88     int32_T DiscreteFilter1_tmp;         /* '<S4>/Discrete Filter1' */
       89     int32_T clockTickCounter;            /* '<S1>/2 Hz LED' */
       90     int16_T Memory_1_DSTATE;             /* '<S14>/Memory_1' */
       91     uint16_T UnitDelay1_DSTATE;          /* '<S4>/Unit Delay1' */
       92     int16_T DiscreteFilter_DSTATE;       /* '<Root>/Discrete Filter' */
       93     int16_T DiscreteFilter_tmp;          /* '<Root>/Discrete Filter' */
       94     uint8_T UnitDelay4_DSTATE;           /* '<S2>/Unit Delay4' */
       95     uint8_T UnitDelay9_DSTATE;           /* '<S2>/Unit Delay9' */
       96     uint8_T UnitDelay10_DSTATE;          /* '<S2>/Unit Delay10' */
       97     uint8_T UnitDelay7_DSTATE;           /* '<S2>/Unit Delay7' */
       98     uint8_T UnitDelay8_DSTATE;           /* '<S2>/Unit Delay8' */
       99     uint8_T UnitDelay1_DSTATE_g;         /* '<S2>/Unit Delay1' */
      100     uint8_T UnitDelay2_DSTATE;           /* '<S2>/Unit Delay2' */
      101     uint8_T UnitDelay3_DSTATE;           /* '<S2>/Unit Delay3' */
      102     uint8_T UnitDelay5_DSTATE;           /* '<S2>/Unit Delay5' */
      103     uint8_T UnitDelay6_DSTATE;           /* '<S2>/Unit Delay6' */
      104   } D_Work_Vejlupek_Car4_HIL_PIDSpe;
      105
      106   /* Real-time Model Data Structure */
      107   struct RT_MODEL_Vejlupek_Car4_HIL_PIDS {
      108     /*
      109      * Timing:
      110      * The following substructure contains information regarding
      111      * the timing information for the model.
      112      */
      113     struct {
      114       struct {
      115         uint8_T TID[2];
      116       } TaskCounters;
      117     } Timing;
      118   };
      119
      120   /* Block signals (auto storage) */
      121   extern BlockIO_Vejlupek_Car4_HIL_PIDSp Vejlupek_Car4_HIL_PIDSpeed_B;
      122
      123   /* Block states (auto storage) */
      124   extern D_Work_Vejlupek_Car4_HIL_PIDSpe Vejlupek_Car4_HIL_PIDSpee_DWork;
      125
      126   /*
      127    * Exported States
      128    *
      129    * Note: Exported states are block states with an exported global
      130    * storage class designation.  RTW declares the memory for these states
      131    * and exports their symbols.
      132    *
      133    */
      134   extern uint16_T ct_turns;              /* '<Root>/Encoder_01' */
      135
      136   /* External function called from main */
      137   extern void Vejlupek_Car4_HIL_PIDSpeed_SetEventsForThisBaseStep(boolean_T
      138     *eventFlags);
      139
      140   /* Model entry point functions */
      141   extern void Vejlupek_Car4_HIL_PIDSpeed_SetEventsForThisBaseStep(boolean_T
      142     *eventFlags);
      143   extern void Vejlupek_Car4_HIL_PIDSpeed_initialize(boolean_T firstTime);
      144   extern void Vejlupek_Car4_HIL_PIDSpeed_step(int_T tid);
      145
      146   /* Real-time Model object */
      147   extern RT_MODEL_Vejlupek_Car4_HIL_PIDS *Vejlupek_Car4_HIL_PIDSpeed_M;
      148
      149   /*-
      150    * The generated code includes comments that allow you to trace directly
      151    * back to the appropriate location in the model.  The basic format
      152    * is <system>/block_name, where system is the system number (uniquely
      153    * assigned by Simulink) and block_name is the name of the block.
      154    *
      155    * Use the MATLAB hilite_system command to trace the generated code back
      156    * to the model.  For example,
      157    *
      158    * hilite_system('<S3>')    - opens system 3
      159    * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
      160    *
      161    * Here is the system hierarchy for this model
      162    *
      163    * '<Root>' : Vejlupek_Car4_HIL_PIDSpeed
      164    * '<S1>'   : Vejlupek_Car4_HIL_PIDSpeed/LED 2 Hz
      165    * '<S2>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM
      166    * '<S3>'   : Vejlupek_Car4_HIL_PIDSpeed/PII regulator
      167    * '<S4>'   : Vejlupek_Car4_HIL_PIDSpeed/Pretykajici derivace
      168    * '<S5>'   : Vejlupek_Car4_HIL_PIDSpeed/dbl-click to open Graphical interface
      169    * '<S6>'   : Vejlupek_Car4_HIL_PIDSpeed/do_motoru
      170    * '<S7>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant
      171    * '<S8>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant1
      172    * '<S9>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant2
      173    * '<S10>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant3
      174    * '<S11>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem
      175    * '<S12>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem1
      176    * '<S13>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem2
      177    * '<S14>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem3
      178    * '<S15>'  : Vejlupek_Car4_HIL_PIDSpeed/PII regulator/Discrete Derivative
      179    * '<S16>'  : Vejlupek_Car4_HIL_PIDSpeed/do_motoru/Napeti_na_motoru
      180    */
      181   #endif                                 /* RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_ */
      182
      183   /* File trailer for Real-Time Workshop generated code.
      184    *
      185    * [EOF]
      186    */