1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-11 10:29:01 +00:00
trezor-firmware/embed/extmod/modtrezorconfig/norcow.h
Jochen Hoenicke 497021f2ef storage: New pin fail section inside NORCOW
Added a function to update NORCOW data.
Changed storage pin fail logic.
2017-12-14 17:18:45 +01:00

41 lines
772 B
C

#ifndef __NORCOW_H__
#define __NORCOW_H__
#include <stdint.h>
#include "../../trezorhal/secbool.h"
/*
* Storage parameters:
*/
#define NORCOW_SECTOR_COUNT 2
#define NORCOW_SECTOR_SIZE (64*1024)
/*
* Initialize storage
*/
void norcow_init(void);
/*
* Wipe the storage
*/
void norcow_wipe(void);
/*
* Looks for the given key, returns status of the operation
*/
secbool norcow_get(uint16_t key, const void **val, uint16_t *len);
/*
* Sets the given key, returns status of the operation
*/
secbool norcow_set(uint16_t key, const void *val, uint16_t len);
/*
* Update a word in flash in the given key at the given offset.
* Note that you can only change bits from 1 to 0.
*/
secbool norcow_update(uint16_t key, uint16_t offset, uint32_t value);
#endif