/**
*   @file    CDD_Mcl_PBcfg.c
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcl - Data structures for the Mcl driver.
*   @details Postbuild structure configurations for the driver initalization.
*
*   @addtogroup MCL
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eDMA
*   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.
* Identifiers (internal and external) shall not rely on the significance of more than 31 characters. 
* 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.
* This violation is due to the requirement that requests to have a file version check.
*
* @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 Cdd_Mcl_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 Cdd_Mcl_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 Cdd_Mcl_PBcfg_c_REF_3
* Violates MISRA 2012 Advisory Rule 8.7, Functions and object should not be defined with external linkage if they are referenced in only one translation unit.
* This constant variable will be called by higher layer.
*
* @section Cdd_Mcl_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.
* These functions represent the API of the callback function by user.
*
* @section Cdd_Mcl_PBcfg_c_REF_5
* Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if identifier only appears in a single function.
* These objects are used when Precompile is supported.
*/

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

/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @file             CDD_Mcl_PBcfg.c
* @requirements     BSW00374, BSW00318
*/
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_VENDOR_ID_C                     43
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MAJOR_VERSION_C      4
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MINOR_VERSION_C      3
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_REVISION_VERSION_C   1
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MAJOR_VERSION_C              1
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MINOR_VERSION_C              0
#define MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_PATCH_VERSION_C              0


/*==================================================================================================
                                      FILE VERSION CHECKS
==================================================================================================*/
/* Check if config source file and MCL header file are of the same vendor */
#if (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_VENDOR_ID_C != MCL_VENDOR_ID)
#error "CDD_Mcl_PBcfg.c and CDD_Mcl.h have different vendor IDs"
#endif
/* Check if config source file and MCL header file are of the same Autosar version */
#if ((MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MAJOR_VERSION_C != MCL_AR_RELEASE_MAJOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MINOR_VERSION_C != MCL_AR_RELEASE_MINOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_REVISION_VERSION_C != MCL_AR_RELEASE_REVISION_VERSION))
#error "AutoSar Version Numbers of CDD_Mcl_PBcfg.c and CDD_Mcl.h are different"
#endif
/* Check if config source file and MCL header file are of the same Software version */
#if ((MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MAJOR_VERSION_C != MCL_SW_MAJOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MINOR_VERSION_C != MCL_SW_MINOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_PATCH_VERSION_C != MCL_SW_PATCH_VERSION))
#error "Software Version Numbers of CDD_Mcl_PBcfg.c and CDD_Mcl.h are different"
#endif


/* Check if config source file and Mcl_IPW header file are of the same vendor */
#if (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_VENDOR_ID_C != MCL_IPW_VENDOR_ID)
#error "CDD_Mcl_PBcfg.c and Mcl_IPW.h have different vendor IDs"
#endif
/* Check if config source file and Mcl_IPW header file are of the same version */
#if ((MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MAJOR_VERSION_C != MCL_IPW_AR_RELEASE_MAJOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_MINOR_VERSION_C != MCL_IPW_AR_RELEASE_MINOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_AR_RELEASE_REVISION_VERSION_C != MCL_IPW_AR_RELEASE_REVISION_VERSION))
#error "Autosar Version Numbers of CDD_Mcl_PBcfg.c and Mcl_IPW.h are different"
#endif
/* Check if config source file and Mcl_IPW header file are of the same Software Version */
#if ((MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MAJOR_VERSION_C != MCL_IPW_SW_MAJOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_MINOR_VERSION_C != MCL_IPW_SW_MINOR_VERSION) || \
     (MCL_PBCFG[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_SW_PATCH_VERSION_C != MCL_IPW_SW_PATCH_VERSION))
#error "Software Version Numbers of CDD_Mcl_PBcfg.c and Mcl_IPW.h are different"
#endif

[!INCLUDE "CDD_Mcl_PBcfg_c_checks.m"!][!//
[!INCLUDE "CDD_Mcl_PluginMacro.m"!][!//
/*==================================================================================================
                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


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


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

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

/*==================================================================================================
                                       GLOBAL CONSTANTS
==================================================================================================*/
[!IF "MclGeneral/EnableDMA"!][!//
#define MCL_START_SEC_CODE
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_1 MISRA 2012 Required 4.10*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_2 MISRA 2012 Advisory 20.1*/
#include "Mcl_MemMap.h"

[!CALL "NotificationHandler","Suffix" = "''"!]
#define MCL_STOP_SEC_CODE
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_1 MISRA 2012 Required 4.10*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_2 MISRA 2012 Advisory 20.1*/
#include "Mcl_MemMap.h"

[!ENDIF!]

#define MCL_START_SEC_CONFIG_DATA_UNSPECIFIED
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_1 MISRA 2012 Required 4.10*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_2 MISRA 2012 Advisory 20.1*/
#include "Mcl_MemMap.h"

[!NOCODE!][!//
    [!VAR "TotalNumberOfChannels"             = "ecu:get('Mcl.eDMA.ChannelNumberMain') + ecu:get('Mcl.eDMA.ChannelNumberAcd')"!]
    [!VAR "TotalNumberOfChannelsMainDie"      = "ecu:get('Mcl.eDMA.ChannelNumberMain')"!]
    [!VAR "ChannelsPerDmaInstance"          = "ecu:get('Mcl.eDMA.ChannelNumberPerDmaInstance')"!][!//
    [!VAR "ChannelsPerDmaGroup"             = "ecu:get('Mcl.eDMA.ChannelNumberPerGroup')"!][!//
    [!VAR "ChannelsPerDmaMuxSmall"          = "ecu:get('Mcl.DmaMux.ChannelNumberPerDmaMuxSmall')"!][!//
    [!VAR "ChannelsPerDmaMuxLarge"          = "ecu:get('Mcl.DmaMux.ChannelNumberPerDmaMuxLarge')"!][!//
    [!VAR "ChannelNumberPerDmaCrc"          = "ecu:get('Mcl.DmaCrc.ChannelNumberPerDmaCrc')"!][!//
    [!VAR "NumberOfDmaMuxSmallInstances"    = "ecu:get('Mcl.DmaMux.NumberOfSmallDmaMuxInstances')"!][!//
    [!VAR "LastDmaInstanceId"               = "num:i(count(ecu:list('Mcl.MclConfigSet.DmaInstances')))"!][!//
    [!VAR "LastDmaInstanceId"               = "$LastDmaInstanceId - 1 "!][!//
    [!VAR "DmaMuxInstancesNumber"           = "num:i(ecu:get('Mcl.DmaMux.DmaMuxInstances'))"!][!//
    [!VAR "DmaCrcInstancesNumber"           = "num:i(ecu:get('Mcl.DmaCrc.DmaCrcInstances'))"!][!//
    [!VAR "numeDmaInstances"                = "num:i($TotalNumberOfChannels div $ChannelsPerDmaInstance)"!]
    [!VAR "EccErrorReportingEnabled"        = "ecu:get('Mcl.eDMA.EccErrorReportingEnabled')"!][!//
    [!VAR "DmaPriorityGroup0Exists"         = "ecu:get('Mcl.eDMA.PriorityGroup0Exists')"!][!//
    [!VAR "DmaPriorityGroup1Exists"         = "ecu:get('Mcl.eDMA.PriorityGroup1Exists')"!][!//
    [!VAR "DmaPriorityGroup2Exists"         = "ecu:get('Mcl.eDMA.PriorityGroup2Exists')"!][!//
    [!VAR "DmaPriorityGroup3Exists"         = "ecu:get('Mcl.eDMA.PriorityGroup3Exists')"!][!//
[!ENDNOCODE!][!//

[!LOOP "(MclConfigSet/*)"!][!//
[!IF "../../MclGeneral/EnableDMA"!][!//
[!NOCODE!][!//
    [!VAR "dmaChannelCount"                 = "num:i(count(DMAChannel/*))"!][!//
    [!VAR "dmaCrcChannelCount"              = "num:i(count(DMACrcChannel/*))"!][!//
    [!VAR "comma" = "1"!][!//
[!ENDNOCODE!][!//
[!NOCODE!]/***************************** check priorities configuration ********************/[!ENDNOCODE!][!//
[!NOCODE!][!//

    [!IF "$numeDmaInstances = 1"!][!//
        [!VAR "CheckChannelPrio" = "num:i(0)"!][!//
        [!IF "(MclEDMA_ERCA='false')"!][!//    
            [!VAR "CheckChannelPrio"="num:i(1)"!]
        [!ENDIF!][!//
    [!ELSE!][!// 
            [!VAR "CheckChannelPrio"="num:i(0)"!]            
    [!ENDIF!][!//
                
    [!FOR "varCounter" = "0" TO "num:i(count(DMAChannel/*)) - 1"!][!//
        [!LOOP "DMAChannel/*"!][!//
            [!IF "MclDMAChannelId = $varCounter"!][!//
                [!VAR "DmaCh" = "substring-after(node:value(DmaHwChannel),'eDMA_')"!]   [!//
                [!VAR "Group" = "num:i($DmaCh div $ChannelsPerDmaGroup)"!][!//
                [!VAR "Priority" = "num:i(node:value(DMAChannelPriority))"!][!//
                [!IF "$numeDmaInstances = 2"!][!//
                    [!VAR "CheckChannelPrio" = "num:i(0)"!][!//
                    [!VAR "CurrentDma" = "num:i($Group div (num:i($ChannelsPerDmaInstance div $ChannelsPerDmaGroup)))"!][!//
                    [!LOOP "../../DmaInstance/*"!][!//"!]
                        [!VAR "DmaInstanceCrt" ="num:i(substring-after(node:value(DmaHwInstance),'eDMA_Instance'))"!][!//
                        [!IF "($DmaInstanceCrt = $CurrentDma) and (MclEDMA_ERCA='false')"!][!//
                            [!VAR "CheckChannelPrio"="num:i(1)"!][!//
                    [!ENDIF!][!//
                    [!ENDLOOP!][!//
                [!ENDIF!][!//
            [!ENDIF!][!//
        [!ENDLOOP!][!//
        [!IF "$CheckChannelPrio=1"!][!//
            [!LOOP "DMAChannel/*"!][!//
                [!IF "MclDMAChannelId != $varCounter"!][!//
                    [!VAR "CurrentDmaCh" = "substring-after(node:value(DmaHwChannel),'eDMA_')"!][!//
                    [!VAR "CurrentGroup" = "num:i($CurrentDmaCh div $ChannelsPerDmaGroup)"!][!//
                    [!VAR "CurrentPriority" = "num:i(node:value(DMAChannelPriority))"!][!//
                    [!IF "($CurrentGroup = $Group) and ($CurrentPriority = $Priority) and ($CurrentDmaCh > 63)"!][!//
                        [!ERROR!] [!//
                        "Priority Error! Mcl channel [!"$varCounter"!] and another channel from group [!"num:i($Group)"!] have equal priority."[!//
                        [!ENDERROR!][!//
                    [!ENDIF!][!//
                [!ENDIF!][!//
            [!ENDLOOP!][!//
        [!ENDIF!][!//
    [!ENDFOR!][!//
[!ENDNOCODE!][!//
/**
  * @brief Number of configured Dma channels
  */
#define MCL_DMA_CONF_CHANNELS_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]  [!"num:i(count(DMAChannel/*))"!]U[!CR!]
[!IF "$DmaCrcInstancesNumber != 0"!]
[!VAR "DmaCrcChannelsNo" = "num:i($dmaCrcChannelCount)"!][!//
/**
  * @brief Number of configured DmaCrc channels
  */
#define MCL_DMACRC_CONF_CHANNELS[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]  [!"num:i($dmaCrcChannelCount)"!]U
[!ENDIF!][!//

[!NOCODE!]/***************************** Configuration for DMA ********************/[!ENDNOCODE!][!//

/** @brief Configuration for Dma channels */
[!CALL "DmaChannelConfig","DmaConfigType" = "'PBVariant'"!]
/** @brief Configuration for Dma instances */
[!CALL "DmaInstanceConfig","DmaConfigType" = "'PBVariant'"!]


[!CALL "DmaCrcChannelConfig","DmaConfigType" = "'PBvariant'"!]
[!IF "$DmaCrcInstancesNumber != 0"!]
/**
* @brief            DMA_CRC basic configuration.
* @details          Configuration for DMA_CRC hw IP.
*                   The DMA_CRC allows to add CRC functionality to DMA channels.
*
*/
static CONST( Mcl_DmaCrcConfigType, MCL_CONST) DmaCrc_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
{
    /** @brief Number of configured DMA CRC channels used*/
    MCL_DMACRC_CONF_CHANNELS[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],   
    /** @brief Pointer to the structure containing DMACRC channel configuration */
    &Mcl_DmaCrc_ChannelConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
};
[!ENDIF!][!//  

[!VAR "comma" = "1"!][!//
/** @brief Array of configured Mcl channels */
static CONST(Mcl_ChannelConfigType, MCL_CONST) Mcl_ChannelConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][MCL_DMA_CONF_CHANNELS_PB[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]] =
{
[!FOR "varCounter" = "0" TO "num:i(count(DMAChannel/*))"!][!//
[!LOOP "DMAChannel/*"!][!//
[!IF "MclDMAChannelId = $varCounter"!][!//
    /** @brief [!"node:name(.)"!] */
    {
[!/* */!][!VAR "DmaCh" = "substring-after(node:value(DmaHwChannel),'eDMA_')"!][!//
        /** @brief Number of configured Mcl channel. */
        DMA_HW_CHANNEL_[!"$DmaCh"!],
#if (MCL_DMA_NOTIFICATION_SUPPORTED == STD_ON)
        /** @brief DMA complete notification function */
[!/* */!][!IF "(MclDmaTransferCompletionNotif = '') or (MclDmaTransferCompletionNotif = 'NULL_PTR') or (MclDmaTransferCompletionNotif = 'NULL')"!][!//
        NULL_PTR,
[!/* */!][!ELSE!][!//
        [!"MclDmaTransferCompletionNotif"!],
[!/* */!][!ENDIF!][!//
#endif
#if (MCL_DMA_ERROR_INTERRUPTS_USED == STD_ON)
        /** @brief DMA error notification function */
[!/* */!][!IF "(MclDmaTransferErrorNotif = '') or (MclDmaTransferErrorNotif = 'NULL_PTR') or (MclDmaTransferErrorNotif = 'NULL')"!][!//
        NULL_PTR
[!/* */!][!ELSE!][!//
        [!"MclDmaTransferErrorNotif"!]
[!/* */!][!ENDIF!][!//
#endif
    }[!IF "(num:i($comma))<(num:i($dmaChannelCount))"!],[!ENDIF!][!CR!][!VAR "comma"="$comma + 1"!][!//
[!ENDIF!][!//
[!ENDLOOP!][!//
[!ENDFOR!][!//
};

[!IF "../../MclGeneral/MclEnableLogicalAddress"!][!//
[!CALL "Mcl_LogicalMemorySection_Config", "Type" = "'PB'"!]

static CONST(Mcl_LogicalMemoryConfigType, MCL_CONST) Mcl_LogicalMemory_ConfigPB_[!"@index"!] =
{
    (uint16)[!"num:i(count(MclLogicalMemorySectionConfig/*))"!]U,
    &Mcl_LogicalMemorySection_ConfigPB_[!"@index"!]
};
[!ENDIF!][!//MclEnableLogicalAddress
/**
* @brief            DMA basic configuration
* @details          Configuration for DMA hw IP.
*                   Include Control Register and Channel Priorities.
*
*/
static CONST( Mcl_DmaConfigType, MCL_CONST) Dma_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
{
    /** @brief Number of configured eDMA channels. */
    [!"num:i($dmaChannelCount)"!]U,  
    &Mcl_Dma_InstanceConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],
    /** @brief Pointer to the structure containing DMA channel configuration */
    &Mcl_Dma_ChannelConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
    [!IF "../../MclGeneral/MclEnableLogicalAddress"!][!//
        ,
        &Mcl_LogicalMemory_ConfigPB_[!"@index"!]
[!ENDIF!][!//MclEnableLogicalAddress
};

[!NOCODE!]/*************** Configuration for Mcl_HwIPs_ConfigPB ******************/[!ENDNOCODE!][!//
/**
* @brief          Initialization data for different hw IPs.
* @details        Configuration realized at statup by calling Mcl_Init() API.
*
*/
static CONST( Mcl_DmaHwIpsConfigType, MCL_CONST) Mcl_HwIPs_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
{
    /* Configuration for eDMA (Enhanced Direct Memory Access) hardware IP. */
    &Dma_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][!//
[!IF "$DmaMuxInstancesNumber != 0"!],
    /* Configuration for DMA_MUX (eDMA Channel Mux) hardware IP. */
    &DmaMux_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][!ENDIF!][!//
[!IF "$DmaCrcInstancesNumber != 0"!],
    /* Configuration for DMA_CRC hardware IP. */
    &DmaCrc_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
[!ENDIF!][!//
};

/**
* @brief            Dma basic configuration.
* @details          Configuration for Dma.
*
*/
static CONST( Mcl_DmaInitConfigType, MCL_CONST) Mcl_Dma_InitConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]=
{
    /** @brief Number of configured eDMA channels. */
    [!"num:i($dmaChannelCount)"!]U,
    /** @brief Pointer to the structure containing Mcl channel configuration */
    &Mcl_ChannelConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!],
    /**< @brief IPs data generic configuration. */
    &Mcl_HwIPs_Config[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
#if ((MCL_DMA_NOTIFICATION_SUPPORTED == STD_ON) || (MCL_DMA_GET_GLOBAL_ERR_STATUS_API == STD_ON))
    ,
    /** @brief Hw to logic channel map. Array containing a number of elements
    equal to total number of available DMA channels  */
    {
[!NOCODE!]
    [!FOR "curModChannel" = "0" TO "$TotalNumberOfChannels - 1"!]
    [!VAR "varChTranslationIndex" = "255"!]
    [!LOOP "DMAChannel/*"!][!//
        [!VAR "DmaCh" = "substring-after(node:value(DmaHwChannel),'eDMA_')"!]
        [!IF "num:i($DmaCh) = $curModChannel"!]
            [!VAR "varChTranslationIndex" = "MclDMAChannelId"!]
        [!ENDIF!]
    [!ENDLOOP!]
    [!IF "$varChTranslationIndex = 255"!]
[!CODE!]        (Mcl_ChannelType)MCL_DMA_CHANNEL_NOT_CONFIGURED_U8[!IF "$curModChannel < $TotalNumberOfChannels - 1"!],[!ENDIF!][!CR!][!ENDCODE!]
    [!ELSE!][!//
[!CODE!]        (Mcl_ChannelType)MCL_DMA_LOGICAL_CHANNEL_[!"num:i($varChTranslationIndex)"!][!IF "$curModChannel < $TotalNumberOfChannels - 1"!],[!ENDIF!][!CR!][!ENDCODE!]
    [!ENDIF!][!//
    [!ENDFOR!][!//
[!ENDNOCODE!][!//
    }
#endif /* MCL_DMA_NOTIFICATION_SUPPORTED == STD_ON || MCL_DMA_GET_GLOBAL_ERR_STATUS_API == STD_ON */
};
[!ENDIF!][!//EnableDMA

[!IF "../../MclGeneral/MclEnableCrossbarSwitch"!]
[!VAR "EnableInitAXBS_MGPCR"              = "num:i(ecu:get('Mcl.Crossbar.EnableInitAXBS_MGPCR'))"!][!//
[!VAR "PRSIsReadOnly"                     = "num:i(ecu:get('Mcl.Crossbar.PRS.IsReadOnly'))"!][!//
[!NOCODE!]/*********************** Configuration for the crossbar switch ******************/[!ENDNOCODE!][!//

[!CALL "AxbsConfigMaster","AxbsConfigType" = "''"!]
[!NOCODE!]/*********************** Configuration for the crossbar switch ******************/[!ENDNOCODE!][!//
/**
* @brief Number of configured crossbar channels
*/
[!VAR "crossbarPortCount" = "num:i(count(MclCrossbarLogicalSlavePorts/*))"!]

#define MCL_CROSSBAR_CONF_PORTS[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]  [!"$crossbarPortCount"!]
 

/** @brief Configuration for the crossbar ports */
[!CALL "AxbsConfigSlave","AxbsConfigType" = "''"!]

/**
* @brief            Crossbar basic configuration.
* @details          
*/
static CONST(Mcl_CrossbarConfigType, MCL_CONST)  Mcl_CrossbarSwitchConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
    {
        /** @brief Number of configured logical ports. */
        [!"$crossbarPortCount"!]U,
[!IF "$EnableInitAXBS_MGPCR = 1"!]
        /** @brief The number of Master ports. */
        [!"$MastercrossbarPortCount"!]U,
[!ENDIF!]
        /** @brief Pointer to the structure containing slave port configuration */
        &Mcl_Crossbar_SlavePortConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
[!IF "$EnableInitAXBS_MGPCR = 1"!]
        ,
        /** @brief Pointer to the structure containing master port configuration */
        &Mcl_Crossbar_MasterPortConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
[!ENDIF!]
    };
[!ENDIF!]

[!NOCODE!]/********************** Configuration for Mcl_Flexio ***************/[!ENDNOCODE!][!//
[!NOCODE!]/********************** Configuration for Mcl_ConfigType ***************/[!ENDNOCODE!][!//
/**
* @brief            Mcl basic configuration.
* @details          Configuration for Mcl.
*
*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_3 MISRA 2012 Advisory 8.7*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_5 MISRA 2012 Advisory 8.9*/
[!IF "((./../../IMPLEMENTATION_CONFIG_VARIANT != 'VariantPostBuild') and (variant:size()>1)) or (./../../IMPLEMENTATION_CONFIG_VARIANT = 'VariantPostBuild')"!]
CONST( Mcl_ConfigType, MCL_CONST) [!"@name"!][!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!] =
[!ELSE!][!//
CONST( Mcl_ConfigType, MCL_CONST) Mcl_Init_PBCfgVariantPredefined =
[!ENDIF!][!//
{
[!VAR "comma" = "0"!][!//
[!IF "../../MclGeneral/EnableDMA"!][!//
#if (MCL_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
        /** Configuration for the Dem errors */
    &Mcl_Dem_Config,
#endif
    /** Configuration for the Dma and DmaMux IPs */
    &Mcl_Dma_InitConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!][!//
[!VAR "comma" = "1"!][!//
[!ENDIF!][!//EnableDMA
[!IF "../../MclGeneral/MclEnableCrossbarSwitch"!][!//
[!IF "$comma = 1"!][!//
    ,
[!ENDIF!][!//
    &Mcl_CrossbarSwitchConfig[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]
[!VAR "comma" = "1"!][!//
[!ENDIF!][!//MclEnableCrossbarSwitch
[!IF "../../MclGeneral/MclEnableLogicalAddress"!][!//
[!IF "$comma = 1"!][!//
    ,
[!ENDIF!][!//
    /** Configuration for the Dma logical memory feature*/
    &Mcl_LogicalMemory_ConfigPB_[!"@index"!][!//
[!VAR "comma" = "1"!][!//
[!ENDIF!][!//MclEnableLogicalAddress
[!IF "../../MclGeneral/EnableDMA"!][!//
#if (MCL_DMA_ERROR_INTERRUPTS_USED == STD_ON)
    ,
    /** @brief error notification function */
[!IF "(../../MclGeneral/MclErrorNotification = '') or (../../MclGeneral/MclErrorNotification = 'NULL_PTR') or (../../MclGeneral/MclErrorNotification = 'NULL')"!][!//
    NULL_PTR
[!ELSE!][!//
    &[!"../../MclGeneral/MclErrorNotification"!]
[!ENDIF!][!//
#endif
[!ENDIF!][!//EnableDMA
};
[!ENDLOOP!][!//

#define MCL_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_1 MISRA 2012 Required 4.10*/
/* @violates @ref Cdd_Mcl_PBcfg_c_REF_2 MISRA 2012 Advisory 20.1*/
#include "Mcl_MemMap.h"

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

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


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


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

#ifdef __cplusplus
}
#endif

/** @} */

