[!CODE!][!//
[!AUTOSPACING!]
/**
 *   @file         Icu_PBCfg.c
 *   @implements Icu_PBCfg.c_Artifact
 *   @version 1.0.0
 *
 *   @brief   AUTOSAR Icu - contains the data exported by the Icu module
 *   @details Contains the information that will be exported by the module, as requested by Autosar.
 *
 *   @addtogroup ICU_MODULE
 *   @{
 */
/*==================================================================================================
 *   Project              : AUTOSAR 4.3 MCAL
 *   Platform             : PA
 *   Peripheral           : eMIOS SIU
 *   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 ICU_PBCFG_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 ICU_PBCFG_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.
*
* @section ICU_PBCFG_C_REF_3
* 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.
* External linkage is needed to "export" the configuration structure to driver high layer.
*
* @section ICU_PBCFG_C_REF_4
* Violates MISRA 2012 Required Rule 8.5, An external object or function shall be declared once in one and only one file.
* This is an user ISR function and is available on application level. Extern declaration is done in each PBCfg.c.
*
* @section ICU_PBCFG_C_REF_5
* 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.
*
* @section ICU_PBCFG_C_REF_6
* Violates MISRA 2012 Required Rule 8.4, A compatible declaration shall be visible when an object or function with external linkage is defined.
* This violation is due to exporting the externally configured initialization structure.
*
*/

 /*==================================================================================================
 *                                         INCLUDE FILES
 * 1) system and project includes
 * 2) needed interfaces from external units
 * 3) internal and external interfaces from this unit
 *================================================================================================*/
#include "Icu.h"
#include "Icu_Ipw.h"

#if ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON))
#include "CDD_Mcl.h"
#endif

[!NOCODE!][!//
[!INCLUDE "Icu_VersionCheck_Src_PB.m"!][!//
[!ENDNOCODE!][!//
/*==================================================================================================
 *                              SOURCE FILE VERSION INFORMATION
 *================================================================================================*/

#define ICU_VENDOR_ID_PBCFG_C                   43

#define ICU_AR_RELEASE_MAJOR_VERSION_PBCFG_C    4
#define ICU_AR_RELEASE_MINOR_VERSION_PBCFG_C    3
#define ICU_AR_RELEASE_REVISION_VERSION_PBCFG_C       1

#define ICU_SW_MAJOR_VERSION_PBCFG_C            1
#define ICU_SW_MINOR_VERSION_PBCFG_C            0
#define ICU_SW_PATCH_VERSION_PBCFG_C            0

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

/* Check Icu_PBCfg.c against Icu.h file versions */
#if (ICU_VENDOR_ID_PBCFG_C != ICU_VENDOR_ID)
    #error "Icu_PBCfg.c and Icu.h have different vendor IDs"
#endif

#if ((ICU_AR_RELEASE_MAJOR_VERSION_PBCFG_C != ICU_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_AR_RELEASE_MINOR_VERSION_PBCFG_C != ICU_AR_RELEASE_MINOR_VERSION) || \
     (ICU_AR_RELEASE_REVISION_VERSION_PBCFG_C != ICU_AR_RELEASE_REVISION_VERSION))
  #error "AutoSar Version Numbers of Icu_PBCfg.c and Icu.h are different"
#endif

#if ((ICU_SW_MAJOR_VERSION_PBCFG_C != ICU_SW_MAJOR_VERSION) || \
     (ICU_SW_MINOR_VERSION_PBCFG_C != ICU_SW_MINOR_VERSION) || \
     (ICU_SW_PATCH_VERSION_PBCFG_C != ICU_SW_PATCH_VERSION))
       #error "Software Version Numbers of Icu_PBCfg.c  and Icu.h are different"
#endif


/* Check Icu_PBCfg.c against Icu_Ipw.h file versions */
#if (ICU_VENDOR_ID_PBCFG_C != ICU_IPW_VENDOR_ID)
    #error "Icu_PBCfg.c and Icu_Ipw.h have different vendor IDs"
#endif

#if ((ICU_AR_RELEASE_MAJOR_VERSION_PBCFG_C != ICU_IPW_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_AR_RELEASE_MINOR_VERSION_PBCFG_C != ICU_IPW_AR_RELEASE_MINOR_VERSION) || \
     (ICU_AR_RELEASE_REVISION_VERSION_PBCFG_C != ICU_IPW_AR_RELEASE_REVISION_VERSION))
  #error "AutoSar Version Numbers of Icu_PBCfg.c and Icu_Ipw.h are different"
#endif

#if ((ICU_SW_MAJOR_VERSION_PBCFG_C != ICU_IPW_SW_MAJOR_VERSION) || \
     (ICU_SW_MINOR_VERSION_PBCFG_C != ICU_IPW_SW_MINOR_VERSION) || \
     (ICU_SW_PATCH_VERSION_PBCFG_C != ICU_IPW_SW_PATCH_VERSION))
       #error "Software Version Numbers of Icu_PBCfg.c  and Icu_Ipw.h are different"
#endif

#if ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON))
/* Check Icu_PBCfg.c against CDD_Mcl.h file versions */
#if (ICU_VENDOR_ID_PBCFG_C != MCL_VENDOR_ID)
    #error "Icu_PBcfg.c and CDD_Mcl.h have different vendor IDs"
#endif

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    #if ((ICU_AR_RELEASE_MAJOR_VERSION_PBCFG_C != MCL_AR_RELEASE_MAJOR_VERSION) || \
         (ICU_AR_RELEASE_MINOR_VERSION_PBCFG_C != MCL_AR_RELEASE_MINOR_VERSION) || \
         (ICU_AR_RELEASE_REVISION_VERSION_PBCFG_C != MCL_AR_RELEASE_REVISION_VERSION))
        #error "AutoSar Version Numbers of Icu_Pbcfg.c and CDD_Mcl.h are different"
    #endif
#endif

#if ((ICU_SW_MAJOR_VERSION_PBCFG_C != MCL_SW_MAJOR_VERSION) || \
     (ICU_SW_MINOR_VERSION_PBCFG_C != MCL_SW_MINOR_VERSION) || \
     (ICU_SW_PATCH_VERSION_PBCFG_C != MCL_SW_PATCH_VERSION))
    #error "Software Version Numbers of Icu_PBcfg.c and CDD_Mcl.h are different"
#endif
#endif

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


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


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


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

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

/*==================================================================================================
 *                                       GLOBAL CONSTANTS
 *================================================================================================*/
[!INCLUDE "Icu_PluginMacros.m"!][!//
[!CALL "ICU_VARIABLES"!]

#define ICU_START_SEC_CODE
/**
* @violates @ref ICU_PBCFG_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_PBCFG_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"

[!CALL "ICU_GENERATE_NOTIFICATION_FUNCTIONS_PROTOTYPE", "MISRA_REF"="'ICU_PBCFG_C_REF_4 An external object or function shall be declared once in one and only one file.'"!]

#define ICU_STOP_SEC_CODE
/**
* @violates @ref ICU_PBCFG_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_PBCFG_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"


#define ICU_START_SEC_CONFIG_DATA_UNSPECIFIED
/**
* @violates @ref ICU_PBCFG_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_PBCFG_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"

[!NOCODE!][!//
[!IF "var:defined('postBuildVariant')"!]
[!VAR "PBCfg_Variant" = "concat('PB_', $postBuildVariant)"!]
[!ELSE!]
[!VAR "PBCfg_Variant" = "'PB'"!]
[!ENDIF!]
[!ENDNOCODE!][!//

[!CALL "ICU_GENERATE_CONFIGURATION","VARIANT"="$PBCfg_Variant", "MISRA_REF"="'Icu_PBCfg_c_3'"!]

[!CALL "ICU_GENERATE_IP_CONFIGURATION","VARIANT"="$PBCfg_Variant", "MISRA_REF"="'Icu_PBCfg_c_3'", "MISRA_REF_1"="'Icu_PBCfg_c_4'"!]
/*
*   @brief This index relates the Hardware channels with the respective ICU channel.
*   When an normal interrupt is asserted this index is used to locate the corresponding ICU channel
*/
[!CALL "ICU_GENERATE_HW_MAPPING","VARIANT"="$PBCfg_Variant", "MISRA_REF"="'Icu_PBCfg_c_3'"!]


[!SELECT "IcuConfigSet"!]
[!CALL "ICU_VARIABLES"!]
[!//
[!IF "((../IMPLEMENTATION_CONFIG_VARIANT='VariantPreCompile') or (../IMPLEMENTATION_CONFIG_VARIANT='VariantLinkTime')) and variant:size()<=1"!]
#ifdef ICU_PRECOMPILE_SUPPORT
/**
* @violates @ref ICU_PBCFG_C_REF_3 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if
* they are referenced in only one translation unit.
*
* @violates @ref ICU_PBCFG_C_REF_5 Advisory Rule 8.9, An object should be defined at block scope if its identifier only appears in a single function.
*
* @violates @ref ICU_PBCFG_C_REF_6 Required Rule 8.4, A compatible declaration shall be visible when an object or function with external linkage is defined.
*
*/
CONST(Icu_ConfigType, ICU_CONST) Icu_PBCfgVariantPredefined =
[!ELSE!]
/**
* @violates @ref ICU_PBCFG_C_REF_3 Advisory Rule 8.7, Functions and objects should not be defined with external linkage if
* they are referenced in only one translation unit.
*/
CONST(Icu_ConfigType, ICU_CONST) [!"as:name(.)"!][!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
[!ENDIF!]
 {
    (Icu_ChannelType)[!"num:i(IcuMaxChannel)"!], /* The number of channels configured*/

    &Icu_InitChannel_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],
    {
    /** @brief Pointer to the structure containing eMios configuration */
    [!IF "(num:i($OutNumIcuChannelsUsingeMios))>0"!]
        &Icu_eMiosIcu_IpConfig_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],
    [!ELSE!]
        NULL_PTR,
    [!ENDIF!]
    /** @brief Pointer to the structure containing Siu configuration */
    [!IF "(num:i($OutNumIcuChannelsUsingSiu))>0"!]
        &Icu_SiuIcu_IpConfig_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],
    [!ELSE!]
        NULL_PTR,
    [!ENDIF!]
        /** @brief Pointer to Array containing channel IP related information */
        &Icu_IpChannelConfig_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][!CR!]
    },
    &Icu_InitHWMap_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][!CR!]
 };
 [!IF "((../IMPLEMENTATION_CONFIG_VARIANT='VariantPreCompile') or (../IMPLEMENTATION_CONFIG_VARIANT='VariantLinkTime')) and variant:size()<=1"!]
#endif /*ICU_PRECOMPILE_SUPPORT*/
[!ENDIF!]
[!ENDSELECT!]
#define ICU_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/**
* @violates @ref ICU_PBCFG_C_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_PBCFG_C_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"
/*==================================================================================================
 *                                       GLOBAL VARIABLES
 *================================================================================================*/



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


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

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


#ifdef __cplusplus
}
#endif

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