1 #include "aos/hal/flash.h"
2 #include "xz_hal_plat.h"
3
xz_flash_erase(hal_partition_t flash_partition,unsigned int offset,unsigned int len)4 int xz_flash_erase(hal_partition_t flash_partition, unsigned int offset, unsigned int len)
5 {
6 int ret = 0;
7 ret = hal_flash_erase(flash_partition, offset, len);
8 return ret;
9 }
10
xz_flash_read_data(hal_partition_t flash_partition,unsigned int offset,unsigned char * buffer,unsigned int len)11 int xz_flash_read_data(hal_partition_t flash_partition, unsigned int offset, unsigned char *buffer, unsigned int len)
12 {
13 int ret = 0;
14 unsigned int tmp_offset = offset;
15 ret = hal_flash_read(flash_partition, &tmp_offset, buffer, len);
16 return ret;
17 }
18
xz_flash_write_data(hal_partition_t flash_partition,unsigned int offset,unsigned char * buffer,unsigned int len)19 int xz_flash_write_data(hal_partition_t flash_partition, unsigned int offset, unsigned char *buffer, unsigned int len)
20 {
21 int ret = 0;
22 unsigned int tmp_offset = offset;
23 ret = hal_flash_write(flash_partition, &tmp_offset, buffer, len);
24 return ret;
25 }