nvm.h File Reference

NVM API definition. More...

#include <stdint.h>
#include <stdbool.h>
#include "em_device.h"
#include "nvm_hal.h"
#include "ecode.h"
#include "em_msc.h"
#include "em_dma.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "em_int.h"
#include "nvm_config.h"
Include dependency graph for nvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ECODE_EMDRV_NVM_OK   ( ECODE_OK )
 Return/error codes.
#define ECODE_EMDRV_NVM_ADDR_INVALID   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000001 )
 Invalid address.
#define ECODE_EMDRV_NVM_ALIGNMENT_INVALID   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000002 )
 Invalid data alignment.
#define ECODE_EMDRV_NVM_DATA_INVALID   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000003 )
 Invalid input data or format.
#define ECODE_EMDRV_NVM_WRITE_LOCK   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000004 )
 A write is currently in progress.
#define ECODE_EMDRV_NVM_NO_PAGES_AVAILABLE   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000005 )
 Initialization didn't find any pages available to allocate.
#define ECODE_EMDRV_NVM_PAGE_INVALID   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000006 )
 Could not find the page specified.
#define ECODE_EMDRV_NVM_ERROR   ( ECODE_EMDRV_SPIDRV_BASE | 0x00000007 )
 General error.
#define NVM_WRITE_ALL_CMD   0xff
 All objects are written from RAM.
#define NVM_WRITE_NONE_CMD   0xfe
 All objects are copied from the old page.
#define NVM_READ_ALL_CMD   0xff
 All objects are read to RAM.
#define NVM_ERASE_RETAINCOUNT   0xffffffffUL
 Retains the registered erase count when eraseing a page.
#define NVM_PAGE_TERMINATION   { NULL, 0, (NVM_Object_Ids) 0 }
 Structure defining end of pages table.

Functions

Ecode_t NVM_Init (NVM_Config_t const *nvmConfig)
 Initialize the NVM manager.
Ecode_t NVM_Erase (uint32_t erasureCount)
 Erase the entire allocated NVM area.
Ecode_t NVM_Write (uint16_t pageId, uint8_t objectId)
 Write an object or a page.
Ecode_t NVM_Read (uint16_t pageId, uint8_t objectId)
 Read an object or an entire page.
uint32_t NVM_WearLevelGet (void)
 Get maximum wear level.

Detailed Description

NVM API definition.

License

(C) Copyright 2014 Silicon Labs, http://www.silabs.com

This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file nvm.h.