/*********************************************************************************************************************
*
* Description:     DataM module configuration interface
* FileName:        FBL_DataMCfg.h
* Company:         ETAS GmbH (www.etas.com)
* Generated        28/12/2018 at 11:22
*
**********************************************************************************************************************
*
* COPYRIGHT RESERVED, Copyright ETAS GmbH 2018. All rights reserved, also regarding any disposal,
* exploitation, reproduction, editing, distribution, as well as in the event of applications
* for industrial property rights.
*
**********************************************************************************************************************
* History:
**********************************************************************************************************************
* Author        Date            Comment
**********************************************************************************************************************
BGA1YOK         25/10/2017      First Version    
**********************************************************************************************************************/

#ifndef  FBL_DATAMCFG_H
#define  FBL_DATAMCFG_H

/*********************************************************************************************************************
* Includes
*********************************************************************************************************************/
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_OFF
#endif
#include "Std_Types.h"
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_ON
#endif
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_OFF
#endif
#include "NvM.h"
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_ON
#endif
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_OFF
#endif
#include "Dcm.h"
#ifdef __PQRA_QAC__
#pragma PRQA_MESSAGES_ON
#endif

/*********************************************************************************************************************
* Exported Defines
*********************************************************************************************************************/
/***** Defines for configured NvM Data *****/
/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 1] */
/* Defines for NvM Data ReprogrammingRequestFlag */
#define FBL_DATAM_NVM_DATA_REPROGRAMMINGREQUESTFLAG_SIZE            (4U)
/* Defines for NvM Data ApplicationValidFlag */
#define FBL_DATAM_NVM_DATA_APPLICATIONVALIDFLAG_SIZE                (4U)
/* Defines for NvM Data FREERUNNINGCNTR */
#define FBL_DATAM_NVM_DATA_FREERUNNINGCNTR_SIZE                     (8U)
/* Defines for NvM Data ProgramConditions */
#define FBL_DATAM_NVM_DATA_PROGRAMCONDITIONS_SIZE                   (31U)
/* Defines for NvM Data SECRETKEY */
#define FBL_DATAM_NVM_DATA_SECRETKEY_SIZE                           (16U)
/* Defines for NvM Data SECRETKEYUPDATECOUNTER */
#define FBL_DATAM_NVM_DATA_SECRETKEYUPDATECOUNTER_SIZE              (4U)
/* Defines for NvM Data APPLICATIONUPDATECOUNTER */
#define FBL_DATAM_NVM_DATA_APPLICATIONUPDATECOUNTER_SIZE            (4U)
/* Defines for NvM Data ALIBRATIONUPDATECOUNTER */
#define FBL_DATAM_NVM_DATA_CALIBRATIONUPDATECOUNTER_SIZE            (4U)
/* Defines for NvM Data HARDWAREPARTNUMBER */
#define FBL_DATAM_NVM_DATA_HARDWAREPARTNUMBER_SIZE                  (32U)
/* Defines for NvM Data HARDWARESERIALNUMBERg */
#define FBL_DATAM_NVM_DATA_HARDWARESERIALNUMBER_SIZE                (32U)
/* Defines for NvM Data COMPONENTID */
#define FBL_DATAM_NVM_DATA_COMPONENTID_SIZE                         (2U)
/* Defines for NvM Data HARDWAREID */
#define FBL_DATAM_NVM_DATA_HARDWAREID_SIZE                          (1U)
/* Defines for NvM Data APPLICATIONUPDATERFINGERPRINT */
#define FBL_DATAM_NVM_DATA_APPLICATIONUPDATERFINGERPRINT_SIZE       (16U)
/* Defines for NvM Data CALIBRATIONUPDATERFINGERPRINTg */
#define FBL_DATAM_NVM_DATA_CALIBRATIONUPDATERFINGERPRINT_SIZE       (16U)
/* Defines for NvM Data APPLICATIONUPDATETIMESTAMP */
#define FBL_DATAM_NVM_DATA_APPLICATIONUPDATETIMESTAMP_SIZE          (14U)
/* Defines for NvM Data CALIBRATIONUPDATETIMESTAMP */
#define FBL_DATAM_NVM_DATA_CALIBRATIONUPDATETIMESTAMP_SIZE          (14U)
/* Defines for NvM Data HARDWAREMANUFACTURINGDATE */
#define FBL_DATAM_NVM_DATA_HARDWAREMANUFACTURINGDATE_SIZE           (8U)

/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 64] */
#define FBL_DATAM_OPERATION_PENDING_TIMEOUT                         (150000UL)
/*********************************************************************************************************************
* Exported Macros
*********************************************************************************************************************/

/*********************************************************************************************************************
* Exported Types
*********************************************************************************************************************/

/*********************************************************************************************************************
* Exported Variables
*********************************************************************************************************************/

/*********************************************************************************************************************
* Exported Functions
*********************************************************************************************************************/
/* Read_xxx for data stored in NvM */
/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 29] */
extern Std_ReturnType Fbl_DataM_NvmReprogrammingRequestFlagReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationValidFlagReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmFreeRunningCntrReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmProgramConditionsReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyUpdateCounterReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateCounterReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateCounterReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwarePartNumberReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareSerialNumberReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCompnentIDReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareIDReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdaterFingerprintReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdaterFingerprintReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateTimestampReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateTimestampReadFunc (uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareManufacturingDateReadFunc (uint8 * data);
/* Write_xxx for data stored in NvM */
/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 30] */
extern Std_ReturnType Fbl_DataM_NvmReprogrammingRequestFlagWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationValidFlagWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmFreeRunningCntrWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmProgramConditionsWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyUpdateCounterWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateCounterWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateCounterWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwarePartNumberWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareSerialNumberWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCompnentIDWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareIDWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdaterFingerprintWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdaterFingerprintWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateTimestampWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateTimestampWriteFunc (const uint8 * data);
extern Std_ReturnType Fbl_DataM_NvmHardwareManufacturingDateWriteFunc (const uint8 * data);
/* Check if nvm data has been persisted*/
/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 62] */
extern boolean Fbl_DataM_NvmReprogrammingRequestFlagIsPersisted (void);
extern boolean Fbl_DataM_NvmApplicationValidFlagIsPersisted (void);
extern boolean Fbl_DataM_NvmFreeRunningCntrIsPersisted (void);
extern boolean Fbl_DataM_NvmProgramConditionsIsPersisted (void);
extern boolean Fbl_DataM_NvmSecretKeyIsPersisted (void);
extern boolean Fbl_DataM_NvmSecretKeyUpdateCounterIsPersisted (void);
extern boolean Fbl_DataM_NvmApplicationUpdateCounterIsPersisted (void);
extern boolean Fbl_DataM_NvmCalibrationUpdateCounterIsPersisted (void);
extern boolean Fbl_DataM_NvmHardwarePartNumberIsPersisted (void);
extern boolean Fbl_DataM_NvmHardwareSerialNumberIsPersisted (void);
extern boolean Fbl_DataM_NvmCompnentIDIsPersisted (void);
extern boolean Fbl_DataM_NvmHardwareIDIsPersisted (void);
extern boolean Fbl_DataM_NvmApplicationUpdaterFingerprintIsPersisted (void);
extern boolean Fbl_DataM_NvmCalibrationUpdaterFingerprintIsPersisted (void);
extern boolean Fbl_DataM_NvmApplicationUpdateTimestampIsPersisted (void);
extern boolean Fbl_DataM_NvmCalibrationUpdateTimestampIsPersisted (void);
extern boolean Fbl_DataM_NvmHardwareManufacturingDateIsPersisted (void);
extern boolean Fbl_DataM_NvmAllBlocksArePersisted (void);

/* Callback for Nvm*/
/* [$Satisfies $RTA_FBL_SDK_DD_DATAM 45] */
extern Std_ReturnType Fbl_DataM_NvmReprogrammingRequestFlagBlockCallbackFunction(const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmApplicationValidFlagBlockCallbackFunction(const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmPSNGBlockCallbackFunction(const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmProgramConditionsBlockCallbackFunction(const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmSecretKeyUpdateCounterBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateCounterBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateCounterBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmHardwarePartNumberBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmHardwareSerialNumberBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmCompnentIDBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmHardwareIDBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdaterFingerprintBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdaterFingerprintBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmApplicationUpdateTimestampBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmCalibrationUpdateTimestampBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
extern Std_ReturnType Fbl_DataM_NvmHardwareManufacturingDateBlockCallbackFunction (const uint8 u8ServiceIdP,const NvM_RequestResultType JobResultP);
#endif /* FBL_DATAMCFG_H */
