| 476 | } |
| 477 | |
| 478 | void LoRaClass::setSpreadingFactor(int sf) |
| 479 | { |
| 480 | if (sf < 6) { |
| 481 | sf = 6; |
| 482 | } else if (sf > 12) { |
| 483 | sf = 12; |
| 484 | } |
| 485 | |
| 486 | if (sf == 6) { |
| 487 | writeRegister(REG_DETECTION_OPTIMIZE, 0xc5); |
| 488 | writeRegister(REG_DETECTION_THRESHOLD, 0x0c); |
| 489 | } else { |
| 490 | writeRegister(REG_DETECTION_OPTIMIZE, 0xc3); |
| 491 | writeRegister(REG_DETECTION_THRESHOLD, 0x0a); |
| 492 | } |
| 493 | |
| 494 | writeRegister(REG_MODEM_CONFIG_2, (readRegister(REG_MODEM_CONFIG_2) & 0x0f) | ((sf << 4) & 0xf0)); |
| 495 | setLdoFlag(); |
| 496 | } |
| 497 | |
| 498 | long LoRaClass::getSignalBandwidth() |
| 499 | { |
nothing calls this directly
no outgoing calls
no test coverage detected