提交 | 用户 | age
|
6a6261
|
1 |
/**
|
Q |
2 |
******************************************************************************
|
|
3 |
* @file : KWireLess.h
|
|
4 |
* @brief : Header for KWireLess.c file.
|
|
5 |
* This file contains the common defines of the application.
|
|
6 |
******************************************************************************
|
|
7 |
*/
|
|
8 |
#include "KMachine.h"
|
|
9 |
#include <stdint.h>
|
|
10 |
#include "user.h"
|
|
11 |
|
|
12 |
#include "radio/inc/sx126x-board.h"
|
|
13 |
|
|
14 |
|
|
15 |
#ifndef __KWIRELESS_H__
|
|
16 |
#define __KWIRELESS_H__
|
|
17 |
typedef unsigned char uchar;
|
|
18 |
|
|
19 |
|
|
20 |
/**************************************************************************************************************************************
|
091773
|
21 |
Demo 程序流程 RadioEnableMaster=true 为主机端,主机端发送一个"PING"数据后切换到接收,等待从机返回的应答"PONG"数据LED闪烁
|
6a6261
|
22 |
|
091773
|
23 |
RadioEnableMaster=false 为从机端,从机端接收到主机端发过来的"PING"数据后LED闪烁并发送一个"PONG"数据作为应答
|
6a6261
|
24 |
***************************************************************************************************************************************/
|
Q |
25 |
|
091773
|
26 |
extern uint32_t nRadioChannel;
|
6a6261
|
27 |
void SendPingMsg(void );
|
Q |
28 |
|
091773
|
29 |
int KWireLessInit(bool bRadioEnableMaster, uint32_t nChn);
|
6a6261
|
30 |
int KWireLessStart(void);
|
Q |
31 |
|
|
32 |
void OnTxDone( void );
|
|
33 |
void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr );
|
|
34 |
void OnTxTimeout( void );
|
|
35 |
void OnRxTimeout( void );
|
|
36 |
void OnRxError( void );
|
|
37 |
|
|
38 |
void LedToggle(void);
|
|
39 |
|
db25c9
|
40 |
typedef enum tagenKWStates
|
6a6261
|
41 |
{
|
Q |
42 |
KW_PON,
|
|
43 |
KW_UNINIT,
|
|
44 |
KW_INITED,
|
|
45 |
KW_UNCONFIGED,
|
|
46 |
KW_CONFIGING,
|
|
47 |
KW_CONFIGED,
|
|
48 |
KW_READY,
|
|
49 |
KW_STARTING,
|
|
50 |
KW_OPERATION,
|
|
51 |
KW_ERROR1,
|
|
52 |
KW_ERROR2,
|
|
53 |
KW_ERROR3,
|
db25c9
|
54 |
}enKWStates;
|
6a6261
|
55 |
|
Q |
56 |
|
|
57 |
int KWMasterProc(void);
|
|
58 |
int KWSlaveProc(void);
|
|
59 |
int MkKwPkg(void* pPkg, int len);
|
|
60 |
|
|
61 |
int KWSendPkg(void* pPkg, int len);
|
|
62 |
int KWProcPkg(void);
|
db25c9
|
63 |
/*
|
Q |
64 |
typedef struct KWStates
|
|
65 |
{
|
|
66 |
|
|
67 |
}stKWStat,*pstKWstat;
|
|
68 |
*/
|
|
69 |
|
|
70 |
|
6a6261
|
71 |
#endif ///* __KBUS_H__ */
|
Q |
72 |
|