📄 common.h
字号:
#ifndef __COMMON_H_ICL__
#define __COMMON_H_ICL__
#include <REG52.H>
#include <stdio.h>
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned long u_long;
#define DB0 P0_0
#define DB1 P0_1
#define DB2 P0_2
#define DB3 P0_3
#define DB4 P0_4
#define DB5 P0_5
#define DB6 P0_6
#define DB7 P0_7
#define CLOM1 P1_0
#define CLOM2 P1_1
#define CLOM3 P1_2
#define CLOM4 P1_3
#define ROW1 P1_4
#define ROW2 P1_5
#define ROW3 P1_6
#define ROW4 P1_7
#define WCS0 P2_0
#define WCS1 P2_1
/*
#define ST2 P2_2
#define ST3 P2_3
#define ST4 P3_4 //T0
#define ST5 P3_5 //T1
#define RE P3_3 //INT1
#define LED P3_2 //INT0
#define BAUD_RATE_H P3_7 //RD
#define BAUD_RATE_L P3_6 //WR
*/
#define RXD P3_0 //RECIEVE
#define TXD P3_1 //SEND
#define MAX_COMM_BUF_SIZE 10
#define RECV 0
#define SEND 1
#define START_CHAR '%' // 0x25
#define END_CHAR '$' // 0x24
#define ACK_CHAR '!' // 0x21
#define NO_ACK_CHAR '#' // 0x23
// R = 0x52
// W = 0x57
#define CMD_HEAD_LEN 5
// 长正数存储顺序,首地址+偏移值
#define MSB 0
#define NMSB 1
#define NLSB 2
#define LSB 3
#define MAX_CLOMN 4
#define MAX_ROW 4
typedef struct
{
u_char MsgCnt;
u_char SendIdx;
u_char MsgData[MAX_COMM_BUF_SIZE];
}COMM_BUF_DEF;
u_char KeybdBtn[MAX_CLOMN][MAX_ROW];
u_char KeybdLed[MAX_CLOMN][MAX_ROW];
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -