OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librlink/] [RlinkCrc16.ipp] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 wfjm
// $Id: RlinkCrc16.ipp 602 2014-11-08 21:42:47Z mueller $
2
//
3
// Copyright 2014- by Walter F.J. Mueller 
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
//
14
// Revision History:
15
// Date         Rev Version  Comment
16
// 2014-11-08   602   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
/*!
20
  \file
21
  \version $Id: RlinkCrc16.ipp 602 2014-11-08 21:42:47Z mueller $
22
  \brief   Implemenation (inline) of class RlinkCrc16.
23
*/
24
 
25
// all method definitions in namespace Retro
26
namespace Retro {
27
 
28
//------------------------------------------+-----------------------------------
29
//! Default constructor
30
 
31
inline RlinkCrc16::RlinkCrc16()
32
  : fCrc(0)
33
{}
34
 
35
//------------------------------------------+-----------------------------------
36
//! Destructor
37
 
38
inline RlinkCrc16::~RlinkCrc16()
39
{}
40
 
41
//------------------------------------------+-----------------------------------
42
//! FIXME_docs
43
 
44
inline void RlinkCrc16::Clear()
45
{
46
  fCrc = 0;
47
  return;
48
}
49
 
50
//------------------------------------------+-----------------------------------
51
//! FIXME_docs
52
 
53
inline void RlinkCrc16::AddData(uint8_t data)
54
{
55
  uint8_t tmp = ((uint8_t)(fCrc>>8)) ^ data;
56
  fCrc = (fCrc<<8) ^ fCrc16Table[tmp];
57
  return;
58
}
59
 
60
//------------------------------------------+-----------------------------------
61
//! FIXME_docs
62
 
63
inline uint16_t RlinkCrc16::Crc() const
64
{
65
  return fCrc;
66
}
67
 
68
} // end namespace Retro

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.