debug_.h
来自「单片机与pc机通讯例程的mcu部分」· C头文件 代码 · 共 55 行
H
55 行
#ifndef _DEBUG__H_
#define _DEBUG__H_
#if 1
#define E_OSC 22.1184
#else
#define E_OSC 11.0592
#endif
#define F_OSC 12.0
/* T0 做100us的定时器用 */
#define T0_BASE_TIME 100 /* 100us T0 operation mode---8 bit auto-reload */
#define T0_OVERFLOW_COUNT T0_BASE_TIME*E_OSC/F_OSC
/* T2 做单总线时序计数 */
/* T1 作波特率串行口的溢出率 */
#define T1_INIT_COUNT 0xfd
#define SetBit(var,thisBit) ( var|=(1<<thisBit) )
#define ClrBit(var,thisBit) ( var&=(0xff-(1<<thisBit)) )
#define CompBit(var,thisBit) ( var^=(1<<thisBit))
#define GetBit(var,thisBit) ( var&(1<<thisBit) )
#define OSC_TEST 0
#define TEST_MODEL 0
enum{
SER_ERR_LESS_DATA,
SER_ERR_PARITY,
SER_ERR_MORE_DATA,
OPERATE_IC_FAILED,
OPERATE_IC_OK
};
#define LC32_WRITE_CMD 0xae
#define LC32_READ_CMD 0xaf
//#define LC32_WRITE_CMD 0xa0 /* 用24C02模拟24LC32 */
//#define LC32_READ_CMD 0xa1
#define AD1110_WRITE_CMD 0x90
#define AD1110_READ_CMD 0x91
#define AD1110_CONFIG_CMD 0x8c
#define P8574A_WRITE_CMD 0x7e
#define P8574A_READ_CMD 0x7f
#endif /* End definition of _DEBUG__H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?