File: crc16.h

package info (click to toggle)
avrdude 5.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,284 kB
  • ctags: 1,520
  • sloc: ansic: 15,167; sh: 3,437; yacc: 1,051; lex: 240; makefile: 158
file content (25 lines) | stat: -rw-r--r-- 683 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef CRC16_H
#define CRC16_H
/*
 * Derived from CRC algorithm for JTAG ICE mkII, published in Atmel
 * Appnote AVR067.  Converted from C++ to C.
 */

extern unsigned short crcsum(const unsigned char* message,
			     unsigned long length,
			     unsigned short crc);
/*
 * Verify that the last two bytes is a (LSB first) valid CRC of the
 * message.
 */
extern int crcverify(const unsigned char* message,
		     unsigned long length);
/*
 * Append a two byte CRC (LSB first) to message.  length is size of
 * message excluding crc.  Space for the CRC bytes must be allocated
 * in advance!
 */
extern void crcappend(unsigned char* message,
		      unsigned long length);

#endif