/**
 * @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_FiP16.h"
#include "I_FiP16.h"
#include "Sin3Gen_FiP16.h"
#include "Negation_FiP16.h"
#include "AutoSwitch_FiP16.h"
#include "LoopBreaker_FiP16.h"
#include "Scope_Main.h"
#include "CommonFcts.h"

/**********************************************************************************************************************/
/**     Defines                                                                                                      **/
/**********************************************************************************************************************/
#define FUNCTIONS \
    CONSTANT_BOOL_FUNCTIONS , \
    CONSTANT_FIP16_FUNCTIONS , \
    I_FIP16_FUNCTIONS , \
    SIN3GEN_FIP16_FUNCTIONS , \
    NEGATION_FIP16_FUNCTIONS , \
    AUTOSWITCH_FIP16_FUNCTIONS , \
    LOOPBREAKER_FIP16_FUNCTIONS , \
    SCOPE_MAIN_FUNCTIONS

#define PARAMETER_TABLE \
    { 1u, &x2cModel.blocks.bAmplitude } , \
    { 2u, &x2cModel.blocks.bD17 } , \
    { 3u, &x2cModel.blocks.bD2 } , \
    { 4u, &x2cModel.blocks.bSin3Gen } , \
    { 5u, &x2cModel.blocks.bStart_Stop } , \
    { 6u, &x2cModel.blocks.sTriangleGenerator.bAutoSwitch } , \
    { 7u, &x2cModel.blocks.sTriangleGenerator.bI } , \
    { 8u, &x2cModel.blocks.sTriangleGenerator.bInit } , \
    { 9u, &x2cModel.blocks.sTriangleGenerator.bLoopBreaker } , \
    { 10u, &x2cModel.blocks.sTriangleGenerator.bNegation } , \
    { 11u, &x2cModel.blocks.sTriangleGenerator.bSlope } , \
    { 28u, &x2cScope }

#define INPORT_PARAMID_TABLE \
    { 12u, 1u, &x2cModel.inports.bHA } , \
    { 13u, 1u, &x2cModel.inports.bHB } , \
    { 14u, 1u, &x2cModel.inports.bHC } , \
    { 15u, 1u, &x2cModel.inports.bHOME } , \
    { 16u, 2u, &x2cModel.inports.bI1 } , \
    { 17u, 2u, &x2cModel.inports.bI2 } , \
    { 18u, 2u, &x2cModel.inports.bISum } , \
    { 19u, 2u, &x2cModel.inports.bPOT } , \
    { 20u, 1u, &x2cModel.inports.bS2 } , \
    { 21u, 1u, &x2cModel.inports.bS3 } , \
    { 22u, 2u, &x2cModel.inports.bVBUS } 

#define OUTPORT_PARAMID_TABLE \
    { 23u, 1u, &x2cModel.outports.bLED17 } , \
    { 24u, 1u, &x2cModel.outports.bLED2 } , \
    { 25u, 2u, &x2cModel.outports.bPWM1 } , \
    { 26u, 2u, &x2cModel.outports.bPWM2 } , \
    { 27u, 2u, &x2cModel.outports.bPWM3 } 


/**********************************************************************************************************************/
/**                                            Model structure definition                                            **/
/**********************************************************************************************************************/
struct x2cModel {
/*  Control Blocks                                                                                                    */
    struct {
/*      Sub-system TriangleGenerator                                                                                  */
        struct {
            AUTOSWITCH_FIP16 bAutoSwitch;
            I_FIP16 bI;
            CONSTANT_FIP16 bInit;
            LOOPBREAKER_FIP16 bLoopBreaker;
            NEGATION_FIP16 bNegation;
            CONSTANT_FIP16 bSlope;
        } sTriangleGenerator;
        CONSTANT_FIP16 bAmplitude;
        CONSTANT_BOOL bD17;
        CONSTANT_BOOL bD2;
        SIN3GEN_FIP16 bSin3Gen;
        CONSTANT_BOOL bStart_Stop;
    } blocks;
/*  Inports                                                                                                           */
    struct {
        bool bHA;
        bool bHB;
        bool bHC;
        bool bHOME;
        int16 bI1;
        int16 bI2;
        int16 bISum;
        int16 bPOT;
        bool bS2;
        bool bS3;
        int16 bVBUS;
    } inports;
/*  Outports                                                                                                          */
    struct {
        bool* bLED17;
        bool* bLED2;
        int16* bPWM1;
        int16* bPWM2;
        int16* bPWM3;
    } 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
