general.h

来自「本文件用于智能云台电机控制和图像处理」· C头文件 代码 · 共 115 行

H
115
字号

#include <c516rd.h>
#define WdtCls()  WDT_CONTR=0xff		 //0xff;	看门狗清零
#define  SONY		  1
#define  CAMERABAUD     0xa000
#define  CAMERAMODEL    0xa100
#define	 IRISCLOSE		0x0100
#define	 IRISOPEN		0x0200
#define	 FOCUSNEAR		0x0300
#define	 FOCUSFAR		0x0400
#define	 ZOOMWIDE		0x0500
#define	 ZOOMTELE		0x0600
#define	 DOWN			0x0700
#define	 UP				0x0800
#define	 LEFT			0x0900
#define	 RIGHT			0x0a00
#define	 STOP			0x0b00
#define	 SETPRESET		0x0c00
#define	 CLEARPRESET	0x0d00
#define	 CALLPRESET		0x0e00
#define	 FLIP			0x0f00
#define	 PANZERO		0x1000
#define	 AUXSET			0x1100
#define	 AUXCLEAR		0x1200
#define	 ZONEBEGIN		0x1300
#define	 ZONEEND		0x1400
#define	 ZONERUN		0x1500
#define	 PATTERNBEGIN	0x1600
#define	 PATTERNEND		0x1700
#define	 PATTERNRUN		0x1800
#define HSTB    P1_2
#define HCLK    P1_3
#define HDATA   P1_4		  //定义A3972控制位
#define VSTB    P1_5
#define VCLK    P1_6
#define VDATA   P1_7
#define CLK6464  P0_0
#define DATA6464 P0_1
#define STB6464  P0_2
#define BUSY6464 P0_3
#define black 0
#define blue 1
#define	 green 2
#define  red 4
#define	 white 7   //0黑1兰2绿4红7白
#define	 VIDEORAMCLS 0
#define	 DISPCONTROL 0x14
#define	 DISPON		 8
#define	 DISPOFF	 0
#define	 BLINKOFF	 0
#define	 BLINK2hz	 1
#define	 BLINK1hz	 2
#define	 BLINK05hz	 3
#define	 BACKGROUNDCONTROL 0x30
#define	 BACKGROUNDno  0
#define	 BACKGROUNDblackframe 2
#define	 BACKGROUNDwhiteonblack  4
#define	 BACKGROUNDblack  6
#define	 EXTERNALVIDEO   0x40 
#define	 PAL  0x49
#define	 NTSC 0x48
#define	 ORIGIN  0x8000
#define	 ORIGINPROW   <<5
#define	 POSITION	  0x8800
#define	 POSITIONy	  <<5 
#define	 OUT1VPP  0x9005
#define	 CHARACTERSIZE  0x9800
#define	 CHARACTERSIZE0 0
#define	 CHARACTERSIZE1	 0x40
#define	 CHARACTORWRITE  0xc000
#define	 CHARACTORWRITEBLINK  0x0200
#define	 CHARACTORWRITEBLINKNO	0
#define	 A3279INITATE  0x040449
#define	 SCL  P0_6
#define	 SDA  P0_7
//#define	 POINTMOTION 2
#define	 FREEMOTION  1
#define	 SINGLEMOTION 2
#define	 DOUBLEMOTION  3
#define	 MULMOTION  4
#define	 STOPROTATION  5

//#define	 ROUTINROTATION 3
//#define	 TWOROTATION  4
#define	 NORMALMOTION  2
#define	 ACCELERATION  1
#define	 DECELERATION  3
#define	 PAUSE  4
#include <mcu51_set.h>
#include <intrins.h>
#include <string.h> 
 /*----------------经试验效果不好-------------------
 unsigned long code	SIN64[]={0x45f80,0x47f8c,0x47f18,0x47e24,
 0x47d30,0x47c3c,0x47a46,0x478d0,0x476da,0x47462,0x471e8,
 0x46f70,0x46c74,0x46978,0x4667c,0x4637e,0x4207e,0x4237e,
 0x4267c,0x42978,0x42c74,0x42f70,0x431e8,0x43462,0x436da,
 0x438d0,0x43a46,0x43c3c,0x43d30,0x43e24,0x43f18,0x43f8c,
 0x41f80,0x41f8c,0x41f18,0x41e24,0x41d30,0x41c3c,0x41a46,
 0x418d0,0x416da,0x41462,0x411e8,0x40f70,0x40c74,0x40978,
 0x4067c,0x4037e,0x4407e,0x4437e,0x4467c,0x44978,0x44c74,
 0x44f70,0x451e8,0x45462,0x456da,0x458d0,0x45a46,0x45c3c,
 0x45d30,0x45e24,0x45f18,0x45f8c};
 unsigned long code	SIN32[]={0x45f80,0x47f18,0x47d30,0x47a46,
 0x476da,0x471e8,0x46c74,0x4667c,0x4207e,0x4267c,0x42c74,
 0x431e8,0x436da,0x43a46,0x43d30,0x43f18,0x41f80,0x41f18,
 0x41d30,0x41a46,0x416da,0x411e8,0x40c74,0x4067c,0x4407e,
 0x4467c,0x44c74,0x451e8,0x456da,0x45a46,0x45d30,0x45f18} ;
 unsigned long code	SIN4[]={0x043ffe,0x047ffe,0x045ffe,0x041ffe};
 ---------------------------------------------------*/
  //unsigned long code  SINFIRST= 0x043ffe;
// unsigned long code  SINEND= 0x041ffe;
 /*
 unsigned long code	SIN16[]={0x45f80,0x47d30,0x476da,0x46c74,
 0x4207e,0x42c74,0x436da,0x43d30,0x41f80,0x41d30,0x416da,
 0x40c74,0x4407e,0x44c74,0x456da,0x45d30} ;	  */

⌨️ 快捷键说明

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