2009-04-29 14:47:41 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
Public platform independent Near Field Communication (NFC) library
|
|
|
|
Copyright (C) 2009, Roel Verdult
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
2009-06-26 11:05:25 +02:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
2009-04-29 14:47:41 +02:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2009-06-26 11:05:25 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
2009-04-29 14:47:41 +02:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-02-12 13:39:05 +01:00
|
|
|
#ifndef _LIBNFC_BITUTILS_H_
|
|
|
|
#define _LIBNFC_BITUTILS_H_
|
|
|
|
|
2009-05-27 12:13:19 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2009-07-16 14:09:06 +02:00
|
|
|
#include "types.h"
|
2009-02-12 13:39:05 +01:00
|
|
|
|
2009-07-16 14:09:06 +02:00
|
|
|
byte_t oddparity(const byte_t bt);
|
|
|
|
void oddparity_byte_ts(const byte_t* pbtData, const uint32_t uiLen, byte_t* pbtPar);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
2009-07-16 14:09:06 +02:00
|
|
|
byte_t mirror(byte_t bt);
|
2009-05-27 12:13:19 +02:00
|
|
|
uint32_t mirror32(uint32_t ui32Bits);
|
|
|
|
uint64_t mirror64(uint64_t ui64Bits);
|
2009-07-16 14:09:06 +02:00
|
|
|
void mirror_byte_ts(byte_t *pbts, uint32_t uiLen);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
2009-09-04 10:37:03 +02:00
|
|
|
LIBNFC_EXPORT uint32_t swap_endian32(const void* pui32);
|
2009-09-08 10:17:37 +02:00
|
|
|
LIBNFC_EXPORT uint64_t swap_endian64(const void* pui64);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
2009-09-08 10:17:37 +02:00
|
|
|
LIBNFC_EXPORT void append_iso14443a_crc(byte_t* pbtData, uint32_t uiLen);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
2009-09-04 10:37:03 +02:00
|
|
|
LIBNFC_EXPORT void print_hex(const byte_t* pbtData, const uint32_t uiLen);
|
2009-09-08 10:17:37 +02:00
|
|
|
LIBNFC_EXPORT void print_hex_bits(const byte_t* pbtData, const uint32_t uiBits);
|
|
|
|
LIBNFC_EXPORT void print_hex_par(const byte_t* pbtData, const uint32_t uiBits, const byte_t* pbtDataPar);
|
2009-02-12 13:39:05 +01:00
|
|
|
|
|
|
|
#endif // _LIBNFC_BITUTILS_H_
|
|
|
|
|