// ************************************************************************** // // This confidential and proprietary Header_file may be used only as // authorised by a licensing agreement from CORERIVER Semiconductor Co., Ltd. // // (c) Copyright 2008 CORERIVER Semiconductor Co., Ltd. // All Rights Reserved // // The entire notice above must be reproduced on all authorised // copies and copies may only be made to the extent permitted // by a licensing agreement from CORERIVER Semiconductor Co., Ltd. // // ----------------------------------------------------------------------- // *** Subject : Midas220.H (ver 0.3) // ----------------------------------------------------------------------- // Header file for the GenCore Turbo midas230 //************************************************************************** #ifndef M220_HEADER_FILE #define M220_HEADER_FILE 1 /*=========================================================================*/ /*------- Define of Byte Registers ---------------------------*/ /*=========================================================================*/ sfr P0 = 0x80; sfr SP = 0x81; sfr DPL = 0x82; sfr DPH = 0x83; sfr ITSEL = 0x86; sfr PCON = 0x87; sfr TCON = 0x88; sfr TMOD = 0x89; sfr TL0 = 0x8A; sfr TL1 = 0x8B; sfr TH0 = 0x8C; sfr TH1 = 0x8D; sfr CKCON = 0x8E; sfr P1 = 0x90; sfr EXIF = 0x91; sfr PCLKEN = 0x92; sfr OSCTEST = 0x94; sfr RINGCON = 0x95; sfr OSCBIAS = 0x96; sfr OSCREF = 0x97; sfr SCON = 0x98; sfr SBUF = 0x99; sfr P2 = 0xA0; sfr IE = 0xA8; sfr IP = 0xB8; sfr STCON = 0xBC; sfr STCFG = 0xBD; sfr OSCICN = 0xBE; sfr PMR = 0xC4; sfr STATUS = 0xC5; sfr LVDCFG = 0xC6; sfr I2CST1 = 0xC8; sfr I2CSTH1 = 0xC9; sfr I2CCON1 = 0xCB; sfr I2CCFG1 = 0xCC; sfr I2CSLA1 = 0xCD; sfr I2CDAT1 = 0xCE; sfr PSW = 0xD0; sfr P0TYPE = 0xD4; sfr P1TYPE = 0xD5; sfr P2TYPE = 0xD6; sfr WDCON = 0xD8; sfr ADCHL = 0xD9; sfr ADCHSEL = 0xDB; sfr PWMCON = 0xDC; sfr PWMDH = 0xDD; sfr PWMD = 0xDE; sfr ACC = 0xE0; sfr ADCSELH = 0xE1; sfr ADCSEL = 0xE2; sfr ALTSEL = 0xE3; sfr P0SEL = 0xE4; sfr P1SEL = 0xE5; sfr P2SEL = 0xE6; sfr EIE = 0xE8; sfr P0HD = 0xEC; sfr ADCR = 0xEE; sfr ADCON = 0xEF; sfr B = 0xF0; sfr P0DIR = 0xF4; sfr P1DIR = 0xF5; sfr P2DIR = 0xF6; sfr EIP = 0xF8; sfr IAPWEN = 0xFC; sfr IAPCON = 0xFD; sfr IAPDAT = 0xFE; /* ------- End of Byte Registers ----------------------------- */ /*========================================================================*/ /*------- Define of Bit Register ----------------------------*/ /*========================================================================*/ /*------------------------------------------------ P0(80h) Bit Register ------------------------------------------------*/ sbit P00 = 0x80; sbit P01 = 0x81; sbit P02 = 0x82; sbit P03 = 0x83; sbit P04 = 0x84; sbit P05 = 0x85; sbit P06 = 0x86; sbit P07 = 0x87; /*------------------------------------------------ TCON(88h) Bit Register ------------------------------------------------*/ sbit IT0 = 0x88; sbit IE0 = 0x89; sbit IT1 = 0x8A; sbit IE1 = 0x8B; sbit TR0 = 0x8C; sbit TF0 = 0x8D; sbit TR1 = 0x8E; sbit TF1 = 0x8F; /*------------------------------------------------ P1(90h) Bit Register ------------------------------------------------*/ sbit P10 = 0x90; sbit P11 = 0x91; sbit P12 = 0x92; /*------------------------------------------------ SCON(98h) Bit Register ------------------------------------------------*/ sbit RI = 0x98; sbit TI = 0x99; sbit REN = 0x9C; /*------------------------------------------------ P2(A0h) Bit Register ------------------------------------------------*/ sbit P20 = 0xA0; sbit P21 = 0xA1; sbit P22 = 0xA2; sbit P23 = 0xA3; sbit P24 = 0xA4; sbit P25 = 0xA5; sbit P26 = 0xA6; /*------------------------------------------------ IE(A8h) Bit Register ------------------------------------------------*/ sbit EX0 = 0xA8; sbit ET0 = 0xA9; sbit EX1 = 0xAA; sbit ET1 = 0xAB; sbit ES = 0xAC; sbit EADC = 0xAE; sbit EA = 0xAF; /*------------------------------------------------ IP(B8h) Bit Register ------------------------------------------------*/ sbit PX0 = 0xB8; sbit PT0 = 0xB9; sbit PX1 = 0xBA; sbit PT1 = 0xBB; sbit PS = 0xBC; sbit PADC = 0xBE; /*------------------------------------------------ I2CST1(C8h) Bit Register ------------------------------------------------*/ sbit I2CBF = 0xC8; sbit I2CS = 0xC9; sbit I2CP = 0xCA; sbit I2CDA = 0xCB; sbit I2CRW = 0xCC; sbit I2CACK = 0xCD; sbit I2COF = 0xCE; sbit I2CIF = 0xCF; /*------------------------------------------------ PSW(D0h) Bit Register ------------------------------------------------*/ sbit P = 0xD0; sbit F1 = 0xD1; sbit OV = 0xD2; sbit RS0 = 0xD3; sbit RS1 = 0xD4; sbit F0 = 0xD5; sbit AC = 0xD6; sbit CY = 0xD7; /*------------------------------------------------ WDCON(D8h) Bit Register ------------------------------------------------*/ sbit RWT = 0xD8; sbit EWT = 0xD9; sbit WTRF = 0xDA; sbit WDIF = 0xDB; sbit WDM = 0xDD; sbit WD0 = 0xDE; sbit WD1 = 0xDF; /*------------------------------------------------ ACC(E0h) Bit Register ------------------------------------------------*/ sbit ACC0 = 0xE0; sbit ACC1 = 0xE1; sbit ACC2 = 0xE2; sbit ACC3 = 0xE3; sbit ACC4 = 0xE4; sbit ACC5 = 0xE5; sbit ACC6 = 0xE6; sbit ACC7 = 0xE7; /*------------------------------------------------ EIE(E8h) Bit Register ------------------------------------------------*/ sbit EX2 = 0xE8; sbit EX3 = 0xE9; sbit EI2C1 = 0xEB; sbit EWDT = 0xEC; sbit EPWM = 0xED; /*------------------------------------------------ B(F0h) Bit Register ------------------------------------------------*/ sbit B0 = 0xF0; sbit B1 = 0xF1; sbit B2 = 0xF2; sbit B3 = 0xF3; sbit B4 = 0xF4; sbit B5 = 0xF5; sbit B6 = 0xF6; sbit B7 = 0xF7; /*------------------------------------------------ EIP(F8h) Bit Register ------------------------------------------------*/ sbit PX2 = 0xF8; sbit PX3 = 0xF9; sbit PI2C1 = 0xFB; sbit PWDT = 0xFC; sbit PPWM = 0xFD; /* ------- End of Bit Register ---------------------------------- */ /*=========================================================================*/ /*------- Define of Bit Values --------------------------*/ /*=========================================================================*/ /*------------------------------------------------ P0 (80h) Bit Values ------------------------------------------------*/ #define P0_0_ 0x01 #define P0_1_ 0x02 #define P0_2_ 0x04 #define P0_3_ 0x08 #define P0_4_ 0x10 #define P0_5_ 0x20 #define P0_6_ 0x40 #define P0_7_ 0x80 /*------------------------------------------------ SP (81h) Bit Values ------------------------------------------------*/ #define SP0_ 0x01 #define SP1_ 0x02 #define SP2_ 0x04 #define SP3_ 0x08 #define SP4_ 0x10 #define SP5_ 0x20 #define SP6_ 0x40 #define SP7_ 0x80 /*------------------------------------------------ DPL (82h) Bit Values ------------------------------------------------*/ #define DPL0_ 0x01 #define DPL1_ 0x02 #define DPL2_ 0x04 #define DPL3_ 0x08 #define DPL4_ 0x10 #define DPL5_ 0x20 #define DPL6_ 0x40 #define DPL7_ 0x80 /*------------------------------------------------ DPH (83h) Bit Values ------------------------------------------------*/ #define DPH0_ 0x01 #define DPH1_ 0x02 #define DPH2_ 0x04 #define DPH3_ 0x08 #define DPH4_ 0x10 #define DPH5_ 0x20 #define DPH6_ 0x40 #define DPH7_ 0x80 /*------------------------------------------------ ITSEL (86h) Bit Values ------------------------------------------------*/ #define IT0SEL_ 0x01 #define IT1SEL_ 0x02 #define IT2SEL_ 0x04 #define IT3SEL_ 0x08 #define IT2_ 0x40 #define IT3_ 0x80 /*------------------------------------------------ PCON (87h) Bit Values ------------------------------------------------*/ #define IDL_ 0x01 #define PD_ 0x02 #define GF0_ 0x04 #define GF1_ 0x08 #define POF_ 0x10 #define SMOD1_ 0x80 /*------------------------------------------------ TCON (88h)Bit Values ------------------------------------------------*/ #define IT0_ 0x01 #define IE0_ 0x02 #define IT1_ 0x04 #define IE1_ 0x08 #define TR0_ 0x10 #define TF0_ 0x20 #define TR1_ 0x40 #define TF1_ 0x80 /*------------------------------------------------ TMOD (89h) Bit Values ------------------------------------------------*/ #define M0_ 0x01 #define M1_ 0x02 #define CT_ 0x04 #define GATE_ 0x08 /*------------------------------------------------ TL0 (8Ah) Bit Values ------------------------------------------------*/ #define TL0_0_ 0x01 #define TL0_1_ 0x02 #define TL0_2_ 0x04 #define TL0_3_ 0x08 #define TL0_4_ 0x10 #define TL0_5_ 0x20 #define TL0_6_ 0x40 #define TL0_7_ 0x80 /*------------------------------------------------ TL1 (8Bh) Bit Values ------------------------------------------------*/ #define TL1_0_ 0x01 #define TL1_1_ 0x02 #define TL1_2_ 0x04 #define TL1_3_ 0x08 #define TL1_4_ 0x10 #define TL1_5_ 0x20 #define TL1_6_ 0x40 #define TL1_7_ 0x80 /*------------------------------------------------ TH0 (8Ch) Bit Values ------------------------------------------------*/ #define TH0_0_ 0x01 #define TH0_1_ 0x02 #define TH0_2_ 0x04 #define TH0_3_ 0x08 #define TH0_4_ 0x10 #define TH0_5_ 0x20 #define TH0_6_ 0x40 #define TH0_7_ 0x80 /*------------------------------------------------ TH1 (8Dh) Bit Values ------------------------------------------------*/ #define TH1_0_ 0x01 #define TH1_1_ 0x02 #define TH1_2_ 0x04 #define TH1_3_ 0x08 #define TH1_4_ 0x10 #define TH1_5_ 0x20 #define TH1_6_ 0x40 #define TH1_7_ 0x80 /*------------------------------------------------ CKCON (8Eh) Bit Values ------------------------------------------------*/ #define T0M_ 0x04 #define T1M_ 0x08 /*------------------------------------------------ P1 (90h) Bit Values ------------------------------------------------*/ #define P1_0_ 0x01 #define P1_1_ 0x02 #define P1_2_ 0x04 /*------------------------------------------------ EXIF (91h) Bit Values ------------------------------------------------*/ #define BGS_ 0x01 #define RGSL_ 0x02 #define RGMD_ 0x04 #define XTRG_ 0x08 #define IE2_ 0x10 #define IE3_ 0x20 /*------------------------------------------------ PCLKEN (92h) Bit Values ------------------------------------------------*/ #define PCLKEN0_ 0x01 #define PCLKEN1_ 0x02 #define PCLKEN2_ 0x04 #define PCLKEN3_ 0x08 #define PCLKEN4_ 0x10 #define PCLKEN5_ 0x20 #define PCLKEN6_ 0x40 #define PCLKEN7_ 0x80 /*------------------------------------------------ OSCTEST (94h) Bit Values ------------------------------------------------*/ #define TEST0_ 0x01 #define TEST1_ 0x02 #define TEST2_ 0x04 #define TEST3_ 0x08 #define TEST4_ 0x10 #define TEST5_ 0x20 #define TEST6_ 0x40 #define TEST7_ 0x80 /*------------------------------------------------ RINGCON (95h) Bit Values ------------------------------------------------*/ #define S0_ 0x01 #define S1_ 0x02 #define S2_ 0x04 #define S3_ 0x08 #define S4_ 0x10 #define S5_ 0x20 #define S6_ 0x40 #define S7_ 0x80 /*------------------------------------------------ OSCBIAS(96h) Bit Values ------------------------------------------------*/ #define BIAS0_ 0x01 #define BIAS1_ 0x02 #define BIAS2_ 0x04 #define BIAS3_ 0x08 #define BIAS4_ 0x10 #define BIAS5_ 0x20 #define BIAS6_ 0x40 #define BIAS7_ 0x80 /*------------------------------------------------ OSCREF(97h) Bit Values ------------------------------------------------*/ #define OREF0_ 0x01 #define OREF1_ 0x02 #define OREF2_ 0x04 #define OREF3_ 0x08 #define OREF4_ 0x10 /*------------------------------------------------ SCON(98h) Bit Values ------------------------------------------------*/ #define RI_ 0x01 #define TI_ 0x02 #define REN_ 0x10 /*------------------------------------------------ SBUF(99h) Bit Values ------------------------------------------------*/ #define SBUF0_ 0x01 #define SBUF1_ 0x02 #define SBUF2_ 0x04 #define SBUF3_ 0x08 #define SBUF4_ 0x10 #define SBUF5_ 0x20 #define SBUF6_ 0x40 #define SBUF7_ 0x80 /*------------------------------------------------ P2 (A0h) Bit Values ------------------------------------------------*/ #define P2_0_ 0x01 #define P2_1_ 0x02 #define P2_2_ 0x04 #define P2_3_ 0x08 #define P2_4_ 0x10 #define P2_5_ 0x20 #define P2_6_ 0x40 /*------------------------------------------------ IE (A8h) Bit Values ------------------------------------------------*/ #define EX0_ 0x01 #define ET0_ 0x02 #define EX1_ 0x04 #define ET1_ 0x08 #define ES_ 0x10 #define EADC_ 0x40 #define EA_ 0x80 /*------------------------------------------------ IP (B8h) Bit Values ------------------------------------------------*/ #define PX0_ 0x01 #define PT0_ 0x02 #define PX1_ 0x04 #define PT1_ 0x08 #define PS_ 0x10 #define PADC_ 0x40 /*------------------------------------------------ STCON (BCh) Bit Values ------------------------------------------------*/ #define ST_EN_ 0x01 #define ST_CLR_ 0x02 /*------------------------------------------------ STCFG (BDh) Bit Values ------------------------------------------------*/ #define ST_DR0_ 0x01 #define ST_DR1_ 0x02 #define ST_DR2_ 0x04 #define ST_DR3_ 0x08 #define ST_BUSY_ 0x10 /*------------------------------------------------ OSCICN (BEh) Bit Value ------------------------------------------------*/ #define DIV0_ 0x01 #define DIV1_ 0x02 #define RINGON_ 0x04 #define DIV2_ 0x08 /*------------------------------------------------ PMR (C4h)Bit Values ------------------------------------------------*/ #define XTOFF_ 0x08 /*------------------------------------------------ STATUS (C5h)Bit Values ------------------------------------------------*/ #define XTUP_ 0x10 /*------------------------------------------------ LVDCFG (C6h)Bit Values ------------------------------------------------*/ #define CFG0_ 0x01 #define CFG1_ 0x02 #define CFG2_ 0x04 #define CFG3_ 0x08 #define CFG4_ 0x10 #define PFI_ 0x20 #define EPFI_ 0x40 #define EPFR_ 0x80 /*------------------------------------------------ I2CST1 (C8h)Bit Values ------------------------------------------------*/ #define I2CBF_ 0x01 #define I2CS_ 0x02 #define I2CP_ 0x04 #define I2CDA_ 0x08 #define I2CRW_ 0x10 #define I2CACK_ 0x20 #define I2COF_ 0x40 #define I2CIF_ 0x80 /*------------------------------------------------ I2CSTH1 (C9h)Bit Values ------------------------------------------------*/ #define I2CBB_ 0x01 #define DBVLID_ 0x02 /*------------------------------------------------ I2CCON1 (CBh)Bit Values ------------------------------------------------*/ #define I2CEN_ 0x01 #define I2CIOEN_ 0x02 #define SGEN_ 0x04 #define PGEN_ 0x08 #define LASTB_ 0x10 #define SCLHD_ 0x20 #define SLA2ME_ 0x40 /*------------------------------------------------ I2CCFG1 (CCh)Bit Values ------------------------------------------------*/ #define GCE_ 0x01 #define SP_IE_ 0x02 #define ADSEL_ 0x04 #define TXDBE_ 0x10 #define DISHD_ 0x20 /*------------------------------------------------ I2CSLA1 (CDh) Bit Values ------------------------------------------------*/ #define SLA1_0_ 0x01 #define SLA1_1_ 0x02 #define SLA1_2_ 0x04 #define SLA1_3_ 0x08 #define SLA1_4_ 0x10 #define SLA1_5_ 0x20 #define SLA1_6_ 0x40 #define SLA1_7_ 0x80 /*------------------------------------------------ I2CDAT1 (CEh) Bit Values ------------------------------------------------*/ #define MDAT0_ 0x01 #define MDAT1_ 0x02 #define MDAT2_ 0x04 #define MDAT3_ 0x08 #define MDAT4_ 0x10 #define MDAT5_ 0x20 #define MDAT6_ 0x40 #define MDAT7_ 0x80 /*------------------------------------------------ PSW (D0h) Bit Values ------------------------------------------------*/ #define P_ 0x01 #define F1_ 0x02 #define OV_ 0x04 #define RS0_ 0x08 #define RS1_ 0x10 #define F0_ 0x20 #define AC_ 0x40 #define CY_ 0x80 /*------------------------------------------------ P0TYPE (D4h) Bit Values ------------------------------------------------*/ #define P0TYPE_0_ 0x01 #define P0TYPE_1_ 0x02 #define P0TYPE_2_ 0x04 #define P0TYPE_3_ 0x08 #define P0TYPE_4_ 0x10 #define P0TYPE_5_ 0x20 #define P0TYPE_6_ 0x40 #define P0TYPE_7_ 0x80 /*------------------------------------------------ P1TYPE (D5h) Bit Values ------------------------------------------------*/ #define P1TYPE_0_ 0x01 #define P1TYPE_1_ 0x02 #define P1TYPE_2_ 0x04 /*------------------------------------------------ P2TYPE (D6h) Bit Values ------------------------------------------------*/ #define P2TYPE_0_ 0x01 #define P2TYPE_1_ 0x02 #define P2TYPE_2_ 0x04 #define P2TYPE_3_ 0x08 #define P2TYPE_4_ 0x10 #define P2TYPE_5_ 0x20 #define P2TYPE_6_ 0x40 /*------------------------------------------------ WDCON (D8h) Bit Values ------------------------------------------------*/ #define RWT_ 0x01 #define EWT_ 0x02 #define WTRF_ 0x04 #define WDIF_ 0x08 #define WDM_ 0x20 #define WD0_ 0x40 #define WD1_ 0x80 /*------------------------------------------------ ADCHL (D9h) Bit Values ------------------------------------------------*/ #define ADCH0B_ 0x01 #define ADCH2B_ 0x04 #define ADCH3B_ 0x08 #define ADCH7B_ 0x80 /*------------------------------------------------ ADCHSEL (DBh) Bit Values ------------------------------------------------*/ #define CHH0_ 0x01 #define CHH1_ 0x02 #define CHH2_ 0x04 #define CH_SEL_ 0x80 /*------------------------------------------------ PWMCON (DCh) Bit Value ------------------------------------------------*/ #define RUN_P0_ 0x01 #define CLR_P0_ 0x02 #define PWMF_ 0x04 #define PWMM_ 0x08 #define PS0_P0_ 0x10 #define PS1_P0_ 0x20 #define PS2_P0_ 0x40 #define PWM06_ 0x80 /*------------------------------------------------ PWMDH (DDh) Bit Values ------------------------------------------------*/ #define PWMDH0_ 0x01 #define PWMDH1_ 0x02 /*------------------------------------------------ PWMD (DEh) Bit Values ------------------------------------------------*/ #define PWMD0_ 0x01 #define PWMD1_ 0x02 #define PWMD2_ 0x04 #define PWMD3_ 0x08 #define PWMD4_ 0x10 #define PWMD5_ 0x20 #define PWMD6_ 0x40 #define PWMD7_ 0x80 /*------------------------------------------------ ACC (E0h)Bit Values ------------------------------------------------*/ #define ACC0_ 0x01 #define ACC1_ 0x02 #define ACC2_ 0x04 #define ACC3_ 0x08 #define ACC4_ 0x10 #define ACC5_ 0x20 #define ACC6_ 0x40 #define ACC7_ 0x80 /*------------------------------------------------ ADCSELH (E1h) Bit Value ------------------------------------------------*/ #define ADC4B_ 0x01 #define ADC5B_ 0x02 #define ADC6B_ 0x04 #define ADC7B_ 0x08 #define ADC8B_ 0x10 #define ADC9B_ 0x20 #define ADC10B_ 0x40 #define ADC11B_ 0x80 /*------------------------------------------------ ADCSEL (E2h) Bit Value ------------------------------------------------*/ #define CH0_ 0x01 #define CH1_ 0x02 #define CH2_ 0x04 #define CH3_ 0x08 #define ADC0B_ 0x10 #define ADC1B_ 0x20 #define ADC2B_ 0x40 #define ADC3B_ 0x80 /*------------------------------------------------ ALTSEL (E3h) Bit Value ------------------------------------------------*/ #define I2C_AE_ 0x01 #define TX_AE_ 0x02 #define TX_ 0x04 #define TVO_ 0x08 #define PWM00_ 0x10 #define CLO_ 0x20 #define IORSTEN_ 0x40 #define IOXEN_ 0x80 /*------------------------------------------------ P0SEL (E4h) Bit Values ------------------------------------------------*/ #define P0SEL_0_ 0x01 #define P0SEL_1_ 0x02 #define P0SEL_2_ 0x04 #define P0SEL_3_ 0x08 #define P0SEL_4_ 0x10 #define P0SEL_5_ 0x20 #define P0SEL_6_ 0x40 #define P0SEL_7_ 0x80 /*------------------------------------------------ P1SEL (E5h) Bit Values ------------------------------------------------*/ #define P1SEL_0_ 0x01 #define P1SEL_1_ 0x02 #define P1SEL_2_ 0x04 /*------------------------------------------------ P2SEL (E6h) Bit Values ------------------------------------------------*/ #define P2SEL_0_ 0x01 #define P2SEL_1_ 0x02 #define P2SEL_2_ 0x04 #define P2SEL_3_ 0x08 #define P2SEL_4_ 0x10 #define P2SEL_5_ 0x20 #define P2SEL_6_ 0x40 /*------------------------------------------------ EIE (E8h) Bit Values ------------------------------------------------*/ #define EX2_ 0x01 #define EX3_ 0x02 #define EI2C1_ 0x08 #define EWDT_ 0x10 #define EPWM_ 0x20 /*------------------------------------------------ P0HD (ECh) Bit Values ------------------------------------------------*/ #define P0HD_0_ 0x01 #define P0HD_1_ 0x02 #define P0HD_2_ 0x04 #define P0HD_3_ 0x08 /*------------------------------------------------ ADCR (EEh) Bit Values ------------------------------------------------*/ #define SAR2_ 0x01 #define SAR3_ 0x02 #define SAR4_ 0x04 #define SAR5_ 0x08 #define SAR6_ 0x10 #define SAR7_ 0x20 #define SAR8_ 0x40 #define SAR9_ 0x80 /*------------------------------------------------ ADCON (EFh) Bit Values ------------------------------------------------*/ #define SAR0_ 0x01 #define SAR1_ 0x02 #define ADIV0_ 0x04 #define ADIV1_ 0x08 #define ADCF_ 0x10 #define AD_END_ 0x20 #define AD_REQ_ 0x40 #define AD_EN_ 0x80 /*------------------------------------------------ B (F0h) Bit Values ------------------------------------------------*/ #define B0_ 0x01 #define B1_ 0x02 #define B2_ 0x04 #define B3_ 0x08 #define B4_ 0x10 #define B5_ 0x20 #define B6_ 0x40 #define B7_ 0x80 /*------------------------------------------------ P0DIR (F4h) Bit Values ------------------------------------------------*/ #define P0DIR_0_ 0x01 #define P0DIR_1_ 0x02 #define P0DIR_2_ 0x04 #define P0DIR_3_ 0x08 #define P0DIR_4_ 0x10 #define P0DIR_5_ 0x20 #define P0DIR_6_ 0x40 #define P0DIR_7_ 0x80 /*------------------------------------------------ P1DIR (F5h) Bit Values ------------------------------------------------*/ #define P1DIR_0_ 0x01 #define P1DIR_1_ 0x02 #define P1DIR_2_ 0x04 /*------------------------------------------------ P2DIR (F6h) Bit Values ------------------------------------------------*/ #define P2DIR_0_ 0x01 #define P2DIR_1_ 0x02 #define P2DIR_2_ 0x04 #define P2DIR_3_ 0x08 #define P2DIR_4_ 0x10 #define P2DIR_5_ 0x20 #define P2DIR_6_ 0x40 /*------------------------------------------------ EIP (F8h) Bit Value ------------------------------------------------*/ #define PX2_ 0x01 #define PX3_ 0x02 #define PI2C1_ 0x08 #define PWDT_ 0x10 #define PPWM_ 0x20 /*------------------------------------------------ IAPWEN (FCh) Bit Value ------------------------------------------------*/ #define WEN0_ 0x01 #define WEN1_ 0x02 #define WEN2_ 0x04 #define WEN3_ 0x08 #define WEN4_ 0x10 #define WEN5_ 0x20 #define WEN6_ 0x40 #define WEN7_ 0x80 /*------------------------------------------------ IAPCON (FDh) Bit Value ------------------------------------------------*/ #define OPS0_ 0x01 #define OPS1_ 0x02 #define RGS0_ 0x04 #define RGS1_ 0x08 /*------------------------------------------------ IAPDAT (FEh) Bit Value ------------------------------------------------*/ #define DAT0_ 0x01 #define DAT1_ 0x02 #define DAT2_ 0x04 #define DAT3_ 0x08 #define DAT4_ 0x10 #define DAT5_ 0x20 #define DAT6_ 0x40 #define DAT7_ 0x80 /* ------- End of Bit Values ---------------------------------- */ /*=========================================================================*/ /*------- Define of Interrupt Vectors & Register Banks -----------*/ /*=========================================================================*/ /*------------------------------------------------ Interrupt Vectors: Interrupt Address = (Number * 8) + 3 ------------------------------------------------*/ #define INT0_VECTOR 0 /* 0x03 External Interrupt 0 */ #define TF0_VECTOR 1 /* 0x0B Timer 0 */ #define INT1_VECTOR 2 /* 0x13 External Interrupt 1 */ #define TF1_VECTOR 3 /* 0x1B Timer 1 */ #define RITI_VECTOR 4 /* 0x23 UART */ #define LVD_VECTOR 6 /* 0x33 LVD */ #define ADC_VECTOR 7 /* 0x3B ADC */ #define INT2_VECTOR 8 /* 0x43 External Interrupt 2 */ #define INT3_VECTOR 9 /* 0x4B External Interrupt 2 */ #define I2C1_VECTOR 11 /* 0x5B I2C1 */ #define WDT_VECTOR 12 /* 0x63 WDT */ #define PWM_VECTOR 13 /* 0x6B PWM */ /*------------------------------------------------ Register Banks ------------------------------------------------*/ #define REGISTER_BANK_0 0 /* Register Bank 0 */ #define REGISTER_BANK_1 1 /* Register Bank 1 */ #define REGISTER_BANK_2 2 /* Register Bank 2 */ #define REGISTER_BANK_3 3 /* Register Bank 3 */ /*----------------------------------------------*/ /* ------- End of Interrupt Vectors & Register Banks ------------ */ #endif