/*
 * PWM_sf.h
 *
 * Code generation for model "PWM_sf".
 *
 * Model version              : 1.825
 * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020
 * C source code generated on : Fri Apr 14 12:53:29 2023
 *
 * Target selection: rtwsfcn.tlc
 * Note: GRT includes extra infrastructure and instrumentation for prototyping
 * Embedded hardware selection: ARM Compatible->ARM Cortex-M
 * Emulation hardware selection:
 *    Differs from embedded hardware (MATLAB Host)
 * Code generation objectives:
 *    1. Execution efficiency
 *    2. RAM efficiency
 * Validation result: Not run
 */

#ifndef RTW_HEADER_PWM_sf_h_
#define RTW_HEADER_PWM_sf_h_
#include <float.h>
#include <math.h>
#include <string.h>
#include <stddef.h>
#ifndef PWM_sf_COMMON_INCLUDES_
#define PWM_sf_COMMON_INCLUDES_
#include <stdlib.h>
#define S_FUNCTION_NAME                PWM_sf
#define S_FUNCTION_LEVEL               2
#define RTW_GENERATED_S_FUNCTION
#include "rtwtypes.h"
#include "simstruc.h"
#include "fixedpoint.h"
#if !defined(MATLAB_MEX_FILE)
#include "rt_matrx.h"
#endif

#if !defined(RTW_SFUNCTION_DEFINES)
#define RTW_SFUNCTION_DEFINES

typedef struct {
  void *blockIO;
  void *defaultParam;
  void *nonContDerivSig;
} LocalS;

#define ssSetLocalBlockIO(S, io)       ((LocalS *)ssGetUserData(S))->blockIO = ((void *)(io))
#define ssGetLocalBlockIO(S)           ((LocalS *)ssGetUserData(S))->blockIO
#define ssSetLocalDefaultParam(S, paramVector) ((LocalS *)ssGetUserData(S))->defaultParam = (paramVector)
#define ssGetLocalDefaultParam(S)      ((LocalS *)ssGetUserData(S))->defaultParam
#define ssSetLocalNonContDerivSig(S, pSig) ((LocalS *)ssGetUserData(S))->nonContDerivSig = (pSig)
#define ssGetLocalNonContDerivSig(S)   ((LocalS *)ssGetUserData(S))->nonContDerivSig
#endif
#endif                                 /* PWM_sf_COMMON_INCLUDES_ */

#include "PWM_sf_types.h"

/* Shared type includes */
#include "multiword_types.h"
#include "rtGetNaN.h"
#include "rt_nonfinite.h"
#include "rtGetInf.h"
#include "rt_defines.h"

/* Block signals (default storage) */
typedef struct {
  real_T Product;                      /* '<S2>/Product' */
  real_T Product1;                     /* '<S2>/Product1' */
  real_T DataTypeConversion6;          /* '<S2>/Data Type Conversion6' */
  real_T DataTypeConversion2;          /* '<S2>/Data Type Conversion2' */
  real_T DataTypeConversion4;          /* '<S2>/Data Type Conversion4' */
} B_PWM_T;

/* Constant parameters (default storage) */
typedef struct {
  /* Expression: rep_seq_y
   * Referenced by: '<S3>/Look-Up Table1'
   */
  real_T LookUpTable1_tableData[3];

  /* Expression: rep_seq_t - min(rep_seq_t)
   * Referenced by: '<S3>/Look-Up Table1'
   */
  real_T LookUpTable1_bp01Data[3];
} ConstP_PWM_T;

/* External inputs (root inport signals with default storage) */
typedef struct {
  real_T *pwm_info[3];                 /* '<Root>/pwm_info' */
} ExternalUPtrs_PWM_T;

/* External outputs (root outports fed by signals with default storage) */
typedef struct {
  real_T *PWMb[6];                     /* '<Root>/PWMb' */
} ExtY_PWM_T;

/* Constant parameters (default storage) */
extern const ConstP_PWM_T PWM_ConstP;

/*-
 * These blocks were eliminated from the model due to optimizations:
 *
 * Block '<S3>/Output' : Eliminate redundant signal conversion block
 */

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Note that this particular code originates from a subsystem build,
 * and has its own system numbers different from the parent model.
 * Refer to the system hierarchy for this subsystem below, and use the
 * MATLAB hilite_system command to trace the generated code back
 * to the parent model.  For example,
 *
 * hilite_system('FOC_ADRC/PWM')    - opens subsystem FOC_ADRC/PWM
 * hilite_system('FOC_ADRC/PWM/Kp') - opens and selects block Kp
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'FOC_ADRC'
 * '<S1>'   : 'FOC_ADRC/PWM'
 * '<S2>'   : 'FOC_ADRC/PWM/PWM Generator'
 * '<S3>'   : 'FOC_ADRC/PWM/modulated wave'
 * '<S4>'   : 'FOC_ADRC/PWM/PWM Generator/MATLAB Function1'
 */
#endif                                 /* RTW_HEADER_PWM_sf_h_ */
