⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iqmathlib.h

📁 附件程序是我用DSP2812开发的无刷直流电机控制程序
💻 H
📖 第 1 页 / 共 5 页
字号:
#define   _IQcosPU(A)  _IQ20cosPU(A)
#endif
#if GLOBAL_Q == 19
#define   _IQcosPU(A)  _IQ19cosPU(A)
#endif
#if GLOBAL_Q == 18
#define   _IQcosPU(A)  _IQ18cosPU(A)
#endif
#if GLOBAL_Q == 17
#define   _IQcosPU(A)  _IQ17cosPU(A)
#endif
#if GLOBAL_Q == 16
#define   _IQcosPU(A)  _IQ16cosPU(A)
#endif
#if GLOBAL_Q == 15
#define   _IQcosPU(A)  _IQ15cosPU(A)
#endif
#if GLOBAL_Q == 14
#define   _IQcosPU(A)  _IQ14cosPU(A)
#endif
#if GLOBAL_Q == 13
#define   _IQcosPU(A)  _IQ13cosPU(A)
#endif
#if GLOBAL_Q == 12
#define   _IQcosPU(A)  _IQ12cosPU(A)
#endif
#if GLOBAL_Q == 11
#define   _IQcosPU(A)  _IQ11cosPU(A)
#endif
#if GLOBAL_Q == 10
#define   _IQcosPU(A)  _IQ10cosPU(A)
#endif
#if GLOBAL_Q == 9
#define   _IQcosPU(A)  _IQ9cosPU(A)
#endif
#if GLOBAL_Q == 8
#define   _IQcosPU(A)  _IQ8cosPU(A)
#endif
#if GLOBAL_Q == 7
#define   _IQcosPU(A)  _IQ7cosPU(A)
#endif
#if GLOBAL_Q == 6
#define   _IQcosPU(A)  _IQ6cosPU(A)
#endif
#if GLOBAL_Q == 5
#define   _IQcosPU(A)  _IQ5cosPU(A)
#endif
#if GLOBAL_Q == 4
#define   _IQcosPU(A)  _IQ4cosPU(A)
#endif
#if GLOBAL_Q == 3
#define   _IQcosPU(A)  _IQ3cosPU(A)
#endif
#if GLOBAL_Q == 2
#define   _IQcosPU(A)  _IQ2cosPU(A)
#endif
#if GLOBAL_Q == 1
#define   _IQcosPU(A)  _IQ1cosPU(A)
#endif
//---------------------------------------------------------------------------
extern    long _IQ30atan2(long A, long B);
extern    long _IQ29atan2(long A, long B);
extern    long _IQ28atan2(long A, long B);
extern    long _IQ27atan2(long A, long B);
extern    long _IQ26atan2(long A, long B);
extern    long _IQ25atan2(long A, long B);
extern    long _IQ24atan2(long A, long B);
extern    long _IQ23atan2(long A, long B);
extern    long _IQ22atan2(long A, long B);
extern    long _IQ21atan2(long A, long B);
extern    long _IQ20atan2(long A, long B);
extern    long _IQ19atan2(long A, long B);
extern    long _IQ18atan2(long A, long B);
extern    long _IQ17atan2(long A, long B);
extern    long _IQ16atan2(long A, long B);
extern    long _IQ15atan2(long A, long B);
extern    long _IQ14atan2(long A, long B);
extern    long _IQ13atan2(long A, long B);
extern    long _IQ12atan2(long A, long B);
extern    long _IQ11atan2(long A, long B);
extern    long _IQ10atan2(long A, long B);
extern    long _IQ9atan2(long A, long B);
extern    long _IQ8atan2(long A, long B);
extern    long _IQ7atan2(long A, long B);
extern    long _IQ6atan2(long A, long B);
extern    long _IQ5atan2(long A, long B);
extern    long _IQ4atan2(long A, long B);
extern    long _IQ3atan2(long A, long B);
extern    long _IQ2atan2(long A, long B);
extern    long _IQ1atan2(long A, long B);

#if GLOBAL_Q == 30
#define   _IQatan2(A,B)  _IQ30atan2(A,B)
#endif
#if GLOBAL_Q == 29
#define   _IQatan2(A,B)  _IQ29atan2(A,B)
#endif
#if GLOBAL_Q == 28
#define   _IQatan2(A,B)  _IQ28atan2(A,B)
#endif
#if GLOBAL_Q == 27
#define   _IQatan2(A,B)  _IQ27atan2(A,B)
#endif
#if GLOBAL_Q == 26
#define   _IQatan2(A,B)  _IQ26atan2(A,B)
#endif
#if GLOBAL_Q == 25
#define   _IQatan2(A,B)  _IQ25atan2(A,B)
#endif
#if GLOBAL_Q == 24
#define   _IQatan2(A,B)  _IQ24atan2(A,B)
#endif
#if GLOBAL_Q == 23
#define   _IQatan2(A,B)  _IQ23atan2(A,B)
#endif
#if GLOBAL_Q == 22
#define   _IQatan2(A,B)  _IQ22atan2(A,B)
#endif
#if GLOBAL_Q == 21
#define   _IQatan2(A,B)  _IQ21atan2(A,B)
#endif
#if GLOBAL_Q == 20
#define   _IQatan2(A,B)  _IQ20atan2(A,B)
#endif
#if GLOBAL_Q == 19
#define   _IQatan2(A,B)  _IQ19atan2(A,B)
#endif
#if GLOBAL_Q == 18
#define   _IQatan2(A,B)  _IQ18atan2(A,B)
#endif
#if GLOBAL_Q == 17
#define   _IQatan2(A,B)  _IQ17atan2(A,B)
#endif
#if GLOBAL_Q == 16
#define   _IQatan2(A,B)  _IQ16atan2(A,B)
#endif
#if GLOBAL_Q == 15
#define   _IQatan2(A,B)  _IQ15atan2(A,B)
#endif
#if GLOBAL_Q == 14
#define   _IQatan2(A,B)  _IQ14atan2(A,B)
#endif
#if GLOBAL_Q == 13
#define   _IQatan2(A,B)  _IQ13atan2(A,B)
#endif
#if GLOBAL_Q == 12
#define   _IQatan2(A,B)  _IQ12atan2(A,B)
#endif
#if GLOBAL_Q == 11
#define   _IQatan2(A,B)  _IQ11atan2(A,B)
#endif
#if GLOBAL_Q == 10
#define   _IQatan2(A,B)  _IQ10atan2(A,B)
#endif
#if GLOBAL_Q == 9
#define   _IQatan2(A,B)  _IQ9atan2(A,B)
#endif
#if GLOBAL_Q == 8
#define   _IQatan2(A,B)  _IQ8atan2(A,B)
#endif
#if GLOBAL_Q == 7
#define   _IQatan2(A,B)  _IQ7atan2(A,B)
#endif
#if GLOBAL_Q == 6
#define   _IQatan2(A,B)  _IQ6atan2(A,B)
#endif
#if GLOBAL_Q == 5
#define   _IQatan2(A,B)  _IQ5atan2(A,B)
#endif
#if GLOBAL_Q == 4
#define   _IQatan2(A,B)  _IQ4atan2(A,B)
#endif
#if GLOBAL_Q == 3
#define   _IQatan2(A,B)  _IQ3atan2(A,B)
#endif
#if GLOBAL_Q == 2
#define   _IQatan2(A,B)  _IQ2atan2(A,B)
#endif
#if GLOBAL_Q == 1
#define   _IQatan2(A,B)  _IQ1atan2(A,B)
#endif
//---------------------------------------------------------------------------
extern    long _IQ30atan2PU(long A, long B);
extern    long _IQ29atan2PU(long A, long B);
extern    long _IQ28atan2PU(long A, long B);
extern    long _IQ27atan2PU(long A, long B);
extern    long _IQ26atan2PU(long A, long B);
extern    long _IQ25atan2PU(long A, long B);
extern    long _IQ24atan2PU(long A, long B);
extern    long _IQ23atan2PU(long A, long B);
extern    long _IQ22atan2PU(long A, long B);
extern    long _IQ21atan2PU(long A, long B);
extern    long _IQ20atan2PU(long A, long B);
extern    long _IQ19atan2PU(long A, long B);
extern    long _IQ18atan2PU(long A, long B);
extern    long _IQ17atan2PU(long A, long B);
extern    long _IQ16atan2PU(long A, long B);
extern    long _IQ15atan2PU(long A, long B);
extern    long _IQ14atan2PU(long A, long B);
extern    long _IQ13atan2PU(long A, long B);
extern    long _IQ12atan2PU(long A, long B);
extern    long _IQ11atan2PU(long A, long B);
extern    long _IQ10atan2PU(long A, long B);
extern    long _IQ9atan2PU(long A, long B);
extern    long _IQ8atan2PU(long A, long B);
extern    long _IQ7atan2PU(long A, long B);
extern    long _IQ6atan2PU(long A, long B);
extern    long _IQ5atan2PU(long A, long B);
extern    long _IQ4atan2PU(long A, long B);
extern    long _IQ3atan2PU(long A, long B);
extern    long _IQ2atan2PU(long A, long B);
extern    long _IQ1atan2PU(long A, long B);

#if GLOBAL_Q == 30
#define   _IQatan2PU(A,B)  _IQ30atan2PU(A,B)
#endif
#if GLOBAL_Q == 29
#define   _IQatan2PU(A,B)  _IQ29atan2PU(A,B)
#endif
#if GLOBAL_Q == 28
#define   _IQatan2PU(A,B)  _IQ28atan2PU(A,B)
#endif
#if GLOBAL_Q == 27
#define   _IQatan2PU(A,B)  _IQ27atan2PU(A,B)
#endif
#if GLOBAL_Q == 26
#define   _IQatan2PU(A,B)  _IQ26atan2PU(A,B)
#endif
#if GLOBAL_Q == 25
#define   _IQatan2PU(A,B)  _IQ25atan2PU(A,B)
#endif
#if GLOBAL_Q == 24
#define   _IQatan2PU(A,B)  _IQ24atan2PU(A,B)
#endif
#if GLOBAL_Q == 23
#define   _IQatan2PU(A,B)  _IQ23atan2PU(A,B)
#endif
#if GLOBAL_Q == 22
#define   _IQatan2PU(A,B)  _IQ22atan2PU(A,B)
#endif
#if GLOBAL_Q == 21
#define   _IQatan2PU(A,B)  _IQ21atan2PU(A,B)
#endif
#if GLOBAL_Q == 20
#define   _IQatan2PU(A,B)  _IQ20atan2PU(A,B)
#endif
#if GLOBAL_Q == 19
#define   _IQatan2PU(A,B)  _IQ19atan2PU(A,B)
#endif
#if GLOBAL_Q == 18
#define   _IQatan2PU(A,B)  _IQ18atan2PU(A,B)
#endif
#if GLOBAL_Q == 17
#define   _IQatan2PU(A,B)  _IQ17atan2PU(A,B)
#endif
#if GLOBAL_Q == 16
#define   _IQatan2PU(A,B)  _IQ16atan2PU(A,B)
#endif
#if GLOBAL_Q == 15
#define   _IQatan2PU(A,B)  _IQ15atan2PU(A,B)
#endif
#if GLOBAL_Q == 14
#define   _IQatan2PU(A,B)  _IQ14atan2PU(A,B)
#endif
#if GLOBAL_Q == 13
#define   _IQatan2PU(A,B)  _IQ13atan2PU(A,B)
#endif
#if GLOBAL_Q == 12
#define   _IQatan2PU(A,B)  _IQ12atan2PU(A,B)
#endif
#if GLOBAL_Q == 11
#define   _IQatan2PU(A,B)  _IQ11atan2PU(A,B)
#endif
#if GLOBAL_Q == 10
#define   _IQatan2PU(A,B)  _IQ10atan2PU(A,B)
#endif
#if GLOBAL_Q == 9
#define   _IQatan2PU(A,B)  _IQ9atan2PU(A,B)
#endif
#if GLOBAL_Q == 8
#define   _IQatan2PU(A,B)  _IQ8atan2PU(A,B)
#endif
#if GLOBAL_Q == 7
#define   _IQatan2PU(A,B)  _IQ7atan2PU(A,B)
#endif
#if GLOBAL_Q == 6
#define   _IQatan2PU(A,B)  _IQ6atan2PU(A,B)
#endif
#if GLOBAL_Q == 5
#define   _IQatan2PU(A,B)  _IQ5atan2PU(A,B)
#endif
#if GLOBAL_Q == 4
#define   _IQatan2PU(A,B)  _IQ4atan2PU(A,B)
#endif
#if GLOBAL_Q == 3
#define   _IQatan2PU(A,B)  _IQ3atan2PU(A,B)
#endif
#if GLOBAL_Q == 2
#define   _IQatan2PU(A,B)  _IQ2atan2PU(A,B)
#endif
#if GLOBAL_Q == 1
#define   _IQatan2PU(A,B)  _IQ1atan2PU(A,B)
#endif
//---------------------------------------------------------------------------
#if GLOBAL_Q == 30
#define   _IQatan(A)  _IQ30atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 29
#define   _IQatan(A)  _IQ29atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 28
#define   _IQatan(A)  _IQ28atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 27
#define   _IQatan(A)  _IQ27atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 26
#define   _IQatan(A)  _IQ26atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 25
#define   _IQatan(A)  _IQ25atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 24
#define   _IQatan(A)  _IQ24atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 23
#define   _IQatan(A)  _IQ23atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 22
#define   _IQatan(A)  _IQ22atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 21
#define   _IQatan(A)  _IQ21atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 20
#define   _IQatan(A)  _IQ20atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 19
#define   _IQatan(A)  _IQ19atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 18
#define   _IQatan(A)  _IQ18atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 17
#define   _IQatan(A)  _IQ17atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 16
#define   _IQatan(A)  _IQ16atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 15
#define   _IQatan(A)  _IQ15atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 14
#define   _IQatan(A)  _IQ14atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 13
#define   _IQatan(A)  _IQ13atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 12
#define   _IQatan(A)  _IQ12atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 11
#define   _IQatan(A)  _IQ11atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 10
#define   _IQatan(A)  _IQ10atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 9
#define   _IQatan(A)  _IQ9atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 8
#define   _IQatan(A)  _IQ8atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 7
#define   _IQatan(A)  _IQ7atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 6
#define   _IQatan(A)  _IQ6atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 5
#define   _IQatan(A)  _IQ5atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 4
#define   _IQatan(A)  _IQ4atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 3
#define   _IQatan(A)  _IQ3atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 2
#define   _IQatan(A)  _IQ2atan2(A,_IQ(1.0))
#endif
#if GLOBAL_Q == 1
#define   _IQatan(A)  _IQ1atan2(A,_IQ(1.0))
#endif
//---------------------------------------------------------------------------
extern    long _IQ30sqrt(long A);
extern    long _IQ29sqrt(long A);
extern    long _IQ28sqrt(long A);
extern    long _IQ27sqrt(long A);
extern    long _IQ26sqrt(long A);
extern    long _IQ25sqrt(long A);
extern    long _IQ24sqrt(long A);
extern    long _IQ23sqrt(long A);
extern    long _IQ22sqrt(long A);
extern    long _IQ21sqrt(long A);
extern    long _IQ20sqrt(long A);
extern    long _IQ19sqrt(long A);
extern    long _IQ18sqrt(long A);
extern    long _IQ17sqrt(long A);
extern    long _IQ16sqrt(long A);
extern    long _IQ15sqrt(long A);
extern    long _IQ14sqrt(long A);
extern    long _IQ13sqrt(long A);
extern    long _IQ12sqrt(long A);
extern    long _IQ11sqrt(long A);
extern    long _IQ10sqrt(long A);
extern    long _IQ9sqrt(long A);
extern    long _IQ8sqrt(long A);
extern    long _IQ7sqrt(long A);
extern    long _IQ6sqrt(long A);
extern    long _IQ5sqrt(long A);
extern    long _IQ4sqrt(long A);
extern    long _IQ3sqrt(long A);
extern    long _IQ2sqrt(long A);
extern    long _IQ1sqrt(long A);

#if GLOBAL_Q == 30
#define   _IQsqrt(A)  _IQ30sqrt(A)
#endif
#if GLOBAL_Q == 29
#define   _IQsqrt(A)  _IQ29sqrt(A)
#endif
#if GLOBAL_Q == 28
#define   _IQsqrt(A)  _IQ28sqrt(A)
#endif
#if GLOBAL_Q == 27
#define   _IQsqrt(A)  _IQ27sqrt(A)
#endif
#if GLOBAL_Q == 26
#define   _IQsqrt(A)  _IQ26sqrt(A)
#endif
#if GLOBAL_Q == 25
#define   _IQsqrt(A)  _IQ25sqrt(A)
#endif
#if GLOBAL_Q == 24

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -