00001 00002 #include "datatypes.h" 00003 #include "t89c51cc02.h" 00004 00006 #define SHARP_PWRCTL P3_2 00007 00008 #define SHARP_PWRCTL_MASK 0x04 00009 00011 #define SHARP_ONLY 0x03 00012 00014 #define SHARP_TIMER_RELOAD_H 0x7d 00015 00016 #define SHARP_TIMER_RELOAD_L 0xcb 00017 00019 #define Sharp_PowerOn() P3=(P3 & SHARP_ONLY)|SHARP_PWRCTL_MASK; Sharp_TimerInit(); 00020 00021 #define Sharp_PowerOff() SHARP_PWRCTL=0; TR1=0; ET1=0; 00022 00023 void Sharp_init(void); 00024 void Sharp_TimerInit(void); 00025 WORD Sharp_read(void); 00026 void Sharp_Timer_interrupt(void) interrupt 3 using 2; 00027