    1/*

    2 * PWM_sf.h

    3 *

    4 * Code generation for model "PWM_sf".

    5 *

    6 * Model version              : 1.825

    7 * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020

    8 * C source code generated on : Fri Apr 14 12:53:29 2023

    9 *

    10 * Target selection: rtwsfcn.tlc

    11 * Note: GRT includes extra infrastructure and instrumentation for prototyping

    12 * Embedded hardware selection: ARM Compatible->ARM Cortex-M

    13 * Emulation hardware selection:

    14 *    Differs from embedded hardware (MATLAB Host)

    15 * Code generation objectives:

    16 *    1. Execution efficiency

    17 *    2. RAM efficiency

    18 * Validation result: Not run

    19 */

    20

    21#ifndef RTW_HEADER_PWM_sf_h_

    22#define RTW_HEADER_PWM_sf_h_

    23#include <float.h>

    24#include <math.h>

    25#include <string.h>

    26#include <stddef.h>

    27#ifndef PWM_sf_COMMON_INCLUDES_

    28#define PWM_sf_COMMON_INCLUDES_

    29#include <stdlib.h>

    30#define S_FUNCTION_NAME                PWM_sf

    31#define S_FUNCTION_LEVEL               2

    32#define RTW_GENERATED_S_FUNCTION

    33#include "rtwtypes.h"

    34#include "simstruc.h"

    35#include "fixedpoint.h"

    36#if !defined(MATLAB_MEX_FILE)

    37#include "rt_matrx.h"

    38#endif

    39

    40#if !defined(RTW_SFUNCTION_DEFINES)

    41#define RTW_SFUNCTION_DEFINES

    42

    43typedef struct {

    44  void *blockIO;

    45  void *defaultParam;

    46  void *nonContDerivSig;

    47} LocalS;

    48

    49#define ssSetLocalBlockIO(S, io)       ((LocalS *)ssGetUserData(S))->blockIO = ((void *)(io))

    50#define ssGetLocalBlockIO(S)           ((LocalS *)ssGetUserData(S))->blockIO

    51#define ssSetLocalDefaultParam(S, paramVector) ((LocalS *)ssGetUserData(S))->defaultParam = (paramVector)

    52#define ssGetLocalDefaultParam(S)      ((LocalS *)ssGetUserData(S))->defaultParam

    53#define ssSetLocalNonContDerivSig(S, pSig) ((LocalS *)ssGetUserData(S))->nonContDerivSig = (pSig)

    54#define ssGetLocalNonContDerivSig(S)   ((LocalS *)ssGetUserData(S))->nonContDerivSig

    55#endif

    56#endif                                 /* PWM_sf_COMMON_INCLUDES_ */

    57

    58#include "PWM_sf_types.h"

    59

    60/* Shared type includes */

    61#include "multiword_types.h"

    62#include "rtGetNaN.h"

    63#include "rt_nonfinite.h"

    64#include "rtGetInf.h"

    65#include "rt_defines.h"

    66

    67/* Block signals (default storage) */

    68typedef struct {

    69  real_T Product;                      /* '<S2>/Product' */

    70  real_T Product1;                     /* '<S2>/Product1' */

    71  real_T DataTypeConversion6;          /* '<S2>/Data Type Conversion6' */

    72  real_T DataTypeConversion2;          /* '<S2>/Data Type Conversion2' */

    73  real_T DataTypeConversion4;          /* '<S2>/Data Type Conversion4' */

    74} B_PWM_T;

    75

    76/* Constant parameters (default storage) */

    77typedef struct {

    78  /* Expression: rep_seq_y

    79   * Referenced by: '<S3>/Look-Up Table1'

    80   */

    81  real_T LookUpTable1_tableData[3];

    82

    83  /* Expression: rep_seq_t - min(rep_seq_t)

    84   * Referenced by: '<S3>/Look-Up Table1'

    85   */

    86  real_T LookUpTable1_bp01Data[3];

    87} ConstP_PWM_T;

    88

    89/* External inputs (root inport signals with default storage) */

    90typedef struct {

    91  real_T *pwm_info[3];                 /* '<Root>/pwm_info' */

    92} ExternalUPtrs_PWM_T;

    93

    94/* External outputs (root outports fed by signals with default storage) */

    95typedef struct {

    96  real_T *PWMb[6];                     /* '<Root>/PWMb' */

    97} ExtY_PWM_T;

    98

    99/* Constant parameters (default storage) */

    100extern const ConstP_PWM_T PWM_ConstP;

    101

    102/*-

    103 * These blocks were eliminated from the model due to optimizations:

    104 *

    105 * Block '<S3>/Output' : Eliminate redundant signal conversion block

    106 */

    107

    108/*-

    109 * The generated code includes comments that allow you to trace directly

    110 * back to the appropriate location in the model.  The basic format

    111 * is <system>/block_name, where system is the system number (uniquely

    112 * assigned by Simulink) and block_name is the name of the block.

    113 *

    114 * Note that this particular code originates from a subsystem build,

    115 * and has its own system numbers different from the parent model.

    116 * Refer to the system hierarchy for this subsystem below, and use the

    117 * MATLAB hilite_system command to trace the generated code back

    118 * to the parent model.  For example,

    119 *

    120 * hilite_system('FOC_ADRC/PWM')    - opens subsystem FOC_ADRC/PWM

    121 * hilite_system('FOC_ADRC/PWM/Kp') - opens and selects block Kp

    122 *

    123 * Here is the system hierarchy for this model

    124 *

    125 * '<Root>' : 'FOC_ADRC'

    126 * '<S1>'   : 'FOC_ADRC/PWM'

    127 * '<S2>'   : 'FOC_ADRC/PWM/PWM Generator'

    128 * '<S3>'   : 'FOC_ADRC/PWM/modulated wave'

    129 * '<S4>'   : 'FOC_ADRC/PWM/PWM Generator/MATLAB Function1'

    130 */

    131#endif                                 /* RTW_HEADER_PWM_sf_h_ */

    132