查看LoRa的源代码
←
LoRa
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
=== Spreading Factor === [[文件:Sx1278-spreading-factor.png]] '''Note:''' The Spreading Factor must be known in advance on both transmit and receive sides of the link as different spreading factors are orthogonal to each other Spreading Factor 6: * Set Spreading Factor = 6 in Reg_ModemConfig2 * The head must be set to Implicit mode (Reg_ModemConfig1[0] := 1) * Set the DetectionOptimize of Reg_LoRaDetectOptimize to value '0b101' * Write 0x0C in the RegDetectionThreshold <source lang=cpp> void sx1278_set_spread_fact(uint8_t factor) { uint8_t d; d = sx1278_read_reg(REG_MODEMCONFIG2); d = (d & MODEMCONFIG2_SF_MASK) | (factor << 4); sx1278_write_reg(REG_MODEMCONFIG2, d); if (factor == 6) { sx1278_write_reg(REG_DETECTIONOPTIMIZE, 0x5); sx1278_write_reg(REG_DETECTIONTHRESHOLD, 0xC); } else { sx1278_write_reg(REG_DETECTIONOPTIMIZE, 0x3); sx1278_write_reg(REG_DETECTIONTHRESHOLD, 0xA); } } /* Reg_ModemConfig1[0] */ void sx1278_set_head_on(bool enable) { uint8_t rxd; rxd = sx1278_read_reg(REG_MODEMCONFIG1); rxd = (rxd & MODEMCONFIG1_IMPLICITHEADER_MASK) | (enable); sx1278_write_reg(REG_MODEMCONFIG1, rxd); } </source> <br>
返回到
LoRa
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面