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. \
29Consider adjusting Test hardware word size settings on the \
30Hardware Implementation pane to match your compiler word sizes as \
31defined in limits.h of the compiler. Alternatively, you can \
32select the Test hardware is the same as production hardware option and \
33select the Enable portable word sizes option on the Code Generation > \
34Verification pane for ERT based targets, which will disable the \
35preprocessor 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. \
40Consider adjusting Test hardware word size settings on the \
41Hardware Implementation pane to match your compiler word sizes as \
42defined in limits.h of the compiler. Alternatively, you can \
43select the Test hardware is the same as production hardware option and \
44select the Enable portable word sizes option on the Code Generation > \
45Verification pane for ERT based targets, which will disable the \
46preprocessor 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. \
51Consider adjusting Test hardware word size settings on the \
52Hardware Implementation pane to match your compiler word sizes as \
53defined in limits.h of the compiler. Alternatively, you can \
54select the Test hardware is the same as production hardware option and \
55select the Enable portable word sizes option on the Code Generation > \
56Verification pane for ERT based targets, which will disable the \
57preprocessor 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. \
62Consider adjusting Test hardware word size settings on the \
63Hardware Implementation pane to match your compiler word sizes as \
64defined in limits.h of the compiler. Alternatively, you can \
65select the Test hardware is the same as production hardware option and \
66select the Enable portable word sizes option on the Code Generation > \
67Verification pane for ERT based targets, which will disable the \
68preprocessor word size checks.
69#endif
70
71/* Skipping ulong_long/long_long check: insufficient preprocessor integer range. */
72extern uint16_T plook_u16s16_evencka(int16_T u, int16_T bp0, uint16_T bpSpace,
73 uint32_T maxIndex);
74extern uint8_T plook_u8u16_evencka(uint16_T u, uint16_T bp0, uint16_T bpSpace,
75 uint32_T maxIndex);
76extern void Counter_Init(DW_Counter *localDW, uint16_T rtp_z_cntInit);
77extern uint16_T Counter(uint16_T rtu_inc, uint16_T rtu_max, boolean_T rtu_rst,
78 DW_Counter *localDW);
79extern boolean_T either_edge(boolean_T rtu_u, DW_either_edge *localDW);
80extern void Debounce_Filter_Init(DW_Debounce_Filter *localDW);
81extern void Debounce_Filter(boolean_T rtu_u, uint16_T rtu_tAcv, uint16_T
82 rtu_tDeacv, boolean_T *rty_y, DW_Debounce_Filter *localDW);
83extern 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);
85extern 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);
88extern 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);
91extern void pi_speed_Init(DW_pi_speed *localDW);
92extern 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