

#ifndef FEE_CFG_H
#define FEE_CFG_H

#include "Fls.h"

#define FEE_PRESENT   1

/* For Fee test purposes only */
#define FEE_PRV_DEBUGGING FALSE
#define FEE_SIMULATION_ACTIVE FALSE

/* *********************************************************************************************************************
 *
 * Description: This configuration is to enable and disable the availability of the variable which gives hint on how much bytes
 * free bytes available in D-flash. The veriable can be used  only for seeing the status of the free bytes using INCA tool
 * Application should not use this veriable for taking any decision.
 * TRUE : The veriable is available for INCA measurement
 * FALSE : The veriable won't be available INCA for measurement
 ******************************************************************************************************************** */
#define FEE_PRV_FREEBYTES_INDFLASH  FALSE


/* *********************************************************************************************************************
 * SWS Item:        FEE039_Conf
 * Container Name:  FeeGeneral
 * Description:     Container for general parameters. These parameters are not specific to a block.
 ******************************************************************************************************************** */
#define FEE_VENDOR_ID                   6 
#define FEE_MODULE_ID                   21 /* Module ID of Fee */
#define FEE_INSTANCE_ID                 0 /* Instance ID */

/* Fee Software Version in BASD is Fee / AR40.16.0.0 */
#define FEE_SW_MAJOR_VERSION            16
#define FEE_SW_MINOR_VERSION            0
#define FEE_SW_PATCH_VERSION            0

/* Fee is compatible with Autosar 4.2Rev2 */
#define FEE_AR_RELEASE_MAJOR_VERSION    4
#define FEE_AR_RELEASE_MINOR_VERSION    2
#define FEE_AR_RELEASE_REVISION_VERSION 2

/* *********************************************************************************************************************
 * SWS Item:        FEE111_Conf
 * Name:            FeeDevErrorDetect
 * Description:     Pre-processor switch to enable and disable development error detection.
 *                  true: Development error detection enabled.
 *                  false: Development error detection disabled.
 * Multiplicity:    1
 * Type:            EcucBooleanParamDef
 ********************************* ********************************************************************************** */
#define FEE_DEV_ERROR_DETECT        STD_OFF

/* *********************************************************************************************************************
 * SWS Item:        FEE152_Conf
 * Name:            FeeIndex
 * Description:     Specifies the InstanceId of this module instance. If only one instance is present it shall have
 *                  the Id 0.
 * Multiplicity:    1
 * Type:            EcucIntegerParamDef
 * Range:           0 .. 254
  ******************************************************************************************************************* */
#define FEE_FEEINDEX      0u

/* *********************************************************************************************************************
 * SWS Item:        FEE112_Conf
 * Name:            FeeNvmJobEndNotification
 * Description:     Mapped to the job end notification routine provided by the upper layer module
 *                  (NvM_JobEndNotification).
 *                  This tag has no effect. Job end and job error notifications must be configured block wise
 *                  if necessary via FeeRbCallbackEnd and FeeRbCallbackError.
 * Multiplicity:    0 .. 1
 * Type:            EcucFunctionNameDef
  ******************************************************************************************************************* */
#define FEE_NVM_JOB_END_NOTIFICATION    NULL_PTR

/* *********************************************************************************************************************
 * SWS Item:        FEE113_Conf
 * Name:            FeeNvmJobErrorNotification
 * Description:     Mapped to the job error notification routine provided by the upper layer module
 *                  (NvM_JobErrorNotification).
 *                  This tag has no effect. Job end and job error notifications must be configured block wise
 *                  if necessary via FeeRbCallbackEnd and FeeRbCallbackError.
 * Multiplicity:    0 .. 1
 * Type:            EcucFunctionNameDef
  ******************************************************************************************************************* */
#define FEE_NVM_JOB_ERROR_NOTIFICATION  NvM_JobErrorNotification

/* *********************************************************************************************************************
 * SWS Item:        FEE114_Conf
 * Name:            FeePollingMode
 * Description:     Pre-processor switch to enable and disable the polling mode for this module.
 *                  true:  Polling mode enabled, callback functions (provided to FLS module) disabled.
 *                  false: Polling mode disabled, callback functions (provided to FLS module) enabled.
 * Multiplicity:    1
 * Type:            EcucBooleanParamDef
  ******************************************************************************************************************* */
#define FEE_POLLING_MODE  STD_ON

/* *********************************************************************************************************************
 * SWS Item:        FEE119_Conf
 * Name:            FeeSetModeSupported
 * Description:     Compiler switch to enable/disable the 'SetMode' functionality of the FEE module.
 *                  TRUE: SetMode functionality supported / code present,
 *                  FALSE: SetMode functionality not supported / code not present. Note: This configuration setting has
 *                  to be consistent with that of all underlying flash device drivers (configuration parameter
 *                  FlsSetModeApi).
 * Multiplicity:    1
 * Type:            EcucBooleanParamDef
  ******************************************************************************************************************* */
#define FEE_SET_MODE_SUPPORTED  STD_OFF

/* *********************************************************************************************************************
 * SWS Item:        FEE115_Conf
 * Name:            FeeVersionInfoApi
 * Description:     Pre-processor switch to enable / disable the API to read out the modules version information.
 *                  true:  Version info API enabled.
 *                  false: Version info API disabled.
 * Multiplicity:    1
 * Type:            EcucBooleanParamDef
  ******************************************************************************************************************* */
#define FEE_VERSION_INFO_API    STD_ON

/* *********************************************************************************************************************
 * SWS Item:        FEE116_Conf
 * Name:            FeeVirtualPageSize
 * Description:     The size in bytes to which logical blocks shall be aligned.
 * Multiplicity:    1
 * Type:            EcucIntegerParamDef
 * Range:           0 .. 65535
  ******************************************************************************************************************* */
#define FEE_VIRTUAL_PAGE_SIZE   8u



/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbPageBufferSize
 * Description:     Size of buffer for communication between flash driver and Fee.
 * Multiplicity:    0
 * Type:            EcucIntegerParamDef
 * Range:           256 .. Fee logical sector size
  ******************************************************************************************************************* */
#define FEE_LL_PAGEBUFFSIZE   1024u

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbMaintainRedundantBlocks
 * Description:     Pre-processor switch to enable / disable the API to maintain the redundant blocks.
 *                  true:  Maintain function enabled.
 *                  false: Maintain function disabled.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_MAINTAIN        TRUE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbReadForce
 * Description:     Pre-processor switch to enable and disable read force function.
 *                  true:  Read force function enabled.
 *                  false: Read force function disabled.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_READ_FORCE        FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbTriggerReorgApi
 * Description:     Pre-processor switch to enable or disable forced sector reorganisation (for one sector).
 *                  true:  Forced reorganisation feature supported (one force reorg per call).
 *                  false: Forced reorganisation feature not supported.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_TRIGGER_REORG        FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbEnterStopModeApi
 * Description:     Pre-processor switch to enable or disable stop mode
 *                  true:  Entering into stop mode feature supported.
 *                  false: Entering into stop mode feature not supported.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ENTER_STOP_MODE        FALSE

/* *********************************************************************************************************************
 * SWS Item:        RB add-on
 * Name:            FeeRbAddonsCCAS
 * Description:     Pre-processor switch to enable or disable addons for CCAS which are realised is an adapter:
 *                  - rba_FeeAddOnAS_EnterStopMode
 *                  - rba_FeeAddOnAS_WriteAdr
 *                  - rba_FeeAddOnAS_ForcedRead
 *                  Hint: for the usage of the rba_FeeAddOnAS_ForcedRead functionality, the Fee configuration tag
 *                        "FeeRbReadForce" needs to be activated as well.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ADDONS_CCAS        FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbActSurvivalEval
 * Description:     Pre-processor switch to enable or disable an additional block specific reorganization for unknown
 *                  blocks with an active survival setting ("FeeRbSurvival") in the medium.
 *                  true:  Feature enabled  ("block specific afterburner" on for blocks with active survival setting).
 *                  false: Feature disabled ("block specific afterburner" off for blocks with active survival setting).
 *                  Hint:  If activated, this block will be overtaken independent from the "FeeRbActUnknownBlockReorg"
 *                         setting ("general afterburner").
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ACT_SURVIVAL_EVAL  TRUE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbActUnknownBlockReorg
 * Description:     Pre-processor switch to enable or disable an additional reorganization for any unknown block in
 *                  the medium.
 *                  true:  Feature enabled  ("general afterburner" on for all unknown blocks).
 *                  false: Feature disabled ("general afterburner" off for all unknown blocks).
 *                  Hints: If activated, all unknown blocks will be overtaken independent from the "FeeRbActSurvivalEval"
 *                         setting ("block specific afterburner").
 *                         If deactivated and with active survival evaluation ("FeeRbActSurvivalEval" == TRUE),
 *                         only blocks with an active survival setting ("FeeRbSurvival" == TRUE) will be overtaken.
 *                         Only the CB (Customer Block) is allowed to enable this feature, because this is affecting the
 *                         thresholds of the sector reorganization to a special safety level. It must be deactivated
 *                         for the ASW!
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ACT_UNKNOWN_BLOCK_REORG   TRUE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbActUnknownBlockReorgCacheSize
 * Description:     Pre-processor switch to enable or disable an additional optimisation in sector reorganization
 *                  for any unknown block in the medium.
 *                  This feature fastens the sector reorganisation for unknown blocks (Global after burner feature) by
 *                  scanning the sector and building up a cache for unknown block. Each unknown block requires 6 bytes
 *                  information in the cache, 4 bytes for address and 2 bytes for FEE index.
 *                  For best performance project must allocate enough cache size to store information of all unknown blocks.
 *                  For example, if a project has 250 unknown blocks in CB then at least 250*6 = 1500bytes to be allocated.
 *                  Default value is for 300 unknown blocks, which is 300*6=1800bytes.
 *                  Using the configured size the size of the array is generated.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ACT_UNKNOWN_BLOCK_CACHE_SIZE   1800u

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbActEraseSuspension
 * Description:     Pre-processor switch to enable or disable erase suspension feature of Ti devices.
 *                  true:  Erase suspension enabled.
 *                  false: Erase suspension disabled.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_ACT_ERASE_SUSPENSION      FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbGetFreeSpaceApi
 * Description:     Pre-processor switch to enable or disable free space API
 *                  true:  Free space API supported.
 *                  false: Free space API not supported.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_GET_NR_FREE_BYTES        FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbGetNrFreeBytesAndFatEntriesApi
 * Description:     Pre-processor switch to enable or disable number free bytes and FAT entries API
 *                  true:  Number free bytes and FAT entries API supported.
 *                  false: Number free bytes and FAT entries API not supported.
 * Multiplicity:    0
 * Type:            EcucBooleanParamDef
 ******************************************************************************************************************** */
#define FEE_RB_GET_NR_FREE_BYTES_AND_FAT_ENTRIES  FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbBlockTableLocation
 * Description:     Selected Location for Block Properties Table
 *                  TRUE:  Use ROM-Loction for Fee_BlockProperties_st.
 *                  FALSE: Use RAM-Location for Fee_BlockProperties_st.
 * Multiplicity:    0
 * Type:            EcucEnumerationParamDef
 ******************************************************************************************************************** */
#define FEE_RB_USE_ROM_BLOCKTABLE        FALSE

/* *********************************************************************************************************************
 * SWS Item:        Conf
 * Name:            FeeRbSyncFlsMainLoopHook
 * Description:     Hook into synchronous Fls_MainFunction loop
 * Multiplicity:    0
 * Type:            FunctionName
 ******************************************************************************************************************** */
#define FEE_RB_SYNC_LOOP_FLS_MAIN_HOOK() (void)0

/* ******************************************************************************************************************
   ******************************************** FeePublishedInformation *********************************************
   ****************************************************************************************************************** */

/* FEE117_Conf: FeeBlockOverhead {FEE_BLOCK_OVERHEAD}
 * Management overhead per logical block in bytes.
 * Note:
 * If the management overhead depends on the block size or block location a formula has to be provided that allows the
 * configurator to calculate the management overhead correctly.
 * Type:    EcucIntegerParamDef
 * Range:   0 .. 65535 */
#define FEE_BLOCK_OVERHEAD          14u

/* FEE070_Conf: FeeMaximumBlockingTime {FEE_MAXIMUM_BLOCKING_TIME}
 * The maximum time the FEE module's API routines shall be blocked (delayed) by internal operations.
 * Note:
 * Internal operations in that case means operations that are not explicitly invoked from the upper layer module but
 * need to be handled for proper operation of this module or the underlying memory driver.
 * Type:    EcucFloatParamDef
 * Range:   0.0 .. Inf */
#define FEE_MAXIMUM_BLOCKING_TIME   5u

/* FEE118_Conf: FeePageOverhead {FEE_PAGE_OVERHEAD}
 * Management overhead per page in bytes.
 * Note:
 * If the management overhead depends on the block size or block location a formula has to be provided that allows the
 * configurator to calculate the management overhead correctly.
 * Type:    EcucIntegerParamDef
 * Range:   0 .. 65535 */
#define FEE_PAGE_OVERHEAD           0u



/* ******************************************************************************************************************
   *************************************** Fee internally used configuration ****************************************
   ****************************************************************************************************************** */

/* Fee Robustness Feature active for any of the configured blocks */
#define FEE_ROB_FEATURE_ACTIVE                      TRUE
/* Fee NoFallback feature active for any of the configured blocks */
#define FEE_NO_FALLBACK_ACTIVE                      FALSE
/* Fast cache initialization */
#define FEE_FAST_CACHE_INIT_ACTIVE                  TRUE
/* Header Recheck - necessary for flash types with undefined erase pattern like Renesas RH850 */
#define FEE_HEADER_RECHECK_ACTIVE                   FALSE
/* Robust programming feature setting */
#define FEE_ROBUST_PROG_ACTIVE                      FALSE

/* Threshold calculation*/
#define FEE_REQUIRED_FREE_SPACE_BEFORE_SOFT_SR       786432uL  /* FEE_REQUIRED_FREE_SPACE_BEFORE_SOFT_SR = (Fee_TotalFlashSize) * 1/3 = 2359296 * 1/3 */
#define FEE_REQUIRED_FREE_SPACE_BEFORE_HARD_SR       471859uL  /* FEE_REQUIRED_FREE_SPACE_BEFORE_HARD_SR = (Fee_TotalFlashSize) * 1/5 = 2359296 * 1/5 */

/* Number of pages which are used to store the blockheader */
#define FEE_PAGES_USED_BY_BLK_HEADER                2u
/* Number of data bytes behind the blockheader */
#define FEE_FREE_BYTES_AFTER_HEADER                 2u
/* Size of the sector header */
#define FEE_SEC_HEADER_SIZE                         96u

/* Number of FeeBlocks */
#define FEE_NUM_BLOCKS                              17u
/* Number of unknown blocks that can be transfered/checked in one iteration of unknown block sector reorganisation (Global After burner feature) */
#define FEE_RB_ACT_UNKNOWN_BLK_CACHE_ARRAY_SIZE     300u
/* Number of retries in case of an error (Compare / Read / Write) */
#define FEE_MAX_RD_WR_COMP_RETRIES                  3u

/* Init value for the cache */
#define FEE_CACHE_INIT_VALUE                        0xCAFEAFFEuL
/* Update start value for the cache (there might be an entry available in the flash which can be found via "manual search") */
#define FEE_CACHE_TMP_INVALID_VALUE                 0xAFFECAFEuL

#define FEE_PRV_CFG_SELECTED_FS                     1
/* ******************************************************************************************************************
   ******************************************* Generate FLASH configuration *****************************************
   ****************************************************************************************************************** */
#define FEE_PAGE_LEN                                8u  /* Configured virtual page size */
#define FEE_FASTMODE_ALIGNMENT                      8u  /* Necessary address alignment to write in FastMode */
#define FEE_ERASE_PATTERN                           255u

/* DFLASH configuration for uC MCU_RB_MANUAL_CFG */
/* ******************************************* Configuration of sector 0 ******************************************** */
#define FEE_PHYS_SEC_START0  0x00000000uL
#define FEE_PHYS_SEC_END0    0x0000FFFFuL
#define FEE_LOG_SEC_START0   (FEE_PHYS_SEC_START0 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END0     FEE_PHYS_SEC_END0

/* ******************************************* Configuration of sector 1 ******************************************** */
#define FEE_PHYS_SEC_START1  0x00010000uL
#define FEE_PHYS_SEC_END1    0x0001FFFFuL
#define FEE_LOG_SEC_START1   (FEE_PHYS_SEC_START1 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END1     FEE_PHYS_SEC_END1

/* ******************************************* Configuration of sector 2 ******************************************** */
#define FEE_PHYS_SEC_START2  0x00020000uL
#define FEE_PHYS_SEC_END2    0x0002FFFFuL
#define FEE_LOG_SEC_START2   (FEE_PHYS_SEC_START2 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END2     FEE_PHYS_SEC_END2

/* ******************************************* Configuration of sector 3 ******************************************** */
#define FEE_PHYS_SEC_START3  0x00030000uL
#define FEE_PHYS_SEC_END3    0x0003FFFFuL
#define FEE_LOG_SEC_START3   (FEE_PHYS_SEC_START3 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END3     FEE_PHYS_SEC_END3

/* ******************************************* Configuration of sector 4 ******************************************** */
#define FEE_PHYS_SEC_START4  0x00040000uL
#define FEE_PHYS_SEC_END4    0x0004FFFFuL
#define FEE_LOG_SEC_START4   (FEE_PHYS_SEC_START4 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END4     FEE_PHYS_SEC_END4

/* ******************************************* Configuration of sector 5 ******************************************** */
#define FEE_PHYS_SEC_START5  0x00050000uL
#define FEE_PHYS_SEC_END5    0x0005FFFFuL
#define FEE_LOG_SEC_START5   (FEE_PHYS_SEC_START5 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END5     FEE_PHYS_SEC_END5

/* ******************************************* Configuration of sector 6 ******************************************** */
#define FEE_PHYS_SEC_START6  0x00060000uL
#define FEE_PHYS_SEC_END6    0x0006FFFFuL
#define FEE_LOG_SEC_START6   (FEE_PHYS_SEC_START6 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END6     FEE_PHYS_SEC_END6

/* ******************************************* Configuration of sector 7 ******************************************** */
#define FEE_PHYS_SEC_START7  0x00070000uL
#define FEE_PHYS_SEC_END7    0x0007FFFFuL
#define FEE_LOG_SEC_START7   (FEE_PHYS_SEC_START7 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END7     FEE_PHYS_SEC_END7

/* ******************************************* Configuration of sector 8 ******************************************** */
#define FEE_PHYS_SEC_START8  0x00080000uL
#define FEE_PHYS_SEC_END8    0x0008FFFFuL
#define FEE_LOG_SEC_START8   (FEE_PHYS_SEC_START8 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END8     FEE_PHYS_SEC_END8

/* ******************************************* Configuration of sector 9 ******************************************** */
#define FEE_PHYS_SEC_START9  0x00090000uL
#define FEE_PHYS_SEC_END9    0x0009FFFFuL
#define FEE_LOG_SEC_START9   (FEE_PHYS_SEC_START9 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END9     FEE_PHYS_SEC_END9

/* ******************************************* Configuration of sector 10 ******************************************** */
#define FEE_PHYS_SEC_START10  0x000A0000uL
#define FEE_PHYS_SEC_END10    0x000AFFFFuL
#define FEE_LOG_SEC_START10   (FEE_PHYS_SEC_START10 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END10     FEE_PHYS_SEC_END10

/* ******************************************* Configuration of sector 11 ******************************************** */
#define FEE_PHYS_SEC_START11  0x000B0000uL
#define FEE_PHYS_SEC_END11    0x000BFFFFuL
#define FEE_LOG_SEC_START11   (FEE_PHYS_SEC_START11 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END11     FEE_PHYS_SEC_END11

/* ******************************************* Configuration of sector 12 ******************************************** */
#define FEE_PHYS_SEC_START12  0x000C0000uL
#define FEE_PHYS_SEC_END12    0x000CFFFFuL
#define FEE_LOG_SEC_START12   (FEE_PHYS_SEC_START12 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END12     FEE_PHYS_SEC_END12

/* ******************************************* Configuration of sector 13 ******************************************** */
#define FEE_PHYS_SEC_START13  0x000D0000uL
#define FEE_PHYS_SEC_END13    0x000DFFFFuL
#define FEE_LOG_SEC_START13   (FEE_PHYS_SEC_START13 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END13     FEE_PHYS_SEC_END13

/* ******************************************* Configuration of sector 14 ******************************************** */
#define FEE_PHYS_SEC_START14  0x000E0000uL
#define FEE_PHYS_SEC_END14    0x000EFFFFuL
#define FEE_LOG_SEC_START14   (FEE_PHYS_SEC_START14 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END14     FEE_PHYS_SEC_END14

/* ******************************************* Configuration of sector 15 ******************************************** */
#define FEE_PHYS_SEC_START15  0x000F0000uL
#define FEE_PHYS_SEC_END15    0x000FFFFFuL
#define FEE_LOG_SEC_START15   (FEE_PHYS_SEC_START15 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END15     FEE_PHYS_SEC_END15

/* ******************************************* Configuration of sector 16 ******************************************** */
#define FEE_PHYS_SEC_START16  0x00100000uL
#define FEE_PHYS_SEC_END16    0x0010FFFFuL
#define FEE_LOG_SEC_START16   (FEE_PHYS_SEC_START16 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END16     FEE_PHYS_SEC_END16

/* ******************************************* Configuration of sector 17 ******************************************** */
#define FEE_PHYS_SEC_START17  0x00110000uL
#define FEE_PHYS_SEC_END17    0x0011FFFFuL
#define FEE_LOG_SEC_START17   (FEE_PHYS_SEC_START17 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END17     FEE_PHYS_SEC_END17

/* ******************************************* Configuration of sector 18 ******************************************** */
#define FEE_PHYS_SEC_START18  0x00120000uL
#define FEE_PHYS_SEC_END18    0x0012FFFFuL
#define FEE_LOG_SEC_START18   (FEE_PHYS_SEC_START18 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END18     FEE_PHYS_SEC_END18

/* ******************************************* Configuration of sector 19 ******************************************** */
#define FEE_PHYS_SEC_START19  0x00130000uL
#define FEE_PHYS_SEC_END19    0x0013FFFFuL
#define FEE_LOG_SEC_START19   (FEE_PHYS_SEC_START19 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END19     FEE_PHYS_SEC_END19

/* ******************************************* Configuration of sector 20 ******************************************** */
#define FEE_PHYS_SEC_START20  0x00140000uL
#define FEE_PHYS_SEC_END20    0x0014FFFFuL
#define FEE_LOG_SEC_START20   (FEE_PHYS_SEC_START20 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END20     FEE_PHYS_SEC_END20

/* ******************************************* Configuration of sector 21 ******************************************** */
#define FEE_PHYS_SEC_START21  0x00150000uL
#define FEE_PHYS_SEC_END21    0x0015FFFFuL
#define FEE_LOG_SEC_START21   (FEE_PHYS_SEC_START21 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END21     FEE_PHYS_SEC_END21

/* ******************************************* Configuration of sector 22 ******************************************** */
#define FEE_PHYS_SEC_START22  0x00160000uL
#define FEE_PHYS_SEC_END22    0x0016FFFFuL
#define FEE_LOG_SEC_START22   (FEE_PHYS_SEC_START22 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END22     FEE_PHYS_SEC_END22

/* ******************************************* Configuration of sector 23 ******************************************** */
#define FEE_PHYS_SEC_START23  0x00170000uL
#define FEE_PHYS_SEC_END23    0x0017FFFFuL
#define FEE_LOG_SEC_START23   (FEE_PHYS_SEC_START23 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END23     FEE_PHYS_SEC_END23

/* ******************************************* Configuration of sector 24 ******************************************** */
#define FEE_PHYS_SEC_START24  0x00180000uL
#define FEE_PHYS_SEC_END24    0x0018FFFFuL
#define FEE_LOG_SEC_START24   (FEE_PHYS_SEC_START24 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END24     FEE_PHYS_SEC_END24

/* ******************************************* Configuration of sector 25 ******************************************** */
#define FEE_PHYS_SEC_START25  0x00190000uL
#define FEE_PHYS_SEC_END25    0x0019FFFFuL
#define FEE_LOG_SEC_START25   (FEE_PHYS_SEC_START25 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END25     FEE_PHYS_SEC_END25

/* ******************************************* Configuration of sector 26 ******************************************** */
#define FEE_PHYS_SEC_START26  0x001A0000uL
#define FEE_PHYS_SEC_END26    0x001AFFFFuL
#define FEE_LOG_SEC_START26   (FEE_PHYS_SEC_START26 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END26     FEE_PHYS_SEC_END26

/* ******************************************* Configuration of sector 27 ******************************************** */
#define FEE_PHYS_SEC_START27  0x001B0000uL
#define FEE_PHYS_SEC_END27    0x001BFFFFuL
#define FEE_LOG_SEC_START27   (FEE_PHYS_SEC_START27 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END27     FEE_PHYS_SEC_END27

/* ******************************************* Configuration of sector 28 ******************************************** */
#define FEE_PHYS_SEC_START28  0x001C0000uL
#define FEE_PHYS_SEC_END28    0x001CFFFFuL
#define FEE_LOG_SEC_START28   (FEE_PHYS_SEC_START28 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END28     FEE_PHYS_SEC_END28

/* ******************************************* Configuration of sector 29 ******************************************** */
#define FEE_PHYS_SEC_START29  0x001D0000uL
#define FEE_PHYS_SEC_END29    0x001DFFFFuL
#define FEE_LOG_SEC_START29   (FEE_PHYS_SEC_START29 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END29     FEE_PHYS_SEC_END29

/* ******************************************* Configuration of sector 30 ******************************************** */
#define FEE_PHYS_SEC_START30  0x001E0000uL
#define FEE_PHYS_SEC_END30    0x001EFFFFuL
#define FEE_LOG_SEC_START30   (FEE_PHYS_SEC_START30 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END30     FEE_PHYS_SEC_END30

/* ******************************************* Configuration of sector 31 ******************************************** */
#define FEE_PHYS_SEC_START31  0x001F0000uL
#define FEE_PHYS_SEC_END31    0x001FFFFFuL
#define FEE_LOG_SEC_START31   (FEE_PHYS_SEC_START31 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END31     FEE_PHYS_SEC_END31

/* ******************************************* Configuration of sector 32 ******************************************** */
#define FEE_PHYS_SEC_START32  0x00200000uL
#define FEE_PHYS_SEC_END32    0x0020FFFFuL
#define FEE_LOG_SEC_START32   (FEE_PHYS_SEC_START32 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END32     FEE_PHYS_SEC_END32

/* ******************************************* Configuration of sector 33 ******************************************** */
#define FEE_PHYS_SEC_START33  0x00210000uL
#define FEE_PHYS_SEC_END33    0x0021FFFFuL
#define FEE_LOG_SEC_START33   (FEE_PHYS_SEC_START33 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END33     FEE_PHYS_SEC_END33

/* ******************************************* Configuration of sector 34 ******************************************** */
#define FEE_PHYS_SEC_START34  0x00220000uL
#define FEE_PHYS_SEC_END34    0x0022FFFFuL
#define FEE_LOG_SEC_START34   (FEE_PHYS_SEC_START34 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END34     FEE_PHYS_SEC_END34

/* ******************************************* Configuration of sector 35 ******************************************** */
#define FEE_PHYS_SEC_START35  0x00230000uL
#define FEE_PHYS_SEC_END35    0x0023FFFFuL
#define FEE_LOG_SEC_START35   (FEE_PHYS_SEC_START35 + FEE_SEC_HEADER_SIZE)
#define FEE_LOG_SEC_END35     FEE_PHYS_SEC_END35

#define FEE_NUM_FLASH_BANKS_AVAILABLE  36u      /* Number of sectors which are available by the HW */


/* ******************************************************************************************************************
   ******************************************* Defines for accessing blocks *****************************************
   ****************************************************************************************************************** */
/* Defines for all configured blocks which should be used by the upperlaying modules (NvM, ...) to access their blocks via the Fee APIs */
#define FeeConf_FeeBlockConfiguration_NvM_CalibrationUpdateTimestamp                              0
#define FeeConf_FeeBlockConfiguration_NvM_CalibrationUpdateCounter                                1
#define FeeConf_FeeBlockConfiguration_NvM_HardwareManufacturingDate                               2
#define FeeConf_FeeBlockConfiguration_NvM_SecretKey                                               3
#define FeeConf_FeeBlockConfiguration_NvM_HardwareSerialNumber                                    4
#define FeeConf_FeeBlockConfiguration_NvM_ApplicationUpdateTimestamp                              5
#define FeeConf_FeeBlockConfiguration_NvM_HardwarePartNumber                                      6
#define FeeConf_FeeBlockConfiguration_NvM_ApplicationUpdateCounter                                7
#define FeeConf_FeeBlockConfiguration_NvM_ProgramConditions                                       8
#define FeeConf_FeeBlockConfiguration_NvM_ReprogrammingRequestFlag                                9
#define FeeConf_FeeBlockConfiguration_NvM_PSNG_Block                                              10
#define FeeConf_FeeBlockConfiguration_Nvm_SecretKeyUpdateCounter                                  11
#define FeeConf_FeeBlockConfiguration_NvM_HardwareID                                              12
#define FeeConf_FeeBlockConfiguration_NvM_ApplicationValidFlag                                    13
#define FeeConf_FeeBlockConfiguration_NvM_ApplicationUpdaterFingerprint                           14
#define FeeConf_FeeBlockConfiguration_NvM_CompnentID                                              15
#define FeeConf_FeeBlockConfiguration_NvM_CalibrationUpdaterFingerprint                           16


/* ******************************************************************************************************************
   ********************************** External declarations, provided by/to Fee *************************************
   ****************************************************************************************************************** */


/* ******************************************************************************************************************
   ***************************** External declarations of hook functions provided to Fee ****************************
   ****************************************************************************************************************** */


/* ******************************************************************************************************************
   ********************************************** Fs specific defines ***********************************************
   ****************************************************************************************************************** */
#define FEE_ERASE_PATTERN_U32                                        0xFFFFFFFFuL
#define FEE_PHY_PAGE_LEN                                             8u             /* Physical page size */


#endif /* FEE_CFG_H */
