trigono.h
来自「非常实用的AD和pwm的ad公司21990dsp芯片的控制源代码」· C头文件 代码 · 共 116 行
H
116 行
/****************************************************************************************
* *
* Library: Configuration and Macros for Trigonometric Functions *
* *
* File: trigono.h *
* *
* Description: Trigono Include File *
* Purpose : Declare Library Routines and Macros for Trigonometric Operations *
* *
* Author : KU *
* Version : 1.0 *
* Date : January 2000 *
* Modification History: KU *
* *
* Embedded Control Systems *
* Analog Devices Inc. *
****************************************************************************************/
/****************************************************************************************
* *
* Constant that need to be defined in main.h: *
* *
* None *
****************************************************************************************/
/****************************************************************************************
* *
* Other Libraries Required by this Module: *
* *
* None *
****************************************************************************************/
#ifndef TRIG_INCLUDED
#define TRIG_INCLUDED
/****************************************************************************************
* Routines Defined in this Module *
****************************************************************************************/
.EXTERN Sin_;
.EXTERN Cos_;
/****************************************************************************************
* Global Variables Defined in this Module *
****************************************************************************************/
/* None */
/****************************************************************************************
* *
* Type: Macro *
* *
* Call: Set_DAG_registers_for_trigonometric(); *
* *
* Initialise the DAG registers for use with the trigonometric functions *
* *
* Inputs : None *
* *
* Ouputs : None *
* *
* Modified: M5, L5 *
* *
****************************************************************************************/
#define Set_DAG_registers_for_trigonometric \
M5 = 1; \
L5 = 0
/****************************************************************************************
* *
* Type: Macro *
* *
* Call: Sin(angle); *
* *
* This Function performs the Sine Calculation *
* *
* Input: %0 : Angle in 1.15 format (dreg or constant) *
* *
* Output: AR : Sine of angle *
* *
* Modified: AX0, AX1, AY0, AY1, AR, AF, MY0, MX1, MY1, MR, SR, I6, M6, L6 *
* *
****************************************************************************************/
#define Sin(theta) \
ax0 = theta; \
call Sin_
/****************************************************************************************
* *
* Type: Macro *
* *
* Call: Cos(angle); *
* *
* This Function performs the Cose calculation *
* *
* Input: %0 : Angle in 1.15 format (dreg or constant) *
* *
* Output: AR : Cosine of angle *
* *
* Modified: AX0, AX1, AY0, AY1, AR, AF, MY0, MX1, MY1, MR, SR, I6 *
* *
****************************************************************************************/
#define Cos(theta) \
ax0 = theta; \
call Cos_
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?