📄 serial_h.h
字号:
#include <reg52.h>
sfr AUXR = 0x8e;
#define uint unsigned int
#define ulong unsigned long int
#define uchar unsigned char
#define TBUF_SIZE 256
#define RBUF_SIZE 132
static xdata uchar send_ok_flag;
static xdata uchar receive_ok_flag;
xdata uchar tbuf[TBUF_SIZE];
uchar xdata rbuf[RBUF_SIZE];
static xdata uchar t_in;
static xdata uchar t_out;
static xdata uchar r_in;
static xdata uchar r_out;
uchar r_c;
uchar t_c;
uchar t_disable;
uchar xmodem_flag;
uint xomdem_count;
#define SOH 0x01
#define EOT 0x04
#define ACK 0x06
#define NAK 0x15
#define CRC 0x43
#define DLE 0x10
#define XON 0x11
#define XOF 0x13
#define SYN 0x16
#define CAN 0x18
static xdata uchar r_xmodem[132];
void putword(uint value);
uint getword(void);
void xmodem_receive(void);
uchar xdata *getxmodem(void);
uchar getchar1(uint value);
/*----------------------------------------------------------------
DELAY program
-----------------------------------------------------------------*/
extern void delay5us(uint utimes); //5uS*utimes IN 12MHZ
extern void delay10ms(uint mtimes); //10MS*mtimes IN 12MHZ
extern void delay1s(uint time1,uint time2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -