1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! # API related to FSK operations
//!
//! This module provides an API for configuring and operating the LR1120 chip for FSK (Frequency Shift Keying) modulation.
//! This API is for a generic FSK modulation using a packet structure used in previous Semtech chips
//! (SX126x, SX127x). It supports fixed or dynamic length packets up to 255 bytes, with configurable
//! CRC, address filtering, and whitening.
//!
//! ## Quick Start
//!
//! Here's a typical sequence to initialize the chip for FSK operations:
//!
//! ```rust,no_run
//! use lr1120::radio::PacketType;
//! use lr1120::fsk::{PblLenDetect, AddrComp, FskPktFormat, Crc, DcFree};
//! use lr1120::{PulseShape, RxBw};
//!
//! // Set packet type to FSK Legacy (compatible with SX126x/SX127x/LR11xx)
//! lr1120.set_packet_type(PacketType::FskLegacy).await.expect("Setting packet type");
//!
//! // Configure FSK modulation (250kbps, BT=0.5 pulse shaping, 444kHz bandwidth, 62.5kHz deviation)
//! lr1120.set_fsk_modulation(
//! 250_000, // Bitrate: 250 kbps
//! PulseShape::Bt0p5, // Pulse shaping: BT=0.5 Gaussian filter
//! RxBw::Bw444, // RX bandwidth: 444 kHz
//! 62500 // Frequency deviation: 62.5 kHz
//! ).await.expect("Setting FSK modulation");
//!
//! // Configure syncword (64-bit value, syncword length configured separately in packet params)
//! lr1120.set_fsk_syncword(0xCD05DEADC0FE1337).await.expect("Setting syncword");
//!
//! // Configure packet parameters
//! lr1120.set_fsk_packet(
//! 16, // TX preamble length: 16 bits (minimum recommended)
//! PblLenDetect::Len16Bits, // Preamble detection length: 16 bits
//! 32, // Syncword length: 32 bits
//! AddrComp::Off, // No address filtering
//! FskPktFormat::Variable8bit, // Variable length with 8-bit length field
//! 10, // Maximum payload length: 10 bytes
//! Crc::Crc2Byte, // 2-byte CRC
//! DcFree::DcFreeWhitening // DC-free encoding enabled (whitening)
//! ).await.expect("Setting packet parameters");
//! ```
//!
//! ## Available Methods
//!
//! - [`set_fsk_modulation`](Lr1120::set_fsk_modulation) - Configure bitrate, pulse shaping, bandwidth, and frequency deviation
//! - [`set_fsk_packet`](Lr1120::set_fsk_packet) - Set packet parameters (preamble, length format, CRC, addressing, whitening)
//! - [`set_fsk_syncword`](Lr1120::set_fsk_syncword) - Configure synchronization word value
//! - [`get_fsk_packet_status`](Lr1120::get_fsk_packet_status) - Read FSK packet status: RSSI, packet length, error source (address, CRC, length, ...)
use OutputPin;
use SpiBus;
pub use *;
use ;