#ifndef IOREGS_INC
#define IOREGS_INC			1

#include	<msc_config.h>

//External Vars
extern ushort WrRegVal;

/* Memory Mapped Registers - chip select defines */

#define	CS8_BASE_ADDR		0x00100000
#define CS8_BLOCK_SIZE		0x00000800

#define	CS10_BASE_ADDR		0x00100800
#define CS10_BLOCK_SIZE		0x00000800


/* Memory Mapped Registers - bit field defines */

// WR Latch (8bit)
#define DURA_ADC_CLK		0x0001
#define SYS_I2C_TXD     	0x0002    
#define SYS_I2C_SCL    		0x0004
#define SYS_I2C_RST  		0x0008   
#define SYS_I2C_ENABLE 		0x0010    
#define DURA_I2C_ENABLE		0x0020    
#define SPEC_232_ENABLE 	0x0040   
#define REFD_232_ENABLE		0x0080		

// Default Value
#define WR_REG_DEFAULTS 0x0000    /* All low */

// RD Latch (8 bit)
#define DURA_ADC_DAT    	0x0001    
#define SYS_I2C_RXD  		0x0002
#define DURA_I2C_RXD   		0x0004
#define SYS_I2C_INT    		0x0008
#define DURA_I2C_INT    	0x0010
#define SYS_POR_MON     	0x0020
#define SPEC_CMOS_CTS   	0x0040
#define REFD_CMOS_CTS		0x0080


/* Memory Mapped External Registers - function prototypes */

void   RegIO_Init(void);
ushort RegIO_RdWord(void);
void   RegIO_WrWord(ushort WordVal);
void   RegIO_SetBit(ushort BitVals);
void   RegIO_ClrBit(ushort BitVals);
void   RegIO_WrDefaults(void);

#endif
