1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 #ifndef XZ_HAL_PLAT_H
5 #define XZ_HAL_PLAT_H
6 #include <stddef.h>
7 #include <stdint.h>
8 #include <stdbool.h>
9 #include "aos/hal/flash.h"
10 
11 #define SECTOR_SIZE 0x1000    /* flash sector size */
12 #ifndef XZ_BUF_SIZE
13 #define XZ_BUF_SIZE 2048
14 #endif
15 
16 /* flash APIs */
17 int xz_flash_erase(hal_partition_t flash_partition, unsigned int offset, unsigned int len);
18 int xz_flash_read_data(hal_partition_t flash_partition, unsigned int offset, unsigned char *buf, unsigned int len);
19 int xz_flash_write_data(hal_partition_t flash_partition, unsigned int offset, unsigned char *buf, unsigned int len);
20 
21 #endif /*XZ_HAL_PLAT_H */
22