summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/PersistDataServer/include/private/pdsWriteData.h
blob: 17cedbc45770508d058202bd6d24b82053211a29 (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
74
75
76
77
78
79
80
81
82
83
84
/******************************************************************************
  \file csDbg.h

  \brief
    Persistent Periodic data save implementation header

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

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

  \internal
    History:
    29.10.10 A. Razinkov - Created.
******************************************************************************/

#ifndef _PDSWRITEDATA_H_
#define _PDSWRITEDATA_H_

/******************************************************************************
                    Includes section
******************************************************************************/
#include <pdsMemAbstract.h>

#ifdef _COMMISSIONING_
/******************************************************************************
                    Functions prototypes section
******************************************************************************/
/******************************************************************************
\brief Update persistent items values in Configuration Server from persist memory
\
\return Operation result
******************************************************************************/
PDS_DataServerState_t pdsUpdate(void);

/******************************************************************************
\brief Locates parameter by it's index in persistent memory table. And prepares
\      memory descriptor to store parameter's value in EEPROM
\
\param[in] index - index of the parameter in persistent memory table
\param[out]descriptor - memory descriptor to store parameter value
******************************************************************************/
void pdsPrepareMemoryAccess(uint8_t index, MEMORY_DESCRIPTOR* descriptor);

/******************************************************************************
\brief Timer callback, initiates the commit process.
******************************************************************************/
void pdsOnTimerSave(void);

/*******************************************************************************
\brief Start server work
*******************************************************************************/
void pdsStartPersistServer(void);
#endif /* _COMMISSIONING_ */

/******************************************************************************
\brief Writes data to persist memory
\
\param[in] descriptor - memory descriptor to store parameter value
\param[out]callback - callback to write-finidhed event handler
******************************************************************************/
PDS_DataServerState_t pdsWrite(MEMORY_DESCRIPTOR* descriptor, void (*callback)(void));

/******************************************************************************
\brief Read data from persist memory
\
\param[in] descriptor - memory descriptor to read parameter value
\param[out]callback - callback to read-finished event handler
******************************************************************************/
PDS_DataServerState_t pdsRead(MEMORY_DESCRIPTOR* descriptor, void (*callback)(void));

/******************************************************************************
\brief Wait until memory be ready for transaction
******************************************************************************/
void pdsWaitMemoryFree(void);

/*******************************************************************************
\brief Dummy callback
*******************************************************************************/
void pdsDummyCallback(void);

#endif /* _PDSWRITEDATA_H_ */