A collection of error correction code (ECC) algorithms. More...

Detailed Description

A collection of error correction code (ECC) algorithms.

Files

file  golay2412.h
 Golay(24,12) half-rate forward error-correction code.
 
file  repetition.h
 ECC repetition code.
 
#define Hamming_ERROR_NONE   0
 Hamming Code implementation for 256byte data segments. More...
 
#define Hamming_ERROR_SINGLEBIT   1
 A single bit was incorrect but has been recovered.
 
#define Hamming_ERROR_ECC   2
 The original code has been corrupted.
 
#define Hamming_ERROR_MULTIPLEBITS   3
 Multiple bits are incorrect in the data and they cannot be corrected.
 
void hamming_compute256x (const uint8_t *data, uint32_t size, uint8_t *code)
 Computes 3-bytes hamming codes for a data block whose size is multiple of 256 bytes. More...
 
uint8_t hamming_verify256x (uint8_t *data, uint32_t size, const uint8_t *code)
 Verifies 3-bytes hamming codes for a data block whose size is multiple of 256 bytes. More...
 

Macro Definition Documentation

◆ Hamming_ERROR_NONE

#define Hamming_ERROR_NONE   0

Hamming Code implementation for 256byte data segments.

Author
Lucas Jenß lucas.nosp@m.@x3r.nosp@m.o.de No bit errors were detected in the message

Definition at line 29 of file hamming256.h.

Function Documentation

◆ hamming_compute256x()

void hamming_compute256x ( const uint8_t *  data,
uint32_t  size,
uint8_t *  code 
)

Computes 3-bytes hamming codes for a data block whose size is multiple of 256 bytes.

Each 256 bytes block gets its own code.

Parameters
[in]dataData to compute code for.
[in]sizeData size in bytes.
[out]codeCodes buffer.

◆ hamming_verify256x()

uint8_t hamming_verify256x ( uint8_t *  data,
uint32_t  size,
const uint8_t *  code 
)

Verifies 3-bytes hamming codes for a data block whose size is multiple of 256 bytes.

Each 256-bytes block is verified with its own code.

Returns
Hamming_ERROR_NONE if the data is correct, Hamming_ERROR_SINGLEBIT if one or more block(s) have had a single bit corrected, or either Hamming_ERROR_ECC or Hamming_ERROR_MULTIPLEBITS.
Parameters
[in]dataData buffer to verify.
[in]sizeSize of the data in bytes.
[in]codeOriginal codes.