#ifndef __BSP_FLASH_H__
#define __BSP_FLASH_H__

//flash 1.0V

/*********************************************************************
 * INCLUDES
 */
 
#include "nrf_fstorage.h"
#include "nrf_fstorage_sd.h"
#include "nrf_pwr_mgmt.h"
#include "nrf_soc.h"
#include "nrf_log.h"
#include "app_error.h"
#include "SEGGER_RTT.h"

#define FLASH_PAGE_SIZE											4096	
#define PAGE_INT_SIZE												(FLASH_PAGE_SIZE/4)		//一页所包含的4字节个数
#define START_FSTORAGE_ADDR									0x00073000UL		//FLASH起始地址
#define END_FSTORAGE_ADDR										0x00078000UL		//FLASH结束地址

//ERROR CODE
		
typedef enum{
	FLASH_OP_SUCCESS =0,      //ZONE操作成功
	FLASH_ERROR_READ_FAIL,    //读取该区域失败
	FLASH_ERROR_WRITE_FAIL,   //写入该区域失败
	FLASH_ERROR_ERASE_FAIL,   //擦除该区域失败
	FLASH_ERROR_ADDRESS_FAIL, //输入地址越界
}flash_OPER_Result;


flash_OPER_Result sdflash_write(uint32_t *p_dst, uint32_t const *p_src, uint32_t sizewords);
flash_OPER_Result sdflash_page_erase(uint32_t page_addr);

#endif


