yincheng.zhong
2024-03-01 04bf7f56b700d45fd44175b67d25e0c535aa0941
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __LORA_H__
#define __LORA_H__
 
#include <stdint.h>
#include <stdbool.h>
void OnTxTimeout( void );
void OnRxTimeout( void );
void OnRxError( void );
void T_R_Init(uint8_t kind);
void Lora_Init(void);
void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr);
void OnTxDone( void );
void LedToggle(void);
void SwitchLoraSettings(uint32_t freq,uint8_t sf,uint8_t power);
uint8_t GetFlagLoraWaitSync(void);
void SetFlagLoraWaitSync(uint8_t value);
void SwitchLoraSettingstest(uint32_t freq,uint8_t sf);
uint8_t GetLoraBufferAndLen(uint8_t* buffer,uint16_t* lp_count);
uint16_t GetLoraSyncCount(void);
//#define TEST_FREQ
#ifdef  TEST_FREQ
    #define LORA_UPCHANNEL_FRQ 456
    #define LORA_UPCHANNEL_SF 7
 
    #define SYNC_CHANNEL_FRQ 457
    #define SYNC_CHANNEL_SF 7
 
    #define UWB_CHANNEL_FRQ 450
    #define UWB_CHANNEL_SF 5
#else
    #define LORA_UPCHANNEL_FRQ 476
    #define LORA_UPCHANNEL_SF 7
 
    #define SYNC_CHANNEL_FRQ 477
    #define SYNC_CHANNEL_SF 7
 
    #define UWB_CHANNEL_FRQ 470
    #define UWB_CHANNEL_SF 5
#endif
 
#define APP2_ADRESS 0X8012800
#define APP1_ADRESS 0X8005000
 
#define APP_SIZE 0XAB00
 
#define APP_1OR2_ADRESS 0x8004B38
#endif