www.pudn.com > voltage_monitor.rar > MFID.h


/* Offset Address of MFID 
   7-25-2003 by zhaoxh. 
 */ 
 
//定义基地址,防止严重错误 
#ifndef IO_BASE  
#define IO_BASE						0x300	//定义为0x300以防止严重错误 
#endif 
 
//定义偏移地址 
#define OFFSET_CTRL_8255			0x3		//8255命令口的偏移地址 
#define OFFSET_PA_8255				0x0 
#define OFFSET_PB_8255				0x1 
#define OFFSET_PC_8255				0x2 
 
#define OFFSET_CTRL_8251			0x9 
#define OFFSET_DATA_8251			0x8 
 
#define OFFSET_CTRL_8253			0x7 
#define OFFSET_TIMER0_8253			0x4 
#define OFFSET_TIMER1_8253			0x5 
#define OFFSET_TIMER2_8253			0x6 
 
 
#define OFFSET_START_ADC			0xC 
#define OFFSET_EOC_ADC				0xE 
 
#define OFFSET_DATA_DAC				0xF 
#define OFFSET_CHANNEL_DAC			0xE 
#define OFFSET_EN_INTR_DAC			0xD 
 
//基地址+偏移地址 
#define CTRL_8255					IO_BASE + OFFSET_CTRL_8255 
#define PA_8255						IO_BASE + OFFSET_PA_8255 
#define PB_8255						IO_BASE + OFFSET_PB_8255 
#define PC_8255						IO_BASE + OFFSET_PC_8255 
 
#define CTRL_8251					IO_BASE + OFFSET_CTRL_8251 
#define DATA_8251					IO_BASE + OFFSET_DATA_8251 
 
#define CTRL_8253					IO_BASE + OFFSET_CTRL_8253 
#define TIMER0_8253					IO_BASE + OFFSET_TIMER0_8253 
#define TIMER1_8253					IO_BASE + OFFSET_TIMER1_8253 
#define TIMER2_8253					IO_BASE + OFFSET_TIMER2_8253 
 
 
#define START_ADC					IO_BASE + OFFSET_START_ADC 
#define EOC_ADC						IO_BASE + OFFSET_EOC_ADC 
 
#define DATA_DAC					IO_BASE + OFFSET_DATA_DAC 
#define CHANNEL_DAC					IO_BASE + OFFSET_CHANNEL_DAC 
#define EN_INTR_DAC					IO_BASE + OFFSET_EN_INTR_DAC 
 
//绝对是相对的,相对才是绝对的! 
 
 
#define CLK_8253					1193182	//8253输入时钟频率 
#define FACTOR16_BAUDRATE_8251		16	//8251波特率因子16 
 
#define WM_STOP						WM_USER+10 
#define WM_RECEIVE					WM_USER+20 
#define WM_RECEIVE_SLAVE			WM_USER+30 
#define WM_RECEIVE_MAIN				WM_USER+35 
#define WM_PLAYING_END				WM_USER+40 
 
#define DELAY_GENERAL1					50 
#define DELAY_LONG1						300 
 
#define REPEATS1_8251					3 
#define REPEATS2_8251					3 
#define DELAY1_8251						3 
#define DELAY2_8251						2 
#define DELAY_SENDFILE_8251				10 
 
#define DELAY1_8255						5 
 
#define SLOW_STEP						200 
#define RAPID_STEP						50 
 
#define WAITING_TIME					10