/*
 * File: Merici_jednotka.h
 *
 * Real-Time Workshop code generated for Simulink model Merici_jednotka.
 *
 * Model version                        : 1.194
 * Real-Time Workshop file version      : 7.3  (R2009a)  15-Jan-2009
 * Real-Time Workshop file generated on : Tue May 21 16:17:24 2013
 * TLC version                          : 7.3 (Jan 18 2009)
 * C source code generated on           : Tue May 21 16:17:25 2013
 *--------------------------------------------------------------
 *   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.5                               27-Apr-2011      |
 *   For Matlab 7.8             R2009a                          |
 *--------------------------------------------------------------
 */

#ifndef RTW_HEADER_Merici_jednotka_h_
#define RTW_HEADER_Merici_jednotka_h_
#ifndef Merici_jednotka_COMMON_INCLUDES_
# define Merici_jednotka_COMMON_INCLUDES_
#include <math.h>
#include <string.h>
#include "rtwtypes.h"
#include "rtGetInf.h"
#include "rtGetNaN.h"
#include "rt_SATURATE.h"
#include "rt_nonfinite.h"
#endif                                 /* Merici_jednotka_COMMON_INCLUDES_ */

#include "Merici_jednotka_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 rtmGetStopRequested
# define rtmGetStopRequested(rtm)      ((void*) 0)
#endif

/* Block signals (auto storage) */
typedef struct {
  uint16_T Teplota;                    /* '<Root>/ADC ' */
  uint16_T Vlhkost;                    /* '<Root>/ADC ' */
  uint16_T Fotorezistor;               /* '<Root>/ADC ' */
  uint8_T RxInput;                     /* '<Root>/Rx Input' */
  uint8_T DataTypeConversion8;         /* '<Root>/Data Type Conversion8' */
  uint8_T DataTypeConversion1;         /* '<Root>/Data Type Conversion1' */
  uint8_T DataTypeConversion2;         /* '<Root>/Data Type Conversion2' */
  uint8_T DataTypeConversion3;         /* '<Root>/Data Type Conversion3' */
  uint8_T DataTypeConversion4;         /* '<Root>/Data Type Conversion4' */
  uint8_T DataTypeConversion5;         /* '<Root>/Data Type Conversion5' */
  uint8_T DataTypeConversion7;         /* '<Root>/Data Type Conversion7' */
  boolean_T A1;                        /* '<S1>/A1' */
  boolean_T A2;                        /* '<S1>/A2' */
  boolean_T A3;                        /* '<S1>/A3' */
  boolean_T A4;                        /* '<S1>/A4' */
  boolean_T DataTypeConversion;        /* '<Root>/Data Type Conversion' */
  boolean_T y;                         /* '<Root>/Chart' */
} BlockIO_Merici_jednotka;

/* Block states (auto storage) for system '<Root>' */
typedef struct {
  int32_T clockTickCounter;            /* '<Root>/Pulse Generator' */
  uint32_T UnitDelay4_DSTATE;          /* '<S7>/Unit Delay4' */
  uint32_T UnitDelay3_DSTATE;          /* '<S7>/Unit Delay3' */
  uint32_T UnitDelay2_DSTATE;          /* '<S7>/Unit Delay2' */
  uint32_T UnitDelay_DSTATE;           /* '<S7>/Unit Delay' */
  uint32_T UnitDelay1_DSTATE;          /* '<S7>/Unit Delay1' */
  uint8_T is_active_c1_Merici_jednotka;/* '<Root>/Chart' */
  uint8_T is_c1_Merici_jednotka;       /* '<Root>/Chart' */
  uint8_T temporalCounter_i1;          /* '<Root>/Chart' */
} D_Work_Merici_jednotka;

/* Parameters (auto storage) */
struct Parameters_Merici_jednotka_ {
  real_T Constant2_Value;              /* Expression: 500
                                        * '<S4>/Constant2'
                                        */
  real_T Gain5_Gain;                   /* Expression: 1/10
                                        * '<S4>/Gain5'
                                        */
  real_T Gain1_Gain;                   /* Expression: 10
                                        * '<S4>/Gain1'
                                        */
  real_T Constant12_Value;             /* Expression: 1.0546
                                        * '<S4>/Constant12'
                                        */
  real_T Gain6_Gain;                   /* Expression: 0.00216
                                        * '<S4>/Gain6'
                                        */
  real_T Constant1_Value;              /* Expression: 0.5
                                        * '<S4>/Constant1'
                                        */
  real_T Gain7_Gain;                   /* Expression: 1/0.021
                                        * '<S4>/Gain7'
                                        */
  real_T PulseGenerator_Amp;           /* Expression: 1
                                        * '<Root>/Pulse Generator'
                                        */
  real_T PulseGenerator_Period;        /* Computed Parameter: Period
                                        * '<Root>/Pulse Generator'
                                        */
  real_T PulseGenerator_Duty;          /* Computed Parameter: PulseWidth
                                        * '<Root>/Pulse Generator'
                                        */
  real_T PulseGenerator_PhaseDelay;    /* Expression: 0
                                        * '<Root>/Pulse Generator'
                                        */
  uint32_T UnitDelay4_X0;              /* Computed Parameter: X0
                                        * '<S7>/Unit Delay4'
                                        */
  uint32_T UnitDelay3_X0;              /* Computed Parameter: X0
                                        * '<S7>/Unit Delay3'
                                        */
  uint32_T UnitDelay2_X0;              /* Computed Parameter: X0
                                        * '<S7>/Unit Delay2'
                                        */
  uint32_T UnitDelay_X0;               /* Computed Parameter: X0
                                        * '<S7>/Unit Delay'
                                        */
  uint32_T UnitDelay1_X0;              /* Computed Parameter: X0
                                        * '<S7>/Unit Delay1'
                                        */
  uint32_T Gain_Gain;                  /* Computed Parameter: Gain
                                        * '<S7>/Gain'
                                        */
  int16_T Saturation_UpperSat;         /* Computed Parameter: UpperLimit
                                        * '<Root>/Saturation'
                                        */
  int16_T Saturation_LowerSat;         /* Computed Parameter: LowerLimit
                                        * '<Root>/Saturation'
                                        */
  int16_T Saturation1_UpperSat;        /* Computed Parameter: UpperLimit
                                        * '<Root>/Saturation1'
                                        */
  int16_T Saturation1_LowerSat;        /* Computed Parameter: LowerLimit
                                        * '<Root>/Saturation1'
                                        */
  uint16_T Switch_Threshold;           /* Computed Parameter: Threshold
                                        * '<S4>/Switch'
                                        */
  uint16_T Gain4_Gain;                 /* Computed Parameter: Gain
                                        * '<S4>/Gain4'
                                        */
  uint16_T Gain2_Gain;                 /* Computed Parameter: Gain
                                        * '<S4>/Gain2'
                                        */
  uint8_T Constant_Value;              /* Computed Parameter: Value
                                        * '<S1>/Constant'
                                        */
  uint8_T Constant14_Value;            /* Computed Parameter: Value
                                        * '<S4>/Constant14'
                                        */
  uint8_T Constant13_Value;            /* Computed Parameter: Value
                                        * '<S4>/Constant13'
                                        */
  uint8_T Constant5_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant5'
                                        */
  uint8_T Constant9_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant9'
                                        */
  uint8_T Constant6_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant6'
                                        */
  uint8_T Constant4_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant4'
                                        */
  uint8_T Constant8_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant8'
                                        */
  uint8_T Constant3_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant3'
                                        */
  uint8_T Constant2_Value_a;           /* Computed Parameter: Value
                                        * '<S6>/Constant2'
                                        */
  uint8_T Constant7_Value;             /* Computed Parameter: Value
                                        * '<S6>/Constant7'
                                        */
  uint8_T Constant1_Value_i;           /* Computed Parameter: Value
                                        * '<S6>/Constant1'
                                        */
  uint8_T START_Value;                 /* Computed Parameter: Value
                                        * '<S6>/START'
                                        */
  uint8_T Gain_Gain_g;                 /* Computed Parameter: Gain
                                        * '<S1>/Gain'
                                        */
  uint8_T Gain1_Gain_i;                /* Computed Parameter: Gain
                                        * '<S1>/Gain1'
                                        */
  uint8_T Gain2_Gain_d;                /* Computed Parameter: Gain
                                        * '<S1>/Gain2'
                                        */
  uint8_T Gain3_Gain;                  /* Computed Parameter: Gain
                                        * '<S1>/Gain3'
                                        */
};

/* Block parameters (auto storage) */
extern Parameters_Merici_jednotka Merici_jednotka_P;

/* Block signals (auto storage) */
extern BlockIO_Merici_jednotka Merici_jednotka_B;

/* Block states (auto storage) */
extern D_Work_Merici_jednotka Merici_jednotka_DWork;

/* Model entry point functions */
extern void Merici_jednotka_initialize(boolean_T firstTime);
extern void Merici_jednotka_step(void);

/*-
 * 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>' : Merici_jednotka
 * '<S1>'   : Merici_jednotka/Adresa
 * '<S2>'   : Merici_jednotka/Chart
 * '<S3>'   : Merici_jednotka/Embedded MATLAB Function
 * '<S4>'   : Merici_jednotka/Prepocet hodnot
 * '<S5>'   : Merici_jednotka/Simulink Configuration
 * '<S6>'   : Merici_jednotka/TX odeslani
 * '<S7>'   : Merici_jednotka/Prepocet hodnot/prumer 5 hodnot
 */
#endif                                 /* RTW_HEADER_Merici_jednotka_h_ */

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