PWM_sf.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. #ifndef RTW_HEADER_PWM_sf_h_
  21. #define RTW_HEADER_PWM_sf_h_
  22. #include <float.h>
  23. #include <math.h>
  24. #include <string.h>
  25. #include <stddef.h>
  26. #ifndef PWM_sf_COMMON_INCLUDES_
  27. #define PWM_sf_COMMON_INCLUDES_
  28. #include <stdlib.h>
  29. #define S_FUNCTION_NAME PWM_sf
  30. #define S_FUNCTION_LEVEL 2
  31. #define RTW_GENERATED_S_FUNCTION
  32. #include "rtwtypes.h"
  33. #include "simstruc.h"
  34. #include "fixedpoint.h"
  35. #if !defined(MATLAB_MEX_FILE)
  36. #include "rt_matrx.h"
  37. #endif
  38. #if !defined(RTW_SFUNCTION_DEFINES)
  39. #define RTW_SFUNCTION_DEFINES
  40. typedef struct {
  41. void *blockIO;
  42. void *defaultParam;
  43. void *nonContDerivSig;
  44. } LocalS;
  45. #define ssSetLocalBlockIO(S, io) ((LocalS *)ssGetUserData(S))->blockIO = ((void *)(io))
  46. #define ssGetLocalBlockIO(S) ((LocalS *)ssGetUserData(S))->blockIO
  47. #define ssSetLocalDefaultParam(S, paramVector) ((LocalS *)ssGetUserData(S))->defaultParam = (paramVector)
  48. #define ssGetLocalDefaultParam(S) ((LocalS *)ssGetUserData(S))->defaultParam
  49. #define ssSetLocalNonContDerivSig(S, pSig) ((LocalS *)ssGetUserData(S))->nonContDerivSig = (pSig)
  50. #define ssGetLocalNonContDerivSig(S) ((LocalS *)ssGetUserData(S))->nonContDerivSig
  51. #endif
  52. #endif /* PWM_sf_COMMON_INCLUDES_ */
  53. #include "PWM_sf_types.h"
  54. /* Shared type includes */
  55. #include "multiword_types.h"
  56. #include "rtGetNaN.h"
  57. #include "rt_nonfinite.h"
  58. #include "rtGetInf.h"
  59. #include "rt_defines.h"
  60. /* Block signals (default storage) */
  61. typedef struct {
  62. real_T Product; /* '<S2>/Product' */
  63. real_T Product1; /* '<S2>/Product1' */
  64. real_T DataTypeConversion6; /* '<S2>/Data Type Conversion6' */
  65. real_T DataTypeConversion2; /* '<S2>/Data Type Conversion2' */
  66. real_T DataTypeConversion4; /* '<S2>/Data Type Conversion4' */
  67. } B_PWM_T;
  68. /* Constant parameters (default storage) */
  69. typedef struct {
  70. /* Expression: rep_seq_y
  71. * Referenced by: '<S3>/Look-Up Table1'
  72. */
  73. real_T LookUpTable1_tableData[3];
  74. /* Expression: rep_seq_t - min(rep_seq_t)
  75. * Referenced by: '<S3>/Look-Up Table1'
  76. */
  77. real_T LookUpTable1_bp01Data[3];
  78. } ConstP_PWM_T;
  79. /* External inputs (root inport signals with default storage) */
  80. typedef struct {
  81. real_T *pwm_info[3]; /* '<Root>/pwm_info' */
  82. } ExternalUPtrs_PWM_T;
  83. /* External outputs (root outports fed by signals with default storage) */
  84. typedef struct {
  85. real_T *PWMb[6]; /* '<Root>/PWMb' */
  86. } ExtY_PWM_T;
  87. /* Constant parameters (default storage) */
  88. extern const ConstP_PWM_T PWM_ConstP;
  89. /*-
  90. * These blocks were eliminated from the model due to optimizations:
  91. *
  92. * Block '<S3>/Output' : Eliminate redundant signal conversion block
  93. */
  94. /*-
  95. * The generated code includes comments that allow you to trace directly
  96. * back to the appropriate location in the model. The basic format
  97. * is <system>/block_name, where system is the system number (uniquely
  98. * assigned by Simulink) and block_name is the name of the block.
  99. *
  100. * Note that this particular code originates from a subsystem build,
  101. * and has its own system numbers different from the parent model.
  102. * Refer to the system hierarchy for this subsystem below, and use the
  103. * MATLAB hilite_system command to trace the generated code back
  104. * to the parent model. For example,
  105. *
  106. * hilite_system('FOC_ADRC/PWM') - opens subsystem FOC_ADRC/PWM
  107. * hilite_system('FOC_ADRC/PWM/Kp') - opens and selects block Kp
  108. *
  109. * Here is the system hierarchy for this model
  110. *
  111. * '<Root>' : 'FOC_ADRC'
  112. * '<S1>' : 'FOC_ADRC/PWM'
  113. * '<S2>' : 'FOC_ADRC/PWM/PWM Generator'
  114. * '<S3>' : 'FOC_ADRC/PWM/modulated wave'
  115. * '<S4>' : 'FOC_ADRC/PWM/PWM Generator/MATLAB Function1'
  116. */
  117. #endif /* RTW_HEADER_PWM_sf_h_ */