summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/PersistDataServer/include/private/pdsCrcService.h
blob: cf00f9f4c8844c515b5c07f6ba40ba3051f2b2ce (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************//**
  \file pdsCrcService.h

  \brief The header file describes the interface of crc counting

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
  History:
    22/01/08 A. Khromykh - Created
    01/11/10 A. Razinkov - Modified
*****************************************************************************/

#ifndef _PDSCRCSERVICE_H
#define _PDSCRCSERVICE_H

/******************************************************************************
                   Includes section
******************************************************************************/
#include <pdsDataServer.h>
#include <pdsAuxService.h>

#ifdef _COMMISSIONING_
/******************************************************************************
                   Prototypes section
******************************************************************************/
/******************************************************************************
\brief Calculate CRC of persistent data stored in persist memory
\
\param[out] crcStation - pointer to CRC service structure
******************************************************************************/
void pdsCalculateCrc(PDS_ServiceCrc_t *crcStation);

/******************************************************************************
\brief Read CRC of stored data from persist memory
\
\param[out] crcStation - pointer to CRC service structure
******************************************************************************/
void pdsReadCrc(PDS_ServiceCrc_t *crcStation);

/******************************************************************************
\brief Write CRC of stored data to persist memory. The ring buffer used
\      to increase persist memory life cycle
\
\param[out] crcStation - pointer to CRC service structure
******************************************************************************/
PDS_DataServerState_t pdsWriteCrc(void);

/******************************************************************************
\brief Clears whole CRC area in persist memory
\
\return operation result
******************************************************************************/
PDS_DataServerState_t pdsClearCrcArea(void);

/******************************************************************************
\brief Check if any valid data exists in persist memory
\
\return operation result
******************************************************************************/
PDS_DataServerState_t pdsCheckPersistMemory(void);

#ifdef __DBG_PDS__
  void pdsDbgReadAllEeprom(void);
#endif

#endif /* _COMMISSIONING_ */
#endif /*_PDSCRCSERVICE_H*/