Hamming ECC software implementation.
This file contains a software Hamming ECC implementation.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
Macros | |
#define | HAMMING_ERROR_ECC 2 |
#define | HAMMING_ERROR_MULTIPLE_BITS 3 |
#define | HAMMING_ERROR_SINGLE_BIT 1 |
These are the possible errors when trying to verify a block of data encoded using a Hamming code: More... | |
Functions | |
void | hamming_compute_256x (const uint8_t *puc_data, uint32_t dw_size, uint8_t *puc_code) |
Computes 3-bytes hamming codes for a data block whose size is multiple of 256 bytes. More... | |
uint32_t | hamming_verify_256x (uint8_t *puc_data, uint32_t dw_size, const uint8_t *puc_code) |
Verify 3-bytes hamming codes for a data block whose size is multiple of 256 bytes. More... | |
#define HAMMING_ERROR_ECC 2 |
Referenced by verify256().
#define HAMMING_ERROR_MULTIPLE_BITS 3 |
Referenced by verify256().
#define HAMMING_ERROR_SINGLE_BIT 1 |
These are the possible errors when trying to verify a block of data encoded using a Hamming code:
Referenced by hamming_verify_256x(), and verify256().
void hamming_compute_256x | ( | const uint8_t * | puc_data, |
uint32_t | dw_size, | ||
uint8_t * | puc_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.
puc_data | Pointer to data to compute code for. |
dw_size | Data size in bytes. |
puc_code | Pointer to codes buffer. |
References compute256().
uint32_t hamming_verify_256x | ( | uint8_t * | puc_data, |
uint32_t | dw_size, | ||
const uint8_t * | puc_code | ||
) |
Verify 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.
puc_data | Pointer to data buffer to verify. |
dw_size | Size of the data in bytes. |
puc_code | Pointer to original codes. |
References HAMMING_ERROR_SINGLE_BIT, and verify256().