
#ifndef _Common_H_
#define _Common_H_
#include "CRG.h"
#include "stdint.h"
#include "mc9s12xhy256.h"
#include "comdef.h"
#include "hidef.h"
#include "main.h"
#include "TSzhen.h"

//图层  
#define 	LAYER_BEIJING 		                  0             //底图                                                      
#define 	LAYER_BEIJING1 		                  1             //底图
#define   LAYER_VehicleL                      2             //车速L
#define   LAYER_VehicleR                      3             //车速R
#define   LAYER_ODO                           4             //ODO与km
#define 	LAYER_ODO1											    5             //
#define 	LAYER_ODO2											    6             //
#define 	LAYER_ODO3											    7             //
#define 	LAYER_ODO4											    8             //
#define 	LAYER_ODO5											    9             //
#define 	LAYER_ODO6                         10             // 

#define 	LAYER_Trip											   11             //TRIP
#define 	LAYER_Trip1											   12             //
#define 	LAYER_Trip2											   13             //
#define 	LAYER_Trip3											   14             //
#define 	LAYER_Trip4											   15             // 
#define   LAYER_Gear                         16             //档位
#define   LAYER_Gear1                        17             //档位1
#define   LAYER_Gear2                        18             //档位2
#define 	LAYER_Time_Hour1		               19             //时间小时
#define 	LAYER_Time_Hour2		               20             //时间小时
#define 	LAYER_Time_Dot			               21             //时间冒号

#define 	LAYER_Time_Minute1	               22             //时间分钟
#define 	LAYER_Time_Minute2                 23             //时间分钟
#define   LAYER_AirL1                        24             //气压
#define   LAYER_AirR1                        25             //
#define 	LAYER_EngineL                      26             //转速L
#define 	LAYER_EngineR                      27             //转速R
#define 	LAYER_Engine1                      28             //转速数字
#define   LAYER_Engine2                      29             //转速数字
#define   LAYER_EngineDot                    30             //转速数字
#define   LAYER_Vehicle1                     31             //车速数字

#define   LAYER_Vehicle2                     32             // 车速数字
#define   LAYER_Vehicle3                     33             //车速数字
#define 	LAYER_TUINT                        34             //温度单位
#define 	LAYER_TEMP1                        35             //温度负号
#define 	LAYER_TEMP2                        36             //温度
#define 	LAYER_TEMP3                        37             //温度
#define 	LAYER_LED01                        38             //指示灯01
#define 	LAYER_LED02                        39             //指示灯02
#define 	LAYER_LED03                        40             //指示灯03
#define 	LAYER_LED04                        41             //指示灯04

#define 	LAYER_LED05                        42             //指示灯05
#define 	LAYER_LED06                        43             //指示灯06
#define   LAYER_LED07                        44             //指示灯07
#define 	LAYER_LED08                        45             //指示灯08
#define 	LAYER_LED09                        46             //指示灯09
#define 	LAYER_LED10                        47             //指示灯10
#define 	LAYER_LED11                        48             //指示灯11
#define 	LAYER_LED12                        49             //指示灯12
#define 	LAYER_LED13                        50             //指示灯13
#define 	LAYER_LED14                        51             //指示灯14

#define 	LAYER_LED15                        52             //指示灯15
#define 	LAYER_LED16                        53             //指示灯16
#define 	LAYER_LED17                        54             //指示灯17
#define 	LAYER_LED18                        55             //指示灯18
#define 	LAYER_LED19                        56             //指示灯19
#define   LAYER_LED20                        57             //指示灯20
#define   LAYER_LED21                        58             //指示灯21
#define   LAYER_LED22                        59             //指示灯22
#define   LAYER_LED23                        60             //指示灯23
#define   LAYER_LED24                        61             //指示灯24

#define 	LAYER_LED25                        62             //指示灯25
#define 	LAYER_LED26                        63             //指示灯26
#define 	LAYER_LED27                        64             //指示灯27
#define   LAYER_LED28                        65             //指示灯28
#define 	LAYER_LED29                        66             //指示灯29
#define   LAYER_LED30                        67             //指示灯30

//共享图层 
#define   LAYER_MENU01                       68             //菜单层
#define   LAYER_MENU02                       69   
#define   LAYER_MENU03                       70                                                              
#define   LAYER_MENU04                       71      
#define   LAYER_MENU05                       72     
#define   LAYER_MENU06                       73  
#define   LAYER_MENU07                       74  
#define   LAYER_MENU08                       75  
#define   LAYER_MENU09                       76  
#define   LAYER_MENU10                       77  
#define   LAYER_MENU11                       78  
#define   LAYER_MENU12                       79  
#define   LAYER_MENU13                       80   
#define   LAYER_MENU14                       81

#define   LAYER_LED31                        82             //指示灯31
#define   LAYER_LED32                        83             //指示灯32
#define   LAYER_LED33                        84             //指示灯33 

//#define 	LAYER_POPUP_Text                           //报警图片
//#define 	LAYER_POPUP_Textwenzi                      //报警文字

//------

//档位信息
#define Gear_N            0
#define Gear_One          1
#define Gear_Two          2
#define Gear_Three        3
#define Gear_Four         4
#define Gear_Five         5
#define Gear_Six          6
#define Gear_R            13
#define Gear_D            14
#define Gear_P            15

/****************************************************************
	普通参数(各模块通用的常量定义)
****************************************************************/
#define         cnUASTHandH	        0xF5	// 串口接受消息头高位
#define         cnUASTHandL	        0x5A	// 串口接受消息头低位
/****************串口命令定义***********************************/

#define         comACK   	          0x10  	       //ACK 
#define         comNCK   	          0x11  	       //NCK 
#define   	  	cnRSBufLen    		  33             //串口接收缓存区长度
#define   		  cnRSDatLen    		  cnRSBufLen-3   //串口接收数据区最大长度 
#define	        cnCZSB_BJDJ_WBD 	  12		       	 //车,转速表  1度等于12微步
extern   const  uint8_t CommandNCK[5];
extern          uint8_t RSB_P;
extern          uint8_t  RX_BUF[cnRSBufLen];       //串口接收缓存区
extern          uint8_t  TX_BUF[cnRSBufLen];       //串口发送缓存区
/*******************函数************************************/
extern uint8_t RSSRecivJudge(void);
void JSCCSendDataToYQ(void);
void SendRomStrToUART(INT8U *myROMADR, INT8U mDataLen);
void SendACKToSBEI(void);
void ReadDataCOMPRG(void);
void WriteDataCOMPRG(void);
#endif






