2017-03-30 18:50:50 +00:00
|
|
|
#ifndef __NORCOW_H__
|
|
|
|
#define __NORCOW_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Storage parameters:
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NORCOW_SECTOR_COUNT 2
|
|
|
|
#define NORCOW_SECTOR_SIZE (16*1024)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize storage
|
|
|
|
*/
|
|
|
|
bool norcow_init(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Wipe the storage
|
|
|
|
*/
|
|
|
|
bool norcow_wipe(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Looks for the given key, returns status of the operation
|
|
|
|
*/
|
2017-03-30 19:40:36 +00:00
|
|
|
bool norcow_get(uint16_t key, const void **val, uint16_t *len);
|
2017-03-30 18:50:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Sets the given key, returns status of the operation
|
|
|
|
*/
|
2017-03-30 19:40:36 +00:00
|
|
|
bool norcow_set(uint16_t key, const void *val, uint16_t len);
|
2017-03-30 18:50:50 +00:00
|
|
|
|
|
|
|
#endif
|