id: rylr998_phy_encode label: RYLR998 PHY Encoder category: '[RYLR998]/PHY' flags: [python, cpp] documentation: |- LoRa PHY layer encoder. Complete transmit chain: CRC → Whiten → Hamming FEC → Interleave → Gray encode Encodes payload bytes into CSS symbol bins. TX chain order: 1. Payload bytes → nibbles (low nibble first) 2. Append CRC (if enabled) 3. Whiten payload nibbles 4. Build header (if explicit mode) 5. Hamming FEC encode 6. Interleave 7. Gray encode 8. Scale for reduced rate (header) Input: Raw payload bytes Output: Encoded symbol bins (ready for Frame Generator) templates: imports: from rylr998 import phy_encode make: rylr998.phy_encode(sf=${sf}, cr=${cr}, has_crc=${has_crc}, ldro=${ldro}, implicit_header=${implicit_header}) parameters: - id: sf label: Spreading Factor dtype: int default: 9 options: [7, 8, 9, 10, 11, 12] option_labels: ['SF7', 'SF8', 'SF9', 'SF10', 'SF11', 'SF12'] - id: cr label: Coding Rate dtype: int default: 1 options: [1, 2, 3, 4] option_labels: ['4/5', '4/6', '4/7', '4/8'] - id: has_crc label: CRC Enabled dtype: bool default: 'True' options: ['True', 'False'] - id: ldro label: Low Data Rate Opt dtype: bool default: 'False' options: ['True', 'False'] - id: implicit_header label: Implicit Header dtype: bool default: 'False' options: ['True', 'False'] inputs: - label: payload domain: message dtype: byte outputs: - label: symbols domain: message dtype: int file_format: 1