| | |
| | | #define __KBUS_H__
|
| | | typedef unsigned char uchar;
|
| | |
|
| | | extern unsigned char bMaster,bSlave,bRepeater;
|
| | | extern unsigned char bKBusMaster,bKBusSlave,bKBusRepeater;;
|
| | | enum enCMDs
|
| | | {
|
| | | cmdNone = '0', //Nothing
|
| | |
| | | };
|
| | | } stChnStat;
|
| | |
|
| | | extern stChnStat ChnStats[9];
|
| | | extern stChnStat ChnStats[8];
|
| | |
|
| | | typedef struct tagSlaveStat
|
| | | {
|
| | |
| | |
|
| | | } ;
|
| | |
|
| | | int RepeaterFunc(int nChn);
|
| | | int MasterFunc(int nChn);
|
| | | int SlaveFunc(int nChn);
|
| | |
|
| | | unsigned char BCC(void * pData, int nSize);
|
| | | unsigned char KBusBCC(void * pData, int nSize);
|
| | | //
|
| | | /* Make a Packet and return Packet Length */
|
| | | int MakePacket(pPacket p1,uchar Src, uchar Dst, uchar nType, uchar nSEQ, uchar DataLen, void *pData );
|
| | | int KBusMakePacket(pPacket p1,uchar Src, uchar Dst, uchar nType, uchar nSEQ, uchar DataLen, void *pData );
|
| | |
|
| | | /* */
|
| | | int CheckPacket(int nChn, pPacket p1, int len1);
|
| | | int KBusCheckPacket(int nChn, pPacket p1, int len1);
|
| | |
|
| | | /* */
|
| | | int ParsePacket(int nChn, pPacket p1, int Len1);
|
| | | int KBusParsePacket(int nChn, pPacket p1, int Len1);
|
| | | typedef struct tagMachineConfig
|
| | | {
|
| | | int bMaster;
|
| | | int bKBusMaster;
|
| | | int nAddr;
|
| | | }stMachineConfig;
|
| | |
|
| | | /*
|
| | | int InitMachine(stMachineConfig * pConfig);
|
| | |
|
| | | int SetConfig(void );
|
| | |
| | | int WriteData(void);
|
| | |
|
| | | int GetStat(void);
|
| | |
|
| | |
|
| | |
|
| | | |
| | |
|
| | | */
|
| | | int KBusRepeaterFunc(int nChn);
|
| | | int KBusMasterFunc(int nChn);
|
| | | int KBusSlaveFunc(int nChn);
|
| | |
|
| | | #endif /* __KBUS_H__ */
|
| | |
|