📄 trigono.h
字号:
/****************************************************************************************
* *
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -