New file |
| | |
| | | /**
|
| | | ******************************************************************************
|
| | | * @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"数据后LED闪烁并发送一个"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__ */
|
| | |
|