/**
 * @file
 * @brief Generated model file.
 * 
 * Date:  2025-11-27 13:58
 * 
 * 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:58                                                                                            */

/* 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 "Constant_Float32.h"
#include "AutoSwitch_Float32.h"
#include "Negation_Float32.h"
#include "Sin3Gen_Float32.h"
#include "LoopBreaker_Float32.h"
#include "I_Float32.h"
#include "Scope_Main.h"
#include "CommonFcts.h"

/**********************************************************************************************************************/
/**     Defines                                                                                                      **/
/**********************************************************************************************************************/
#define FUNCTIONS \
    CONSTANT_BOOL_FUNCTIONS , \
    CONSTANT_FLOAT32_FUNCTIONS , \
    AUTOSWITCH_FLOAT32_FUNCTIONS , \
    NEGATION_FLOAT32_FUNCTIONS , \
    SIN3GEN_FLOAT32_FUNCTIONS , \
    LOOPBREAKER_FLOAT32_FUNCTIONS , \
    I_FLOAT32_FUNCTIONS , \
    SCOPE_MAIN_FUNCTIONS

#define PARAMETER_TABLE \
    { 1u, &x2cModel.blocks.bAmplitude } , \
    { 2u, &x2cModel.blocks.bAutoSwitch1 } , \
    { 3u, &x2cModel.blocks.bAutoSwitch2 } , \
    { 4u, &x2cModel.blocks.bAutoSwitch3 } , \
    { 5u, &x2cModel.blocks.bDigOut1 } , \
    { 6u, &x2cModel.blocks.bDigOut2 } , \
    { 7u, &x2cModel.blocks.bDigOut3 } , \
    { 8u, &x2cModel.blocks.bDigOut4 } , \
    { 9u, &x2cModel.blocks.bLED_off } , \
    { 10u, &x2cModel.blocks.bLED_on } , \
    { 11u, &x2cModel.blocks.bLED_on_off } , \
    { 12u, &x2cModel.blocks.bSin3Gen } , \
    { 13u, &x2cModel.blocks.bStart_Stop } , \
    { 14u, &x2cModel.blocks.sTriangleGenerator.bAutoSwitch0 } , \
    { 15u, &x2cModel.blocks.sTriangleGenerator.bI } , \
    { 16u, &x2cModel.blocks.sTriangleGenerator.bInit } , \
    { 17u, &x2cModel.blocks.sTriangleGenerator.bLoopBreaker } , \
    { 18u, &x2cModel.blocks.sTriangleGenerator.bNegation } , \
    { 19u, &x2cModel.blocks.sTriangleGenerator.bSlope } , \
    { 42u, &x2cScope }

#define INPORT_PARAMID_TABLE \
    { 20u, 1u, &x2cModel.inports.bP8_10 } , \
    { 21u, 1u, &x2cModel.inports.bP8_12 } , \
    { 22u, 1u, &x2cModel.inports.bP8_16 } , \
    { 23u, 1u, &x2cModel.inports.bP8_8 } , \
    { 24u, 4u, &x2cModel.inports.bP9_33 } , \
    { 25u, 4u, &x2cModel.inports.bP9_35 } , \
    { 26u, 4u, &x2cModel.inports.bP9_36 } , \
    { 27u, 4u, &x2cModel.inports.bP9_37 } , \
    { 28u, 4u, &x2cModel.inports.bP9_38 } , \
    { 29u, 4u, &x2cModel.inports.bP9_39 } , \
    { 30u, 4u, &x2cModel.inports.bP9_40 } 

#define OUTPORT_PARAMID_TABLE \
    { 31u, 4u, &x2cModel.outports.bLED0 } , \
    { 32u, 4u, &x2cModel.outports.bLED1 } , \
    { 33u, 4u, &x2cModel.outports.bLED2 } , \
    { 34u, 4u, &x2cModel.outports.bLED3 } , \
    { 35u, 1u, &x2cModel.outports.bP8_11 } , \
    { 36u, 4u, &x2cModel.outports.bP8_13_19 } , \
    { 37u, 1u, &x2cModel.outports.bP8_15 } , \
    { 38u, 1u, &x2cModel.outports.bP8_7 } , \
    { 39u, 1u, &x2cModel.outports.bP8_9 } , \
    { 40u, 4u, &x2cModel.outports.bP9_14_16 } , \
    { 41u, 4u, &x2cModel.outports.bP9_21_22 } 


/**********************************************************************************************************************/
/**                                            Model structure definition                                            **/
/**********************************************************************************************************************/
struct x2cModel {
/*  Control Blocks                                                                                                    */
    struct {
/*      Sub-system TriangleGenerator                                                                                  */
        struct {
            AUTOSWITCH_FLOAT32 bAutoSwitch0;
            I_FLOAT32 bI;
            CONSTANT_FLOAT32 bInit;
            LOOPBREAKER_FLOAT32 bLoopBreaker;
            NEGATION_FLOAT32 bNegation;
            CONSTANT_FLOAT32 bSlope;
        } sTriangleGenerator;
        CONSTANT_FLOAT32 bAmplitude;
        AUTOSWITCH_FLOAT32 bAutoSwitch1;
        AUTOSWITCH_FLOAT32 bAutoSwitch2;
        AUTOSWITCH_FLOAT32 bAutoSwitch3;
        CONSTANT_BOOL bDigOut1;
        CONSTANT_BOOL bDigOut2;
        CONSTANT_BOOL bDigOut3;
        CONSTANT_BOOL bDigOut4;
        CONSTANT_FLOAT32 bLED_off;
        CONSTANT_FLOAT32 bLED_on;
        CONSTANT_FLOAT32 bLED_on_off;
        SIN3GEN_FLOAT32 bSin3Gen;
        CONSTANT_BOOL bStart_Stop;
    } blocks;
/*  Inports                                                                                                           */
    struct {
        bool bP8_10;
        bool bP8_12;
        bool bP8_16;
        bool bP8_8;
        float32 bP9_33;
        float32 bP9_35;
        float32 bP9_36;
        float32 bP9_37;
        float32 bP9_38;
        float32 bP9_39;
        float32 bP9_40;
    } inports;
/*  Outports                                                                                                          */
    struct {
        float32* bLED0;
        float32* bLED1;
        float32* bLED2;
        float32* bLED3;
        bool* bP8_11;
        float32* bP8_13_19;
        bool* bP8_15;
        bool* bP8_7;
        bool* bP8_9;
        float32* bP9_14_16;
        float32* bP9_21_22;
    } 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
