/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * File: Modell.h
 *
 * Code generated for Simulink model 'Modell'.
 *
 * Model version                  : 1.26
 * Simulink Coder version         : 24.2 (R2024b) 21-Jun-2024
 * C/C++ source code generated on : Fri Feb  7 09:14:10 2025
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Atmel->AVR
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef Modell_h_
#define Modell_h_
#ifndef Modell_COMMON_INCLUDES_
#define Modell_COMMON_INCLUDES_
#include "rtwtypes.h"
#include "rtw_extmode.h"
#include "sysran_types.h"
#include "rtw_continuous.h"
#include "rtw_solver.h"
#include "MW_AnalogIn.h"
#include "LCD.h"
#include "MW_arduino_digitalio.h"
#endif                                 /* Modell_COMMON_INCLUDES_ */

#include "Modell_types.h"
#include "MW_target_hardware_resources.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetFinalTime
#define rtmGetFinalTime(rtm)           ((rtm)->Timing.tFinal)
#endif

#ifndef rtmGetRTWExtModeInfo
#define rtmGetRTWExtModeInfo(rtm)      ((rtm)->extModeInfo)
#endif

#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

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

#ifndef rtmGetStopRequested
#define rtmGetStopRequested(rtm)       ((rtm)->Timing.stopRequestedFlag)
#endif

#ifndef rtmSetStopRequested
#define rtmSetStopRequested(rtm, val)  ((rtm)->Timing.stopRequestedFlag = (val))
#endif

#ifndef rtmGetStopRequestedPtr
#define rtmGetStopRequestedPtr(rtm)    (&((rtm)->Timing.stopRequestedFlag))
#endif

#ifndef rtmGetT
#define rtmGetT(rtm)                   ((rtm)->Timing.taskTime0)
#endif

#ifndef rtmGetTFinal
#define rtmGetTFinal(rtm)              ((rtm)->Timing.tFinal)
#endif

#ifndef rtmGetTPtr
#define rtmGetTPtr(rtm)                (&(rtm)->Timing.taskTime0)
#endif

/* Block signals (default storage) */
typedef struct {
  real_T KraftinN;                     /* '<Root>/Product' */
  boolean_T Logic[2];                  /* '<S3>/Logic' */
} B_Modell_T;

/* Block states (default storage) for system '<Root>' */
typedef struct {
  LCD_Modell_T obj;                    /* '<Root>/LCD_DDAppGeneratedBlock' */
  codertarget_arduinobase_inter_T obj_p;/* '<Root>/Analogeingang FSR402' */
  codertarget_arduinobase_block_T obj_a;/* '<Root>/Lautsprecher' */
  real_T UD_DSTATE;                    /* '<S1>/UD' */
  real_T buffer[40];                   /* '<Root>/MATLAB Function1' */
  real_T sum_buffer;                   /* '<Root>/MATLAB Function1' */
  struct {
    void *LoggedData[2];
  } Scope_PWORK;                       /* '<Root>/Scope' */

  boolean_T Delay_DSTATE[5];           /* '<Root>/Delay' */
  boolean_T Memory_PreviousInput;      /* '<S3>/Memory' */
} DW_Modell_T;

/* Parameters (default storage) */
struct P_Modell_T_ {
  real_T Difference_ICPrevInput;       /* Mask Parameter: Difference_ICPrevInput
                                        * Referenced by: '<S1>/UD'
                                        */
  boolean_T SRFlipFlop_initial_condition;
                                 /* Mask Parameter: SRFlipFlop_initial_condition
                                  * Referenced by: '<S3>/Memory'
                                  */
  real_T LCD_DDAppGeneratedBlock_SampleT;/* Expression: -1
                                          * Referenced by: '<Root>/LCD_DDAppGeneratedBlock'
                                          */
  real_T uDLookupTable_bp01Data[26];
  /* Expression: [43 46 50 55 60 72 78 87 88 99 132 168 198 320 330 362 412 535 580 627 790 875 925 950 995 1005]
   * Referenced by: '<Root>/1-D Lookup Table'
   */
  real_T Constant1_Value;              /* Expression: 1000
                                        * Referenced by: '<Root>/Constant1'
                                        */
  real_T Constant_Value;               /* Expression: 9.81
                                        * Referenced by: '<Root>/Constant'
                                        */
  real_T Constant2_Value;              /* Expression: 0.0017
                                        * Referenced by: '<Root>/Constant2'
                                        */
  real_T Constant3_Value;              /* Expression: 0.01
                                        * Referenced by: '<Root>/Constant3'
                                        */
  uint16_T uDLookupTable_tableData[26];
                                  /* Computed Parameter: uDLookupTable_tableData
                                   * Referenced by: '<Root>/1-D Lookup Table'
                                   */
  boolean_T Delay_InitialCondition;/* Computed Parameter: Delay_InitialCondition
                                    * Referenced by: '<Root>/Delay'
                                    */
  boolean_T Logic_table[16];           /* Computed Parameter: Logic_table
                                        * Referenced by: '<S3>/Logic'
                                        */
};

/* Real-time Model Data Structure */
struct tag_RTM_Modell_T {
  const char_T *errorStatus;
  RTWExtModeInfo *extModeInfo;

  /*
   * Sizes:
   * The following substructure contains sizes information
   * for many of the model attributes such as inputs, outputs,
   * dwork, sample times, etc.
   */
  struct {
    uint32_T checksums[4];
  } Sizes;

  /*
   * SpecialInfo:
   * The following substructure contains special information
   * related to other components that are dependent on RTW.
   */
  struct {
    const void *mappingInfo;
  } SpecialInfo;

  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    time_T taskTime0;
    uint32_T clockTick0;
    time_T stepSize0;
    time_T tFinal;
    boolean_T stopRequestedFlag;
  } Timing;
};

/* Block parameters (default storage) */
extern P_Modell_T Modell_P;

/* Block signals (default storage) */
extern B_Modell_T Modell_B;

/* Block states (default storage) */
extern DW_Modell_T Modell_DW;

/* Model entry point functions */
extern void Modell_initialize(void);
extern void Modell_step(void);
extern void Modell_terminate(void);

/* Real-time Model object */
extern RT_MODEL_Modell_T *const Modell_M;
extern volatile boolean_T stopRequested;
extern volatile boolean_T runModel;

/*-
 * 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>' : 'Modell'
 * '<S1>'   : 'Modell/Difference'
 * '<S2>'   : 'Modell/MATLAB Function1'
 * '<S3>'   : 'Modell/S-R Flip-Flop'
 */
#endif                                 /* Modell_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
