From 842bb64195f958b050867c50db66fc0aa413dafb Mon Sep 17 00:00:00 2001 From: QuakeGod <quakegod@sina.com> Date: 星期六, 27 七月 2024 10:42:56 +0800 Subject: [PATCH] KBus upgrade --- CCT6_TestApp1/Inc/SLP.h | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 43 insertions(+), 10 deletions(-) diff --git a/CCT6_TestApp1/Inc/SLP.h b/CCT6_TestApp1/Inc/SLP.h index 86301d1..c8718f8 100644 --- a/CCT6_TestApp1/Inc/SLP.h +++ b/CCT6_TestApp1/Inc/SLP.h @@ -1,5 +1,3 @@ - - #ifndef __SLP_H_V10__ #define __SLP_H_V10__ typedef unsigned char uchar; @@ -19,14 +17,49 @@ // uchar ED; }stSLPPacket; -extern uchar bSLPMaster; -extern uchar nStation; -extern uchar SLPinputB; -extern uchar SLPoutputB; -extern uchar SLPErrSign; +//extern uchar bSLPMaster; +//extern uchar nStation; +//extern uchar SLPinputB; +//extern uchar SLPoutputB; +//extern uchar SLPErrSign; -void SLPparsePacket(void * pBuf, uchar len1); -void SLPMasterSendPacket(void); -void SLPProcess(void); +typedef void (*SLPSendPktDef)(unsigned char * pBuf, int Len1); + + +typedef struct tagSLPDef +{ + uchar bSLPMaster; + uchar nStation; + uchar SLPinputB; + uchar SLPoutputB; + uchar nCurStation; + uchar inputBuf[5]; + uchar outputBuf[5]; + + uchar SendBuf[8]; + + uchar SLPMasterRecved; //主机收到子机回复 + + SLPSendPktDef SLPSendPktFunc; + + unsigned int SLPSlaveCountOut; + + unsigned int SLPLostPkt; // 丢包数量 + + uchar SLPOKSign; + uchar SLPErrSign; + + int nCount; + +}stSLPDef; + +void SLPInit(stSLPDef * pSLP, SLPSendPktDef pFunc1); +void SLPSetCallBack(stSLPDef * pSLP, SLPSendPktDef pFunc1); + +void SLPparsePacket(stSLPDef * pSLP, unsigned char * pBuf, uchar len1); +void SLPMasterSendPacket(stSLPDef * pSLP); +void SLPProcess(stSLPDef * pSLP); + #endif /* __SLP_H_V10__ */ + -- Gitblit v1.9.1