QuakeGod
2023-10-23 4cda72771765720a6a8721bd8844945c2403afe6
提交 | 用户 | age
0ed438 1 /*
Q 2
3
4
5 */
6 #pragma once
7 #include "KDefine.h"
326d3e 8 #include "HvSerialPort.h"
0ed438 9 #include <functional>
Q 10 class KLink
11 {
12     typedef unsigned char UCHAR;
13     typedef unsigned short USHORT;
14     typedef unsigned int UINT;
15
16 public:
17     KLink();
18     virtual ~KLink();
326d3e 19     HvSerialPort m_SerialPort;
0ed438 20 #define TYPECOIL 0x00
Q 21 #define TYPEDATA 0x80
22     enum enKLCoilTypes
23     {
24         KLCoilTypeX = 0 | TYPECOIL,        //X Input
25         KLCoilTypeY = 1 | TYPECOIL,        //Y Output
26         KLCoilTypeR = 2 | TYPECOIL,        //R register
27         KLCoilTypeLX = 3 | TYPECOIL,        //Link register
28         KLCoilTypeLY = 4 | TYPECOIL,        //Link register
29         KLCoilTypeT = 5 | TYPECOIL,        //Timer
30         KLCoilTypeC = 6 | TYPECOIL,        //Counter
31         KLCoilTypeLR = 7 | TYPECOIL,        //Link register
32         KLCoilTypeSR = 8 | TYPECOIL,        //Link register
33
34
35     };
36     enum enKLDataTypes
37     {
38         KLDataTypeDEC = 0 | TYPEDATA,
39         KLDataTypeHEX = 1 | TYPEDATA,
40         KLDataTypeFloat = 2 | TYPEDATA,
41         KLDataTypeWX = 3 | TYPEDATA,
42         KLDataTypeWY = 4 | TYPEDATA,
43         KLDataTypeWR = 5 | TYPEDATA,
44         KLDataTypeWLX = 6 | TYPEDATA,
45         KLDataTypeWLY = 7 | TYPEDATA,
46         KLDataTypeDT = 8 | TYPEDATA,
47         KLDataTypeSDT = 9 | TYPEDATA,
48         KLDataTypeWSR = 10 | TYPEDATA,
49         KLDataTypeSV = 11 | TYPEDATA,
50         KLDataTypeEV = 12 | TYPEDATA,
51         KLDataTypeLD = 13 | TYPEDATA,
52         KLDataSysCfg = 25 | TYPEDATA,
53         KLDataTypeFlash = 33 | TYPEDATA,
54         KLDataTypeTest = 254 | TYPEDATA,
55     };
56     enum enKLDataCounts
57     {
58         KLDataDTCount = 256,
59         KLDataSDTCount = 256,
60
61         KLDataWXCount = 16,
62         KLDataWYCount = 16,
63         KLDataWRCount = 16,
64         KLDataLDCount = 64,
65         KLDataWLCount = 8,
66
67         KLCoilXCount = KLDataWXCount * 16,
68         KLCoilYCount = KLDataWYCount * 16,
69         KLCoilRCount = KLDataWRCount * 16,
70
71         KLCoilTCount = 64,
72         KLCoilCCount = KLCoilTCount,
73         KLDataSVCount = KLCoilTCount,
74         KLDataEVCount = KLCoilTCount,
75
76         KLCoilLXCount = 128,
77         KLCoilLYCount = 128,
78         KLCoilLRCount = 128,
79         KLCoilSRCount = 128,
80
81     };
82     typedef struct tagKLTypeName
83     {
84         int nType;
85         const char * sName;
86         int nRange = 0;
87     }stKLTypeName;
88     static const stKLTypeName KLCoilTypeNames[];
89     static const stKLTypeName KLDataTypeNames[];
90
91 enum eKLResult
92 {
93     KL_ERR = -1,
94     KL_OK = 0,
95     KL_NG = 1,
96     KL_UNKNOWN = 2,
97     KL_TIMEOUT = 3,
98     KL_BCC_ERR = 4,
99     KL_PKG_ERR = 5,
100     KL_SEQ_ERR = 6,
101     KL_LENTH_EXCEED,
102     KL_NEED_PASS,
103     KL_NOT_SUPPORT,
104 };
105 const char * GetErrDescStr(int nErrNo);
106 enum
107 {
108     KLSignStart = '%',
109     KLSignReply = 'U',
110     KLSignEnd = 0x0D,
111     KLMaxPacketLength = 128,
112
113 };
114 enum ExtraDataType
115 {
116     KLExtTypeNone = 0,
117     KLExtTypeText = 1,
118     KLExtTypeCmd = 2,
119     KLExtTypePassTh = 3,
120
121     KLExtTypeTestData = 8,
122 };
123
124 enum enCMDs
125 {
126     //        cmdOK = '1',        //Reply OK
127     //        cmdNG = '2',        //Rplay NG
128     KLCmdNone = 0x00,        //Nothing
129     KLCmdPing = 0x01,            //Ping
130     KLCmdPingReply = 0x02,        //PingReply
131     KLCmdGetInfo = 0x03,            //GetInfo
132     KLCmdVerInfo = 0x04,            //InfoReply
133
134     KLCmdRead = 0x05,            //Read
135     KLCmdReadReply = 0x06,        //ReadReply
136     KLCmdWrite = 0x07,            //Write
137     KLCmdWriteReply = 0x08,    //WriteReply
138     KLCmdSaveToFlash = 0x09,                //Write
139
140     KLCmdExChgData = 0x0A,                //ExChangeDate, = Wirte + Read
141     KLCmdExChgDataReply,            //ExchangeData Reply
142
143     KLCmdSyncRead = 0x0D,                //SyncRead
144     KLCmdSyncWrite,                        //SyncWrite
145     KLCmdSequenRead,                    //Sequence Read
146     KLCmdSyncTime,                        //SyncTime
147
148     KLCmdChgMode = 0x11,
149     KLCmdGetMode = 0x12,
150
151     KLCmdChkPass,
152     KLCmdSetPass,
153     KLCmdEraseAll,
154     KLCmdReadProgram,
155     KLCmdStartProgram,
156     KLCmdWriteProgram,
157     KLCmdFinishProgram,
158
159     KLCmdRead1Bit = 0x21,                //ReadSingleBit
160     KLCmdWrite1Bit = 0x22,                //WriteSingleBit
161
162     KLCmdReadBits = 0x23,                //ReadBits        n = 1 - 8
163     KLCmdWriteBits = 0x24,                //ReadBits        n = 1 - 8
164
165     KLCmdReadBitsByByte = 0x25,            //ReadBitsByByte    ,byteCount
166     KLCmdWriteBitsByByte = 0x26,        //ReadBitsByByte    ,ByteCount
167
168     KLCmdReadBitsByWord = 0x27,            //ReadBitsByWord    ,WordCount
169     KLCmdWriteBitsByWord = 0x28,        //ReadBitsByWord    ,WordCount
170
171     KLCmdReadDataByte = 0x31,            //ByteCount
172     KLCmdWriteDataByte = 0x32,
173
174     KLCmdReadDataWord = 0x33,            //WordCount
175     KLCmdWriteDataWord = 0x34,
176
177     KLCmdReadData = 0x35,                //?Count
178     KLCmdWriteData = 0x36,
179
180     KLCmdReadProg = 0x51,
181     KLCmdWriteProg,
182     KLCmdReadSysCfg,
183     KLCmdWriteSysCfg,
184     KLCmdSaveSysCfg,
185     KLCmdSaveRunStat,
186     KLCmdReadRunStat,
187
188     KLCmdEraseFlashPage = 0x61,
189     KLCmdWriteToFlash = 0x62,
190
191     KLCmdGetEventLogCount,
192     KLCmdGetEventLog,
193     KLCmdClearEventLog,
194     KLCmdGetFactoryData,
195     KLCmdWriteFactoryData,
196     KLCmdResetMachine,
197     KLCmdGetUid,
198     KLCmdSetTime,
65f713 199     KLCmdGetSN,
0ed438 200
65f713 201
Q 202     KLCmdMC = 0x70, 
0ed438 203     KLCmdMD,
Q 204     KLCmdMG,
205
206     KLCmdErrRply = 0xEE,                //ERRORReply
207 };
208
209 typedef struct tagRunStat
210 {
211     unsigned short Sign1;
212     unsigned short Seq1;
213     volatile unsigned short PowerCount;    //
214     volatile unsigned short Reserved1;
215     volatile unsigned int UpTime;        //Seconds;
216     volatile unsigned int UserData1;
217     volatile unsigned short WorkMode;
218     volatile unsigned short WorkMode2;
219     volatile unsigned short nBinProgBank;
220     volatile unsigned short nBinProgSize;
221     unsigned int Reserved2[1];
222     unsigned short CRC1;
223     unsigned short EndSign1;
224 }stRunStat, *pRunStat;
225
226 stRunStat KMRunStat;
227
228 enum enKeventType
229 {
230     EventTypeNone = 0,
231     EventTypePowerUp = 1,
232     EventTypePowerDown = 2,
233     EventTypePowerRecover = 3,
234     EventTypeConnected = 4,
235     EventTypeLostCon = 5,
236     EventTypeSetTime = 6,
237     EventTypeSysCfg = 7,
238     EventTypeProg = 8,
239     EventTypeForce = 9,
240     EventTypeClearEvent = 10,
241
242     EventType
243 };
244
245 typedef struct tagEventLog
246 {
247     unsigned short Sign1;
248     unsigned short Seq1;
249     unsigned int nTime;
250     unsigned short nType;
251     unsigned short nParam1;
252     unsigned int nParam2;
253 }stEventLog, *pEventLog;
254
255
256 typedef struct tagKLCmdName
257 {
258     const int nCmd;
259     const char * sName;
260     const char * sType;
261
262 }KLCmdName;
263
264 const KLCmdName KLCmdNames[42] =
265 {
266     {KLCmdNone,"None",""},    //==0    //Nothing
267     {KLCmdPing,"Ping"},    //=1        //Ping
268     {KLCmdPingReply,"PingReply"}, //2        //PingReply
269     {KLCmdGetInfo,"GetInfo"},//3            //GetInfo
270     {KLCmdVerInfo,"VerInfo"},// = 0x04,            //InfoReply
271
272     {KLCmdRead,"Read","WX;WY;DT;SDT;EV;SV;LD;WL;CFG;FLASH;RAM"},// = 0x05,            //Read
273     {KLCmdReadReply,"ReadReply"},// = 0x06,        //ReadReply
274     {KLCmdWrite,"Write"},// = 0x07,            //Write
275     {KLCmdWriteReply,"WriteReply"},// = 0x08,    //WriteReply
276     {KLCmdSaveToFlash,"SaveToFlash"},// = 0x09,                //Write
277
278     {KLCmdExChgData,"ExChgData"},// = 0x0A,                //ExChangeDate, = Wirte + Read
279     {KLCmdExChgDataReply,"ExChgDataReply"},//,            //ExchangeData Reply
280
281     {    KLCmdSyncRead,"SyncRead"},// = 0x0D,                //SyncRead
282     {    KLCmdSyncWrite,    "SyncWrite"},//                     //SyncWrite
283     {    KLCmdSequenRead,"SequenRead"},//                     //Sequence Read
284     {    KLCmdSyncTime,"SyncTime"},//                         //SyncTime
285
286     {    KLCmdGetMode,"GetMode"},//  = 0x12,
287
288     {    KLCmdChkPass,"ChkPass"},// 
289     {    KLCmdSetPass,"SetPass"},// 
290     {    KLCmdEraseAll,"EraseAll"},// 
291     {    KLCmdReadProgram,"ReadProgram"},// 
292     {    KLCmdWriteProgram,"WriteProgram"},// 
293
294     {    KLCmdRead1Bit,"Read1Bit"},//  = 0x21,                //ReadSingleBit
295     {    KLCmdWrite1Bit,"Write1Bit"},//  = 0x22,                //WriteSingleBit
296
297     {    KLCmdReadBits,"ReadBits"},//  = 0x23,                //ReadBits        n = 1 - 8
298     {    KLCmdWriteBits,"WriteBits"},//  = 0x24,                //ReadBits        n = 1 - 8
299
300     {    KLCmdReadBitsByByte,"ReadBitsByByte"},//  = 0x25,            //ReadBitsByByte
301     {    KLCmdWriteBitsByByte,"WriteBitsByByte"},//  = 0x26,        //ReadBitsByByte
302
303     {    KLCmdReadBitsByWord,"ReadBitsByWord"},//  = 0x27,            //ReadBitsByWord
304     {    KLCmdWriteBitsByWord,"WriteBitsByWord"},//  = 0x28,        //ReadBitsByWord
305
306     {    KLCmdReadDataByte,"ReadDataByte"},//  = 0x31,
307     {    KLCmdWriteDataByte,"WriteDataByte"},//  = 0x32,
308
309     {    KLCmdReadDataWord,"ReadDataWord"},//  = 0x33,
310     {    KLCmdWriteDataWord,"WriteDataWord"},//  = 0x34,
311
312     {    KLCmdReadData,"ReadData"},//  = 0x35,
313     {    KLCmdWriteData,"WriteData"},//  = 0x36,
314
315     {    KLCmdReadProg,"ReadProg"},//  = 0x51,
316     {    KLCmdWriteProg,"WriteProg"},// 
317     {    KLCmdReadSysCfg,"ReadSysCfg"},// 
318     {    KLCmdWriteSysCfg,"WriteSysCfg"},// 
319
320     {    KLCmdSaveSysCfg,"SaveSysCfg"},// 
321 //        KLCmdReadRunStat,
322
323
324     {    KLCmdErrRply,"ErrRply"}//  = 0xEE,                //ERRORReply
325 };
326
327 typedef struct tagKLExtDataFrame
328 {
329     UCHAR Dst;
330     UCHAR nType;
331     UCHAR Len2;
332     UCHAR Data[1];
333 }*pKLExtDataFrame;
334
335
336 typedef union tagKLStatDef
337 {
338     UCHAR StatByte;
339     struct {
340         UCHAR nSEQ : 4;
341         UCHAR HasExt : 1;
342         UCHAR HasErr : 1;
343     };
344 }unKLStat, *pKLStat;
345
346 int m_nSeq = 0;
347 int m_nRSeq = 0;
348 unsigned char m_Dst;
349
350 //unsigned char m_Stat;
351
352 unKLStat m_Stat1 = { 0 };
353 unKLStat m_DstStat;
354 typedef struct tagKLReqPacketDef
355 {
356
357     UCHAR StartSign;
358     UCHAR DstAddr;
359     UCHAR Stat;
360     UCHAR Cmd;
361     UCHAR Type1;
362     UCHAR Params[1];
363 }stKLReqPacket, * pKLReqPacket;
364
365 typedef struct tagKLRplyPktHdr
366 {
367     unsigned char RplyStSgn;    //
368     unsigned char DstAddr;        //
369     unsigned char nStatus;        //
370     unsigned char nRplyCMD;        //
371     unsigned char nSize1;            //
372     unsigned char Datas[1];        //
373 }stKLRplyPktHdr, *pKLRplyPktHdr;
374
375 unsigned char m_Packetbuf[256];
376 unsigned char m_SendBuf[1024];
377 unsigned char m_RecvBuf[1024];
378 unsigned char m_DataBuf[1024];
379
380 typedef struct tagChnStat
381 {
382     unsigned int Stat;
383     unsigned int SendPackets;
384     unsigned int RecvPackets;
385     unsigned int LastSentTimeuS;
386     unsigned int LostPackets;
387     unsigned int CtnLstPkts;
388     unsigned int MaxCtnLstPkts;
389     unsigned int NotPkgErr;
390     unsigned int PkgLenErr;
391     unsigned int BCCErr;
392     unsigned int TimeOutErr;
393     unsigned int Delay;
394     unsigned int MaxDelay;
395     unsigned int SendTimeInterval;
396     union
397     {
398         unsigned int ClientDatas[10];
399         struct {
400             unsigned int ClientRecvPkts;    //
401             unsigned int ClientSendPkts;    //
402             unsigned int ClientNotPktErr;    //
403             unsigned int ClientMisIdPkts;    //
404             unsigned int ClientPkgLenErr;    //
405             unsigned int ClientBccErr;        //
406             unsigned int ClientTimeOutErr;    //
407         };
408     };
409 } stChnStat, * pChnStat;
410
411 struct tagMEM
412 {
413     union //tagWX
414     {
415         USHORT WX[64];
416         UCHAR WXB[128];
417         UINT WXD[32];
418     };
419     union //tagWY
420     {
421         USHORT WY[64];
422         UCHAR WYB[128];
423         UINT WYD[32];
424     };
425     union //tagDT
426     {
427         USHORT DT[256];
428         UCHAR DTB[512];
429         UINT DTD[128];
430     };
431     union //tagWR
432     {
433         USHORT WR[64];
434         UCHAR WRB[128];
435         UINT WRD[32];
436     };
437     union //tagSDT
438     {
439         UCHAR SDB[512];
440         USHORT SDT[256];
441         UINT SDD[128];
442         struct {
443             unsigned int EffJumperSW;
444             unsigned int CurJumperSW;
445             unsigned int haltick;
446             unsigned int RunStat;
447             unsigned int ErrStat;
448             unsigned int nTickCount;
449             unsigned int TotalRunTime;
450             unsigned int ThisRunTime;
451             unsigned int PwrOnCount;
452             unsigned int LastScanTime;
453             unsigned int ScanTimeuS;
454             unsigned int MinScanTimeuS;
455             unsigned int MaxScanTimeuS;
456             unsigned short ADCValues[20];
457         };
458     };
459 }MEM;
460
461 CString m_resultStr;
462
463 static int xtoi(const char * hexstr, int len = 0);
464 unsigned char KLBCC(void * pData, int nSize);
465
466 int CalCRC(void * pBuf, int nSize);
467
468 /*
469     连接状态
470     开始连接(未定)-> 心跳包正常->已连接 -> 心跳包连续正常 -> 连接很好
471
472     连接很好 -> 心跳包 失败 / 数据包失败 -> 已连接 (有错误) 
473
474     已连接 (有错误) -> 心跳包正常 -> 已连接 
475
476
477
478 */
479
480 int ParseReqPacket();
481 int MakeRplyPacket();
482
483 typedef int(*pSend)(void *, int);
484 typedef int(*pRecv)(void *, int);
485 typedef int(*pOpen)(int);
486 typedef int(*pClose)(int);
487
488 // pSend SendPkgFunc;
489 //  pRecv RecvPkgFunc;
490 //  pOpen OpenFunc;
491 //  pClose CloseFunc;
492
fc8a81 493 typedef struct tagCallBackFuncs
Q 494 {
495     std::function<int(void)> OpenFunc;
496     std::function<int(void)> CloseFunc;
497     std::function<int(void)> ClearBufFunc;
498     std::function<int(void *, int)> SendPkgFunc;
499     std::function<int(void *, int)> RecvPkgFunc;
500 }stCallBackFuncs, *pCallBackFuncs;
0ed438 501
fc8a81 502 stCallBackFuncs m_CallBackFuncs;
0ed438 503
Q 504 int m_bSendCallBackSet = 0;
505 int m_bRecvCallBackSet = 0;
506 int m_bOpenCallBackSet = 0;
507 int m_bCloseCallBackSet = 0;
fc8a81 508 int m_bClearBufCallBackSet = 0;
0ed438 509
Q 510 bool m_bOpened=false;
511
fc8a81 512 int SetCallBackFuncs(pCallBackFuncs pFuncSt);
0ed438 513
Q 514 int m_nErrCount = 0;
515 int m_nContinueErrCount = 0;
516 int Open(int OpenParam=0)
517 {
518     if (m_bOpenCallBackSet)
519     {
fc8a81 520         m_CallBackFuncs.OpenFunc();
0ed438 521     }
Q 522     m_bOpened = true;
523     return KL_OK;
524 };
525 int Close(int CloseParam=0)
526 {
527     if (m_bCloseCallBackSet)
528     {
fc8a81 529         m_CallBackFuncs.CloseFunc();
0ed438 530     }
Q 531     m_bOpened = false;
532     return KL_OK;
533 };
534 int SendPacket(void * pBuf, int Len)
535 {
fc8a81 536     if (m_bOpened && m_bSendCallBackSet)
Q 537     {    
538         if (m_bClearBufCallBackSet) m_CallBackFuncs.ClearBufFunc();
539         return m_CallBackFuncs.SendPkgFunc(pBuf, Len);
540     }
0ed438 541     else return KL_ERR;
Q 542 }
543
fc8a81 544 int RecvPacket(void * pBuf, int LenToRead, int ReTryCount=1)
0ed438 545 {
Q 546     
547     if (m_bOpened && m_bRecvCallBackSet)
548     {
549         int len2 = 0;
550         char * pBufByte = (char *)pBuf;
551         for (int i = 0; i < ReTryCount; i++)
552         {
fc8a81 553             int len1= m_CallBackFuncs.RecvPkgFunc(pBufByte + len2, LenToRead - len2);
65f713 554             if (len1 <= 0 || len1 > 256) {
Q 555                 continue;
556             }
0ed438 557             len2 += len1;
Q 558             if (len2 >= LenToRead) break;
559         }
560         if (len2 >= LenToRead) {
561             m_nContinueErrCount = 0;
562             return len2;
563         }
564         else if (len2<=0) {
565             m_nErrCount++;
566             m_nContinueErrCount++;
567             if (m_nContinueErrCount > 10)
568             {
569             //    Close(-1);
570             }
571             return KL_ERR;
572         }
573         else {
574             return len2;
575         }
576     }
577     else
578     {
579         return KL_ERR;
580     }
581 }
582 int GetNextSeq();
583
584 int MakeExtDataFrame(void * pBuf, UCHAR nDst, UCHAR nType, UCHAR len2, void * pData);
585
586 //int MakeReqPacket(void * pBuf, UCHAR nDst, UCHAR Stat, UCHAR nCMD, UCHAR Type, USHORT nAddr = 0, USHORT nCount = 0, void * pData = NULL);
587
588 int MakeReqPacketEx(void * pBuf, UCHAR nDst, UCHAR Stat, UCHAR nCMD, UCHAR Type, USHORT nAddr = 0, USHORT nCount = 0, void * pData = NULL, int ExtFrameLen = 0, void * pExtDataFrame = NULL);
589
590 int CheckPackage(void * pBuf, int nSize);
591 int ProcessPacket(void *pBuf, int nLen);
592 int ParseRplyPacket(void *pBuf, int nPkgLen, UCHAR * nCmd, UCHAR * Status, USHORT* nCount, void * pData);
593
65f713 594 int GetInfo(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
Q 595 int GetSN(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
596 int GetUID(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
597 int GetFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
598 int WriteFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
599
0ed438 600 //int GetTime32(UCHAR nDst, int * nCount);
Q 601 //int SetTime32(UCHAR nDst, int * nCount);
602 int GetDateTime32(UCHAR nDst, UINT * pValue);
603 int SetDateTime32(UCHAR nDst, UINT Value);
604
605
606 int GetEventLogCount(UCHAR nDst, int * nCount);
607 int GetEventLog(UCHAR nDst, int nStartIndex, int nCount , stEventLog * pEventLogs);
608
609
610 int ReadBit(UCHAR nDst, UCHAR nType,USHORT nBitAddr, UCHAR * Value);//Read 1 Single bit
611 int WriteBit(UCHAR nDst, UCHAR nType,USHORT nBitAddr, UCHAR Value);//Write 1 Single bit
65f713 612 int ReadBits(UCHAR nDst,  UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values);
Q 613 int WriteBits(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values);
614 int ReadBitsByWord(UCHAR nDst,  UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values);
615 int WriteBitsByWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values);
0ed438 616
65f713 617 int ReadDataByte(UCHAR nDst,  UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values);
Q 618 int WriteDataByte(UCHAR nDst, UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values);
0ed438 619
65f713 620 int ReadDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
Q 621 int WriteDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
0ed438 622
65f713 623 int ReadData(UCHAR nDst,  UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
Q 624 int WriteData(UCHAR nDst,  UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
0ed438 625
Q 626 int GetMode(UCHAR nDst, UCHAR nType);
627 int ChangeMode(UCHAR nDst,  UCHAR nType);
628
629
630 int ReadProgram(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
631
632 int StartProgram(UCHAR nDst, UCHAR nType);
633 int WriteProgram(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
634 int FinishProgram(UCHAR nDst, UCHAR nType, USHORT nStepSize);
635
636 int ReadRunStat(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
637
638
639 };
640