ConOpSys V2970  P004.07
ANVILEX control operating system
CRC_16_CCITT.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file CRC_16_CCITT.h
3 //! @brief Cyclic reduncancy check (CRC-16-CCITT) class header file.
4 //! @copyright (C) 2015-2020 ANVILEX LLC
5 //! @attention No special attention requered.
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Common/CRC_16_CCITT.h $
7 //! $Revision: 2796 $
8 //! $Date: 2021-07-12 02:57:34 +0500 (Mo, 12 Jul 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 //------------------------------------------------------------------------------
41 // Protecting header files from mutual, recursive inclusion.
42 //------------------------------------------------------------------------------
43 
44 #pragma once
45 
46 //------------------------------------------------------------------------------
47 // Include standard libraries header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include thrid party header files
52 //------------------------------------------------------------------------------
53 
54 //------------------------------------------------------------------------------
55 // Include ConOpSys header files
56 //------------------------------------------------------------------------------
57 
58 #include "CRC_16_Base.h"
59 
60 //------------------------------------------------------------------------------
61 // Include ConOpSys application header files
62 //------------------------------------------------------------------------------
63 
64 //------------------------------------------------------------------------------
65 // Global defines
66 //------------------------------------------------------------------------------
67 
68 //------------------------------------------------------------------------------
69 // Global macros
70 //------------------------------------------------------------------------------
71 
72 //------------------------------------------------------------------------------
73 // Class definitions
74 //------------------------------------------------------------------------------
75 
76 //! @brief Cyclic redundancy check (CRC-16-CCITT) class
78 {
79 
80  //----------------------------------------------------------------------------
81  // Public defines, methods and variables
82  //----------------------------------------------------------------------------
83 
84  public:
85 
86  //!-------------------------------------------------------------------------
87  //! @brief Get initial value of CRC
88  //! @note None
89  //! @return U16 - CRC initial value
90  //! \par Override
91  //! Not allowed
92  //! @attention None
93  //! @dotfile TCRC_16_CCITT__Init.dt
94  //--------------------------------------------------------------------------
95 
96  virtual U16 Init();
97 
98  //!-------------------------------------------------------------------------
99  //! @brief Update CRC with new data value
100  //! @note None
101  //! @param [in, out] &u16_CRC - Actual CRC value
102  //! @param [in] u8_Data - Data value
103  //! @return None
104  //! \par Override
105  //! Not allowed
106  //! @attention None
107  //! @dotfile TCRC_16_CCITT__Update.dt
108  //--------------------------------------------------------------------------
109 
110  virtual VOID Update( U16 &u16_CRC, U8 u8_Data );
111 
112  //----------------------------------------------------------------------------
113  // Protected defines, methods and variables
114  //----------------------------------------------------------------------------
115 
116  protected:
117 
118  //----------------------------------------------------------------------------
119  // Private defines, methods and variables
120  //----------------------------------------------------------------------------
121 
122  private:
123 
124 };
125 
126 //------------------------------------------------------------------------------
127 // End of file
128 //------------------------------------------------------------------------------
Cyclic reduncancy check (CRC-16) base class header file.
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
Cyclic redundancy check (CRC-16) base class.
Definition: CRC_16_Base.h:78
Cyclic redundancy check (CRC-16-CCITT) class.
Definition: CRC_16_CCITT.h:78
virtual VOID Update(U16 &u16_CRC, U8 u8_Data)
Update CRC with new data value.
Definition: CRC_16_CCITT.cpp:118
virtual U16 Init()
Get initial value of CRC.
Definition: CRC_16_CCITT.cpp:106