/******************************************************************************/
/* Williams Advanced Engineering Limited                     Copyright(C) 2021*/
/* Grove                                                  All rights reserved */
/*                                                                            */
/******************************************************************************/


#ifndef MAINSOURCES_INCLUDE_IOS_EXTFLASHNVM_H_
#define MAINSOURCES_INCLUDE_IOS_EXTFLASHNVM_H_

#include "Std_Types.h"

typedef enum
{
    ExtFlsJobReqNone = 0,
    ExtFlsJobReqEraseNvM
} ExtFlashJobType;

typedef enum
{
    ExtFlsJobStdby = 0,
    ExtFlsJobCompleteOK ,
    ExtFlsJobInit,
    ExtFlsJobEraseSectorRequest,
    ExtFlsJobCheckEraseRslt,
    ExtFlsJobReInitMemoryStack,
    ExtFlsJobFailed
} ExtFlashJobStatusType;


typedef struct
{
    ExtFlashJobType       CurrentExtFlashJobReq;
    ExtFlashJobStatusType CurrentExtFlashJobStatus;

} ExtFlashMngrStatusType;

#define NUM_MAX_REFUSED_ERASE_REQUESTS 5



/*------------------------------------------------------------*/
/*          Functions prototypes definition                   */
/*------------------------------------------------------------*/
/* Public */
//extern void fnIosTestFlashJobs(const uint8* bDataToProgram, uint32 ulDataToProgramLengthBytes);
extern void fnIosExtFlsJobRqstManager(void);
extern void fnIosExtFlsJobSetRqst(ExtFlashJobType FlashJobReq);
extern ExtFlashJobStatusType fnIosExtFlsJobGetCurrentJobStatus(void);
extern void fnIosExtFlsJobResetCurrentJobStatus(void);
extern ExtFlashJobType fnIosExtFlsJobGetRqst(void);


#endif /* MAINSOURCES_INCLUDE_IOS_EXTFLASHNVM_H_ */
