unv.h revision f8a4ca325ef137a94869b34d36095ba7d08816a3
1/*******************************************************************************
2**  Name:       unv.h
3**
4**  Description:
5**
6**  This file contains NV definitions from WIDCOMM's Universal Embedded
7**  Drivers API.
8**
9**  Copyright (c) 2002-2004, WIDCOMM Inc., All Rights Reserved.
10**  WIDCOMM Bluetooth Core. Proprietary and confidential.
11*******************************************************************************/
12
13#ifndef UNV_H
14#define UNV_H
15
16#include "data_types.h"
17
18/*******************************************************************************
19** NV APIs
20*******************************************************************************/
21
22/**** Storage preferences ****/
23#define UNV_BLOCK         1
24#define UNV_BYTE          2
25#define UNV_NOPREF        3
26
27typedef UINT8 tUNV_STORAGE_PREF;
28
29/**** Status ****/
30#define UNV_REINIT      (-1)
31#define UNV_WRITELOCKED (-2)
32#define UNV_ERROR       (-3)
33
34typedef INT16 tUNV_STATUS;
35
36/* Prototype for function to restore defaults to a block */
37typedef void  (tUNV_DEFAULT_FUNC)(void);
38
39/*******************************************************************************
40** Function Prototypes
41*******************************************************************************/
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#ifndef UDRV_API
48#define UDRV_API
49#endif
50
51UDRV_API extern void        UNV_Init(void *);
52UDRV_API extern BOOLEAN     UNV_MapBlock(UINT16, tUNV_STORAGE_PREF, UINT16,
53                                         UINT16, UINT16 *, void *);
54UDRV_API extern BOOLEAN     UNV_ReadMap(UINT16, tUNV_STORAGE_PREF *, UINT16 *,
55                                        UINT16 *, UINT16 *);
56UDRV_API extern BOOLEAN     UNV_EraseBlock(UINT16);
57UDRV_API extern void        UNV_Default(UINT16);
58UDRV_API extern tUNV_STATUS UNV_Read(UINT16, UINT16, UINT16, UINT16, void *);
59UDRV_API extern tUNV_STATUS UNV_Write(UINT16, UINT16, UINT16, UINT16, void *);
60UDRV_API extern tUNV_STATUS UNV_ReadBlock(UINT16, UINT16, void *);
61UDRV_API extern tUNV_STATUS UNV_WriteBlock(UINT16, void *);
62UDRV_API extern UINT32      UNV_BytesRemaining(void);
63UDRV_API extern void        UNV_Consolidate(void);
64UDRV_API extern tUNV_STATUS UNV_ReadPtr(UINT16, UINT16, UINT8 **);
65UDRV_API extern tUNV_STATUS UNV_FreePtr(UINT16, UINT16);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* UNV_H */
72