MSPM0G3507SensoredFOCMotorControlLibrary  1.0
IQmath_mathacl.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,TI
2  * MSP Source and Object Code Software License Agreement
3  *
4  *
5  * IMPORTANT - PLEASE CAREFULLY READ THE FOLLOWING LICENSE AGREEMENT, WHICH IS LEGALLY BINDING. AFTER YOU READ IT, YOU WILL BE ASKED WHETHER YOU ACCEPT AND AGREE TO ITS TERMS. DO NOT CLICK "I ACCEPT" UNLESS: (1) YOU WILL USE THE LICENSED MATERIALS FOR YOUR OWN BENEFIT AND PERSONALLY ACCEPT, AGREE TO AND INTEND TO BE BOUND BY THESE TERMS; OR (2) YOU ARE AUTHORIZED TO, AND INTEND TO BE BOUND BY, THESE TERMS ON BEHALF OF YOUR COMPANY.
6  *
7  *
8  * Important - Read carefully: This Source and Object Code Software License Agreement ("Agreement") is a legal agreement between you and Texas Instruments Incorporated ("TI"). In this Agreement "you" means you personally if you will exercise the rights granted for your own benefit, but it means your company (or you on behalf of your company) if you will exercise the rights granted for your company's benefit. The "Licensed Materials" subject to this Agreement include the software programs and any associated electronic documentation (in each case, in whole or in part) that accompany this Agreement, are set forth in the applicable software manifest and you access "on-line", as well as any updates or upgrades to such software programs or documentation, if any, provided to you at TI's sole discretion. The Licensed Materials are specifically designed and licensed for use solely and exclusively with MSP microcontroller devices manufactured by or for TI ("TI Devices"). By installing, copying or otherwise using the Licensed Materials you agree to abide by the provisions set forth herein. This Agreement is displayed for you to read prior to using the Licensed Materials. If you choose not to accept or agree with these provisions, do not download or install the Licensed Materials.
9  *
10  * Note Regarding Possible Access to Other Licensed Materials: The Licensed Materials may be bundled with software and associated electronic documentation, if any, licensed under terms other than the terms of this Agreement (in whole or in part, "Other Licensed Materials"), including, for example Open Source Software and/or TI-owned or third party Proprietary Software licensed under such other terms. "Open Source Software" means any software licensed under terms requiring that (A) other software ("Proprietary Software") incorporated, combined or distributed with such software or developed using such software: (i) be disclosed or distributed in source code form; or (ii) otherwise be licensed on terms inconsistent with the terms of this Agreement, including but not limited to permitting use of the Proprietary Software on or with devices other than TI Devices, or (B) require the owner of Proprietary Software to license any of its patents to users of the Open Source Software and/or Proprietary Software incorporated, combined or distributed with such Open Source Software or developed using such Open Source Software.
11  *
12  * If by accepting this Agreement, you gain access to Other Licensed Materials, they will be listed in the applicable software manifest. Your use of the Other Licensed Materials is subject to the applicable other licensing terms acknowledgements and disclaimers as specified in the applicable software manifest and/or identified or included with the Other Licensed Materials in the software bundle. For clarification, this Agreement does not limit your rights under, or grant you rights that supersede, the terms of any applicable Other Licensed Materials license agreement. If any of the Other Licensed Materials is Open Source Software that has been provided to you in object code only under terms that obligate TI to provide to you or show you where you can access the source code versions of such Open Source Software, TI will provide to you, or show you where you can access, such source code if you contact TI at Texas Instruments Incorporated, 12500 TI Boulevard, Mail Station 8638, Dallas, Texas 75243, Attention: Contracts Manager, Embedded Processing. In the event you choose not to accept or agree with the terms in any applicable Other Licensed Materials license agreement, you must terminate this Agreement.
13  *
14  * 1. License Grant and Use Restrictions.
15  *
16  * a. Licensed Materials License Grant. Subject to the terms of this Agreement, TI hereby grants to you a limited, non-transferable, non-exclusive, non-assignable, non-sublicensable, fully paid-up and royalty-free license to:
17  *
18  * i. Limited Source Code License: make copies, prepare derivative works, display internally and use internally the Licensed Materials provided to you in source code for the sole purpose of developing object and executable versions of such Licensed Materials, or any derivative thereof, that execute solely and exclusively on TI Devices, for end use in Licensee Products, and maintaining and supporting such Licensed Materials, or any derivative thereof, and Licensee Products. For purposes of this Agreement, "Licensee Product" means a product that consists of both hardware, including one or more TI Devices, and software components, including only executable versions of the Licensed Materials that execute solely and exclusively on such TI Devices.
19  *
20  * ii. Object Code Evaluation, Testing and Use License: make copies, display internally, distribute internally and use internally the Licensed Materials in object code for the sole purposes of evaluating and testing the Licensed Materials and designing and developing Licensee Products, and maintaining and supporting the Licensee Products;
21  *
22  * iii. Demonstration License: demonstrate to third parties the Licensed Materials executing solely and exclusively on TI Devices as they are used in Licensee Products, provided that such Licensed Materials are demonstrated in object or executable versions only and
23  *
24  * iv. Production and Distribution License: make, use, import, export and otherwise distribute the Licensed Materials as part of a Licensee Product, provided that such Licensee Products include only embedded executable copies of such Licensed Materials that execute solely and exclusively on TI Devices.
25  *
26  * b. Contractors. The licenses granted to you hereunder shall include your on-site and off-site contractors (either an individual or entity), while such contractors are performing work for or providing services to you, provided that such contractors have executed work-for-hire agreements with you containing applicable terms and conditions consistent with the terms and conditions set forth in this Agreement and provided further that you shall be liable to TI for any breach by your contractors of this Agreement to the same extent as you would be if you had breached the Agreement yourself.
27  *
28  * c. No Other License. Nothing in this Agreement shall be construed as a license to any intellectual property rights of TI other than those rights embodied in the Licensed Materials provided to you by TI. EXCEPT AS PROVIDED HEREIN, NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY OTHER TI INTELLECTUAL PROPERTY RIGHTS IS GRANTED HEREIN.
29  *
30  * d. Covenant not to Sue. During the term of this Agreement, you agree not to assert a claim against TI or its licensees that the Licensed Materials infringe your intellectual property rights.
31  *
32  * e. Restrictions. You shall maintain the source code versions of the Licensed Materials under password control protection and shall not disclose such source code versions of the Licensed Materials, to any person other than your employees and contractors whose job performance requires access. You shall not use the Licensed Materials with a processing device other than a TI Device, and you agree that any such unauthorized use of the Licensed Materials is a material breach of this Agreement. You shall not use the Licensed Materials for the purpose of analyzing or proving infringement of any of your patents by either TI or TI's customers. Except as expressly provided in this Agreement, you shall not copy, publish, disclose, display, provide, transfer or make available the Licensed Materials to any third party and you shall not sublicense, transfer, or assign the Licensed Materials or your rights under this Agreement to any third party. You shall not mortgage, pledge or encumber the Licensed Materials in any way. You may use the Licensed Materials with Open Source Software or with software developed using Open Source Software tools provided you do not incorporate, combine or distribute the Licensed Materials in a manner that subjects the Licensed Materials to any license obligations or any other intellectual property related terms of any license governing such Open Source Software.
33  *
34  * f. Termination. This Agreement is effective on the date the Licensed Materials are delivered to you together with this Agreement and will remain in full force and effect until terminated. You may terminate this Agreement at any time by written notice to TI. Without prejudice to any other rights, if you fail to comply with the terms of this Agreement or you are acquired, TI may terminate your right to use the Licensed Materials upon written notice to you. Upon termination of this Agreement, you will destroy any and all copies of the Licensed Materials in your possession, custody or control and provide to TI a written statement signed by your authorized representative certifying such destruction. Except for Sections 1(a), 1(b) and 1(d), all provisions of this Agreement shall survive termination of this Agreement.
35  *
36  * 2. Licensed Materials Ownership. The Licensed Materials are licensed, not sold to you, and can only be used in accordance with the terms of this Agreement. Subject to the licenses granted to you pursuant to this Agreement, TI and its licensors own and shall continue to own all right, title and interest in and to the Licensed Materials, including all copies thereof. You agree that all fixes, modifications and improvements to the Licensed Materials conceived of or made by TI that are based, either in whole or in part, on your feedback, suggestions or recommendations are the exclusive property of TI and all right, title and interest in and to such fixes, modifications or improvements to the Licensed Materials will vest solely in TI. Moreover, you acknowledge and agree that when your independently developed software or hardware components are combined, in whole or in part, with the Licensed Materials, your right to use the combined work that includes the Licensed Materials remains subject to the terms and conditions of this Agreement.
37  *
38  * 3. Intellectual Property Rights.
39  *
40  * a. The Licensed Materials contain copyrighted material, trade secrets and other proprietary information of TI and its licensors and are protected by copyright laws, international copyright treaties, and trade secret laws, as well as other intellectual property laws. To protect TI's and its licensors' rights in the Licensed Materials, you agree, except as specifically permitted by statute by a provision that cannot be waived by contract, not to "unlock", decompile, reverse engineer, disassemble or otherwise translate to a human-perceivable form any portions of the Licensed Materials provided to you in object code format only, nor permit any person or entity to do so. You shall not remove, alter, cover, or obscure any confidentiality, trade secret, trade mark, patent, copyright or other proprietary notice or other identifying marks or designs from any component of the Licensed Materials and you shall reproduce and include in all copies of the Licensed Materials the copyright notice(s) and proprietary legend(s) of TI and its licensors as they appear in the Licensed Materials. TI reserves all rights not specifically granted under this Agreement.
41  *
42  * b. Certain Licensed Materials may be based on industry recognized standards or software programs published by industry recognized standards bodies and certain third parties may claim to own patents, copyrights, and other intellectual property rights that cover implementation of those standards. You acknowledge and agree that this Agreement does not convey a license to any such third party patents, copyrights, and other intellectual property rights and that you are solely responsible for any patent, copyright, or other intellectual property right claim that relates to your use or distribution of the Licensed Materials or your use or distribution of your products that include or incorporate the Licensed Materials. Moreover, you acknowledge that you are responsible for any fees or royalties that may be payable to any third party based on such third party's interests in the Licensed Materials or any intellectual property rights that cover implementation of any industry recognized standard, any software program published by any industry recognized standards bodies or any other proprietary technology.
43  *
44  * 4. Confidential Information. You acknowledge and agree that the Licensed Materials contain trade secrets and other confidential information of TI and its licensors. You agree to use the Licensed Materials solely within the scope of the licenses set forth herein, to maintain the Licensed Materials in strict confidence, to use at least the same procedures and degree of care that you use to prevent disclosure of your own confidential information of like importance but in no instance less than reasonable care, and to prevent disclosure of the Licensed Materials to any third party, except as may be necessary and required in connection with your rights and obligations hereunder; provided, however, that you may not provide the Licensed Materials to any business organization or group within your company or to customers or contractors that design or manufacture semiconductors unless TI gives written consent. You agree to obtain executed confidentiality agreements with your employees and contractors having access to the Licensed Materials and to diligently take steps to enforce such agreements in this respect. TI may disclose your contact information to TI's licensors.
45  *
46  * 5. Warranties and Limitations. THE LICENSED MATERIALS ARE PROVIDED "AS IS". FURTHERMORE, YOU ACKNOWLEDGE AND AGREE THAT THE LICENSED MATERIALS HAVE NOT BEEN TESTED OR CERTIFIED BY ANY GOVERNMENT AGENCY OR INDUSTRY REGULATORY ORGANIZATION OR ANY OTHER THIRD PARTY ORGANIZATION. YOU AGREE THAT PRIOR TO USING, INCORPORATING OR DISTRIBUTING THE LICENSED MATERIALS IN OR WITH ANY COMMERCIAL PRODUCT THAT YOU WILL THOROUGHLY TEST THE PRODUCT AND THE FUNCTIONALITY OF THE LICENSED MATERIALS IN OR WITH THAT PRODUCT AND BE SOLELY RESPONSIBLE FOR ANY PROBLEMS OR FAILURES.
47  *
48  * TI AND ITS LICENSORS MAKE NO WARRANTY OR REPRESENTATION, EITHER EXPRESS, IMPLIED OR STATUTORY, REGARDING THE LICENSED MATERIALS, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER INTELLECTUAL PROPERTY RIGHTS. YOU AGREE TO USE YOUR INDEPENDENT JUDGMENT IN DEVELOPING YOUR PRODUCTS. NOTHING CONTAINED IN THIS AGREEMENT WILL BE CONSTRUED AS A WARRANTY OR REPRESENTATION BY TI TO MAINTAIN PRODUCTION OF ANY TI SEMICONDUCTOR DEVICE OR OTHER HARDWARE OR SOFTWARE WITH WHICH THE LICENSED MATERIALS MAY BE USED.
49  *
50  * IN NO EVENT SHALL TI OR ITS LICENSORS, BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED, ON ANY THEORY OF LIABILITY, IN CONNECTION WITH OR ARISING OUT OF THIS AGREEMENT OR THE USE OF THE LICENSED MATERIALS REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF REMOVAL OR REINSTALLATION, OUTSIDE COMPUTER TIME, LABOR COSTS, LOSS OF DATA, LOSS OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S OR ITS LICENSORS' AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF YOUR USE OF THE LICENSED MATERIALS EXCEED FIVE HUNDRED U.S. DOLLARS (US$500).
51  *
52  * Because some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages or limitation on how long an implied warranty lasts, the above limitations or exclusions may not apply to you.
53  *
54  * 6. Indemnification Disclaimer. YOU ACKNOWLEDGE AND AGREE THAT TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON YOUR MANUFACTURE, USE, OR DISTRIBUTION OF THE LICENSED MATERIALS OR YOUR MANUFACTURE, USE, OFFER FOR SALE, SALE, IMPORTATION OR DISTRIBUTION OF YOUR PRODUCTS THAT INCLUDE OR INCORPORATE THE LICENSED MATERIALS.
55  *
56  * 7. No Technical Support. TI and its licensors are under no obligation to install, maintain or support the Licensed Materials.
57  *
58  * 8. Notices. All notices to TI hereunder shall be delivered to Texas Instruments Incorporated, 12500 TI Boulevard, Mail Station 8638, Dallas, Texas 75243, Attention: Contracts Manager - Embedded Processing, with a copy to Texas Instruments Incorporated, 13588 N. Central Expressway, Mail Station 3999, Dallas, Texas 75243, Attention: Law Department - Embedded Processing. All notices shall be deemed served when received by TI.
59  *
60  * 9. Export Control. The Licensed Materials are subject to export control under the U.S. Commerce Department's Export Administration Regulations ("EAR"). Unless prior authorization is obtained from the U.S. Commerce Department, neither you nor your subsidiaries shall export, re-export, or release, directly or indirectly (including, without limitation, by permitting the Licensed Materials to be downloaded), any technology, software, or software source code, received from TI, or export, directly or indirectly, any direct product of such technology, software, or software source code, to any person, destination or country to which the export, re-export, or release of the technology, software, or software source code, or direct product is prohibited by the EAR. You represent and warrant that you (i) are not located in, or under the control of, a national or resident of Cuba, Iran, North Korea, Sudan and Syria or any other country subject to a U.S. goods embargo; (ii) are not on the U.S. Treasury Department's List of Specially Designated Nationals or the U.S. Commerce Department's Denied Persons List or Entity List; and (iii) will not use the Licensed Materials or transfer the Licensed Materials for use in any military, nuclear, chemical or biological weapons, or missile technology end-uses. Any software export classification made by TI shall not be construed as a representation or warranty regarding the proper export classification for such software or whether an export license or other documentation is required for the exportation of such software.
61  *
62  * 10. Governing Law and Severability; Waiver. This Agreement will be governed by and interpreted in accordance with the laws of the State of Texas, without reference to conflict of laws principles. If for any reason a court of competent jurisdiction finds any provision of the Agreement to be unenforceable, that provision will be enforced to the maximum extent possible to effectuate the intent of the parties, and the remainder of the Agreement shall continue in full force and effect. This Agreement shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, or by the Uniform Computer Information Transactions Act (UCITA). The parties agree that non-exclusive jurisdiction for any dispute arising out of or relating to this Agreement lies within the courts located in the State of Texas. Notwithstanding the foregoing, any judgment may be enforced in any United States or foreign court, and either party may seek injunctive relief in any United States or foreign court. Failure by TI to enforce any provision of this Agreement shall not be deemed a waiver of future enforcement of that or any other provision in this Agreement or any other agreement that may be in place between the parties.
63  *
64  * 11. PRC Provisions. If you are located in the People's Republic of China ("PRC") or if the Licensed Materials will be sent to the PRC, the following provisions shall apply:
65  *
66  * a. Registration Requirements. You shall be solely responsible for performing all acts and obtaining all approvals that may be required in connection with this Agreement by the government of the PRC, including but not limited to registering pursuant to, and otherwise complying with, the PRC Measures on the Administration of Software Products, Management Regulations on Technology Import-Export, and Technology Import and Export Contract Registration Management Rules. Upon receipt of such approvals from the government authorities, you shall forward evidence of all such approvals to TI for its records. In the event that you fail to obtain any such approval or registration, you shall be solely responsible for any and all losses, damages or costs resulting therefrom, and shall indemnify TI for all such losses, damages or costs.
67  *
68  * b. Governing Language. This Agreement is written and executed in the English language and shall be authoritative and controlling, whether or not translated into a language other than English to comply with law or for reference purposes. If a translation of this Agreement is required for any purpose, including but not limited to registration of the Agreement pursuant to any governmental laws, regulations or rules, you shall be solely responsible for creating such translation.
69  *
70  * 12. Contingencies. TI shall not be in breach of this Agreement and shall not be liable for any non-performance or delay in performance if such non-performance or delay is due to a force majeure event or other circumstances beyond TI's reasonable control.
71  *
72  * 13. Entire Agreement. This is the entire agreement between you and TI and this Agreement supersedes any prior agreement between the parties related to the subject matter of this Agreement. Notwithstanding the foregoing, any signed and effective software license agreement relating to the subject matter hereof and stating expressly that such agreement shall control regardless of any subsequent click-wrap, shrink-wrap or web-wrap, shall supersede the terms of this Agreement. No amendment or modification of this Agreement will be effective unless in writing and signed by a duly authorized representative of TI. You hereby warrant and represent that you have obtained all authorizations and other applicable consents required empowering you to enter into this Agreement.
73  *
74  * --/COPYRIGHT--*/
75  /*!****************************************************************************
76  * @file IQmath_mathacl.h
77  * @brief Library of IQMath operations.
78  *
79  * <hr>
80  ******************************************************************************/
81 #ifndef __IQMATH_MATHACL_H__
82 #define __IQMATH_MATHACL_H__
83 
84 //*****************************************************************************
85 //
86 // If building with a C++ compiler, make all of the definitions in this header
87 // have a C binding.
88 //
89 //*****************************************************************************
90 #ifdef __cplusplus
91 extern "C"
92 {
93 #endif
94 
95 //*****************************************************************************
101 //*****************************************************************************
102 #ifndef GLOBAL_IQ
103 #define GLOBAL_IQ 24
104 #endif
105 
106 //*****************************************************************************
107 //
108 // Include some standard headers.
109 //
110 //*****************************************************************************
111 #include <limits.h>
112 #include <stdlib.h>
113 #include <stdint.h>
114 
115 #include <ti/devices/msp/msp.h>
116 
117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
118 //*****************************************************************************
119 //
120 // Various Useful Constant Definitions:
121 //
122 //*****************************************************************************
123 #define Q30 30
124 #define Q29 29
125 #define Q28 28
126 #define Q27 27
127 #define Q26 26
128 #define Q25 25
129 #define Q24 24
130 #define Q23 23
131 #define Q22 22
132 #define Q21 21
133 #define Q20 20
134 #define Q19 19
135 #define Q18 18
136 #define Q17 17
137 #define Q16 16
138 #define Q15 15
139 #define Q14 14
140 #define Q13 13
141 #define Q12 12
142 #define Q11 11
143 #define Q10 10
144 #define Q9 9
145 #define Q8 8
146 #define Q7 7
147 #define Q6 6
148 #define Q5 5
149 #define Q4 4
150 #define Q3 3
151 #define Q2 2
152 #define Q1 1
153 #ifndef QG
154 #define QG GLOBAL_IQ
155 #endif
156 
157 #define MAX_IQ_POS LONG_MAX
158 #define MAX_IQ_NEG LONG_MIN
159 #define MIN_IQ_POS 1
160 #define MIN_IQ_NEG -1
161 
162 //*****************************************************************************
163 //
164 // The types for the various IQ formats.
165 //
166 //*****************************************************************************
167 typedef int32_t _iq30;
168 typedef int32_t _iq29;
169 typedef int32_t _iq28;
170 typedef int32_t _iq27;
171 typedef int32_t _iq26;
172 typedef int32_t _iq25;
173 typedef int32_t _iq24;
174 typedef int32_t _iq23;
175 typedef int32_t _iq22;
176 typedef int32_t _iq21;
177 typedef int32_t _iq20;
178 typedef int32_t _iq19;
179 typedef int32_t _iq18;
180 typedef int32_t _iq17;
181 typedef int32_t _iq16;
182 typedef int32_t _iq15;
183 typedef int32_t _iq14;
184 typedef int32_t _iq13;
185 typedef int32_t _iq12;
186 typedef int32_t _iq11;
187 typedef int32_t _iq10;
188 typedef int32_t _iq9;
189 typedef int32_t _iq8;
190 typedef int32_t _iq7;
191 typedef int32_t _iq6;
192 typedef int32_t _iq5;
193 typedef int32_t _iq4;
194 typedef int32_t _iq3;
195 typedef int32_t _iq2;
196 typedef int32_t _iq1;
197 typedef int32_t _iq;
198 
199 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
200 
201 //*****************************************************************************
202 //
203 // Multiplies two IQ numbers.
204 //
205 //*****************************************************************************
206 #ifndef DOXYGEN_SHOULD_SKIP_THIS
207 extern _iq30 _IQ30mpy_mathacl(_iq30 A, _iq30 B);
208 extern _iq29 _IQ29mpy_mathacl(_iq29 A, _iq29 B);
209 extern _iq28 _IQ28mpy_mathacl(_iq28 A, _iq28 B);
210 extern _iq27 _IQ27mpy_mathacl(_iq27 A, _iq27 B);
211 extern _iq26 _IQ26mpy_mathacl(_iq26 A, _iq26 B);
212 extern _iq25 _IQ25mpy_mathacl(_iq25 A, _iq25 B);
213 extern _iq24 _IQ24mpy_mathacl(_iq24 A, _iq24 B);
214 extern _iq23 _IQ23mpy_mathacl(_iq23 A, _iq23 B);
215 extern _iq22 _IQ22mpy_mathacl(_iq22 A, _iq22 B);
216 extern _iq21 _IQ21mpy_mathacl(_iq21 A, _iq21 B);
217 extern _iq20 _IQ20mpy_mathacl(_iq20 A, _iq20 B);
218 extern _iq19 _IQ19mpy_mathacl(_iq19 A, _iq19 B);
219 extern _iq18 _IQ18mpy_mathacl(_iq18 A, _iq18 B);
220 extern _iq17 _IQ17mpy_mathacl(_iq17 A, _iq17 B);
221 extern _iq16 _IQ16mpy_mathacl(_iq16 A, _iq16 B);
222 extern _iq15 _IQ15mpy_mathacl(_iq15 A, _iq15 B);
223 extern _iq14 _IQ14mpy_mathacl(_iq14 A, _iq14 B);
224 extern _iq13 _IQ13mpy_mathacl(_iq13 A, _iq13 B);
225 extern _iq12 _IQ12mpy_mathacl(_iq12 A, _iq12 B);
226 extern _iq11 _IQ11mpy_mathacl(_iq11 A, _iq11 B);
227 extern _iq10 _IQ10mpy_mathacl(_iq10 A, _iq10 B);
228 extern _iq9 _IQ9mpy_mathacl(_iq9 A, _iq9 B);
229 extern _iq8 _IQ8mpy_mathacl(_iq8 A, _iq8 B);
230 extern _iq7 _IQ7mpy_mathacl(_iq7 A, _iq7 B);
231 extern _iq6 _IQ6mpy_mathacl(_iq6 A, _iq6 B);
232 extern _iq5 _IQ5mpy_mathacl(_iq5 A, _iq5 B);
233 extern _iq4 _IQ4mpy_mathacl(_iq4 A, _iq4 B);
234 extern _iq3 _IQ3mpy_mathacl(_iq3 A, _iq3 B);
235 extern _iq2 _IQ2mpy_mathacl(_iq2 A, _iq2 B);
236 extern _iq1 _IQ1mpy_mathacl(_iq1 A, _iq1 B);
237 
238 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
239 
247 #ifdef _IQ_MPY_MATHACL_INLINE
248  #if GLOBAL_IQ == 30
249  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 30)
250  #endif
251  #if GLOBAL_IQ == 29
252  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 29)
253  #endif
254  #if GLOBAL_IQ == 28
255  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 28)
256  #endif
257  #if GLOBAL_IQ == 27
258  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 27)
259  #endif
260  #if GLOBAL_IQ == 26
261  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 26)
262  #endif
263  #if GLOBAL_IQ == 25
264  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 25)
265  #endif
266  #if GLOBAL_IQ == 24
267  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 24)
268  #endif
269  #if GLOBAL_IQ == 23
270  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 23)
271  #endif
272  #if GLOBAL_IQ == 22
273  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 22)
274  #endif
275  #if GLOBAL_IQ == 21
276  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 21)
277  #endif
278  #if GLOBAL_IQ == 20
279  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 20)
280  #endif
281  #if GLOBAL_IQ == 19
282  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 19)
283  #endif
284  #if GLOBAL_IQ == 18
285  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 18)
286  #endif
287  #if GLOBAL_IQ == 17
288  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 17)
289  #endif
290  #if GLOBAL_IQ == 16
291  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 16)
292  #endif
293  #if GLOBAL_IQ == 15
294  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 15)
295  #endif
296  #if GLOBAL_IQ == 14
297  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 14)
298  #endif
299  #if GLOBAL_IQ == 13
300  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 13)
301  #endif
302  #if GLOBAL_IQ == 12
303  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 12)
304  #endif
305  #if GLOBAL_IQ == 11
306  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 11)
307  #endif
308  #if GLOBAL_IQ == 10
309  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 10)
310  #endif
311  #if GLOBAL_IQ == 9
312  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 9)
313  #endif
314  #if GLOBAL_IQ == 8
315  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 8)
316  #endif
317  #if GLOBAL_IQ == 7
318  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 7)
319  #endif
320  #if GLOBAL_IQ == 6
321  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 6)
322  #endif
323  #if GLOBAL_IQ == 5
324  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 5)
325  #endif
326  #if GLOBAL_IQ == 4
327  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 4)
328  #endif
329  #if GLOBAL_IQ == 3
330  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 3)
331  #endif
332  #if GLOBAL_IQ == 2
333  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 2)
334  #endif
335  #if GLOBAL_IQ == 1
336  #define _IQmpy_mathacl(A, B) _IQNmpy_mathacl_inline(A, B, 1)
337  #endif
338 #else
339  #if GLOBAL_IQ == 30
340  #define _IQmpy_mathacl(A, B) _IQ30mpy_mathacl(A, B)
341  #endif
342  #if GLOBAL_IQ == 29
343  #define _IQmpy_mathacl(A, B) _IQ29mpy_mathacl(A, B)
344  #endif
345  #if GLOBAL_IQ == 28
346  #define _IQmpy_mathacl(A, B) _IQ28mpy_mathacl(A, B)
347  #endif
348  #if GLOBAL_IQ == 27
349  #define _IQmpy_mathacl(A, B) _IQ27mpy_mathacl(A, B)
350  #endif
351  #if GLOBAL_IQ == 26
352  #define _IQmpy_mathacl(A, B) _IQ26mpy_mathacl(A, B)
353  #endif
354  #if GLOBAL_IQ == 25
355  #define _IQmpy_mathacl(A, B) _IQ25mpy_mathacl(A, B)
356  #endif
357  #if GLOBAL_IQ == 24
358  #define _IQmpy_mathacl(A, B) _IQ24mpy_mathacl(A, B)
359  #endif
360  #if GLOBAL_IQ == 23
361  #define _IQmpy_mathacl(A, B) _IQ23mpy_mathacl(A, B)
362  #endif
363  #if GLOBAL_IQ == 22
364  #define _IQmpy_mathacl(A, B) _IQ22mpy_mathacl(A, B)
365  #endif
366  #if GLOBAL_IQ == 21
367  #define _IQmpy_mathacl(A, B) _IQ21mpy_mathacl(A, B)
368  #endif
369  #if GLOBAL_IQ == 20
370  #define _IQmpy_mathacl(A, B) _IQ20mpy_mathacl(A, B)
371  #endif
372  #if GLOBAL_IQ == 19
373  #define _IQmpy_mathacl(A, B) _IQ19mpy_mathacl(A, B)
374  #endif
375  #if GLOBAL_IQ == 18
376  #define _IQmpy_mathacl(A, B) _IQ18mpy_mathacl(A, B)
377  #endif
378  #if GLOBAL_IQ == 17
379  #define _IQmpy_mathacl(A, B) _IQ17mpy_mathacl(A, B)
380  #endif
381  #if GLOBAL_IQ == 16
382  #define _IQmpy_mathacl(A, B) _IQ16mpy_mathacl(A, B)
383  #endif
384  #if GLOBAL_IQ == 15
385  #define _IQmpy_mathacl(A, B) _IQ15mpy_mathacl(A, B)
386  #endif
387  #if GLOBAL_IQ == 14
388  #define _IQmpy_mathacl(A, B) _IQ14mpy_mathacl(A, B)
389  #endif
390  #if GLOBAL_IQ == 13
391  #define _IQmpy_mathacl(A, B) _IQ13mpy_mathacl(A, B)
392  #endif
393  #if GLOBAL_IQ == 12
394  #define _IQmpy_mathacl(A, B) _IQ12mpy_mathacl(A, B)
395  #endif
396  #if GLOBAL_IQ == 11
397  #define _IQmpy_mathacl(A, B) _IQ11mpy_mathacl(A, B)
398  #endif
399  #if GLOBAL_IQ == 10
400  #define _IQmpy_mathacl(A, B) _IQ10mpy_mathacl(A, B)
401  #endif
402  #if GLOBAL_IQ == 9
403  #define _IQmpy_mathacl(A, B) _IQ9mpy_mathacl(A, B)
404  #endif
405  #if GLOBAL_IQ == 8
406  #define _IQmpy_mathacl(A, B) _IQ8mpy_mathacl(A, B)
407  #endif
408  #if GLOBAL_IQ == 7
409  #define _IQmpy_mathacl(A, B) _IQ7mpy_mathacl(A, B)
410  #endif
411  #if GLOBAL_IQ == 6
412  #define _IQmpy_mathacl(A, B) _IQ6mpy_mathacl(A, B)
413  #endif
414  #if GLOBAL_IQ == 5
415  #define _IQmpy_mathacl(A, B) _IQ5mpy_mathacl(A, B)
416  #endif
417  #if GLOBAL_IQ == 4
418  #define _IQmpy_mathacl(A, B) _IQ4mpy_mathacl(A, B)
419  #endif
420  #if GLOBAL_IQ == 3
421  #define _IQmpy_mathacl(A, B) _IQ3mpy_mathacl(A, B)
422  #endif
423  #if GLOBAL_IQ == 2
424  #define _IQmpy_mathacl(A, B) _IQ2mpy_mathacl(A, B)
425  #endif
426  #if GLOBAL_IQ == 1
427  #define _IQmpy_mathacl(A, B) _IQ1mpy_mathacl(A, B)
428  #endif
429 #endif
430 
431 //*****************************************************************************
432 //
433 // Divides two IQ numbers.
434 //
435 //*****************************************************************************
436 #ifndef DOXYGEN_SHOULD_SKIP_THIS
437 extern _iq30 _IQ30div_mathacl(_iq30 A, _iq30 B);
438 extern _iq29 _IQ29div_mathacl(_iq29 A, _iq29 B);
439 extern _iq28 _IQ28div_mathacl(_iq28 A, _iq28 B);
440 extern _iq27 _IQ27div_mathacl(_iq27 A, _iq27 B);
441 extern _iq26 _IQ26div_mathacl(_iq26 A, _iq26 B);
442 extern _iq25 _IQ25div_mathacl(_iq25 A, _iq25 B);
443 extern _iq24 _IQ24div_mathacl(_iq24 A, _iq24 B);
444 extern _iq23 _IQ23div_mathacl(_iq23 A, _iq23 B);
445 extern _iq22 _IQ22div_mathacl(_iq22 A, _iq22 B);
446 extern _iq21 _IQ21div_mathacl(_iq21 A, _iq21 B);
447 extern _iq20 _IQ20div_mathacl(_iq20 A, _iq20 B);
448 extern _iq19 _IQ19div_mathacl(_iq19 A, _iq19 B);
449 extern _iq18 _IQ18div_mathacl(_iq18 A, _iq18 B);
450 extern _iq17 _IQ17div_mathacl(_iq17 A, _iq17 B);
451 extern _iq16 _IQ16div_mathacl(_iq16 A, _iq16 B);
452 extern _iq15 _IQ15div_mathacl(_iq15 A, _iq15 B);
453 extern _iq14 _IQ14div_mathacl(_iq14 A, _iq14 B);
454 extern _iq13 _IQ13div_mathacl(_iq13 A, _iq13 B);
455 extern _iq12 _IQ12div_mathacl(_iq12 A, _iq12 B);
456 extern _iq11 _IQ11div_mathacl(_iq11 A, _iq11 B);
457 extern _iq10 _IQ10div_mathacl(_iq10 A, _iq10 B);
458 extern _iq9 _IQ9div_mathacl(_iq9 A, _iq9 B);
459 extern _iq8 _IQ8div_mathacl(_iq8 A, _iq8 B);
460 extern _iq7 _IQ7div_mathacl(_iq7 A, _iq7 B);
461 extern _iq6 _IQ6div_mathacl(_iq6 A, _iq6 B);
462 extern _iq5 _IQ5div_mathacl(_iq5 A, _iq5 B);
463 extern _iq4 _IQ4div_mathacl(_iq4 A, _iq4 B);
464 extern _iq3 _IQ3div_mathacl(_iq3 A, _iq3 B);
465 extern _iq2 _IQ2div_mathacl(_iq2 A, _iq2 B);
466 extern _iq1 _IQ1div_mathacl(_iq1 A, _iq1 B);
467 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
468 
477 #if GLOBAL_IQ == 30
478 #define _IQdiv_mathacl(A, B) _IQ30div_mathacl(A, B)
479 #endif
480 #if GLOBAL_IQ == 29
481 #define _IQdiv_mathacl(A, B) _IQ29div_mathacl(A, B)
482 #endif
483 #if GLOBAL_IQ == 28
484 #define _IQdiv_mathacl(A, B) _IQ28div_mathacl(A, B)
485 #endif
486 #if GLOBAL_IQ == 27
487 #define _IQdiv_mathacl(A, B) _IQ27div_mathacl(A, B)
488 #endif
489 #if GLOBAL_IQ == 26
490 #define _IQdiv_mathacl(A, B) _IQ26div_mathacl(A, B)
491 #endif
492 #if GLOBAL_IQ == 25
493 #define _IQdiv_mathacl(A, B) _IQ25div_mathacl(A, B)
494 #endif
495 #if GLOBAL_IQ == 24
496 #define _IQdiv_mathacl(A, B) _IQ24div_mathacl(A, B)
497 #endif
498 #if GLOBAL_IQ == 23
499 #define _IQdiv_mathacl(A, B) _IQ23div_mathacl(A, B)
500 #endif
501 #if GLOBAL_IQ == 22
502 #define _IQdiv_mathacl(A, B) _IQ22div_mathacl(A, B)
503 #endif
504 #if GLOBAL_IQ == 21
505 #define _IQdiv_mathacl(A, B) _IQ21div_mathacl(A, B)
506 #endif
507 #if GLOBAL_IQ == 20
508 #define _IQdiv_mathacl(A, B) _IQ20div_mathacl(A, B)
509 #endif
510 #if GLOBAL_IQ == 19
511 #define _IQdiv_mathacl(A, B) _IQ19div_mathacl(A, B)
512 #endif
513 #if GLOBAL_IQ == 18
514 #define _IQdiv_mathacl(A, B) _IQ18div_mathacl(A, B)
515 #endif
516 #if GLOBAL_IQ == 17
517 #define _IQdiv_mathacl(A, B) _IQ17div_mathacl(A, B)
518 #endif
519 #if GLOBAL_IQ == 16
520 #define _IQdiv_mathacl(A, B) _IQ16div_mathacl(A, B)
521 #endif
522 #if GLOBAL_IQ == 15
523 #define _IQdiv_mathacl(A, B) _IQ15div_mathacl(A, B)
524 #endif
525 #if GLOBAL_IQ == 14
526 #define _IQdiv_mathacl(A, B) _IQ14div_mathacl(A, B)
527 #endif
528 #if GLOBAL_IQ == 13
529 #define _IQdiv_mathacl(A, B) _IQ13div_mathacl(A, B)
530 #endif
531 #if GLOBAL_IQ == 12
532 #define _IQdiv_mathacl(A, B) _IQ12div_mathacl(A, B)
533 #endif
534 #if GLOBAL_IQ == 11
535 #define _IQdiv_mathacl(A, B) _IQ11div_mathacl(A, B)
536 #endif
537 #if GLOBAL_IQ == 10
538 #define _IQdiv_mathacl(A, B) _IQ10div_mathacl(A, B)
539 #endif
540 #if GLOBAL_IQ == 9
541 #define _IQdiv_mathacl(A, B) _IQ9div_mathacl(A, B)
542 #endif
543 #if GLOBAL_IQ == 8
544 #define _IQdiv_mathacl(A, B) _IQ8div_mathacl(A, B)
545 #endif
546 #if GLOBAL_IQ == 7
547 #define _IQdiv_mathacl(A, B) _IQ7div_mathacl(A, B)
548 #endif
549 #if GLOBAL_IQ == 6
550 #define _IQdiv_mathacl(A, B) _IQ6div_mathacl(A, B)
551 #endif
552 #if GLOBAL_IQ == 5
553 #define _IQdiv_mathacl(A, B) _IQ5div_mathacl(A, B)
554 #endif
555 #if GLOBAL_IQ == 4
556 #define _IQdiv_mathacl(A, B) _IQ4div_mathacl(A, B)
557 #endif
558 #if GLOBAL_IQ == 3
559 #define _IQdiv_mathacl(A, B) _IQ3div_mathacl(A, B)
560 #endif
561 #if GLOBAL_IQ == 2
562 #define _IQdiv_mathacl(A, B) _IQ2div_mathacl(A, B)
563 #endif
564 #if GLOBAL_IQ == 1
565 #define _IQdiv_mathacl(A, B) _IQ1div_mathacl(A, B)
566 #endif
567 
568 //*****************************************************************************
569 //
570 // Computes the square root of an IQ number.
571 //
572 //*****************************************************************************
573 #ifndef DOXYGEN_SHOULD_SKIP_THIS
574 extern _iq30 _IQ30sqrt_mathacl(_iq30 A);
575 extern _iq29 _IQ29sqrt_mathacl(_iq29 A);
576 extern _iq28 _IQ28sqrt_mathacl(_iq28 A);
577 extern _iq27 _IQ27sqrt_mathacl(_iq27 A);
578 extern _iq26 _IQ26sqrt_mathacl(_iq26 A);
579 extern _iq25 _IQ25sqrt_mathacl(_iq25 A);
580 extern _iq24 _IQ24sqrt_mathacl(_iq24 A);
581 extern _iq23 _IQ23sqrt_mathacl(_iq23 A);
582 extern _iq22 _IQ22sqrt_mathacl(_iq22 A);
583 extern _iq21 _IQ21sqrt_mathacl(_iq21 A);
584 extern _iq20 _IQ20sqrt_mathacl(_iq20 A);
585 extern _iq19 _IQ19sqrt_mathacl(_iq19 A);
586 extern _iq18 _IQ18sqrt_mathacl(_iq18 A);
587 extern _iq17 _IQ17sqrt_mathacl(_iq17 A);
588 extern _iq16 _IQ16sqrt_mathacl(_iq16 A);
589 extern _iq15 _IQ15sqrt_mathacl(_iq15 A);
590 extern _iq14 _IQ14sqrt_mathacl(_iq14 A);
591 extern _iq13 _IQ13sqrt_mathacl(_iq13 A);
592 extern _iq12 _IQ12sqrt_mathacl(_iq12 A);
593 extern _iq11 _IQ11sqrt_mathacl(_iq11 A);
594 extern _iq10 _IQ10sqrt_mathacl(_iq10 A);
595 extern _iq9 _IQ9sqrt_mathacl(_iq9 A);
596 extern _iq8 _IQ8sqrt_mathacl(_iq8 A);
597 extern _iq7 _IQ7sqrt_mathacl(_iq7 A);
598 extern _iq6 _IQ6sqrt_mathacl(_iq6 A);
599 extern _iq5 _IQ5sqrt_mathacl(_iq5 A);
600 extern _iq4 _IQ4sqrt_mathacl(_iq4 A);
601 extern _iq3 _IQ3sqrt_mathacl(_iq3 A);
602 extern _iq2 _IQ2sqrt_mathacl(_iq2 A);
603 extern _iq1 _IQ1sqrt_mathacl(_iq1 A);
604 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
605 
613 #if GLOBAL_IQ == 30
614 #define _IQsqrt_mathacl(A) _IQ30sqrt_mathacl(A)
615 #endif
616 #if GLOBAL_IQ == 29
617 #define _IQsqrt_mathacl(A) _IQ29sqrt_mathacl(A)
618 #endif
619 #if GLOBAL_IQ == 28
620 #define _IQsqrt_mathacl(A) _IQ28sqrt_mathacl(A)
621 #endif
622 #if GLOBAL_IQ == 27
623 #define _IQsqrt_mathacl(A) _IQ27sqrt_mathacl(A)
624 #endif
625 #if GLOBAL_IQ == 26
626 #define _IQsqrt_mathacl(A) _IQ26sqrt_mathacl(A)
627 #endif
628 #if GLOBAL_IQ == 25
629 #define _IQsqrt_mathacl(A) _IQ25sqrt_mathacl(A)
630 #endif
631 #if GLOBAL_IQ == 24
632 #define _IQsqrt_mathacl(A) _IQ24sqrt_mathacl(A)
633 #endif
634 #if GLOBAL_IQ == 23
635 #define _IQsqrt_mathacl(A) _IQ23sqrt_mathacl(A)
636 #endif
637 #if GLOBAL_IQ == 22
638 #define _IQsqrt_mathacl(A) _IQ22sqrt_mathacl(A)
639 #endif
640 #if GLOBAL_IQ == 21
641 #define _IQsqrt_mathacl(A) _IQ21sqrt_mathacl(A)
642 #endif
643 #if GLOBAL_IQ == 20
644 #define _IQsqrt_mathacl(A) _IQ20sqrt_mathacl(A)
645 #endif
646 #if GLOBAL_IQ == 19
647 #define _IQsqrt_mathacl(A) _IQ19sqrt_mathacl(A)
648 #endif
649 #if GLOBAL_IQ == 18
650 #define _IQsqrt_mathacl(A) _IQ18sqrt_mathacl(A)
651 #endif
652 #if GLOBAL_IQ == 17
653 #define _IQsqrt_mathacl(A) _IQ17sqrt_mathacl(A)
654 #endif
655 #if GLOBAL_IQ == 16
656 #define _IQsqrt_mathacl(A) _IQ16sqrt_mathacl(A)
657 #endif
658 #if GLOBAL_IQ == 15
659 #define _IQsqrt_mathacl(A) _IQ15sqrt_mathacl(A)
660 #endif
661 #if GLOBAL_IQ == 14
662 #define _IQsqrt_mathacl(A) _IQ14sqrt_mathacl(A)
663 #endif
664 #if GLOBAL_IQ == 13
665 #define _IQsqrt_mathacl(A) _IQ13sqrt_mathacl(A)
666 #endif
667 #if GLOBAL_IQ == 12
668 #define _IQsqrt_mathacl(A) _IQ12sqrt_mathacl(A)
669 #endif
670 #if GLOBAL_IQ == 11
671 #define _IQsqrt_mathacl(A) _IQ11sqrt_mathacl(A)
672 #endif
673 #if GLOBAL_IQ == 10
674 #define _IQsqrt_mathacl(A) _IQ10sqrt_mathacl(A)
675 #endif
676 #if GLOBAL_IQ == 9
677 #define _IQsqrt_mathacl(A) _IQ9sqrt_mathacl(A)
678 #endif
679 #if GLOBAL_IQ == 8
680 #define _IQsqrt_mathacl(A) _IQ8sqrt_mathacl(A)
681 #endif
682 #if GLOBAL_IQ == 7
683 #define _IQsqrt_mathacl(A) _IQ7sqrt_mathacl(A)
684 #endif
685 #if GLOBAL_IQ == 6
686 #define _IQsqrt_mathacl(A) _IQ6sqrt_mathacl(A)
687 #endif
688 #if GLOBAL_IQ == 5
689 #define _IQsqrt_mathacl(A) _IQ5sqrt_mathacl(A)
690 #endif
691 #if GLOBAL_IQ == 4
692 #define _IQsqrt_mathacl(A) _IQ4sqrt_mathacl(A)
693 #endif
694 #if GLOBAL_IQ == 3
695 #define _IQsqrt_mathacl(A) _IQ3sqrt_mathacl(A)
696 #endif
697 #if GLOBAL_IQ == 2
698 #define _IQsqrt_mathacl(A) _IQ2sqrt_mathacl(A)
699 #endif
700 #if GLOBAL_IQ == 1
701 #define _IQsqrt_mathacl(A) _IQ1sqrt_mathacl(A)
702 #endif
703 
713 __STATIC_INLINE int_fast32_t _IQNmpy_mathacl_inline(int_fast32_t iqNInput1, int_fast32_t iqNInput2, const int8_t q_value)
714 {
715  /* write control */
716  MATHACL->CTL = 6 | (q_value<<8) | (1 << 5);
717  /* write operands to HWA */
718  MATHACL->OP2 = iqNInput2;
719  /* write trigger word last */
720  MATHACL->OP1 = iqNInput1;
721  /* read iqmpy product */
722  return MATHACL->RES1;
723 }
724 
725 //*****************************************************************************
726 //
727 // Mark the end of the C bindings section for C++ compilers.
728 //
729 //*****************************************************************************
730 #ifdef __cplusplus
731 }
732 #endif
733 
734 #endif // __IQMATH_MATHACL_H__
__STATIC_INLINE int_fast32_t _IQNmpy_mathacl_inline(int_fast32_t iqNInput1, int_fast32_t iqNInput2, const int8_t q_value)
MATHACL inline multiplication.
Definition: IQmath_mathacl.h:713
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale