[!NOCODE!][!//
/**
  @file    Icu_PluginMacros.m
  @version 1.0.0

  @brief   AUTOSAR Icu - plugin check.
  @details Version checks.

  Project AUTOSAR 4.3 MCAL
  Patform PA
  Peripheral eMIOS SIU
  Dependencies none

  ARVersion 4.3.1
  ARRevision ASR_REL_4_3_REV_0001
  ARConfVariant
  SWVersion 1.0.0
  BuildVersion 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.
*/
/*==================================================================================================
==================================================================================================*/
[!AUTOSPACING!]
[!// MACRO for creating the mapping between hardware channels and logical channels
[!MACRO "ICU_VARIABLES"!]
[!NOCODE!]
    [!VAR "ICU_CHANNELS"   = "num:i(80)"!]
    [!VAR "OutNumIcuChannels" = "num:i(count(IcuChannel/*))"!]
    [!VAR "OutNumIcuChannelsUsingeMios" = "0"!]
    [!VAR "OutNumIcuChannelsUsingSiu"  = "0"!]

    [!LOOP "IcuChannel/*"!][!/*
        [!//Update variables storing number of Icu channels using either eMios, Siu
        */!][!IF "contains(IcuHwIP,'EMIOS')"!][!/*
            */!][!VAR "OutNumIcuChannelsUsingeMios" = "$OutNumIcuChannelsUsingeMios + 1"!][!/*
        */!][!ELSEIF "contains(IcuHwIP,'SIU')"!][!/*
            */!][!VAR "OutNumIcuChannelsUsingSiu" = "$OutNumIcuChannelsUsingSiu + 1"!][!/*
        */!][!ENDIF!][!/*
    */!][!ENDLOOP!]
    [!VAR "EMIOS_0_CHANNELS_START_INDEX"   = "num:i(0)"!]
    [!VAR "EMIOS_1_CHANNELS_START_INDEX"   = "num:i(32)"!]
    [!VAR "IRQ_CHANNELS_START_INDEX"   = "num:i(64)"!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!// MACRO for creating Siu global configuration paramters
[!MACRO "ICU_SIU_GLOBAL_CONFIGURATION"!][!//
[!NOCODE!]
    [!VAR "MacSiuChannelsExists"="0"!][!//
    [!LOOP "IcuChannel/*"!][!//
    [!IF "contains(IcuHwIP,'SIU')"!][!//
        [!VAR "MacSiuChannelsExists"="1"!][!//
    [!ENDIF!][!//
    [!ENDLOOP!][!//
        [!IF "$MacSiuChannelsExists != 0 "!][!//
    [!IF "node:exists(IcuSiu/IcuSiu_0/IcuEXT_ISR_InterruptFilterClockPrescaler)"!][!//
        [!IF "node:exists(IcuSiu/IcuSiu_0/IcuEXT_ISR_AlternateInterruptFilterClockPrescaler)"!][!//
        [!CODE!](Icu_Siu_GlobalConfigurationType)(((Icu_Siu_GlobalConfigurationType)[!"node:value(IcuSiu/IcuSiu_0/IcuEXT_ISR_AlternateInterruptFilterClockPrescaler)"!]U << ICU_SIU_INT_ALTERNATE_FILTER_CLOCK_PRESCALER_GC_SHIFT) | [!ENDCODE!][!//
            [!CODE!](Icu_Siu_GlobalConfigurationType)[!"node:value(IcuSiu/IcuSiu_0/IcuEXT_ISR_InterruptFilterClockPrescaler)"!]U),[!ENDCODE!][!//
        [!ELSE!]
        [!CODE!](Icu_Siu_GlobalConfigurationType)[!"node:value(IcuSiu/IcuSiu_0/IcuEXT_ISR_InterruptFilterClockPrescaler)"!]U,[!ENDCODE!][!//
        [!ENDIF!][!//
    [!ELSE!]
        [!CODE!](Icu_Siu_GlobalConfigurationType)0U,[!ENDCODE!][!//
    [!ENDIF!][!//
    [!ELSE!]
        [!CODE!](Icu_Siu_GlobalConfigurationType)0U,[!ENDCODE!][!//
    [!ENDIF!][!//
[!ENDNOCODE!][!//
[!ENDMACRO!]

[!// MACRO for get prescaler for Master Bus
[!MACRO "GetMasterPrescaler", "parameMiosBus", "parameMiosChannel"!]
[!NOCODE!]
    [!IF "($parameMiosBus = 'EMIOS_BUS_A')"!]
        [!VAR "eMiosMaster" = "23"!]
    [!ELSE!]
        [!IF "($parameMiosChannel < 8)"!][!//
            [!VAR "eMiosMaster" = "0"!]
        [!ELSE!]
            [!VAR "eMiosMaster" = "16"!]
        [!ENDIF!]
    [!ENDIF!]
    [!VAR "MacIsRightMasterBus" = "'false'"!]
    [!VAR "NumIcueMiosMasterBus" = "num:i(count(node:ref(IcueMiosChannelRef)/../../IcueMiosMasterBus/*))"!]
    [!IF "num:i($NumIcueMiosMasterBus)>0"!]
        [!LOOP "node:ref(IcueMiosChannelRef)/../../IcueMiosMasterBus/*"!]
            [!VAR "MastereMiosIdx" = "substring-after(eMiosMasterBus,'CH_')"!]
            [!IF "(num:i($eMiosMaster) = $MastereMiosIdx)"!]
                [!VAR "PrescalerVal" = "node:value(MasterBusPrescaler)"!]
                [!VAR "MacIsRightMasterBus" = "'true'"!]
            [!ENDIF!]
        [!ENDLOOP!]
        [!IF "$MacIsRightMasterBus = 'false'"!]
            [!ERROR!] From variant "[!"variant:name( )"!]", Selecting eMios Master Bus channel correspond to [!"$parameMiosBus"!] is wrong[!ENDERROR!]
        [!ENDIF!]
    [!ELSE!]
        [!ERROR!] From variant "[!"variant:name( )"!]", eMios Master Bus channel configuration correspond to [!"$parameMiosBus"!] not exist[!ENDERROR!]
    [!ENDIF!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!// MACRO for get prescaler alternate for Master Bus
[!MACRO "GetMasterPrescaler_Alternate", "parameMiosBus", "parameMiosChannel"!]
[!NOCODE!]
    [!IF "($parameMiosBus = 'EMIOS_BUS_A')"!][!//
        [!VAR "eMiosMaster" = "23"!]
    [!ELSE!][!//
        [!IF "($parameMiosChannel < 8)"!][!//
            [!VAR "eMiosMaster" = "0"!]
        [!ELSE!]
            [!VAR "eMiosMaster" = "16"!]
        [!ENDIF!][!//
    [!ENDIF!][!//
    [!VAR "MacIsRightMasterBus" = "'false'"!]
    [!VAR "NumIcueMiosMasterBus" = "num:i(count(node:ref(IcueMiosChannelRef)/../../IcueMiosMasterBus/*))"!]
    [!IF "num:i($NumIcueMiosMasterBus)>0"!]
        [!LOOP "node:ref(IcueMiosChannelRef)/../../IcueMiosMasterBus/*"!]
            [!VAR "MastereMiosIdx" = "substring-after(eMiosMasterBus,'CH_')"!]
            [!IF "(num:i($eMiosMaster) = $MastereMiosIdx)"!]
                [!VAR "PrescalerVal_Alternate" = "node:value(MasterBusPrescaler_Alternate)"!]
                [!VAR "MacIsRightMasterBus" = "'true'"!]
            [!ENDIF!]
        [!ENDLOOP!]
        [!IF "$MacIsRightMasterBus = 'false'"!]
            [!ERROR!] From variant "[!"variant:name( )"!]", Selecting eMios Master Bus channel correspond to  [!"$parameMiosBus"!] is wrong[!ENDERROR!]
        [!ENDIF!]
    [!ELSE!]
        [!ERROR!] From variant "[!"variant:name( )"!]", eMios Master Bus channel configuration correspond to [!"$parameMiosBus"!] not exist[!ENDERROR!]
    [!ENDIF!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!// MACRO for creating the mapping between hardware channels and logical channels
[!MACRO "ICU_GENERATE_HW_MAPPING","VARIANT", "MISRA_REF"!]
[!SELECT "IcuConfigSet"!]
static CONST(Icu_ChannelType,ICU_CONST) Icu_InitHWMap_[!"$VARIANT"!][ICU_MAX_HW_CHANNELS] = {[!CR!][!/*
   */!][!FOR "Idx" = "0" TO "$ICU_CHANNELS - 1"!][!/*
        */!][!VAR "Found" = "'false'"!][!/*
        */!][!LOOP "./IcuChannel/*"!][!/*
            */!][!IF "contains(IcuHwIP,'EMIOS')"!][!/*
                */!][!IF "(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule)) = 'EMIOS_0'"!][!/*
                    */!][!VAR "ch" = "substring-after((node:ref(IcueMiosChannelRef)/IcueMiosChannel),'CH_') + $EMIOS_0_CHANNELS_START_INDEX"!][!/*
                */!][!ELSEIF "(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule)) = 'EMIOS_1'"!][!/*
                    */!][!VAR "ch" = "substring-after((node:ref(IcueMiosChannelRef)/IcueMiosChannel),'CH_')+$EMIOS_1_CHANNELS_START_INDEX"!][!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!][!/*
            */!][!IF "contains(IcuHwIP,'SIU')"!][!/*
                */!][!VAR "ch" = "substring-after((node:ref(IcuSiuChannelRef)/IcuSiuChannel),'IRQ_CH_')+$IRQ_CHANNELS_START_INDEX"!][!/*
            */!][!ENDIF!][!/*
            */!][!IF "num:i($ch)=$Idx"!][!/*
                */!]  [!"node:name(.)"!][!/*
                */!][!VAR "Found" = "'true'"!][!/*
            */!][!ENDIF!][!/*
            */!][!ENDLOOP!][!/*
            */!][!IF "$Found='false'"!][!/*
          */!]  NoIcuChannel[!/*
           */!][!ENDIF!][!/*

        */!][!IF "$Idx < $ICU_CHANNELS - 1"!],[!ELSE!] [!ENDIF!][!/*

        */!][!IF "$Idx < $EMIOS_1_CHANNELS_START_INDEX"!][!/*
            */!] /* maps to EMIOS_0_CH_[!"$Idx"!] */[!CR!][!/*
        */!][!ELSEIF "$Idx < $IRQ_CHANNELS_START_INDEX"!][!/*
            */!] /* maps to EMIOS_1_CH_[!"num:i($Idx - $EMIOS_1_CHANNELS_START_INDEX)"!] */[!CR!][!/*
        */!][!ELSEIF "$Idx < $ICU_CHANNELS"!][!/*
            */!] /* maps to IRQ_CH_[!"num:i($Idx - $IRQ_CHANNELS_START_INDEX)"!] */[!CR!][!/*
        */!][!ENDIF!][!/*
    */!][!ENDFOR!][!/*
    */!]};
[!ENDSELECT!]
[!ENDMACRO!]
[!MACRO "ICU_CHECK_CHANNEL_VS_ISR_ENABLE"!]
[!NOCODE!]
[!SELECT "IcuConfigSet"!]
[!LOOP "./IcuChannel/*"!]
    [!IF "contains(IcuHwIP,'EMIOS')"!][!//
        [!VAR "IsrName" = "concat(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule),'_',node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel))"!]
        [!IF "(node:value((../../IcuHwInterruptConfigList/*[contains(IcuIsrHwId,$IsrName)])/IcuIsrEnable) = 'false') "!]
            [!ERROR!] ISR for [!"$IsrName"!] is not enabled in HwInterruptConfigList but is used in variant "[!"variant:name( )"!]", node "[!"node:name(.)"!]" [!ENDERROR!]
        [!ENDIF!]
    [!ENDIF!][!//
    [!IF "contains(IcuHwIP,'SIU')"!][!//
        [!VAR "IsrName" = "node:value(node:ref(IcuSiuChannelRef)/IcuSiuChannel)"!]
        [!IF "(node:value((../../IcuHwInterruptConfigList/*[contains(IcuIsrHwId,$IsrName)])/IcuIsrEnable) = 'false') "!]
            [!ERROR!] ISR for [!"$IsrName"!] is not enabled in HwInterruptConfigList but is used in variant "[!"variant:name( )"!]", node "[!"node:name(.)"!]" [!ENDERROR!]
        [!ENDIF!]
    [!ENDIF!][!//
[!ENDLOOP!]
[!ENDSELECT!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!MACRO "ICU_CHECK_OVERFLOW_NOTIFICATION_FOR_EMIOS"!]
[!NOCODE!]
[!VAR "paramMasterBusCh" = "'CH_0'"!]
[!VAR "parameMiosChannel" = "0"!]
[!VAR "IsrName" = "'EMIOS_0_CH_0'"!]
[!SELECT "IcuConfigSet"!]
    [!IF "node:value(../IcuAutosarExt/IcuOverflowNotificationApi) = 'true'"!][!//
        [!LOOP "./IcuChannel/*"!]
            [!IF "contains(IcuHwIP, 'EMIOS')"!][!//
                [!IF "((IcuOverflowNotification != 'NULL_PTR') and (IcuMeasurementMode != 'ICU_MODE_EDGE_COUNTER'))"!][!//
                    [!IF "((node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect != 'EMIOS_BUS_A') and (node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect != 'EMIOS_BUS_DIVERSE'))"!][!//
                        [!ERROR!] From variant "[!"variant:name( )"!]", node "[!"node:name(.)"!]", "IcuOverflowNotification" only supports eMios channels using the Master bus[!ENDERROR!]
                    [!ENDIF!][!//
                    [!IF "(node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect = 'EMIOS_BUS_A')"!][!//
                        [!VAR "paramMasterBusCh" = "'CH_23'"!]
                    [!ELSEIF "(node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect = 'EMIOS_BUS_DIVERSE')"!][!//
                        [!VAR "parameMiosChannel" = "substring-after(node:ref(IcueMiosChannelRef)/IcueMiosChannel,'CH_')"!]
                        [!IF "($parameMiosChannel < 8)"!][!//
                            [!VAR "paramMasterBusCh" = "'CH_0'"!]
                        [!ELSE!]
                            [!VAR "paramMasterBusCh" = "'CH_16'"!]
                        [!ENDIF!][!//
                    [!ENDIF!][!//
                    [!VAR "IsrName" = "concat(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule),'_',$paramMasterBusCh)"!]
                    [!IF "(node:value((../../IcuHwInterruptConfigList/*[contains(IcuIsrHwId,$IsrName)])/IcuIsrEnable) = 'false') "!]
                        [!ERROR!] ISR for [!"$IsrName"!] must be enable as the master bus ISR in HwInterruptConfigList to use for overflow notification in variant "[!"variant:name( )"!]", node "[!"node:name(.)"!]" [!ENDERROR!]
                    [!ENDIF!]
                [!ENDIF!][!//
            [!ENDIF!][!//
        [!ENDLOOP!]
    [!ENDIF!]
[!ENDSELECT!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!// MACRO for generating the notification function prototype
[!MACRO "ICU_GENERATE_NOTIFICATION_FUNCTIONS_PROTOTYPE", "MISRA_REF"="''"!]
[!NOCODE!]
    [!CALL "ICU_CHECK_CHANNEL_VS_ISR_ENABLE"!]
    [!CALL "ICU_CHECK_OVERFLOW_NOTIFICATION_FOR_EMIOS"!]
    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
    [!VAR "Found" = "'false'"!]
    [!SELECT "IcuConfigSet"!]
     [!LOOP "./IcuChannel/*"!]
        [!VAR "a" = "IcuMeasurementMode"!]
        [!IF "(contains($a,'ICU_MODE_TIMESTAMP') and (IcuTimestampMeasurement/IcuTimestampNotification != 'NULL_PTR') and (IcuTimestampMeasurement/IcuTimestampNotification != 'NULL'))"!]
            [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
            [!VAR "MacInnerLoopCounter" = "0"!]
            [!VAR "MacMatchcounter" = "0"!]
            [!VAR "MacNotification" = "IcuTimestampMeasurement/IcuTimestampNotification"!]
            [!LOOP "../../../*/IcuChannel/*"!] [!//All notifications from all configurations
                [!VAR "a" = "IcuMeasurementMode"!]
                [!IF "(contains($a,'ICU_MODE_TIMESTAMP') and (IcuTimestampMeasurement/IcuTimestampNotification != 'NULL_PTR')and (IcuTimestampMeasurement/IcuTimestampNotification != 'NULL'))"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = IcuTimestampMeasurement/IcuTimestampNotification)"!]
                             [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ENDLOOP!]
            [!IF "$MacMatchcounter = 1"!]
                  [!IF "$Found = 'false'"!]
                      [!VAR "Found" = "'true'"!]
                      [!CODE!]
/**
* @brief External Notifications for Timestamp
*
*/[!/*
                       */!][!ENDCODE!]
                 [!ENDIF!]
                 [!CODE!]
/* @violates @ref [!"$MISRA_REF"!] */
extern FUNC (void, ICU_CODE) [!"IcuTimestampMeasurement/IcuTimestampNotification"!](void);[!CR!]
                [!ENDCODE!][!//
            [!ENDIF!]
        [!ENDIF!]
     [!ENDLOOP!]
    [!ENDSELECT!]

    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
    [!VAR "Found" = "'false'"!]
    [!SELECT "IcuConfigSet"!]
     [!LOOP "./IcuChannel/*"!]
        [!VAR "a" = "IcuMeasurementMode"!]
        [!IF "(contains($a,'ICU_MODE_SIGNAL_EDGE_DETECT') and (IcuSignalEdgeDetection/IcuSignalNotification != 'NULL_PTR'))"!]
            [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
            [!VAR "MacInnerLoopCounter" = "0"!]
            [!VAR "MacMatchcounter" = "0"!]
            [!VAR "MacNotification" = "IcuSignalEdgeDetection/IcuSignalNotification"!]
            [!LOOP "../../../*/IcuChannel/*"!] [!//All notifications from all configurations
                [!VAR "a" = "IcuMeasurementMode"!]
                [!IF "(contains($a,'ICU_MODE_SIGNAL_EDGE_DETECT') and (IcuSignalEdgeDetection/IcuSignalNotification != 'NULL_PTR'))"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = IcuSignalEdgeDetection/IcuSignalNotification)"!]
                             [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ENDLOOP!]
            [!IF "$MacMatchcounter = 1"!]
                [!IF "$Found = 'false'"!]
                    [!VAR "Found" = "'true'"!]
                     [!CODE!][!//
[!CR!]/**
* @brief External Notifications for Edge Detection
*
*/[!/*
          */!][!ENDCODE!]
                [!ENDIF!]
                [!CODE!]
/* @violates @ref [!"$MISRA_REF"!] */
extern FUNC (void, ICU_CODE) [!"IcuSignalEdgeDetection/IcuSignalNotification"!](void);[!CR!]
                [!ENDCODE!][!//
            [!ENDIF!]
        [!ENDIF!]
     [!ENDLOOP!]
    [!ENDSELECT!]

    [!VAR "MacOuterLoopCounter" = "0"!]
    [!VAR "MacInnerLoopCounter" = "0"!]
    [!VAR "Found" = "'false'"!]
    [!SELECT "IcuConfigSet"!]
     [!LOOP "./IcuChannel/*"!]
        [!IF "node:exists(IcuOverflowNotification)"!]
         [!IF "(IcuOverflowNotification != 'NULL_PTR') and (IcuOverflowNotification != 'NULL')"!]
            [!VAR "MacOuterLoopCounter" = "$MacOuterLoopCounter + 1"!]
            [!VAR "MacInnerLoopCounter" = "0"!]
            [!VAR "MacMatchcounter" = "0"!]
            [!VAR "MacNotification" = "IcuOverflowNotification"!]
            [!LOOP "../../../*/IcuChannel/*"!] [!//All notifications from all configurations
         [!IF "node:exists(IcuOverflowNotification)"!]
                [!IF "(IcuOverflowNotification != 'NULL_PTR')and (IcuOverflowNotification != 'NULL')"!]
                    [!VAR "MacInnerLoopCounter" = "$MacInnerLoopCounter + 1"!]
                    [!IF "$MacOuterLoopCounter >= $MacInnerLoopCounter"!]
                        [!IF "($MacNotification = IcuOverflowNotification)"!]
                            [!VAR "MacMatchcounter" = "$MacMatchcounter + 1"!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
         [!ENDIF!]
            [!ENDLOOP!]
            [!IF "$MacMatchcounter = 1"!]
                  [!IF "$Found = 'false'"!]
                      [!VAR "Found" = "'true'"!]
                      [!CODE!]
/**
* @brief  Overflow notification handlers
*
*/[!/*
                          */!][!CR!][!ENDCODE!]
                   [!ENDIF!]
                   [!CODE!]
/* @violates @ref [!"$MISRA_REF"!] */
extern FUNC (void, ICU_CODE) [!"IcuOverflowNotification"!](void);[!CR!]
                  [!ENDCODE!][!//
                [!ENDIF!]
            [!ENDIF!]
          [!ENDIF!]
     [!ENDLOOP!]
    [!ENDSELECT!]
[!ENDNOCODE!]
[!ENDMACRO!]

[!// MACRO for creating the configuration pointer(s)
[!MACRO "ICU_GENERATE_CONFIGURATION","VARIANT"="'PB'", "MISRA_REF"="''"!]
[!SELECT "IcuConfigSet"!][!//
[!VAR "count" = "count(IcuChannel/*)"!][!//
[!VAR "Idx" = "1"!][!//
[!VAR "MacLoopVar"="0"!][!//
/*
 *  @brief    [!"$VARIANT"!] Default Configuration
 */
static CONST(Icu_ChannelConfigType, ICU_CONST) Icu_InitChannel_[!"$VARIANT"!][[!"num:i(count(IcuChannel/*))"!]]=
 {
 [!FOR "x" = "0" TO "num:i(count(IcuChannel/*))"!][!/*
  */!][!LOOP "IcuChannel/*"!][!/*
    */!][!VAR "Loop"="num:i($MacLoopVar)"!][!/*
    */!][!IF "IcuChannelId = $Loop"!][!/*
    */!][!WS "8"!]/* [!"node:name(.)"!] */
        {[!CR!][!/*
        */!][!WS "12"!]([!IF "IcuWakeupCapability"!]((Icu_ParamType)1U << ICU_WAKEUP_SHIFT) | \[!CR!][!WS "12"!][!ENDIF!][!/*
        */!](Icu_ParamType)((Icu_ParamType)[!"IcuDefaultStartEdge"!] << ICU_EDGE_PARAM_SHIFT)),[!CR!][!/*

        */!][!IF "contains(IcuHwIP,'EMIOS')"!][!/*
                */!][!IF "not(contains(ecu:list(concat('Icu.ChannelType.',(concat((concat(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule),'_')),node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel))))),node:value(IcuMeasurementMode)))"!][!/*
                    */!][!ERROR!] From variant "[!"variant:name( )"!]", [!"node:name(.)"!] from channel [!"node:name(../.)"!] does not support [!"node:value(IcuMeasurementMode)"!] mode [!ENDERROR!][!/*
                */!][!ENDIF!][!/*
        */!][!ELSEIF "contains(IcuHwIP,'SIU')"!][!/*
                */!][!IF "not(contains(ecu:list(concat('Icu.ChannelType.',node:value(node:ref(IcuSiuChannelRef)/IcuSiuChannel))),node:value(IcuMeasurementMode)))"!][!/*
                    */!][!ERROR!] From variant "[!"variant:name( )"!]", [!"node:name(.)"!] from channel [!"node:name(../.)"!] does not support [!"node:value(IcuMeasurementMode)"!] mode [!ENDERROR!][!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!][!/*
            */!][!WS "12"!][!"IcuMeasurementMode"!],[!CR!][!/*

            */!][!WS "12"!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_SIGNAL_EDGE_DETECT'"!](Icu_MeasurementSubModeType)0U[!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_TIMESTAMP'"!](Icu_MeasurementSubModeType)[!"IcuTimestampMeasurement/IcuTimestampMeasurementProperty"!][!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_SIGNAL_MEASUREMENT'"!](Icu_MeasurementSubModeType)[!"IcuSignalMeasurement/IcuSignalMeasurementProperty"!][!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_EDGE_COUNTER'"!](Icu_MeasurementSubModeType)[!"IcuDefaultStartEdge"!][!ENDIF!],[!CR!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_SIGNAL_MEASUREMENT'"!][!WS "12"!]NULL_PTR[!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_EDGE_COUNTER'"!][!WS "12"!]NULL_PTR[!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_TIMESTAMP'"!][!/*
                */!][!IF "IcuTimestampMeasurement/IcuTimestampNotification!='NULL_PTR'"!][!/*
                    */!][!WS "12"!]&[!"IcuTimestampMeasurement/IcuTimestampNotification"!][!/*
                */!][!ELSE!][!/*
                    */!][!WS "12"!]NULL_PTR[!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!][!/*
            */!][!IF "IcuMeasurementMode='ICU_MODE_SIGNAL_EDGE_DETECT'"!][!/*
                */!][!IF "IcuSignalEdgeDetection/IcuSignalNotification!='NULL_PTR'"!][!/*
                    */!][!WS "12"!]&[!"IcuSignalEdgeDetection/IcuSignalNotification"!][!/*
                */!][!ELSE!][!/*
                    */!][!WS "12"!]NULL_PTR[!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!],
#if ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON))
[!/*     */!](Mcl_ChannelType)[!IF "((IcuMeasurementMode = 'ICU_MODE_TIMESTAMP') or (IcuMeasurementMode = 'ICU_MODE_SIGNAL_MEASUREMENT')) and IcuDMAChannelEnable = 'true'"!][!/*
              */!][!WS "12"!][!"node:value(node:ref(IcuDMAChannelRef)/MclDMAChannelId)"!],[!/* MCL DMA logical Channel
              */!][!IF "node:exists(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif)"!] [!/* Validation for Notification function
                 */!][!IF "(node:value(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif) = 'NULL_PTR') or (node:value(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif) = 'NULL')"!][!/*
                        */!][!ERROR!] From variant "[!"variant:name( )"!]","[!"node:path(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif)"!]" need to be configured for DMA Channels that are linked to "[!"node:name(.)"!]". The name of the notification shall be &lt;IcuChannelName&gt;_MclDmaTransferCompletionNotif e.g [!"node:name(.)"!]_MclDmaTransferCompletionNotif[!ENDERROR!][!/*
                */!][!ELSEIF "node:value(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif) != concat(node:name(.),'_MclDmaTransferCompletionNotif')"!][!/*
                      */!][!ERROR!] From variant "[!"variant:name( )"!]","[!"node:path(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif)"!]" name in "[!"node:name(.)"!]" must be [!"node:name(.)"!]_MclDmaTransferCompletionNotif[!ENDERROR!][!/*
                  */!][!ENDIF!][!/*
                */!][!ELSE!][!/*
                  */!][!ERROR!] From variant "[!"variant:name( )"!]","[!"node:path(node:ref(IcuDMAChannelRef)/MclDmaTransferCompletionNotif)"!]" need to be configured for DMA Channels that are linked to "[!"node:name(.)"!]" [!ENDERROR!][!/*
              */!][!ENDIF!]
                [!IF "node:exists(node:ref(IcuDMAChannelRef)/DmaHwChannel)"!][!/* Validation for DMA source*/!]
                    [!VAR "HwEmiosModule" = "text:split(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule), '_')[2]"!]
                    [!VAR "HwEmios" = "text:split(node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel), '_')[2]"!]
                    [!VAR "DmaSource" = "text:split(node:value(node:ref(IcuDMAChannelRef)/DmaHwChannel),'_')[2]"!]
                    [!IF "num:i($HwEmiosModule) = 0"!]
                        [!IF "num:i($HwEmios) = 0"!]
                            [!IF "$DmaSource != 20"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 1"!]
                            [!IF "$DmaSource != 21"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 2"!]
                            [!IF "$DmaSource != 22"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 3"!]
                            [!IF "$DmaSource != 23"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 4"!]
                            [!IF "$DmaSource != 24"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 6"!]
                            [!IF "$DmaSource != 36"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 7"!]
                            [!IF "$DmaSource != 37"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 16"!]
                            [!IF "$DmaSource != 40"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 17"!]
                            [!IF "$DmaSource != 41"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 18"!]
                            [!IF "$DmaSource != 42"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 19"!]
                            [!IF "$DmaSource != 43"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                    [!ELSE!]
                        [!IF "num:i($HwEmios) = 0"!]
                            [!IF "$DmaSource != 25"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 1"!]
                            [!IF "$DmaSource != 26"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 2"!]
                            [!IF "$DmaSource != 38"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                        [!IF "num:i($HwEmios) = 3"!]
                            [!IF "$DmaSource != 39"!]
                                [!ERROR!] eMios channel need to be configured Corectly with [!"$DmaSource"!][!ENDERROR!]
                            [!ENDIF!]
                        [!ENDIF!]
                    [!ENDIF!]
                [!ENDIF!]
            [!ELSE!][!WS "12"!]NoMclDmaChannel,[!/*
      */!][!ENDIF!]
#endif
#if (ICU_OVERFLOW_NOTIFICATION_API == STD_ON)
[!/*   */!][!IF "node:exists(IcuOverflowNotification)"!][!/*
            */!][!WS "12"!][!IF "IcuOverflowNotification!= 'NULL_PTR'"!]&[!ENDIF!][!"IcuOverflowNotification"!][!/*
        */!][!ELSE!][!/*
            */!][!WS "12"!]NULL_PTR[!/*
        */!][!ENDIF!],
#endif  /* ICU_OVERFLOW_NOTIFICATION_API */
#if (ICU_REPORT_WAKEUP_SOURCE == STD_ON)
            (Icu_WakeupValueType)[!/*
            */!][!IF "IcuWakeupCapability"!][!/*
                */!]((uint32)((uint32)1U<<[!"as:ref(IcuWakeup/IcuChannelWakeupInfo)/EcuMWakeupSourceId"!]))[!/*
            */!][!ELSE!][!/*
                */!]0U[!/*
            */!][!ENDIF!][!CR!]
#endif /* (ICU_REPORT_WAKEUP_SOURCE == STD_ON) */
        }[!IF "$Idx!=$count"!],[!CR!][!ENDIF!][!/*
        */!][!VAR "Idx" = "$Idx + 1"!][!/*
        */!][!ENDIF!][!/*
  */!][!ENDLOOP!][!/*
*/!][!VAR "MacLoopVar"="$MacLoopVar + 1"!][!/*
*/!][!ENDFOR!][!CR!]
 };

[!ENDSELECT!]
[!ENDMACRO!]

[!// MACRO for creating the eMios configuration pointer(s)
[!MACRO "ICU_GENERATE_IP_CONFIGURATION","VARIANT"="'PB'", "MISRA_REF"="''", "MISRA_REF_1"="''"!]
[!SELECT "IcuConfigSet"!][!//
[!CALL "ICU_VARIABLES"!][!//
[!IF "num:i($OutNumIcuChannelsUsingeMios)>0"!]
/*
 *  @brief    [!"$VARIANT"!] Default EMIOS Configuration
 */
static CONST(Icu_eMios_ChannelConfigType, ICU_CONST) Icu_eMios_ChannelConfig_[!"$VARIANT"!][[!"num:i($OutNumIcuChannelsUsingeMios)"!]] =
 {
    [!VAR "comma" = "1"!][!/*
    */!][!FOR "varCounter" = "0" TO "$OutNumIcuChannels"!][!/*
        */!][!LOOP "IcuChannel/*"!][!/*
            */!][!IF "IcuChannelId = $varCounter"!][!/*
                */!][!IF "contains(IcuHwIP,'EMIOS')"!]
    /** @brief [!"node:name(.)"!] */
    {
        /** @brief eMios HW Module and Channel used by the Icu channel */[!CR!][!/*
        */!][!VAR "eMiosMod" = "node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule)"!][!/*
        */!][!VAR "eMiosChannal" = "node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel)"!][!/*
        */!][!WS "8"!](uint8)ICU_[!"$eMiosMod"!]_[!"$eMiosChannal"!],
        /** @brief eMios channel configuration parameters */[!CR!][!/*
        */!][!WS "8"!]([!IF "node:ref(IcueMiosChannelRef)/IcuEmiosFreeze"!](Icu_eMios_ControlType)((Icu_eMios_ControlType)(EMIOS_FREEZE_ENABLE << ICU_EMIOS_FREEZE_PARAM_SHIFT)) | \[!CR!][!WS "8"!][!ENDIF!][!/*
        */!][!IF "(contains(node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect,'EMIOS_BUS_INTERNAL_COUNTER'))"!][!/*
            */!](Icu_eMios_ControlType)((Icu_eMios_ControlType)[!"node:value(node:ref(IcueMiosChannelRef)/IcuEmiosPrescaler)"!] << ICU_EMIOS_PRESCALER_PARAM_SHIFT)[!/*
            */!][!IF "../../../IcuAutosarExt/IcuEnableDualClockMode"!][!/*
                */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)[!"node:value(node:ref(IcueMiosChannelRef)/IcuEmiosPrescaler_Alternate)"!] << ICU_EMIOS_PRESC_ALT_PARAM_SHIFT)[!/*
            */!][!ENDIF!][!/*
        */!][!ELSE!][!/*
            */!][!VAR "BusSelect"="node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect"!][!/*
            */!][!VAR "eMiosChannel"="substring-after(node:ref(IcueMiosChannelRef)/IcueMiosChannel,'CH_')"!][!/*
            */!][!CALL "GetMasterPrescaler", "parameMiosBus" = "$BusSelect", "parameMiosChannel" = "$eMiosChannel"!][!/*
            */!][!WS "8"!](Icu_eMios_ControlType)((Icu_eMios_ControlType)[!"$PrescalerVal"!] << ICU_EMIOS_PRESCALER_PARAM_SHIFT)[!/*
            */!][!IF "../../../IcuAutosarExt/IcuEnableDualClockMode"!][!/*
                */!][!CALL "GetMasterPrescaler_Alternate", "parameMiosBus" = "$BusSelect", "parameMiosChannel" = "$eMiosChannel"!][!/*
                */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType) [!"$PrescalerVal_Alternate"!]<< ICU_EMIOS_PRESC_ALT_PARAM_SHIFT)[!/*
            */!][!ENDIF!][!/*
        */!][!ENDIF!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)[!"node:value(node:ref(IcueMiosChannelRef)/IcuEmiosDigitalFilter)"!] << ICU_EMIOS_DIG_FILTER_PARAM_SHIFT)[!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)[!"node:value(node:ref(IcueMiosChannelRef)/IcuEmiosBusSelect)"!] << ICU_EMIOS_BUS_SELECT_PARAM_SHIFT)[!/*

        */!][!IF "IcuMeasurementMode='ICU_MODE_SIGNAL_MEASUREMENT'"!][!/*
        */!][!IF "IcuDMAChannelEnable='true'"!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_SAIC_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ELSE!][!/*
        */!][!IF "IcuSignalMeasurement/IcuSignalMeasurementProperty='ICU_HIGH_TIME' or IcuSignalMeasurement/IcuSignalMeasurementProperty='ICU_LOW_TIME' or IcuSignalMeasurement/IcuSignalMeasurementProperty='ICU_ACTIVE_TIME'"!][!/*
        */!][!IF "contains(ecu:list(concat('Icu.ChannelType.',(concat((concat(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule),'_')),node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel))))),'IPWM')"!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_IPWM_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ELSE!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_SAIC_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ENDIF!][!/*
        */!][!ELSEIF "(IcuSignalMeasurement/IcuSignalMeasurementProperty ='ICU_DUTY_CYCLE') and ((node:value(node:ref(IcueMiosChannelRef)/IcuUserModeForDutycycle)) = 'IPWM')"!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_IPWM_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ELSEIF "(IcuSignalMeasurement/IcuSignalMeasurementProperty ='ICU_DUTY_CYCLE') and ((node:value(node:ref(IcueMiosChannelRef)/IcuUserModeForDutycycle)) = 'SAIC')"!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_SAIC_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ELSE!][!/*
        */!][!IF "contains(ecu:list(concat('Icu.ChannelType.',(concat((concat(node:value(node:ref(IcueMiosChannelRef)/../../IcueMiosModule),'_')),node:value(node:ref(IcueMiosChannelRef)/IcueMiosChannel))))), 'IPM')"!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_IPM_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ELSE!][!/*
        */!][!CR!][!WS "8"!] | (Icu_eMios_ControlType)((Icu_eMios_ControlType)EMIOS_UC_SAIC_MODE << ICU_EMIOS_UC_MODE_PARAM_SHIFT)[!/*
        */!][!ENDIF!][!/*
        */!][!ENDIF!][!/*
        */!][!ENDIF!][!/*
        */!][!ENDIF!]),[!/*
        */!][!CR!][!WS "8"!][!"text:replace(IcuDefaultStartEdge,'ICU_','EMIOS_')"!],[!/*
        */!][!IF "(IcuSignalMeasurement/IcuSignalMeasurementProperty = 'ICU_DUTY_CYCLE') and (node:ref(IcueMiosChannelRef)/IcuSignalMeasureWithoutInterrupt = 'true')"!][!/*
        */!][!ERROR!] From variant "[!"variant:name( )"!]", IcuSignalMeasureWithoutInterrupt do not support for ICU_DUTY_CYCLE [!ENDERROR!][!/*
        */!][!ENDIF!][!/*
        */!][!CR!][!WS "8"!][!IF "node:ref(IcueMiosChannelRef)/IcuSignalMeasureWithoutInterrupt = 'true'"!](boolean)TRUE[!ELSE!](boolean)FALSE[!ENDIF!]
    }[!IF "(num:i($comma))<(num:i($OutNumIcuChannelsUsingeMios))"!],[!ENDIF!][!CR!][!VAR "comma"="$comma + 1"!][!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!][!/*
        */!][!ENDLOOP!][!/*
    */!][!ENDFOR!]
 };
static CONST(Icu_eMios_IpConfigType, ICU_CONST) Icu_eMiosIcu_IpConfig_[!"$VARIANT"!] =
{
   /** @brief Number of eMios channels in the Icu configuration */
   (uint8)[!"num:i($OutNumIcuChannelsUsingeMios)"!],
   /** @brief Pointer to the array of eMios enabled Icu channel configurations */
   &Icu_eMios_ChannelConfig_[!"$VARIANT"!]
};

[!ELSE!]
    /** @brief No eMios channels configured */
[!ENDIF!]

[!IF "num:i($OutNumIcuChannelsUsingSiu)>0"!]
/*
 *  @brief    [!"$VARIANT"!] Default SIU Configuration
 */
static CONST(Icu_Siu_ChannelConfigType, ICU_CONST) Icu_Siu_ChannelConfig_[!"$VARIANT"!][[!"num:i($OutNumIcuChannelsUsingSiu)"!]] =
 {
    [!VAR "comma" = "1"!][!/*
    */!][!FOR "varCounter" = "0" TO "$OutNumIcuChannels"!][!/*
        */!][!LOOP "IcuChannel/*"!][!/*
            */!][!IF "IcuChannelId = $varCounter"!][!/*
                */!][!IF "contains(IcuHwIP,'SIU')"!][!/*
    */!][!WS "4"!]/** @brief [!"node:name(.)"!] */
    {
        /** @brief Siu HW Module and Channel used by the Icu channel */[!CR!][!/*
        */!][!WS "8"!](Icu_Siu_ChannelType)ICU_[!"node:value(node:ref(IcuSiuChannelRef)/IcuSiuChannel)"!],
        /** @brief Siu channel configuration parameters */[!CR!][!/*
        */!][!IF "node:ref(IcuSiuChannelRef)/Icu_EXT_ISR_IFERDigitalFilter = 'true'"!][!/*
        */!][!WS "8"!](Icu_Siu_ControlType)ICU_SIU_INT_FILTER_ENABLE_PARAM_MASK,[!/*
        */!][!ELSE!][!WS "8"!](Icu_Siu_ControlType)0U,[!/*
        */!][!ENDIF!][!/*
        */!][!CR!][!WS "8"!][!"text:replace(IcuDefaultStartEdge,'ICU_','SIU_')"!]
    }[!IF "(num:i($comma))<(num:i($OutNumIcuChannelsUsingSiu))"!],[!ENDIF!][!CR!][!VAR "comma"="$comma + 1"!][!/*
                */!][!ENDIF!][!/*
            */!][!ENDIF!][!/*
        */!][!ENDLOOP!][!/*
    */!][!ENDFOR!]
 };
/*
 * @brief    [!"$VARIANT"!] Default SIU Configuration
 */
static CONST(Icu_Siu_IpConfigType, ICU_CONST) Icu_SiuIcu_IpConfig_[!"$VARIANT"!] =
 {
    /** @brief Number of Siu channels in the Icu configuration */
    (uint8)[!"num:i($OutNumIcuChannelsUsingSiu)"!],
    /** @brief The Siu global configuration paramters */
    [!CALL "ICU_SIU_GLOBAL_CONFIGURATION"!]
    /** @brief Pointer to the array of Siu enabled Icu channel configurations */
    &Icu_Siu_ChannelConfig_[!"$VARIANT"!]
 };
[!ELSE!]
    /** @brief No Siu channels configured */
[!ENDIF!]

/*
 * @brief   Icu channels IP related configuration array
 */
static CONST(Icu_IpChannelConfigType, ICU_CONST) Icu_IpChannelConfig_[!"$VARIANT"!][[!"num:i(count(IcuChannel/*))"!]] =
 {
    [!VAR "CurIcuChannelUsingeMios" = "0"!][!/*
    */!][!VAR "CurIcuChannelUsingSiu"  = "0"!][!/*
    */!][!VAR "comma" = "1"!][!/*
    */!][!FOR "varCounter" = "0" TO "$OutNumIcuChannels"!][!/*
        */!][!LOOP "IcuChannel/*"!][!/*
            */!][!IF "IcuChannelId = $varCounter"!]
    /** @brief [!"@name"!] */
    {[!/*
        */!][!IF "contains(IcuHwIP,'EMIOS')"!]
        /** @brief IP type of this channel */
        ICU_EMIOS_CHANNEL,
        /** @brief Index in the configuration table of the eMios channels */
        (uint8)[!"num:i($CurIcuChannelUsingeMios)"!],[!/*
        */!][!VAR "CurIcuChannelUsingeMios" = "$CurIcuChannelUsingeMios + 1"!][!/*
        */!][!ELSEIF "contains(IcuHwIP,'SIU')"!]
        /** @brief IP type of this channel */
        ICU_SIU_CHANNEL,
        /** @brief Index in the configuration table of the Siu channels */
        (uint8)[!"num:i($CurIcuChannelUsingSiu)"!],[!/*
        */!][!VAR "CurIcuChannelUsingSiu" = "$CurIcuChannelUsingSiu + 1"!][!/*
        */!][!ENDIF!]
    }[!IF "(num:i($comma))<(num:i($OutNumIcuChannels))"!],[!ENDIF!][!VAR "comma"="$comma + 1"!][!CR!][!/*
            */!][!ENDIF!][!/*
        */!][!ENDLOOP!][!/*
    */!][!ENDFOR!]
 };
[!ENDSELECT!]
[!ENDMACRO!]

[!ENDNOCODE!]