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

📄 constant.h

📁 基于ARM7与CAN总线的加工中心面板控制系统软件。选用ARM单片机且带CAN接口的lpc2119芯片
💻 H
字号:
/*--------------------------------------------------------------------------
constant.H

Header file for function sub.
Copyright (c) 2005 XMUT
All rights reserved.
--------------------------------------------------------------------------*/

#ifndef __constant_H__
#define __constant_H__


/* CH451和CH452的常用命令码 */
#define CH452_NOP		   0x0000					// 空操作
#define CH452_RESET     0x0201					// 复位
#define CH452_LEVEL		0x0100					// 加载光柱值,需另加7位数据
#define CH452_CLR_BIT	0x0180					// 段位清0,需另加6位数据
#define CH452_SET_BIT	0x01C0					// 段位置1,需另加6位数据
#define CH452_SLEEP		0x0202					// 进入睡眠状态
#define CH452_LEFTMOV   0x0300		            // 设置移动方式-左移
#define CH452_LEFTCYC   0x0301		            // 设置移动方式-左循环
#define CH452_RIGHTMOV  0x0302		            // 设置移动方式-右移
#define CH452_RIGHTCYC  0x0303		            // 设置移动方式-右循环	
#define CH452_SELF_BCD	0x0380					// 自定义BCD码,需另加7位数据
#define CH452_SYSOFF    0x0400					// 关闭显示、关闭键盘
#define CH452_SYSON1    0x0401					// 开启显示
#define CH452_SYSON2    0x0403					// 开启显示、键盘
#define CH452_SYSON2W   0x0423					// 开启显示、键盘, 真正2线接口
#define CH452_NO_BCD    0x0500					// 设置默认显示方式,可另加3位扫描极限
#define CH452_BCD       0x0580					// 设置BCD译码方式,可另加3位扫描极限
#define CH452_TWINKLE   0x0600		            // 设置闪烁控制,需另加8位数据
#define CH452_GET_KEY	0x0700					// 获取按键,返回按键代码
#define CH452_DIG0      0x0800					// 数码管位0显示,需另加8位数据
#define CH452_DIG1      0x0900		            // 数码管位1显示,需另加8位数据
#define CH452_DIG2      0x0a00		            // 数码管位2显示,需另加8位数据
#define CH452_DIG3      0x0b00		            // 数码管位3显示,需另加8位数据
#define CH452_DIG4      0x0c00		            // 数码管位4显示,需另加8位数据
#define CH452_DIG5      0x0d00					// 数码管位5显示,需另加8位数据
#define CH452_DIG6      0x0e00					// 数码管位6显示,需另加8位数据
#define CH452_DIG7      0x0f00		            // 数码管位7显示,需另加8位数据  
#define CH452_DSP       0x0500					//设置默认显示方式 
// BCD译码方式下的特殊字符
#define		CH452_BCD_SPACE		0x10
#define		CH452_BCD_PLUS		0x11
#define		CH452_BCD_MINUS		0x12
#define		CH452_BCD_EQU		0x13
#define		CH452_BCD_LEFT		0x14
#define		CH452_BCD_RIGHT		0x15
#define		CH452_BCD_UNDER		0x16
#define		CH452_BCD_CH_H		0x17
#define		CH452_BCD_CH_L		0x18
#define		CH452_BCD_CH_P		0x19
#define		CH452_BCD_DOT		0x1A
#define		CH452_BCD_SELF		0x1E
#define		CH452_BCD_TEST		0x88
#define		CH452_BCD_DOT_X		0x80   
                                                                     
//2线接口的位操作       
/*                                                                            
#define		CH452DispSCL_SET		{CH452DispSCL=1;}                                                     
#define		CH452DispSCL_CLR		{CH452DispSCL=0;}                                                     
#define		CH452DispSDA_SET		{CH452DispSDA=1;}                                                     
#define		CH452DispSDA_CLR		{CH452DispSDA=0;}                                                     
#define		CH452DispSDA_IN			(CH452DispSDA)                                                        
//按键读取,本例中不采用按键中断  


//2线接口的位操作                                                                                   
#define		CH452KeySCL_SET		{CH452KeySCL=1;}                                                        
#define		CH452KeySCL_CLR		{CH452KeySCL=0;}                                                        
#define		CH452KeySDA_SET		{CH452KeySDA=1;}                                                        
#define		CH452KeySDA_CLR		{CH452KeySDA=0;}                                                        
#define		CH452KeySDA_IN		(CH452KeySDA)  
 */
/*定义端口*/



/* 定义常量 */
#define OK 1

#define ERROR 0
#define client 655


#define producer0 0x83
#define producer1 0x76

//昌松  CS 67 83
#define constant1 0x06
#define constant2 0x07
#define constant3 0x08
#define constant4 0x03
#define constant5 0x00
#define constant6 0x00

#endif

⌨️ 快捷键说明

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