/**
 * @file
 * @brief Generated model file.
 * 
 * Date:  2025-11-27 13:53
 * 
 * X2C-Version: 6.5.3948
 * X2C-Edition: Development
 */
/* This file is part of X2C. web: x2c.lcm.at                                                                          */

/* Model: DemoApplication                                                                                             */
/* Date:  2025-11-27 13:53                                                                                            */

/* X2C-Version: 6.5.3948                                                                                              */
/* X2C-Edition: Development                                                                                           */

#ifndef X2C_H
#define X2C_H

#ifdef __cplusplus
extern "C" {
#endif

/**********************************************************************************************************************/
/**     Includes                                                                                                     **/
/**********************************************************************************************************************/
/* Common includes                                                                                                    */
#include "Constant_Bool.h"
#include "Mult_Float32.h"
#include "I_FiP16.h"
#include "Constant_Float32.h"
#include "Negation_FiP16.h"
#include "Real2Int_Float32_Bool.h"
#include "Sin3Gen_Float32.h"
#include "SinGen_Float32.h"
#include "LoopBreaker_FiP16.h"
#include "Not_Bool.h"
#include "Constant_FiP16.h"
#include "AutoSwitch_Float32.h"
#include "Int2Real_Bool_Float32.h"
#include "AutoSwitch_FiP16.h"
#include "Scope_Main.h"
#include "CommonFcts.h"

/**********************************************************************************************************************/
/**     Defines                                                                                                      **/
/**********************************************************************************************************************/
#define FUNCTIONS \
    CONSTANT_BOOL_FUNCTIONS , \
    MULT_FLOAT32_FUNCTIONS , \
    I_FIP16_FUNCTIONS , \
    CONSTANT_FLOAT32_FUNCTIONS , \
    NEGATION_FIP16_FUNCTIONS , \
    REAL2INT_FLOAT32_BOOL_FUNCTIONS , \
    SIN3GEN_FLOAT32_FUNCTIONS , \
    SINGEN_FLOAT32_FUNCTIONS , \
    LOOPBREAKER_FIP16_FUNCTIONS , \
    NOT_BOOL_FUNCTIONS , \
    CONSTANT_FIP16_FUNCTIONS , \
    AUTOSWITCH_FLOAT32_FUNCTIONS , \
    INT2REAL_BOOL_FLOAT32_FUNCTIONS , \
    AUTOSWITCH_FIP16_FUNCTIONS , \
    SCOPE_MAIN_FUNCTIONS

#define PARAMETER_TABLE \
    { 1u, &x2cModel.blocks.bAmplitude } , \
    { 2u, &x2cModel.blocks.bAutoSwitch } , \
    { 3u, &x2cModel.blocks.bFrequency } , \
    { 4u, &x2cModel.blocks.bInt2Real } , \
    { 5u, &x2cModel.blocks.bLED_off } , \
    { 6u, &x2cModel.blocks.bLED_on } , \
    { 7u, &x2cModel.blocks.bMult } , \
    { 8u, &x2cModel.blocks.bNot } , \
    { 9u, &x2cModel.blocks.sOscillator.bAutoSwitch } , \
    { 10u, &x2cModel.blocks.sOscillator.bConstant } , \
    { 11u, &x2cModel.blocks.sOscillator.bEnable } , \
    { 12u, &x2cModel.blocks.sOscillator.bInit } , \
    { 13u, &x2cModel.blocks.sOscillator.bIntegrator } , \
    { 14u, &x2cModel.blocks.sOscillator.bLoopBreaker } , \
    { 15u, &x2cModel.blocks.sOscillator.bNegation } , \
    { 16u, &x2cModel.blocks.bReal2Int } , \
    { 17u, &x2cModel.blocks.bSin3Gen } , \
    { 18u, &x2cModel.blocks.bSinGen } , \
    { 24u, &x2cScope }

#define INPORT_PARAMID_TABLE \
    { 19u, 1u, &x2cModel.inports.bButton1 } , \
    { 20u, 1u, &x2cModel.inports.bButton2 } 

#define OUTPORT_PARAMID_TABLE \
    { 21u, 1u, &x2cModel.outports.bLED1 } , \
    { 22u, 1u, &x2cModel.outports.bLED2 } , \
    { 23u, 2u, &x2cModel.outports.bOsc_out } 


/**********************************************************************************************************************/
/**                                            Model structure definition                                            **/
/**********************************************************************************************************************/
struct x2cModel {
/*  Control Blocks                                                                                                    */
    struct {
/*      Sub-system Oscillator                                                                                         */
        struct {
            AUTOSWITCH_FIP16 bAutoSwitch;
            CONSTANT_FIP16 bConstant;
            CONSTANT_BOOL bEnable;
            CONSTANT_FIP16 bInit;
            I_FIP16 bIntegrator;
            LOOPBREAKER_FIP16 bLoopBreaker;
            NEGATION_FIP16 bNegation;
        } sOscillator;
        CONSTANT_FLOAT32 bAmplitude;
        AUTOSWITCH_FLOAT32 bAutoSwitch;
        CONSTANT_FLOAT32 bFrequency;
        INT2REAL_BOOL_FLOAT32 bInt2Real;
        CONSTANT_FLOAT32 bLED_off;
        CONSTANT_FLOAT32 bLED_on;
        MULT_FLOAT32 bMult;
        NOT_BOOL bNot;
        REAL2INT_FLOAT32_BOOL bReal2Int;
        SIN3GEN_FLOAT32 bSin3Gen;
        SINGEN_FLOAT32 bSinGen;
    } blocks;
/*  Inports                                                                                                           */
    struct {
        bool bButton1;
        bool bButton2;
    } inports;
/*  Outports                                                                                                          */
    struct {
        bool* bLED1;
        bool* bLED2;
        int16* bOsc_out;
    } outports;
};

/**********************************************************************************************************************/
/**     Externals                                                                                                    **/
/**********************************************************************************************************************/
extern struct x2cModel x2cModel;

extern const uint32 x2cModelIdentifier;

extern const tBlockFunctions blockFunctionTable[];
extern const tParameterTable parameterIdTable[];
extern const tIoParamIdEntry inportParamIdTable[];
extern const tIoParamIdEntry outportParamIdTable[];
extern const tMaskParameterEntry maskParamIdTable[];
extern const tMaskParamExtRecord maskParamExtTable[];
extern const tMaskParamDataRecord maskParamDataTable[];


/**********************************************************************************************************************/
/**     Prototypes                                                                                                   **/
/**********************************************************************************************************************/
void X2C_Init(void);
void X2C_Update(void);
void X2C_Update_1(void);

#ifdef __cplusplus
}
#endif

#endif
