/*
 * storage_handle.h
 *
 *  Created on: 29-Jul-2022
 *      Author: Invcuser52
 */

#ifndef CODEFLASH_HANDLE_H_
#define CODEFLASH_HANDLE_H_


#include <stdio.h>
#include <stdlib.h>
#include "storage_mem_def.h"

typedef struct codeflash_api_list
{
	uint8_t* (*codeflash_falloc_fp)(uint32_t req_size, uint8_t module_id,e_sector_usage_mode mode);
	void 	 (*codeflash_init_fp)(uint8_t flash_erase);
	void 	 (*codeflash_info_copyfromn_nvm_fp)(void);
	void 	 (*codeflash_info_storeto_nvm_fp)(void);
	void 	 (*codeflash_clean_unused_sector_fp)(void);
	void 	 (*codeflash_usage_update_fp)(uint8_t sector);
	uint8_t  (*codeflash_get_sector_id_fp)(uint32_t address);
	void 	 (*codeflash_info_copyto_databank_fp)(void);
}s_codeflash_api_list;


#define codeflash_falloc 						codeflash_api->codeflash_falloc_fp
#define codeflash_init 							codeflash_api->codeflash_init_fp
#define codeflash_info_copyfromn_nvm 			codeflash_api->codeflash_info_copyfromn_nvm_fp
#define codeflash_info_storeto_nvm 				codeflash_api->codeflash_info_storeto_nvm_fp
#define codeflash_clean_unused_sector 			codeflash_api->codeflash_clean_unused_sector_fp
#define codeflash_usage_update 					codeflash_api->codeflash_usage_update_fp
#define codeflash_get_sector_id 				codeflash_api->codeflash_get_sector_id_fp
#define codeflash_info_copyto_databank 			codeflash_api->codeflash_info_copyto_databank_fp


#endif /* CODEFLASH_HANDLE_H_ */
