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

/* 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 "SinGen_FiP16.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 , \
    SINGEN_FIP16_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.bAutoSwitch } , \
    { 3u, &x2cModel.blocks.bAutoSwitch1 } , \
    { 4u, &x2cModel.blocks.bFrequency } , \
    { 5u, &x2cModel.blocks.bLED_off } , \
    { 6u, &x2cModel.blocks.bLED_on } , \
    { 7u, &x2cModel.blocks.bLED_on_off } , \
    { 8u, &x2cModel.blocks.sOscillator.bAutoSwitch } , \
    { 9u, &x2cModel.blocks.sOscillator.bConstant } , \
    { 10u, &x2cModel.blocks.sOscillator.bEnable } , \
    { 11u, &x2cModel.blocks.sOscillator.bInit } , \
    { 12u, &x2cModel.blocks.sOscillator.bIntegrator } , \
    { 13u, &x2cModel.blocks.sOscillator.bLoopBreaker } , \
    { 14u, &x2cModel.blocks.sOscillator.bNegation } , \
    { 15u, &x2cModel.blocks.bSin3Gen } , \
    { 16u, &x2cModel.blocks.bSinGen } , \
    { 21u, &x2cScope }

#define OUTPORT_PARAMID_TABLE \
    { 17u, 2u, &x2cModel.outports.bLED0 } , \
    { 18u, 2u, &x2cModel.outports.bLED1 } , \
    { 19u, 2u, &x2cModel.outports.bLED2 } , \
    { 20u, 2u, &x2cModel.outports.bLED3 } 


/**********************************************************************************************************************/
/**                                            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_FIP16 bAmplitude;
        AUTOSWITCH_FIP16 bAutoSwitch;
        AUTOSWITCH_FIP16 bAutoSwitch1;
        CONSTANT_FIP16 bFrequency;
        CONSTANT_FIP16 bLED_off;
        CONSTANT_FIP16 bLED_on;
        CONSTANT_FIP16 bLED_on_off;
        SIN3GEN_FIP16 bSin3Gen;
        SINGEN_FIP16 bSinGen;
    } blocks;
/*  No Inports in Model                                                                                               */
/*  Outports                                                                                                          */
    struct {
        int16* bLED0;
        int16* bLED1;
        int16* bLED2;
        int16* bLED3;
    } 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
