/*
 * File: Vejlupek_Car4_HIL_PIDSpeed.h
 *
 * Real-Time Workshop code generated for Simulink model Vejlupek_Car4_HIL_PIDSpeed.
 *
 * Model version                        : 1.460
 * Real-Time Workshop file version      : 7.3  (R2009a)  15-Jan-2009
 * Real-Time Workshop file generated on : Fri Apr 30 16:12:44 2010
 * TLC version                          : 7.3 (Jan 18 2009)
 * C source code generated on           : Fri Apr 30 16:12:44 2010
 *--------------------------------------------------------------
 *   Embedded Coder for Microchip dsPIC family.                 |
 *   Generate .c and .h files from your Matlab/simulink model   |
 *   and compile the diagram to .hex and .coff file that can be |
 *   downloaded directly into the microcontroller               |
 *                                                              |
 * Licence Accorded to Ing. Robert Grepl, Ph.D.                 |
 *                     Technical University Brno                |
 *                                                              |
 *   Written by Lubin KERHUEL -  http://www.kerhuel.eu          |
 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
 *   Version 3.1                               26-Nov-2009      |
 *   For Matlab 7.8             R2009a                          |
 *--------------------------------------------------------------
 */

#ifndef RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_
#define RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_
#ifndef Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_
# define Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_
#include <math.h>
#include <string.h>
#include "rtwtypes.h"
#include "rtGetInf.h"
#include "rtGetNaN.h"
#include "rt_ABS.h"
#include "rt_SATURATE.h"
#include "rt_nonfinite.h"
#endif                                 /* Vejlupek_Car4_HIL_PIDSpeed_COMMON_INCLUDES_ */

#include "Vejlupek_Car4_HIL_PIDSpeed_types.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
# define rtmGetErrorStatus(rtm)        ((void*) 0)
#endif

#ifndef rtmSetErrorStatus
# define rtmSetErrorStatus(rtm, val)   ((void) 0)
#endif

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

#ifndef rtmGetStopRequested
# define rtmGetStopRequested(rtm)      ((void*) 0)
#endif

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

/* Block signals (auto storage) */
typedef struct {
  uint16_T AngleCountby1roll1000QEI500mode;/* '<S6>/Angle => Count by 1 roll = 1000 QEI 500 mode x2 without index chx' */
  uint16_T DataTypeConversion;         /* '<Root>/Data Type Conversion' */
  uint16_T DataTypeConversion1;        /* '<Root>/Data Type Conversion1' */
  uint16_T DataTypeConversion2;        /* '<Root>/Data Type Conversion2' */
  uint16_T DataTypeConversion3;        /* '<Root>/Data Type Conversion3' */
  uint16_T DataTypeConversion4;        /* '<Root>/Data Type Conversion4' */
  uint16_T DataTypeConversion5;        /* '<Root>/Data Type Conversion5' */
  uint16_T proud;                      /* '<S6>/proud' */
  uint16_T Gain;                       /* '<S16>/Gain' */
  uint8_T RxInput1;                    /* '<Root>/Rx Input1' */
  boolean_T Termal_Flag;               /* '<S6>/Termal_Flag' */
  boolean_T Switch;                    /* '<S16>/Switch' */
  boolean_T DataTypeConversion_e;      /* '<S1>/Data Type Conversion' */
} BlockIO_Vejlupek_Car4_HIL_PIDSp;

/* Block states (auto storage) for system '<Root>' */
typedef struct {
  real_T DiscreteTimeIntegrator_DSTATE;/* '<S3>/Discrete-Time Integrator' */
  real_T UD_DSTATE;                    /* '<S15>/UD' */
  int32_T DiscreteFilter2_DSTATE;      /* '<S4>/Discrete Filter2' */
  int32_T DiscreteFilter1_DSTATE;      /* '<S4>/Discrete Filter1' */
  int32_T DiscreteFilter2_tmp;         /* '<S4>/Discrete Filter2' */
  int32_T DiscreteFilter1_tmp;         /* '<S4>/Discrete Filter1' */
  int32_T clockTickCounter;            /* '<S1>/2 Hz LED' */
  int16_T Memory_1_DSTATE;             /* '<S14>/Memory_1' */
  uint16_T UnitDelay1_DSTATE;          /* '<S4>/Unit Delay1' */
  int16_T DiscreteFilter_DSTATE;       /* '<Root>/Discrete Filter' */
  int16_T DiscreteFilter_tmp;          /* '<Root>/Discrete Filter' */
  uint8_T UnitDelay4_DSTATE;           /* '<S2>/Unit Delay4' */
  uint8_T UnitDelay9_DSTATE;           /* '<S2>/Unit Delay9' */
  uint8_T UnitDelay10_DSTATE;          /* '<S2>/Unit Delay10' */
  uint8_T UnitDelay7_DSTATE;           /* '<S2>/Unit Delay7' */
  uint8_T UnitDelay8_DSTATE;           /* '<S2>/Unit Delay8' */
  uint8_T UnitDelay1_DSTATE_g;         /* '<S2>/Unit Delay1' */
  uint8_T UnitDelay2_DSTATE;           /* '<S2>/Unit Delay2' */
  uint8_T UnitDelay3_DSTATE;           /* '<S2>/Unit Delay3' */
  uint8_T UnitDelay5_DSTATE;           /* '<S2>/Unit Delay5' */
  uint8_T UnitDelay6_DSTATE;           /* '<S2>/Unit Delay6' */
} D_Work_Vejlupek_Car4_HIL_PIDSpe;

/* Real-time Model Data Structure */
struct RT_MODEL_Vejlupek_Car4_HIL_PIDS {
  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    struct {
      uint8_T TID[2];
    } TaskCounters;
  } Timing;
};

/* Block signals (auto storage) */
extern BlockIO_Vejlupek_Car4_HIL_PIDSp Vejlupek_Car4_HIL_PIDSpeed_B;

/* Block states (auto storage) */
extern D_Work_Vejlupek_Car4_HIL_PIDSpe Vejlupek_Car4_HIL_PIDSpee_DWork;

/*
 * Exported States
 *
 * Note: Exported states are block states with an exported global
 * storage class designation.  RTW declares the memory for these states
 * and exports their symbols.
 *
 */
extern uint16_T ct_turns;              /* '<Root>/Encoder_01' */

/* External function called from main */
extern void Vejlupek_Car4_HIL_PIDSpeed_SetEventsForThisBaseStep(boolean_T
  *eventFlags);

/* Model entry point functions */
extern void Vejlupek_Car4_HIL_PIDSpeed_SetEventsForThisBaseStep(boolean_T
  *eventFlags);
extern void Vejlupek_Car4_HIL_PIDSpeed_initialize(boolean_T firstTime);
extern void Vejlupek_Car4_HIL_PIDSpeed_step(int_T tid);

/* Real-time Model object */
extern RT_MODEL_Vejlupek_Car4_HIL_PIDS *Vejlupek_Car4_HIL_PIDSpeed_M;

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : Vejlupek_Car4_HIL_PIDSpeed
 * '<S1>'   : Vejlupek_Car4_HIL_PIDSpeed/LED 2 Hz
 * '<S2>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM
 * '<S3>'   : Vejlupek_Car4_HIL_PIDSpeed/PII regulator
 * '<S4>'   : Vejlupek_Car4_HIL_PIDSpeed/Pretykajici derivace
 * '<S5>'   : Vejlupek_Car4_HIL_PIDSpeed/dbl-click to open Graphical interface
 * '<S6>'   : Vejlupek_Car4_HIL_PIDSpeed/do_motoru
 * '<S7>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant
 * '<S8>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant1
 * '<S9>'   : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant2
 * '<S10>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Compare To Constant3
 * '<S11>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem
 * '<S12>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem1
 * '<S13>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem2
 * '<S14>'  : Vejlupek_Car4_HIL_PIDSpeed/NAPROSTO ULTIMATNI PACKETOVACI SYSTEM/Subsystem3
 * '<S15>'  : Vejlupek_Car4_HIL_PIDSpeed/PII regulator/Discrete Derivative
 * '<S16>'  : Vejlupek_Car4_HIL_PIDSpeed/do_motoru/Napeti_na_motoru
 */
#endif                                 /* RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_h_ */

/* File trailer for Real-Time Workshop generated code.
 *
 * [EOF]
 */
