1 /***************************************************************************
2 * Hamming Encoding and Decoding Headers
5 * Purpose : Header for Hamming encode and decode routines. Contains the
6 * prototypes to be used by programs linking to the Hamming
8 * Author : Michael Dipperstein
9 * Date : December 29, 2004
11 ****************************************************************************
14 * $Id: hamming.h,v 1.2 2007/09/19 13:08:15 michael Exp $
16 * Revision 1.2 2007/09/19 13:08:15 michael
17 * Licensed under LGPL V3.
19 * Revision 1.1.1.1 2005/01/02 05:06:45 michael
23 ****************************************************************************
25 * Hamming: A collection of ANSI C Hamming Encoding/Decoding routines
26 * Copyright (C) 2004, 2007 by Michael Dipperstein (mdipperstein@gmail.com)
28 * This file is part of the Hamming library.
30 * The Hamming library is free software; you can redistribute it and/or
31 * modify it under the terms of the GNU Lesser General Public License as
32 * published by the Free Software Foundation; either version 3 of the
33 * License, or (at your option) any later version.
35 * The Hamming library is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
38 * General Public License for more details.
40 * You should have received a copy of the GNU Lesser General Public License
41 * along with this program. If not, see <http://www.gnu.org/licenses/>.
43 ***************************************************************************/
46 /***************************************************************************
48 ***************************************************************************/
51 /***************************************************************************
53 ***************************************************************************/
54 /* number of uncoded data bits and data values */
56 #define DATA_VALUES (1 << DATA_BITS)
58 /* number of parity bits and data values */
60 #define PARITY_VALUES (1 << PARITY_BITS)
62 /* number of code bits (data + parity) and data values */
63 #define CODE_BITS (DATA_BITS + PARITY_BITS)
64 #define CODE_VALUES (1 << CODE_BITS)
66 /***************************************************************************
68 ***************************************************************************/
69 uint8_t HammingTableEncode(uint8_t data
);
70 uint8_t HammingTableDecode(uint8_t code
);