#lora #iot #lpwan-iot #lpwan

lora-modulation

A definition of LoRa modulation characteristics with minimal external dependencies

6 releases

0.1.5 Nov 11, 2024
0.1.4 Jan 20, 2024
0.1.3 Oct 11, 2023
0.1.2 Sep 14, 2023

#1006 in Embedded development

Download history 144/week @ 2025-05-28 181/week @ 2025-06-04 129/week @ 2025-06-11 50/week @ 2025-06-18 104/week @ 2025-06-25 33/week @ 2025-07-02 98/week @ 2025-07-09 39/week @ 2025-07-16 30/week @ 2025-07-23 16/week @ 2025-07-30 58/week @ 2025-08-06 53/week @ 2025-08-13 68/week @ 2025-08-20 69/week @ 2025-08-27 116/week @ 2025-09-03 119/week @ 2025-09-10

383 downloads per month
Used in 4 crates (3 directly)

MIT license

13KB
212 lines

lora-modulation

Latest Version Docs

A minimal crate for providing LoRa modulation characteristics of:

  • Bandwidth
  • Spreading factor
  • Coding rate

Provides utility for calculating time on air.

Usage

use lora_modulation::{BaseBandModulationParams, SpreadingFactor, Bandwidth, CodingRate};

let length = 12;
let params = BaseBandModulationParams::new(SpreadingFactor::_9, Bandwidth::_125KHz, CodingRate::_4_5);
let time_on_air = params.time_on_air_us(
    Some(8), // preamble
    true,    // explicit header
    length); // length of payload

// Time on air is 144.384 ms
assert_eq!(time_on_air, 144384);
use lora_modulation::{BaseBandModulationParams, SpreadingFactor, Bandwidth, CodingRate};

let symbols = 14;
let params = BaseBandModulationParams::new(SpreadingFactor::_12, Bandwidth::_125KHz, CodingRate::_4_5);
let timeout = params.symbols_to_ms(symbols);

// Timeout is 458 ms
assert_eq!(timeout, 458);

Dependencies

~190KB