#lora #iot #lpwan

lora-modulation

A definition of LoRa modulation characteristics with minimal external dependencies

5 releases

0.1.4 Jan 20, 2024
0.1.3 Oct 11, 2023
0.1.2 Sep 14, 2023
0.1.1 Sep 12, 2023
0.1.0 Sep 8, 2023

#388 in Embedded development

Download history 9/week @ 2024-03-11 6/week @ 2024-03-18 31/week @ 2024-04-01 3/week @ 2024-04-08 16/week @ 2024-04-15 21/week @ 2024-05-20 8/week @ 2024-05-27 23/week @ 2024-06-03 13/week @ 2024-06-10 16/week @ 2024-06-17 7/week @ 2024-06-24

60 downloads per month
Used in 2 crates

MIT license

12KB
207 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

~160KB