/**
 * @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.bFrequency } , \
    { 4u, &x2cModel.blocks.bLED_off } , \
    { 5u, &x2cModel.blocks.bLED_on } , \
    { 6u, &x2cModel.blocks.sOscillator.bAutoSwitch } , \
    { 7u, &x2cModel.blocks.sOscillator.bConstant } , \
    { 8u, &x2cModel.blocks.sOscillator.bEnable } , \
    { 9u, &x2cModel.blocks.sOscillator.bInit } , \
    { 10u, &x2cModel.blocks.sOscillator.bIntegrator } , \
    { 11u, &x2cModel.blocks.sOscillator.bLoopBreaker } , \
    { 12u, &x2cModel.blocks.sOscillator.bNegation } , \
    { 13u, &x2cModel.blocks.bSin3Gen } , \
    { 14u, &x2cModel.blocks.bSinGen } , \
    { 17u, &x2cScope }

#define OUTPORT_PARAMID_TABLE \
    { 15u, 2u, &x2cModel.outports.bLED } , \
    { 16u, 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_FIP16 bAmplitude;
        AUTOSWITCH_FIP16 bAutoSwitch;
        CONSTANT_FIP16 bFrequency;
        CONSTANT_FIP16 bLED_off;
        CONSTANT_FIP16 bLED_on;
        SIN3GEN_FIP16 bSin3Gen;
        SINGEN_FIP16 bSinGen;
    } blocks;
/*  No Inports in Model                                                                                               */
/*  Outports                                                                                                          */
    struct {
        int16* bLED;
        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
