?? hzmmi._h
字號:
#include <iom128.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#ifndef __hzmmi_h
#define __hzmmi_h
#define UBRR0L (*(volatile unsigned char *)0x29)
#define UCSR0B (*(volatile unsigned char *)0x2A)
#define UCSR0A (*(volatile unsigned char *)0x2B)
#define UDR0 (*(volatile unsigned char *)0x2C)
#define UBRR0H (*(volatile unsigned char *)0x90)
#define UCSR0C (*(volatile unsigned char *)0x95)
#define UBRR1H (*(volatile unsigned char *)0x98)
#define UBRR1L (*(volatile unsigned char *)0x99)
#define UCSR1B (*(volatile unsigned char *)0x9A)
#define UCSR1A (*(volatile unsigned char *)0x9B)
#define UDR1 (*(volatile unsigned char *)0x9C)
#define UCSR1C (*(volatile unsigned char *)0x9D)
//typedef unsigned char byte;
typedef char byte;
typedef unsigned short word;
typedef unsigned long dword;
#define TRUE 1
#define FALSE 0
#define ON ((char)1)
#define OFF ((char)0)
//控制數據口定義
//端口D定義
#define LCD_CE (0x20) //LCD使能
#define LCD_ID (0x40) //LCD命令數據口
#define LCD_RST (0x80) //LCD復位
#define LCD_BUSY_S0 (0x01) //判LCD忙S0位
#define LCD_BUSY_S1 (0x02) //判LCD忙S1位
#define LCD_BUSY_S2 (0x04) //判LCD數據自動讀忙位
#define LCD_BUSY_S3 (0x08) //判LCD數據自動寫忙位
//端口E定義
#define RUN_LAMP (0x04)
//端口G定義
#define EL_ON (0x10) //LCD復位
#define KEY_NULL 0
#define KEY_UP 1
#define KEY_LEFT 2
#define KEY_RIGHT 3
#define KEY_DOWN 4
#define KEY_SET 5
#define KEY_QUIT 6
#define KEY_ATTN 7
#define KEY_RST24 8
#define KEY_NOUSE 9
#define LCD_BUSY (0x80)
#define MASTER 1
#define SLAVE 0
#define CMD_XFER 1
#define CMD_NULL 0
#define CMD_RESYNC 0x5a
#define CMD_ACKSYNC 7
#define EOM 0
#define SLAVE_A 0x41
#define SLAVE_B 0x42
#define DIS_LEN 0x20 //液晶顯示寬度BYTE
#define START_ADDRESS 0x000 //液晶圖形顯示起始地址偏移量
#define MMI_VER 1 //版本號
typedef union {
dword l;
struct {
unsigned char a0;
unsigned char a1;
unsigned char a2;
unsigned char a3;
}bytes;
}LIB_ADDR;
typedef struct{
const char *str;
}CSTR;
//二維表元素定義
typedef struct{
const char *AscCode; //代碼項
const char *HzTable; //代碼對應的漢化翻譯
}DaiMa;
#ifdef __main__
#include "hzmmitab18.h"
word ms_count;
word mstimer1,mstimer2;
word mstimer3;
byte poll_com;
word com_i;
byte com_c_key;
byte has_key;
byte soft_dog;
byte ctl_data;
byte nv_update,nv_down_ab;
LIB_ADDR lib_addr;
byte CPU_ID;
byte disp_buffer1[128]; //緩沖區
byte disp_buffer[128]; //顯示緩沖區
word commu_end;
byte commu_buf[MAX_COM_BLOCK];
//手形光標定義
const byte menucursor[32]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x80,
0x03, 0xfe, 0x3c, 0x01, 0x24, 0x7e, 0x24, 0x04,
0x24, 0x78, 0x24, 0x08, 0x24, 0x78, 0x3f, 0x10,
0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*zw
//手形光標定義
const byte menucursor[32]=
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x01,
0xc0, 0x7f, 0x3c, 0x80, 0x24, 0x7e, 0x24, 0x20,
0x24, 0x1e, 0x24, 0x10, 0x24, 0x1e, 0xfc, 0x08,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
zw*/
//天線光標定義
const byte GPScursor[16]=
{
0x02, 0x90, 0x88, 0xc4, 0x40, 0x70, 0x9c, 0x80, 0x80
};
const DaiMa *SetTable;
const DaiMa *AnalogTable;
const DaiMa *KeyTable;
const DaiMa *ReportTable;
const DaiMa *CTL_DOT;
const CSTR *CTL_DOT_CPU;
#else
extern word ms_count;
extern word mstimer1,mstimer2;
extern word mstimer3;
extern byte poll_com;
extern word com_i;
extern byte com_c_key;
extern byte has_key;
extern byte soft_dog;
extern byte ctl_data;
extern byte nv_update,nv_down_ab;
extern LIB_ADDR lib_addr;
extern byte CPU_ID;
extern word commu_end;
extern byte commu_buf[];
extern byte disp_buffer[];
extern byte disp_buffer1[];
extern word comm_timer;
extern const byte menucursor[];
extern const byte GPScursor[];
extern const DaiMa *SetTable;
extern const DaiMa *AnalogTable;
extern const DaiMa *KeyTable;
extern const DaiMa *ReportTable;
extern const DaiMa *CTL_DOT;
extern const CSTR *CTL_DOT_CPU;
#endif
#define wait_spi() while(1)asm("sbis 0x0e,7")
#define watchdog() PORTB|=WDG,PORTB&=~WDG
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -