From f4f290279d32d3cd656472a3298345bc7418cd78 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 17 十月 2022 20:42:45 +0800 Subject: [PATCH] arrange again radio fp0 klink knet --- Inc/KMachine.h | 57 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 28 insertions(+), 29 deletions(-) diff --git a/Inc/KMachine.h b/Inc/KMachine.h index 1be757b..e3fb8a4 100644 --- a/Inc/KMachine.h +++ b/Inc/KMachine.h @@ -49,9 +49,9 @@ #define LoHofB(x) ((x)&0xf) #define HiHofB(x) (((x)>>4)&0xf) -// 锟斤拷息锟斤拷 -// 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟矫匡拷 -// 锟矫伙拷/系统锟斤拷锟斤拷锟斤拷锟矫匡拷 +// 信息块 +// 工厂参数配置块 +// 用户/系统参数配置块 // // @@ -103,26 +103,26 @@ enum enPortType { - PortType_Com = 0, //锟斤拷锟斤拷锟酵ㄑ� - PortType_Gen = 1, //通锟斤拷通讯锟斤拷锟斤拷锟缴匡拷 + PortType_Com = 0, //计算机通讯 + PortType_Gen = 1, //通用通讯,自由口 PortType_KLink = 2, //Klink通讯 PortType_KBus = 3, //KBus通讯 PortType_KNet = 4, // KNet通讯 PortType_ModbusRTU = 5, //Modbus RTU 通讯 }; -//每锟斤拷模锟斤拷锟斤拷 0/1/2/3/4/5/6/7/8锟斤拷 通讯port -//锟斤拷锟斤拷锟斤拷 UART, 锟斤拷锟节o拷锟斤拷锟竭o拷锟斤拷锟斤拷锟竭等o拷锟斤拷锟斤拷port -//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟絧ort +//每个模块有 0/1/2/3/4/5/6/7/8个 通讯port +//不限于 UART, 网口,无线,单总线等,都是port +//甚至可以有虚拟的port typedef struct tagPortStat { - UCHAR nWorking; //锟斤拷锟斤拷锟斤拷 - UCHAR nStation; //锟皆硷拷站锟斤拷 - UCHAR bBus; //锟斤拷锟斤拷?,,全双锟斤拷? - UCHAR bMaster; //锟斤拷锟斤拷 - UCHAR PortType; //锟剿口癸拷锟斤拷模式 - UCHAR nDevices; //锟斤拷锟接碉拷锟借备锟斤拷锟斤拷//锟斤拷锟斤拷锟斤拷锟皆硷拷 //device list; + UCHAR nWorking; //工作中 + UCHAR nStation; //自己站号 + UCHAR bBus; //总线?,,全双工? + UCHAR bMaster; //主机 + UCHAR PortType; //端口工作模式 + UCHAR nDevices; //连接的设备数量//不包括自己 //device list; }stPortStat,*pPortStat; @@ -146,11 +146,11 @@ typedef struct tagKMFuncParam { - USHORT EnablePLC:1; //使锟斤拷锟节诧拷PLC锟斤拷锟斤拷 - USHORT RunMode; //锟斤拷锟斤拷模式 + USHORT EnablePLC:1; //使能内部PLC功能 + USHORT RunMode; //工作模式 }stKMFuncParam; -// 锟斤拷锟斤拷锟斤拷锟斤拷锟街酚筹拷锟� +// 输入输出地址映射 typedef struct tagComPortParam //4 Bytes { @@ -190,7 +190,7 @@ USHORT workmode; // SC1 // 2 Bytes 0=From jumper USHORT SwitchFunc; // SC2 // 2 Bytes - USHORT OutMappings[6]; //12 Bytes //锟斤拷锟接筹拷锟� + USHORT OutMappings[6]; //12 Bytes //输出映射 stComPortParam PortParams[2]; // 8 Bytes stOutputHoldParam OutputParams[16]; //16 Bytes @@ -223,7 +223,6 @@ unsigned short EndSign1; }stStoredKMSysCfg,*pStoredKMSysCfg; - /* typedef struct tagFactData { @@ -238,7 +237,7 @@ }stFactData; */ -typedef struct tagFactoryData //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 +typedef struct tagFactoryData //工厂量产参数,数据 { USHORT Sign1; USHORT Seq1; @@ -397,12 +396,12 @@ stTimer Timers[TOTALTIMERS]; union { - unsigned short WX[KLDataWXCount]; //锟斤拷锟斤拷锟斤拷X锟斤拷Y + unsigned short WX[KLDataWXCount]; //本机的X和Y unsigned char WXB[KLDataWXCount*2]; }; union { - unsigned short WY[KLDataWYCount]; //锟斤拷锟斤拷锟斤拷X锟斤拷Y - unsigned char WYB[KLDataWYCount*2]; //锟斤拷锟斤拷锟斤拷X锟斤拷Y + unsigned short WY[KLDataWYCount]; //本机的X和Y + unsigned char WYB[KLDataWYCount*2]; //本机的X和Y }; unsigned short WR[KLDataWRCount]; @@ -413,7 +412,7 @@ unsigned short SV[KLDataSVCount]; - unsigned short WLX[16]; //锟斤拷锟斤拷锟絏锟斤拷Y锟斤拷远锟斤拷通讯时映锟斤拷锟矫★拷 + unsigned short WLX[16]; //虚拟的X和Y,远程通讯时映射用。 unsigned short WLY[16]; unsigned short WLR[16]; unsigned short WSR[16]; @@ -422,12 +421,12 @@ unsigned int DTD[KLDataDTCount]; unsigned short DT[KLDataDTCount]; unsigned char DTB[KLDataDTCount*2]; -}; +}; - // 锟斤拷锟矫寄达拷锟斤拷 - // 系统状态锟侥达拷锟斤拷 - // 锟斤拷锟斤拷拇锟斤拷锟� - // 锟斤拷锟皆o拷锟斤拷丶拇锟斤拷锟� + // 配置寄存器 + // 系统状态寄存器 + // 特殊寄存器 + // 调试,监控寄存器 union { unsigned int SDD[KLDataSDTCount/2]; unsigned short SDT[KLDataSDTCount]; -- Gitblit v1.9.1