[!CODE!][!//
/**
*   @file    CDD_Mcem_Cfg.h
*   @implements   CDD_Mcem_Cfg.h_Artifact
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcem configuration header.
*   @details This file is the Safety  MCEM driver configuration header. This
*            file is automatically generated, do not modify manually.
*
*
*   @addtogroup MCEM_CFG
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : Fccu
*   Dependencies         : none
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifndef CDD_MCEM_CFG_H
#define CDD_MCEM_CFG_H

#ifdef __cplusplus
extern "C" {
#endif

/**
*
* @page misra_violations MISRA-C:2004 violations
*
* @section [global]
* Violates MISRA 2004 Required Rule 5.1, Exceeds 31 characters due to AUTOSAR compatibility
*
* @section [global]
* Violates MISRA 2004 Required Rule 8.7, Object shall be defined at block scope if they are only 
* accessed from within a single function, due to possible usage of the object in another 
* function or file.
*
*/

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

#include "CDD_Mcem_Types.h"
#include "Mcal.h"
#include "Dem.h"
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/

#define CDD_MCEM_VENDOR_ID_CFG                   43
#define CDD_MCEM_AR_RELEASE_MAJOR_VERSION_CFG    4
#define CDD_MCEM_AR_RELEASE_MINOR_VERSION_CFG    3
#define CDD_MCEM_AR_RELEASE_REVISION_VERSION_CFG 1
#define CDD_MCEM_SW_MAJOR_VERSION_CFG            1
#define CDD_MCEM_SW_MINOR_VERSION_CFG            0
#define CDD_MCEM_SW_PATCH_VERSION_CFG            0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if current file and CDD_Mcem_Types.h header file are of the same vendor */
#if (CDD_MCEM_VENDOR_ID_CFG != CDD_MCEM_TYPES_VENDOR_ID)
    #error "CDD_Mcem_Cfg.h and CDD_Mcem_Types.h have different Vendor ids"
#endif
/* Check if current file and CDD_Mcem_Types.h header file are of the same Autosar version */
#if ((CDD_MCEM_AR_RELEASE_MAJOR_VERSION_CFG != CDD_MCEM_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (CDD_MCEM_AR_RELEASE_MINOR_VERSION_CFG != CDD_MCEM_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (CDD_MCEM_AR_RELEASE_REVISION_VERSION_CFG != CDD_MCEM_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of CDD_Mcem_Cfg.h and CDD_Mcem_Types.h are different"
#endif
/* Check if current file and CDD_Mcem_Types.h header file are of the same Software version */
#if ((CDD_MCEM_SW_MAJOR_VERSION_CFG != CDD_MCEM_TYPES_SW_MAJOR_VERSION) || \
     (CDD_MCEM_SW_MINOR_VERSION_CFG != CDD_MCEM_TYPES_SW_MINOR_VERSION) || \
     (CDD_MCEM_SW_PATCH_VERSION_CFG != CDD_MCEM_TYPES_SW_PATCH_VERSION))
    #error "Software Version Numbers of CDD_Mcem_Cfg.h and CDD_Mcem_Types.h are different"
#endif

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    /* Check if current file and Mcal.h header file are of the same Autosar version */
    #if ((CDD_MCEM_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
         (CDD_MCEM_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
        #error "AutoSar Version Numbers of CDD_Mcem_Cfg.h and Mcal.h are different"
    #endif
#endif

[!INCLUDE "CDD_Mcem_VersionCheck_Inc.m"!][!//
/*==================================================================================================
*                                          CONSTANTS
==================================================================================================*/

/*=================================================================================================
*                                      DEFINES AND MACROS
=================================================================================================*/
/**
*@{
*   @brief Pre-compile configuration constants 
*/
[!IF "IMPLEMENTATION_CONFIG_VARIANT='VariantPreCompile' and (variant:size()<=1)"!][!//
#define MCEM_PRECOMPILE_SUPPORT     (STD_ON)
[!ELSE!][!//
#define MCEM_PRECOMPILE_SUPPORT     (STD_OFF)
[!ENDIF!][!//

[!IF "ecu:get('Mcem.McemGeneral.FccuSupport')='STD_ON'"!]
/**
* @brief          Define if FCCU was supported
*
* @api
*/
#define  MCEM_FCCU_SUPPORT
[!ENDIF!]
/**
* @brief          Enable/Disable Development Error Detection.
*
* @api
*/
#define MCEM_DEV_ERROR_DETECT        [!IF "McemGeneral/McemDevErrorDetect"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]

/**
* @brief          Function @p Mcem_GetVersionInfo() enable switch.
*
* @api
*/
#define MCEM_GET_VERSION_INFO_API    [!IF "McemGeneral/McemVersionInfoApi"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]

/**
* @brief          Function @p Mcem_AlarmNotification usage
*
* @api
*/
#define MCEM_ALARM_NOTIFICATION_API  [!IF "McemGeneral/McemAlarmNotificationApi"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]

/**
* @brief          Enables the merge of the FCCU Alarm and Config Timeout interrupts
*
* @api
*/
#define MCEM_MERGE_FCCU_ALARM_AND_CONFIG_TIMEOUT_IRQS
/**
* @brief          Enable/disable extended DEM error reporting
*
* @api
*/
#define MCEM_DEM_EXTENDED_DATA      [!IF "McemGeneral/McemDemExtendedData"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]
extern CONST(Dem_EventIdType, MCEM_CONST)Mcem_E_InitFailed;
/**
* @brief          Enable/Disable User support mode
*
* @api
*/
#define MCEM_ENABLE_USER_MODE_SUPPORT  [!IF "McemGeneral/McemEnableUserModeSupport"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]

/**
* @brief          Enable new API to allow user get error report and and clear fault id within NMI interrupt when NMI has higher priority than SVC
* Note: this is used for ARM platform when NMI has highest priority and does not allow change from user to super visor mode
* @api
*/
#define MCEM_FCCU_EXTRA_NMI_API     (STD_OFF)

#ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  #if (STD_ON == MCEM_ENABLE_USER_MODE_SUPPORT)
    #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running MCEM in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
  #endif /* (STD_ON == MCEM_ENABLE_USER_MODE_SUPPORT */
#endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
[!IF "ecu:get('Mcem.McemGeneral.FccuUnderRegPotList')='STD_ON'"!]
/**
* @brief          Define if FCCU required configuration of REG_PROT
*
*/
#define  MCEM_FCCU_REG_PROT_AVAILABLE
[!ENDIF!]

/*=================================================================================================
*                                             ENUMS
=================================================================================================*/

/*=================================================================================================
*                                STRUCTURES AND OTHER TYPEDEFS
=================================================================================================*/
/**
* @brief          Configuration struct type.
* @details        MCEM Driver configuration structure type. 
*
* @implements     Mcem_ConfigType_struct
*/
typedef struct
{
    CONST(Mcem_NotifyType, AUTOMATIC)                    AlarmNotification;   /**< @brief MCEM Alarm Interrupt Notification function. */
    CONST(Mcem_NotifyVoidType, AUTOMATIC)                CfgToNotification;   /**< @brief MCEM Configuration TimeOut Interrupt Notification function. */
    CONST(boolean, AUTOMATIC)                            Lockable;            /**< @brief This configuration will be locked. */
    P2CONST(Fccu_ConfigType, AUTOMATIC, MCEM_APPL_CONST) FccuConfig;          /**< @brief Fccu Configuration values. */
} Mcem_ConfigType;

[!NOCODE!][!//
[!IF "((IMPLEMENTATION_CONFIG_VARIANT != 'VariantPostBuild') and (variant:size()>1)) or (IMPLEMENTATION_CONFIG_VARIANT = 'VariantPostBuild')"!][!//
#define MCEM_START_SEC_CONST_UNSPECIFIED
/* @violates @ref CDD_Mcem_Cfg_h_REF_1 only preprocessor statements and comments before "#include". */
/* @violates @ref CDD_Mcem_Cfg_h_REF_2 precautions to prevent the contents of a header file being included twice. */
#include "Mcem_MemMap.h"
  [!VAR "configName" = "as:name(McemConfigSet)"!][!//
  [!IF "var:defined('postBuildVariant')"!][!//
    [!LOOP "variant:all()"!][!//
      [!CODE!][!WS4!]extern CONST(Mcem_ConfigType, MCEM_CONST) [!"$configName"!]_[!"."!];[!CR!][!ENDCODE!][!//
    [!ENDLOOP!][!//
  [!ELSE!][!//
      [!CODE!][!WS4!]extern CONST(Mcem_ConfigType, MCEM_CONST) [!"$configName"!];[!CR!][!ENDCODE!][!//
  [!ENDIF!][!//
#define MCEM_STOP_SEC_CONST_UNSPECIFIED
/* @violates @ref CDD_Mcem_Cfg_h_REF_1 only preprocessor statements and comments before "#include". */
/* @violates @ref CDD_Mcem_Cfg_h_REF_2 precautions to prevent the contents of a header file being included twice. */
#include "Mcem_MemMap.h"
[!ENDIF!][!//
[!ENDNOCODE!][!//

#if (STD_ON==MCEM_DEV_ERROR_DETECT)
    extern CONST(uint32, MCEM_CONST) Mcem_au32StaticFaultMasks[5U];
#endif
/*=================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
=================================================================================================*/

/*==================================================================================================
*                                    FUNCTION PROTOTYPES
==================================================================================================*/

#ifdef __cplusplus
}
#endif

#endif  /* CDD_MCEM_CFG_H */

/** @} */
[!ENDCODE!][!//
