2017-03-07 14:52:19 +00:00
|
|
|
#ifndef __TREZORHAL_FLASH_H__
|
|
|
|
#define __TREZORHAL_FLASH_H__
|
|
|
|
|
2017-06-20 17:53:24 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-03-07 14:52:19 +00:00
|
|
|
int flash_init(void);
|
|
|
|
|
2017-03-13 17:55:06 +00:00
|
|
|
void flash_set_option_bytes(void);
|
|
|
|
|
2017-06-20 15:32:21 +00:00
|
|
|
#define FLASH_SECTOR_BOARDLOADER_START 0
|
|
|
|
#define FLASH_SECTOR_BOARDLOADER_END 1
|
|
|
|
|
|
|
|
#define FLASH_SECTOR_STORAGE_START 2
|
|
|
|
#define FLASH_SECTOR_STORAGE_END 3
|
|
|
|
|
|
|
|
#define FLASH_SECTOR_BOOTLOADER_START 4
|
|
|
|
#define FLASH_SECTOR_BOOTLOADER_END 4
|
|
|
|
|
|
|
|
#define FLASH_SECTOR_FIRMWARE_START 5
|
|
|
|
#define FLASH_SECTOR_FIRMWARE_END 11
|
|
|
|
|
2017-06-20 17:53:24 +00:00
|
|
|
int flash_erase_sectors(int start, int end, void (*progress)(uint16_t val));
|
2017-06-20 15:32:21 +00:00
|
|
|
|
2017-03-07 14:52:19 +00:00
|
|
|
#endif
|