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 --- KPLC/Inc/BoardType.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/KPLC/Inc/BoardType.h b/KPLC/Inc/BoardType.h index a864060..d1f0a4c 100644 --- a/KPLC/Inc/BoardType.h +++ b/KPLC/Inc/BoardType.h @@ -46,6 +46,8 @@ #define BOARD_TYPE 7 #define BOARD_VER 1 +#define ENABLE_PLC 1 + #if (BOARD_TYPE == 11) #define XLAT_FREQ 12 #elif (BOARD_TYPE == 14) @@ -74,4 +76,43 @@ #endif +typedef struct tagInfoBlockHdr { + unsigned short nBlkSign; // 开始标志 + unsigned short nBlkTypeVer; // 类型和版本 + unsigned short nBlkSize; // Block 大小, 包括开始和结束标志 + unsigned short Pad1; +}stInfoBlockHdr; + +typedef struct tagInfoBlockTail { + + unsigned short CRC16; + unsigned short EndSign; +}stInfoBlockTail; + +typedef struct tagBtLdrInfoBlock { + stInfoBlockHdr Hdr; + unsigned short nBtldrVer; + unsigned short nBtldrDevice; + unsigned short nBtldrSize; // 设计大小 + unsigned short nBtldrDataSize; //代码大小 + unsigned int nBtldr_AppAddr; + unsigned int nBtldr_NewAppInfoAddr; + unsigned int nBtldr_NewAppAddr; + stInfoBlockTail tail; +}stBtLdrInfoBlock, *pBtLdrInfoBlock; + +typedef struct tagAppInfoBlock { + stInfoBlockHdr Hdr; + unsigned short nAppVer; + unsigned short nAppDevice; + unsigned short nAppSize; // 代码设计大小 + unsigned short nAppDataSize; //实际代码大小 + unsigned int nAppStartAddr; + unsigned int nAppStartOffset; + unsigned int nApp; + stInfoBlockTail tail; +}stAppInfoBlock, * pAppInfoBlock; + + + #endif /* __BOARDTYPE_H__ */ -- Gitblit v1.9.1