
/**
* @file    Wdg_CfgExt.c
* @version 1.0.0
* @brief   AUTOSAR Wdg - contains the data exported by the watchodg module
* @details Contains the information that will be exported by the module, as requested by Autosar.
*
* @addtogroup  Wdg
* @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : Swt
*   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.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and namespace shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* The used compilers use more than 31 chars for identifiers.
*
* @section WDG_CfgExt_c_REF_1
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
* @section WDG_CfgExt_c_REF_2
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once.
* This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section WDG_CfgExt_c_REF_3
* Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if its identifier only appears in a single function.
* This violation is due to exporting the externally configured initialization structure used by the "<MA>_Init" function.
*
*@section WDG_CfgExt_c_REF_4
* Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if they are referenced in only one translation unit.
* These functions represent the API of the driver. External linkage is needed to "export" the API.
*/

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

#include "Wdg_Channel.h"
#include "Wdg_CfgExt.h"
#if (WDG_TYPE == WDG_INTERNAL_MODULE)
    #include "Reg_eSys_Swt_defines.h"
#endif

[!INCLUDE "Wdg_VersionCheck_Src.m"!][!//
[!INCLUDE "Wdg_PluginMacros.m"!][!//
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @file           Wdg_Cfg.c   
*/
#define WDG_VENDOR_ID_CFG_C                    43
#define WDG_AR_RELEASE_MAJOR_VERSION_CFG_C     4
#define WDG_AR_RELEASE_MINOR_VERSION_CFG_C     3
#define WDG_AR_RELEASE_REVISION_VERSION_CFG_C  1
#define WDG_SW_MAJOR_VERSION_CFG_C             1
#define WDG_SW_MINOR_VERSION_CFG_C             0
#define WDG_SW_PATCH_VERSION_CFG_C             0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if current file and Wdg header file are of the same vendor */
#if (WDG_VENDOR_ID_CFG_C != WDG_CHANNEL_VENDOR_ID)
    #error "Wdg_Cfg.c and Wdg_Channel.h have different vendor ids"
#endif

/* Check if current file and Wdg header file are of the same Autosar version */
#if ((WDG_AR_RELEASE_MAJOR_VERSION_CFG_C    != WDG_CHANNEL_AR_RELEASE_MAJOR_VERSION) || \
     (WDG_AR_RELEASE_MINOR_VERSION_CFG_C    != WDG_CHANNEL_AR_RELEASE_MINOR_VERSION) || \
     (WDG_AR_RELEASE_REVISION_VERSION_CFG_C != WDG_CHANNEL_AR_RELEASE_REVISION_VERSION) \
    )
     #error "AutoSar Version Numbers of Wdg_Cfg.c and Wdg_Channel.h are different"
#endif
/* Check if current file and Wdg header file are of the same Software version */
#if ((WDG_SW_MAJOR_VERSION_CFG_C != WDG_CHANNEL_SW_MAJOR_VERSION) || \
     (WDG_SW_MINOR_VERSION_CFG_C != WDG_CHANNEL_SW_MINOR_VERSION) || \
     (WDG_SW_PATCH_VERSION_CFG_C != WDG_CHANNEL_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Wdg_Cfg.c and Wdg_Channel.h are different"
#endif

   /* Check if current file and Wdg_CfgExt header file are of the same vendor */
 #if (WDG_VENDOR_ID_CFG_C != WDG_VENDOR_ID_CFG_EXT)
     #error "Wdg_Cfg.c and Wdg_CfgExt.h have different vendor ids"
 #endif

 /* Check if source file Wdg_CfgExt Wdg header file are of the same Autosar version */
 #if ((WDG_AR_RELEASE_MAJOR_VERSION_CFG_C != WDG_AR_RELEASE_MAJOR_VERSION_CFG_EXT) || \
      (WDG_AR_RELEASE_MINOR_VERSION_CFG_C != WDG_AR_RELEASE_MINOR_VERSION_CFG_EXT) || \
      (WDG_AR_RELEASE_REVISION_VERSION_CFG_C != WDG_AR_RELEASE_REVISION_VERSION_CFG_EXT))
     #error "AutoSar Version Numbers of Wdg_Cfg.c and Wdg_CfgExt.h are different"
 #endif
 /* Check if source file Wdg_CfgExt Wdg header file are of the same Software version */
 #if ((WDG_SW_MAJOR_VERSION_CFG_C != WDG_SW_MAJOR_VERSION_CFG_EXT) || \
      (WDG_SW_MINOR_VERSION_CFG_C != WDG_SW_MINOR_VERSION_CFG_EXT) || \
      (WDG_SW_PATCH_VERSION_CFG_C != WDG_SW_PATCH_VERSION_CFG_EXT))
     #error "Software Version Numbers of Wdg_Cfg.c and Wdg_CfgExt.h are different"
 #endif

#if (WDG_TYPE == WDG_INTERNAL_MODULE)
    /* Check if current file and Reg_eSys_Swt header file are of the same vendor */
    #if (WDG_VENDOR_ID_CFG_C != REG_ESYS_SWT_DEFINES_VENDOR_ID)
        #error "Wdg_Cfg.c and Reg_eSys_Swt_defines.h have different vendor ids"
    #endif
    
    /* Check if current file and Reg_eSys_Swt header file are of the same Autosar version */
    #if ((WDG_AR_RELEASE_MAJOR_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_AR_RELEASE_MAJOR_VERSION) || \
         (WDG_AR_RELEASE_MINOR_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_AR_RELEASE_MINOR_VERSION) || \
         (WDG_AR_RELEASE_REVISION_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_AR_RELEASE_REVISION_VERSION) \
        )
        #error "AutoSar Version Numbers of Wdg_Cfg.c and Reg_eSys_Swt_defines.h are different"
    #endif
    
    /* Check if current file and Reg_eSys_Swt header file are of the same Software version */
    #if ((WDG_SW_MAJOR_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_SW_MAJOR_VERSION) || \
         (WDG_SW_MINOR_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_SW_MINOR_VERSION) || \
         (WDG_SW_PATCH_VERSION_CFG_C != REG_ESYS_SWT_DEFINES_SW_PATCH_VERSION) \
        )
        #error "Software Version Numbers of Wdg_Cfg.c and Reg_eSys_Swt_defines.h are different"
    #endif
#endif

/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/


/*==================================================================================================
*                                       LOCAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/


/*==================================================================================================
*                                       GLOBAL CONSTANTS
==================================================================================================*/
#define WDG_START_SEC_CONST_8
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1 */
/* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10 */
#include "Wdg_MemMap.h"
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */

CONST(uint8, WDG_CONST) Wdg_au8Index[WDG_NO_OF_INSTANCES] = 
{
WdgConf_WdgGeneral_[!"node:name(("WdgGeneral/WdgIndex"))"!]_U8,
[!FOR "i" = "1" TO "num:i($WdgMaxNumberOfInstances)-1"!]
[!CR!] WdgConf_WdgGeneral_[!"node:name(concat("WdgGeneral/WdgIndex",$i))"!]_U8,
[!ENDFOR!] 
};

#define WDG_STOP_SEC_CONST_8
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1 */
/* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10 */
#include "Wdg_MemMap.h"

#define WDG_START_SEC_CONFIG_DATA_UNSPECIFIED
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1 */
/* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10 */
#include "Wdg_MemMap.h"
/* @violates @ref WDG_CfgExt_c_REF_3 MISRA 2012 Advisory 8.9 */
[!INDENT "0"!][!//
[!IF "IMPLEMENTATION_CONFIG_VARIANT='VariantPreCompile' or IMPLEMENTATION_CONFIG_VARIANT='VariantLinkTime' "!]
  [!IF "variant:size()<=1"!]
      [!LOOP "WdgSettingsConfig/*"!][!//
          [!VAR "configName" = "@name"!][!//
          [!IF "var:defined('postBuildVariant')"!][!//
              [!VAR "variant_name" = "variant:name()"!] 
          [!ENDIF!]
      [!ENDLOOP!][!//
      CONSTP2CONST(Wdg_ConfigType, WDG_VAR, WDG_APPL_CONST) Wdg_apPBCfgVariantPredefined[WDG_NO_OF_INSTANCES]={
          [!FOR "i" = "0" TO "num:i($WdgMaxNumberOfInstances)-1"!][!//
              [!VAR "found" = "'false'"!][!//
              [!LOOP "./WdgSettingsConfig/*"!][!//
                  [!IF "./WdgInstance=concat('SWT',$i)"!][!//
                      [!VAR "found" = "'true'"!][!//
                      [!VAR "configName" = "@name"!][!//
                  [!ENDIF!][!//
              [!ENDLOOP!][!//
                  [!IF "$found"!] 
                      [!IF "var:defined('postBuildVariant')"!][!//
                          &[!"$configName"!]_[!"$variant_name"!][!//                      
                      [!ELSE!][!// 
                          &[!"$configName"!][!//
                      [!ENDIF!][!//
                  [!ELSE!][!//
                      NULL_PTR[!//
                  [!ENDIF!][!//
                  [!IF "$i < num:i($WdgMaxNumberOfInstances)-1"!],[!ENDIF!]
          [!ENDFOR!][!//
          };
  [!ENDIF!]
[!ENDIF!]
[!ENDINDENT!][!// 

#define WDG_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/**
* @brief Include Memory mapping specification
*
* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1
* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10
*/
#include "Wdg_MemMap.h"

#define WDG_START_SEC_CONST_UNSPECIFIED
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1 */
/* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10 */
#include "Wdg_MemMap.h"

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_3 MISRA 2012 Advisory 8.9 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Disable_Rejected = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_DISABLE_REJECTED)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_DISABLE_REJECTED)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_DISABLE_REJECTED)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_3 MISRA 2012 Advisory 8.9 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Mode_Failed = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_MODE_FAILED)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_MODE_FAILED)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_MODE_FAILED)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Corrupt_Config = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_CORRUPT_CONFIG)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_CORRUPT_CONFIG)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_CORRUPT_CONFIG)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Forbidden_Invocation = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_FORBIDDEN_INVOCATION)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_FORBIDDEN_INVOCATION)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_FORBIDDEN_INVOCATION)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Invalid_Call = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_INVALID_CALL)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_INVALID_CALL)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_INVALID_CALL)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */
CONST(Mcal_DemErrorType, WDG_CONST) WDG_E_Unlocked = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_UNLOCKED)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_UNLOCKED)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_UNLOCKED)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

[!IF "node:exists(WdgDemEventParameterRefs)"!][!//
[!IF "WdgGeneral/AutosarExt/WdgDisableDemReportErrorStatus = 'false'"!][!//
/* @violates @ref WDG_CfgExt_c_REF_4 MISRA 2012 Advisory 8.7 */
CONST(Mcal_DemErrorType, WDG_CONST) Wdg_E_Invalid_Parameter = 
{
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_INVALID_PARAMETER)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(WdgDemEventParameterRefs/WDG_E_INVALID_PARAMETER)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(WdgDemEventParameterRefs/WDG_E_INVALID_PARAMETER)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

#define WDG_STOP_SEC_CONST_UNSPECIFIED
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref WDG_CfgExt_c_REF_1 MISRA 2012 Advisory 20.1 */
/* @violates @ref WDG_CfgExt_c_REF_2 MISRA 2012 Required 4.10 */
#include "Wdg_MemMap.h"

/*==================================================================================================
*                                       GLOBAL VARIABLES
==================================================================================================*/

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

/*==================================================================================================
*                                      LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                     GLOBAL FUNCTIONS
==================================================================================================*/
#ifdef __cplusplus
}
#endif

/** @} */
