#include "flash_driver.h"
/**
***********************************************************************
* @brief:      flash_erase_page(uint8_t page)
* @param:		   pageflashҳ
* @retval:     i 0ʧ 1ɹ
* @details:    ҳҳ
***********************************************************************
**/
uint8_t flash_erase_page(uint32_t page)
{
	uint8_t i;
	i = flash_bsp_erase_page(page);
	return i;
}
/**
***********************************************************************
* @brief:      flash_erase_pages(uint32_t start_addr, uint32_t end_addr)
* @param:		   start_addrflash׵ַ
* @param:		   end_addrflashβַ
* @retval:     i 0ʧ 1ɹ
* @details:    ҳַҳ
***********************************************************************
**/
uint8_t flash_erase_pages(uint32_t start_add, uint32_t end_add)
{
	uint8_t i;
	i = flash_bsp_erase_pages(start_add, end_add);
	return i;
}
/**
***********************************************************************
* @brief:      flash_write_data(uint32_t addr, void *data, uint32_t size)
* @param:		   addrflash ַ
* @param:		   dataд
* @param:		   sizeдݵֽ
* @retval:     void
* @details:    flashд
***********************************************************************
**/
void flash_write_data(uint32_t addr, void *data, uint32_t size)
{
	flash_bsp_write_data(addr, data, size);
}
/**
***********************************************************************
* @brief:      flash_read_data(uint32_t addr, void *data, uint32_t size)
* @param:		   addrflash ַ
* @param:		   dataȡ
* @param:		   sizeȡֽ
* @retval:     void
* @details:    flashжȡ
***********************************************************************
**/
void flash_read_data(uint32_t addr, uint32_t *data, uint32_t size)
{
	memcpy(data, (uint32_t *)addr, size);
}
