/**
*   @file    Gpt_Cfg.c
*   
*   @version 1.0.0
*
*   @brief   AUTOSAR Gpt -  GPT driver configuration source file..
*   @details GPT driver source file, containing C and XPath constructs for generating Gpt
*            configuration source file for the Precompile configuration variant.
*
*   @addtogroup GPT_MODULE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eMios_Stm_Pit
*   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 name space
*     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 GPT_CFG_C_REF_1
*     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 GPT_CFG_C_REF_2
*     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
*
*/
/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Mcal.h"
#include "Gpt.h"
[!NOCODE!][!//
[!VAR "MacEmiosUsed"="0"!]
// Loop on all Configuration Sets
    [!LOOP "GptChannelConfigSet/GptChannelConfiguration/*"!][!//
        [!IF "contains(GptHwChannel, 'EMIOS')"!][!//
            [!VAR "MacEmiosUsed"="1"!]
            [!BREAK!][!//
        [!ENDIF!][!//
    [!ENDLOOP!][!//
    [!LOOP "GptPredefTimerConfiguration/*/*"!][!//
        [!IF "contains(GptHwChannel, 'EMIOS')"!][!//
            [!VAR "MacEmiosUsed"="1"!]
            [!BREAK!][!//
        [!ENDIF!][!//
    [!ENDLOOP!][!//
[!ENDNOCODE!][!//
[!//
[!IF "$MacEmiosUsed=1"!][!//
[!CODE!][!//
#include "Reg_eSys_eMios.h"
[!ENDCODE!][!//
[!ENDIF!][!//


[!INCLUDE "Gpt_VersionCheck_Src.m"!][!//
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define GPT_VENDOR_ID_CFG_C                    43

#define GPT_AR_RELEASE_MAJOR_VERSION_CFG_C     4

#define GPT_AR_RELEASE_MINOR_VERSION_CFG_C     3

#define GPT_AR_RELEASE_REVISION_VERSION_CFG_C  1
#define GPT_SW_MAJOR_VERSION_CFG_C             1
#define GPT_SW_MINOR_VERSION_CFG_C             0
#define GPT_SW_PATCH_VERSION_CFG_C             0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    #if ((GPT_AR_RELEASE_MAJOR_VERSION_CFG_C != MCAL_AR_RELEASE_MAJOR_VERSION) || \
         (GPT_AR_RELEASE_MINOR_VERSION_CFG_C != MCAL_AR_RELEASE_MINOR_VERSION) \
        )
        #error "AutoSar Version Numbers of Gpt_Cfg.c and Mcal.h are different"
    #endif
#endif

/* Check if Gpt_Cfg.c file and Gpt.h header file are of the same vendor */
#if (GPT_VENDOR_ID_CFG_C != GPT_VENDOR_ID)
    #error "Gpt_Cfg.c and Gpt.h have different vendor ids"
#endif
/* Check if Gpt_Cfg.c file and Gpt.h header file are of the same Autosar version */
#if ((GPT_AR_RELEASE_MAJOR_VERSION_CFG_C != GPT_AR_RELEASE_MAJOR_VERSION) || \
     (GPT_AR_RELEASE_MINOR_VERSION_CFG_C != GPT_AR_RELEASE_MINOR_VERSION) || \
     (GPT_AR_RELEASE_REVISION_VERSION_CFG_C != GPT_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Gpt_Cfg.c and Gpt.h are different"
#endif
/* Check if Gpt_Cfg.c file and Gpt.h header file are of the same Software version */
#if ((GPT_SW_MAJOR_VERSION_CFG_C != GPT_SW_MAJOR_VERSION) || \
     (GPT_SW_MINOR_VERSION_CFG_C != GPT_SW_MINOR_VERSION) || \
     (GPT_SW_PATCH_VERSION_CFG_C != GPT_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Gpt_Cfg.c and Gpt.h are different"
#endif

[!IF "$MacEmiosUsed=1"!][!//
#if (GPT_VENDOR_ID_CFG_C != REG_ESYS_EMIOS_VENDOR_ID)
    #error "Gpt_Cfg.c and Reg_eSys_eMios.h have different vendor ids"
#endif
/* Check if the source file and Gpt header file are of the same Autosar version */

#if ((GPT_AR_RELEASE_MAJOR_VERSION_CFG_C != REG_ESYS_EMIOS_AR_RELEASE_MAJOR_VERSION) || \
     (GPT_AR_RELEASE_MINOR_VERSION_CFG_C != REG_ESYS_EMIOS_AR_RELEASE_MINOR_VERSION) || \
     (GPT_AR_RELEASE_REVISION_VERSION_CFG_C != REG_ESYS_EMIOS_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Gpt_Cfg.c and Reg_eSys_eMios.h are different"
#endif
/* Check if source file and GPT header file are of the same Software version */

#if ((GPT_SW_MAJOR_VERSION_CFG_C != REG_ESYS_EMIOS_SW_MAJOR_VERSION) || \
     (GPT_SW_MINOR_VERSION_CFG_C != REG_ESYS_EMIOS_SW_MINOR_VERSION) || \
     (GPT_SW_PATCH_VERSION_CFG_C != REG_ESYS_EMIOS_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Gpt_Cfg.c and Reg_eSys_eMios.h are different"
#endif
[!ENDIF!][!//

/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/
#define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
/** @violates @ref GPT_CFG_C_REF_1 MISRA 2012 Required Directive 4.10, the contents of a header 
*   file being included more than once.*/
/** @violates @ref GPT_CFG_C_REF_2 MISRA 2012 Advisory Rule 20.1, <MA>_MemMap.h is included
*   after each section define in order to set the current memory section as defined by AUTOSAR.*/
#include "Gpt_MemMap.h"

[!IF "node:exists(GptDemEventParameterRefs)"!]
[!IF "GptDriverConfiguration/GptDisableDemReportErrorStatus = 'false'"!]
CONST(Mcal_DemErrorType, GPT_CONST) Gpt_E_TimeoutCfg = 
{
[!IF "node:exists(GptDemEventParameterRefs/GPT_E_TIMEOUT)"!][!//
    (uint32)STD_ON,
[!ELSE!][!//
    (uint32)STD_OFF,
[!ENDIF!][!//
[!IF "node:exists(GptDemEventParameterRefs/GPT_E_TIMEOUT)"!][!//
    (uint16)DemConf_DemEventParameter_[!"node:ref(GptDemEventParameterRefs/GPT_E_TIMEOUT)/@name"!]
[!ELSE!][!//
    (uint16)0U
[!ENDIF!][!//
};
[!ENDIF!][!//
[!ENDIF!][!//

#define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/** @violates @ref GPT_CFG_C_REF_1 MISRA 2012 Required Directive 4.10, the contents of a header 
*   file being included more than once.*/
/** @violates @ref GPT_CFG_C_REF_2 MISRA 2012 Advisory Rule 20.1, <MA>_MemMap.h is included
*   after each section define in order to set the current memory section as defined by AUTOSAR.*/
#include "Gpt_MemMap.h"

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

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

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

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

/*==================================================================================================
*                                      GLOBAL CONSTANTS
==================================================================================================*/

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

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

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

#ifdef __cplusplus
}
#endif

/** @} */
