当前位置:网站首页>Lora sync word settings
Lora sync word settings
2022-07-06 22:14:00 【zterrorblade】
According to the sx1302 Is it public network,loragw_sx1302.c
int sx1302_lora_syncword(bool public, uint8_t lora_service_sf) {
/* Multi-SF modem configuration */
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF5->SF6 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF5_PEAK1_POS_SF5, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF5_PEAK2_POS_SF5, 4);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF6_PEAK1_POS_SF6, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF6_PEAK2_POS_SF6, 4);
if (public == true) {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PUBLIC (0x34)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 6);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 8);
} else {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 4);
}
/* LoRa Service modem configuration */
if ((public == false) || (lora_service_sf == DR_LORA_SF5) || (lora_service_sf == DR_LORA_SF6)) {
DEBUG_PRINTF("INFO: configuring LoRa (Service) SF%u with syncword PRIVATE (0x12)\n", lora_service_sf);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH0_PEAK1_POS, 2);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH1_PEAK2_POS, 4);
} else {
DEBUG_PRINTF("INFO: configuring LoRa (Service) SF%u with syncword PUBLIC (0x34)\n", lora_service_sf);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH0_PEAK1_POS, 6);
lgw_reg_w(SX1302_REG_RX_TOP_LORA_SERVICE_FSK_FRAME_SYNCH1_PEAK2_POS, 8);
}
return LGW_REG_SUCCESS;
}Where the setting code is
if (public == true) {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PUBLIC (0x34)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 6);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 8);
} else {
DEBUG_MSG("INFO: configuring LoRa (Multi-SF) SF7->SF12 with syncword PRIVATE (0x12)\n");
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH0_SF7TO12_PEAK1_POS_SF7TO12, 2);
lgw_reg_w(SX1302_REG_RX_TOP_FRAME_SYNCH1_SF7TO12_PEAK2_POS_SF7TO12, 4);
}sx126x Set the synchronization word related code
sx126x.h
/*!
* Syncword for Private LoRa networks
*/
#define LORA_MAC_PRIVATE_SYNCWORD 0x1424
/*!
* Syncword for Public LoRa networks
*/
#define LORA_MAC_PUBLIC_SYNCWORD 0x3444radio.c
void RadioSetPublicNetwork( bool enable )
{
RadioPublicNetwork.Current = RadioPublicNetwork.Previous = enable;
RadioSetModem( MODEM_LORA );
if( enable == true )
{
// Change LoRa modem SyncWord
SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PUBLIC_SYNCWORD >> 8 ) & 0xFF );
SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PUBLIC_SYNCWORD & 0xFF );
}
else
{
// Change LoRa modem SyncWord
SX126xWriteRegister( REG_LR_SYNCWORD, ( LORA_MAC_PRIVATE_SYNCWORD >> 8 ) & 0xFF );
SX126xWriteRegister( REG_LR_SYNCWORD + 1, LORA_MAC_PRIVATE_SYNCWORD & 0xFF );
}
}public network true Set sync word 0x34
false 0x12
边栏推荐
- Management background --5, sub classification
- LeetCode学习记录(从新手村出发之杀不出新手村)----1
- Data processing skills (7): MATLAB reads the data in the text file TXT with mixed digital strings
- 关于程序员的职业操守,从《匠艺整洁之道》谈起
- Assembly and interface technology experiment 5-8259 interrupt experiment
- [线性代数] 1.3 n阶行列式
- 数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
- Embedded common computing artifact excel, welcome to recommend skills to keep the document constantly updated and provide convenience for others
- GPS从入门到放弃(十三)、接收机自主完好性监测(RAIM)
- GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差
猜你喜欢

A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely

【sciter】: 基于 sciter 封装通知栏组件
![[leetcode daily clock in] 1020 Number of enclaves](/img/2d/3d12f20c8c73fb28044c01be633c99.jpg)
[leetcode daily clock in] 1020 Number of enclaves

2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks

HDR image reconstruction from a single exposure using deep CNNs阅读札记

功能强大的国产Api管理工具

Search element topic (DFS)

GPS from getting started to giving up (XV), DCB differential code deviation

bat脚本学习(一)
![Some problems about the use of char[] array assignment through scanf..](/img/cf/d85a3172c5d29ac00377f9c30dbc4f.png)
Some problems about the use of char[] array assignment through scanf..
随机推荐
功能强大的国产Api管理工具
GNN, please deepen your network layer~
GPS从入门到放弃(二十)、天线偏移
What a new company needs to practice and pay attention to
Save and retrieve strings
AI 企业多云存储架构实践 | 深势科技分享
How does the uni admin basic framework close the creation of super administrator entries?
C # realizes crystal report binding data and printing 4-bar code
新入职一家公司需要去实践和注意的内容
2021 geometry deep learning master Michael Bronstein long article analysis
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
十二、启动流程
GPS从入门到放弃(十七) 、对流层延时
The golden age of the U.S. technology industry has ended, and there have been constant lamentations about chip sales and 30000 layoffs
What is the difference between animators and animators- What is the difference between an Animator and an Animation?
Force deduction question 500, keyboard line, JS implementation
小满网络模型&http1-http2 &浏览器缓存
LeetCode刷题(十一)——顺序刷题51至55
zabbix 代理服务器 与 zabbix-snmp 监控
【10点公开课】:视频质量评价基础与实践