00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef TAC_DEFINES_H
00013 #define TAC_DEFINES_H
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "lsfDefines.h"
00031 #include "slamac.h"
00032
00033
00034
00035
00036
00037 #define tacVERSION "$Revision: 1.38 $"
00038 #define tacVERSION_DATE "APR2003"
00039
00040 #define tacMODULE_ID "tac"
00041 #define tacMODULE_NAME tacMODULE_ID
00042 #define tacMODULE_TITLE "Tools for Advanced Control"
00043 #define tacLOG_ID 101
00044
00045
00046
00047
00048
00049 #undef tacDEBUG
00050 #undef tacDEBUG_LOG_TIME_STAMP
00051
00052 #define tacSYNCHRO_NO_SYNC_CONTEXT "NO_SYNC"
00053 #define tacSYNCHRO_AUX_CLK_CONTEXT "AUX_CLK"
00054 #define tacSYNCHRO_SEMAPHORE_CONTEXT "TASK"
00055 #define tacSYNCHRO_INT_CONTEXT "INT"
00056
00057 #define tacIO_BASE_ADDR 0xfbff0000
00058
00059 #define tacMAX_NAME_SIZE 48
00060 #define tacMAX_DATA_NUMBER 10
00061
00062 #if 0
00063 #define tacMAX_PARAM_NUMBER 5
00064 #else
00065 #define tacMAX_PARAM_NUMBER 10
00066 #endif
00067
00068 #define tacMAX_PARAM_SIZE tacMAX_PARAM_NUMBER*sizeof(double)
00069
00070 #define tacMAX_BLOCK_NUMBER 256
00071 #define tacMAX_LINK_NUMBER 256
00072 #define tacMAX_BLOCK_TYPE_NUMBER 80
00073
00074 #if 0
00075 #define tacPI 3.14159265358979
00076 #else
00077 #define tacPI DPI
00078 #endif
00079
00080
00081 #define tacINT_VME_BUS 0
00082 #define tacINT_PCI_BUS 1
00083 #define tacINT_MASK 0xff
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 #define tacRTC_ERR(errNumber,string) \
00094 { \
00095 error->errNum = errNumber; \
00096 strcpy(error->location, __FILE_LINE__); \
00097 sprintf(error->param, "%.40s",string); \
00098 } \
00099
00100 #define tacRTC_ERR_ADD(tacError) \
00101 { \
00102 errAdd(error,tacMODULE_ID,tacError.errNum,tacError.location,"",tacError.param); \
00103 } \
00104
00105
00106 #define tacRtcDefineInterrupt(synchro, busType, intLevel, intVector) \
00107 { \
00108 synchro.type = tacSYNCHRO_INTERRUPT; \
00109 synchro.interrupt.level = (busType * (tacINT_MASK + 1)) + intLevel; \
00110 synchro.interrupt.vector = intVector; \
00111 }
00112
00113 #define tacRtcIsPCIInterrupt(synchro) (synchro.interrupt.level > tacINT_MASK)
00114 #define tacRtcIsVMEInterrupt(synchro) (synchro.interrupt.level <= tacINT_MASK)
00115 #define tacRtcGetInterruptLevel(synchro) (synchro.interrupt.level & tacINT_MASK)
00116
00117 #define tacRtcDefineSemaphore(synchro, semaphore, taskLevel) \
00118 { \
00119 synchro.type = tacSYNCHRO_SEMAPHORE; \
00120 synchro.task.semId = semaphore; \
00121 synchro.task.priority = taskLevel; \
00122 }
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 #endif