From a9312568cde771d4b970445e1f66a04fabb64d56 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期三, 01 二月 2023 14:07:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Radio' into dev1

---
 Inc/KWireLess.h |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/Inc/KWireLess.h b/Inc/KWireLess.h
new file mode 100644
index 0000000..9488d41
--- /dev/null
+++ b/Inc/KWireLess.h
@@ -0,0 +1,64 @@
+/**
+  ******************************************************************************
+  * @file           : KWireLess.h
+  * @brief          : Header for KWireLess.c file.
+  *                   This file contains the common defines of the application.
+  ******************************************************************************
+	*/
+#include "KMachine.h"
+#include <stdint.h>
+#include "user.h"
+
+#include "radio/inc/sx126x-board.h"
+
+
+#ifndef __KWIRELESS_H__
+#define __KWIRELESS_H__
+typedef unsigned char uchar;
+
+
+/**************************************************************************************************************************************
+Demo 绋嬪簭娴佺▼  RadioEnableMaster=true  涓轰富鏈虹锛屼富鏈虹鍙戦�佷竴涓�"PING"鏁版嵁鍚庡垏鎹㈠埌鎺ユ敹锛岀瓑寰呬粠鏈鸿繑鍥炵殑搴旂瓟"PONG"鏁版嵁LED闂儊
+
+               RadioEnableMaster=false 涓轰粠鏈虹锛屼粠鏈虹鎺ユ敹鍒颁富鏈虹鍙戣繃鏉ョ殑"PING"鏁版嵁鍚嶭ED闂儊骞跺彂閫佷竴涓�"PONG"鏁版嵁浣滀负搴旂瓟
+***************************************************************************************************************************************/
+
+extern uint32_t nRadioChannel;
+void SendPingMsg(void );
+
+int KWireLessInit(bool bRadioEnableMaster, uint32_t nChn);
+int KWireLessStart(void);
+
+void OnTxDone( void );
+void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr );
+void OnTxTimeout( void );
+void OnRxTimeout( void );
+void OnRxError( void );
+
+void LedToggle(void);
+
+typedef enum tag_KWStates
+{
+	KW_PON,
+	KW_UNINIT,
+	KW_INITED,
+	KW_UNCONFIGED,
+	KW_CONFIGING,
+	KW_CONFIGED,
+	KW_READY,
+	KW_STARTING,
+	KW_OPERATION,
+	KW_ERROR1,
+	KW_ERROR2,
+	KW_ERROR3,
+}KWStates;
+
+
+int KWMasterProc(void);
+int KWSlaveProc(void);
+int MkKwPkg(void* pPkg, int len);
+
+int KWSendPkg(void* pPkg, int len);
+int KWProcPkg(void);
+#endif ///*  __KBUS_H__  */
+

--
Gitblit v1.9.1