Contiki 2.5
nvm-def.h
Go to the documentation of this file.
1 /** @file hal/micro/cortexm3/nvm-def.h
2  * @brief Data definitions for the Cortex-M3 Non-Volatile Memory data storage
3  * system.
4  * See @ref nvm for documentation.
5  *
6  * See hal/micro/cortexm3/nvm-def.h for source code.
7  *
8  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
9  */
10 
11 /** @addtogroup nvm
12  * @brief Data definitions for the Cortex-M3 Non-Volatile Memory data storage
13  * system.
14  *
15  * This header defines all of the data sets in the NVM data storage. Each
16  * piece of data in NVM storage uses an offset to indicate where the data
17  * lives and a size to indicate the size of that data. Both the offset
18  * and size are defined in bytes and must be a mupltiple of 16bits. The
19  * offset is from the start of an NVM page, defined by NVM_LEFT_PAGE and
20  * NVM_RIGHT_PAGE. The offset and size must be below the maximum size
21  * of NVM storage as defined by NVM_DATA_SIZE_B. All NVM data must start
22  * above NVM_MGMT_SIZE_B, since this is where the management bytes live.
23  *
24  * @note This file is not directly used by the nvm.c or nvm.h files. This
25  * file is intended to be a convenient place to define all data that
26  * lives in NVM so it can be seen together in one group. nvm.h includes
27  * this file which means any code that includes nvm.h to call the read
28  * and write functions also has access to these defines.
29  *@{
30  */
31 
32 #ifndef __NVM_DEF_H__
33 #define __NVM_DEF_H__
34 
35 //The bottom 64 bytes of NVM storage is allocated to radio calibration
36 //values. These 64 bytes *must* exist for the radio to function.
37 #define NVM_RADIO_CAL_OFFSET (NVM_MGMT_SIZE_B+0x0000)
38 #define NVM_RADIO_CAL_SIZE_B 64
39 
40 //IMPORTANT: Data storage starts at offset 0x0040.
41 
42 //Three example pieces of data:
43 #define NVM_FOO_OFFSET (NVM_MGMT_SIZE_B+0x0040)
44 #define NVM_FOO_SIZE_B 2
45 #define NVM_HAM_OFFSET (NVM_MGMT_SIZE_B+0x0042)
46 #define NVM_HAM_SIZE_B 10
47 #define NVM_SPAM_OFFSET (NVM_MGMT_SIZE_B+0x004C)
48 #define NVM_SPAM_SIZE_B 20
49 
50 /** @} END addtogroup */
51 
52 #endif // __NVM_DEF_H__
53