| 1 | /* |
| 2 | * File: PMSM_Controller_private.h |
| 3 | * |
| 4 | * Code generated for Simulink model 'PMSM_Controller'. |
| 5 | * |
| 6 | * Model version : 1.1228 |
| 7 | * Simulink Coder version : 9.4 (R2020b) 29-Jul-2020 |
| 8 | * C/C++ source code generated on : Tue Apr 5 20:46:52 2022 |
| 9 | * |
| 10 | * Target selection: ert.tlc |
| 11 | * Embedded hardware selection: ARM Compatible->ARM Cortex-M |
| 12 | * Code generation objectives: |
| 13 | * 1. Execution efficiency |
| 14 | * 2. RAM efficiency |
| 15 | * Validation result: Not run |
| 16 | */ |
| 17 | |
| 18 | #ifndef RTW_HEADER_PMSM_Controller_private_h_ |
| 19 | #define RTW_HEADER_PMSM_Controller_private_h_ |
| 20 | #include "rtwtypes.h" |
| 21 | #include "zero_crossing_types.h" |
| 22 | #include "PMSM_Controller.h" |
| 23 | #ifndef UCHAR_MAX |
| 24 | #include <limits.h> |
| 25 | #endif |
| 26 | |
| 27 | #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) ) |
| 28 | #error Code was generated for compiler with different sized uchar/char. \ |
| 29 | Consider adjusting Test hardware word size settings on the \ |
| 30 | Hardware Implementation pane to match your compiler word sizes as \ |
| 31 | defined in limits.h of the compiler. Alternatively, you can \ |
| 32 | select the Test hardware is the same as production hardware option and \ |
| 33 | select the Enable portable word sizes option on the Code Generation > \ |
| 34 | Verification pane for ERT based targets, which will disable the \ |
| 35 | preprocessor word size checks. |
| 36 | #endif |
| 37 | |
| 38 | #if ( USHRT_MAX != (0xFFFFU) ) || ( SHRT_MAX != (0x7FFF) ) |
| 39 | #error Code was generated for compiler with different sized ushort/short. \ |
| 40 | Consider adjusting Test hardware word size settings on the \ |
| 41 | Hardware Implementation pane to match your compiler word sizes as \ |
| 42 | defined in limits.h of the compiler. Alternatively, you can \ |
| 43 | select the Test hardware is the same as production hardware option and \ |
| 44 | select the Enable portable word sizes option on the Code Generation > \ |
| 45 | Verification pane for ERT based targets, which will disable the \ |
| 46 | preprocessor word size checks. |
| 47 | #endif |
| 48 | |
| 49 | #if ( UINT_MAX != (0xFFFFFFFFU) ) || ( INT_MAX != (0x7FFFFFFF) ) |
| 50 | #error Code was generated for compiler with different sized uint/int. \ |
| 51 | Consider adjusting Test hardware word size settings on the \ |
| 52 | Hardware Implementation pane to match your compiler word sizes as \ |
| 53 | defined in limits.h of the compiler. Alternatively, you can \ |
| 54 | select the Test hardware is the same as production hardware option and \ |
| 55 | select the Enable portable word sizes option on the Code Generation > \ |
| 56 | Verification pane for ERT based targets, which will disable the \ |
| 57 | preprocessor word size checks. |
| 58 | #endif |
| 59 | |
| 60 | #if ( ULONG_MAX != (0xFFFFFFFFU) ) || ( LONG_MAX != (0x7FFFFFFF) ) |
| 61 | #error Code was generated for compiler with different sized ulong/long. \ |
| 62 | Consider adjusting Test hardware word size settings on the \ |
| 63 | Hardware Implementation pane to match your compiler word sizes as \ |
| 64 | defined in limits.h of the compiler. Alternatively, you can \ |
| 65 | select the Test hardware is the same as production hardware option and \ |
| 66 | select the Enable portable word sizes option on the Code Generation > \ |
| 67 | Verification pane for ERT based targets, which will disable the \ |
| 68 | preprocessor word size checks. |
| 69 | #endif |
| 70 | |
| 71 | /* Skipping ulong_long/long_long check: insufficient preprocessor integer range. */ |
| 72 | extern uint16_T plook_u16s16_evencka(int16_T u, int16_T bp0, uint16_T bpSpace, |
| 73 | uint32_T maxIndex); |
| 74 | extern uint8_T plook_u8u16_evencka(uint16_T u, uint16_T bp0, uint16_T bpSpace, |
| 75 | uint32_T maxIndex); |
| 76 | extern void Counter_Init(DW_Counter *localDW, uint16_T rtp_z_cntInit); |
| 77 | extern uint16_T Counter(uint16_T rtu_inc, uint16_T rtu_max, boolean_T rtu_rst, |
| 78 | DW_Counter *localDW); |
| 79 | extern boolean_T either_edge(boolean_T rtu_u, DW_either_edge *localDW); |
| 80 | extern void Debounce_Filter_Init(DW_Debounce_Filter *localDW); |
| 81 | extern void Debounce_Filter(boolean_T rtu_u, uint16_T rtu_tAcv, uint16_T |
| 82 | rtu_tDeacv, boolean_T *rty_y, DW_Debounce_Filter *localDW); |
| 83 | extern void Low_Pass_Filter(const int16_T rtu_u[2], uint16_T rtu_coef, int16_T |
| 84 | rty_y[2], DW_Low_Pass_Filter *localDW); |
| 85 | extern void PI_iq(int16_T rtu_err, int16_T rtu_P, int16_T rtu_I, int16_T rtu_Kb, |
| 86 | int16_T rtu_satMax, int16_T rtu_satMin, int16_T |
| 87 | rtu_ext_limProt, int16_T *rty_pi_out, DW_PI_iq *localDW); |
| 88 | extern void PI_id(int16_T rtu_err, int16_T rtu_P, int16_T rtu_I, int16_T rtu_Kb, |
| 89 | int16_T rtu_satMax, int16_T rtu_satMin, int16_T |
| 90 | rtu_ext_limProt, int16_T *rty_pi_out, DW_PI_id *localDW); |
| 91 | extern void pi_speed_Init(DW_pi_speed *localDW); |
| 92 | extern int16_T pi_speed(int16_T rtu_err, int16_T rtu_P, int16_T rtu_I, int16_T |
| 93 | rtu_Kb, int16_T rtu_satMax, int16_T rtu_satMin, int16_T rtu_ext_limProt, |
| 94 | uint8_T rtu_reset, const ConstB_pi_speed *localC, DW_pi_speed *localDW, |
| 95 | ZCE_pi_speed *localZCE); |
| 96 | |
| 97 | #endif /* RTW_HEADER_PMSM_Controller_private_h_ */ |
| 98 | |
| 99 | /* |
| 100 | * File trailer for generated code. |
| 101 | * |
| 102 | * [EOF] |
| 103 | */ |
| 104 | |