00001 /* 00002 * Command description and interfacing for Sensor Control 00003 * (c) 2007 by Matthias Arndt <matthias.arndt@tu-clausthal.de> 00004 * 00005 */ 00007 #include "t89c51cc02.h" 00008 #include "datatypes.h" 00009 00010 00012 #define NR_SENSORS 18 00013 00015 #define COMMAND_READ 0x00 00016 00017 #define COMMAND_MONITOR 0x10 00018 00019 #define COMMAND_STOPMONITOR 0x11 00020 00021 #define COMMAND_MONITORSTATUS 0x12 00022 00023 #define COMMAND_RECALLMONITOR 0x13 00024 00025 #define COMMAND_STOPALLMONITORS 0x14 00026 00027 #define COMMAND_REPORT 0x20 00028 00029 #define COMMAND_STOPREPORT 0x21 00030 00031 #define COMMAND_TIMECHECK_ENABLE 0xA0 00032 00033 #define COMMAND_TIMECHECK_DISABLE 0xA1 00034 00035 #define COMMAND_TIMECHECKSTATUS 0xA2 00036 00037 #define COMMAND_EEPROM_SAVEMONITOR 0xE0 00038 00039 #define COMMAND_EEPROM_CLEAR 0xE1 00040 00041 #define COMMAND_RESET 0xff 00042 00044 #define Command_ClearRead() readenable=0 00045 00046 #define Command_DisableReport() reporting=0 00047 00048 #define Command_ClearMonitor() monitor=0 00049 00050 #define Command_CheckMonitor() (monitor!=0) 00051 00052 #define Command_TimecheckEnable() timecheck=1 00053 00054 #define Command_TimecheckDisable() timecheck=0 00055 00056 #define Command_CheckTime() (timecheck==1) 00057 00059 #define CHECKSUM_FILLER 0x3c2a 00060 00061 void Command_SetRead(BYTE); 00062 BYTE Command_ReportDue(void); 00063 void Command_EnableMonitor(BYTE,WORD,bit); 00064 void Command_DisableMonitor(BYTE); 00065 BYTE CheckMonitor(BYTE,WORD); 00066 void Command_EnableReport(BYTE); 00067 WORD Command_GetBoundary(BYTE); 00068 void Command_SetBoundary(BYTE,WORD); 00069 void Command_ReadDefaultConfiguration(void); 00070 void Command_WriteDefaultConfiguration(void); 00071 00072 /* variables open for interfacing in command.c */ 00073 extern LONG readenable; 00074 extern LONG monitor; 00075 extern LONG monitor_direction; 00076 00077 extern volatile bit reporting; 00078 extern volatile bit timecheck; 00079 extern volatile bit read_eeprom_config; 00080 extern volatile bit write_eeprom_config;