00001 #ifndef SCAN_LITE_H
00002 #define SCAN_LITE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #define rtRTAP_SCAN_MNGR CCSSCANMANAGER
00019 #define rtSD_SI_STATUS_AIN 3
00020 #define rtCP_STATUS_AIN 3
00021
00022 #define rtCNTRL_DISABLE_SS 0
00023 #define rtCNTRL_ENABLE_SS 1
00024 #define rtCNTRL_DISABLE_CP 2
00025 #define rtCNTRL_ENABLE_CP 3
00026 #define rtCNTRL_DISABLE_SD_SI 4
00027 #define rtCNTRL_ENABLE_SD_SI 5
00028 #define rtCNTRL_DISABLE_SD_SO 6
00029 #define rtCNTRL_ENABLE_SD_SO 7
00030 #define rtCNTRL_DISABLE_SD_SI_PT 8
00031 #define rtCNTRL_ENABLE_SD_SI_PT 9
00032 #define rtCNTRL_DISABLE_SD_SO_PT 10
00033 #define rtCNTRL_ENABLE_SD_SO_PT 11
00034 #define rtCNTRL_COMM_PORT_MODE 12
00035 #define rtCNTRL_POLL_PERIOD 13
00036 #define rtCNTRL_PRBX_PERIOD 14
00037 #define rtCNTRL_POLL_TYPE 15
00038 #define rtCNTRL_PRBX_TYPE 16
00039 #define rtCNTRL_FORCE_POLL_TYPE 17
00040 #define rtCNTRL_FORCE_PRBX_TYPE 18
00041 #define rtCNTRL_FORCE_POLL 19
00042 #define rtCNTRL_FORCE_PRBX 20
00043 #define rtCNTRL_COLD_RST_DEVICE 21
00044 #define rtCNTRL_WARM_RST_DEVICE 22
00045 #define rtCNTRL_SNAP 23
00046 #define rtCNTRL_SNAP_WITH_VERIFY 24
00047 #define rtCNTRL_SET_TIME 25
00048
00049 #define rtQUERY_SS_STATE 0
00050 #define rtQUERY_SCAN_TASK_STATE 1
00051
00052 #define rtSS_MAX_CNTRL_CNT 255
00053
00054 #define rtSCAN_DISABLE 0
00055 #define rtSCAN_ENABLE 1
00056 typedef rtUInt32 rtSsAction;
00057
00058 #define rtSCAN_DISABLED 0
00059 #define rtSCAN_ENABLED 1
00060 #define rtSCAN_FAILED 2
00061 #define rtSCAN_UNKNOWN 3
00062 typedef rtUInt32 rtSsState;
00063
00064 typedef rtUInt16 rtSsDcAction;
00065
00066
00067
00068
00069 typedef enum
00070 {
00071 rtSSMA_NO_DATA = 0,
00072 rtSSMA_OK,
00073 rtSSMA_FAILED,
00074 rtSSMA_DISABLED
00075 } rtSsmaQuality;
00076
00077 typedef rtInt rtSsConnection;
00078
00079 typedef struct
00080 {
00081 rtBitfld ptControl:8;
00082 rtBitfld ptStatus:8;
00083 rtBytes4 pollTypes;
00084 rtUInt16 stBuffSize;
00085 rtUInt32 offset;
00086 rtUInt16 elemCnt;
00087 rtBitfld rtapDeType:8;
00088 rtBitfld deadbandType:8;
00089 rtDouble deadband;
00090 rtDbXref linkAddress;
00091 rtInt32 reserved;
00092 } rtScanInputRecord;
00093
00094 #define rtSS_MAX_CNTRL_CNT 255
00095 #define rtSS_MAX_QUERY_CNT 128
00096
00097 typedef struct
00098 {
00099 rtInt32 status[rtSS_MAX_CNTRL_CNT];
00100 } rtSsCntrlSsCpSd;
00101
00102 typedef struct
00103 {
00104 rtInt32 status[rtSS_MAX_CNTRL_CNT];
00105 } rtSsCntrlRestartDev;
00106
00107 typedef struct
00108 {
00109 rtInt32 status;
00110 rtSsState state;
00111 } rtScanState;
00112
00113 typedef struct
00114 {
00115 rtScanState scanState[rtSS_MAX_QUERY_CNT];
00116 } rtSsQueryState;
00117
00118 typedef rtUInt16 rtSsCqAction;
00119
00120 typedef struct
00121 {
00122 rtSsCqAction action;
00123 rtUInt16 addrCnt;
00124 rtDbAddress *addr;
00125 rtUInt8 *buffer;
00126 rtUInt16 size;
00127 rtUInt16 actual;
00128 } rtSsCq;
00129
00130 typedef struct
00131 {
00132 rtSsDcAction action;
00133 rtDbAddress addr;
00134 rtUInt8 *data;
00135 rtUInt16 dataSize;
00136 rtUInt16 timeOut;
00137 rtUInt8 *reply;
00138 rtUInt16 replySize;
00139 rtInt32 status;
00140 } rtSsDirectCommand;
00141
00142 rtInt rtOpenSsma (void);
00143 rtInt rtCloseSsma (void);
00144 rtInt rtSpareSsma (void);
00145 rtInt rtSizeSsma (void);
00146 rtInt rtSetSsmaStatus (rtScanInputRecord *scanRecord, rtSsState newStatus);
00147 rtInt rtReadSsma (rtUInt32 offset, rtSsmaQuality *ssmaQlty, rtUInt8 *failCnt,
00148 rtUInt32 dataSize, rtUInt8 *dataBuffer, rtUInt16 stBuffSize,
00149 rtUInt8 *stBuffer);
00150 rtInt rtReadSsmaWithLock(rtUInt32 offset, rtSsmaQuality *ssmaQlty, rtUInt8 *failCnt,
00151 rtUInt32 dataSize, rtUInt8 *dataBuffer, rtUInt16 stBuffSize,
00152 rtUInt8 *stBuffer);
00153 rtInt rtWriteSsma (rtUInt32 offset, rtSsmaQuality ssmaQlty, rtUInt8 failCnt,
00154 rtUInt32 dataSize, rtLogical writeData, rtUInt8 *dataBuffer,
00155 rtUInt16 stBuffSize, rtUInt8 *stBuffer);
00156 void rtTriggerCe (void);
00157 rtSsConnection rtOpenScanSys(rtChar *env);
00158 rtInt rtControlScanSys (rtSsConnection ssConnection, rtSsCq *ssCq);
00159 rtInt32 rtCloseScanSys (rtSsConnection ssConnection);
00160 rtInt rtDirectCmdSS (rtSsConnection ss_connection, rtSsDirectCommand *ss_dc);
00161 rtInt rtQueryScanSys (rtSsConnection ssConnection, rtSsCq *ssCq);
00162
00163 #endif