Double MSP (TLM and MAVLink) throughput for Gemini hardware (#3037)
[ExpressLRS.git] / src / lib / FEC / FEC.h
blob75fbfb1bb6e3b41ea0b4815a2e2c83075eebc664
1 #pragma once
3 #include "hamming.h"
5 /**
6 * @brief Hamming(7,4) + Interleaving
7 *
8 * The below functions may look flexible, but they are not!
9 * Only send it an 8B payload that will go into a 14B FECBuffer.
10 * The encoding will be ok but interleaving expects 8B going into 14B.
12 * Hamming(7,4) - 4b chucks are converted into a 7b codeword. Each
13 * codeword can correct a single bit error during transmission.
15 * Interleaving - The 7b codeword is spread across the entire packet.
16 * A single bit is placed in every second byte of the payload. This
17 * should provide the best defence against burst interference, and single
18 * bit errors in each codeword can be repaired.
21 void FECEncode(uint8_t *incomingData, uint8_t *FECBuffer);
22 void FECDecode(uint8_t *incomingFECBuffer, uint8_t *outgoingData);