/**
*   @file CDD_Mcl_Cfg.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Mcl - contains the configuration data of the MCL driver
*   @details Contains the configuration data of the MCL driver
*
*   @addtogroup MCL_MODULE
*   @{
*/
/*==================================================================================================
*   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.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/




#ifndef CDD_MCL_CFG_H
#define CDD_MCL_CFG_H

#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.
* This violation is due to the requirement that requests to have a file version check.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* This violation is due to the requirement that requests to have a file version check.
*
* @section CDD_Mcl_Cfg_h_REF_1
* Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
* Macros are used only in some configurations or for future releases.
**/

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

#include "Dem.h"
/*==================================================================================================
                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define MCL_VENDOR_ID_CFG                       43

#define MCL_AR_RELEASE_MAJOR_VERSION_CFG        4
#define MCL_AR_RELEASE_MINOR_VERSION_CFG        3
#define MCL_AR_RELEASE_REVISION_VERSION_CFG     1

#define MCL_SW_MAJOR_VERSION_CFG                1
#define MCL_SW_MINOR_VERSION_CFG                0
#define MCL_SW_PATCH_VERSION_CFG                0
/*==================================================================================================
                                      FILE VERSION CHECKS
==================================================================================================*/

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    #if ((MCL_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
        (MCL_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
        #error "AutoSar Version Numbers of CDD_Mcl_Cfg.h and Mcal.h are different"
    #endif
#endif

/* Check if header file and Dem.h file are of the same Autosar version */
 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
     /* Check if source file and Dem header file are of the same Autosar version */
     #if (( MCL_AR_RELEASE_MAJOR_VERSION_CFG != DEM_AR_RELEASE_MAJOR_VERSION) || \
          ( MCL_AR_RELEASE_MINOR_VERSION_CFG != DEM_AR_RELEASE_MINOR_VERSION))
         #error "AutoSar Version Numbers of CDD_Mcl_Cfg.h and Dem.h are different"
     #endif
 #endif

#if (MCL_VENDOR_ID_CFG != MCL_ENVCFG_VENDOR_ID)
    #error "CDD_Mcl_Cfg.h and Mcl_EnvCfg.h have different vendor ids"
#endif
/* Check if current file and Mcl_CfgEnv header file are of the same Autosar version */
#if (( MCL_AR_RELEASE_MAJOR_VERSION_CFG != MCL_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
     ( MCL_AR_RELEASE_MINOR_VERSION_CFG != MCL_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
     ( MCL_AR_RELEASE_REVISION_VERSION_CFG !=  MCL_ENVCFG_AR_RELEASE_REVISION_VERSION))
     #error "AutoSar Version Numbers of CDD_Mcl_Cfg.h and Mcl_EnvCfg.h are different"
#endif
/* Check if current file and Mcl_CfgEnv header file are of the same software version */
#if ((MCL_SW_MAJOR_VERSION_CFG != MCL_ENVCFG_SW_MAJOR_VERSION) || \
     (MCL_SW_MINOR_VERSION_CFG != MCL_ENVCFG_SW_MINOR_VERSION) || \
     (MCL_SW_PATCH_VERSION_CFG != MCL_ENVCFG_SW_PATCH_VERSION))
     #error "Software Version Numbers of CDD_Mcl_Cfg.h and Mcl_EnvCfg.h are different"
#endif

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


/*==================================================================================================
                                       DEFINES AND MACROS
==================================================================================================*/


/* Mcl Pre Compile Switch */
#define MCL_PRECOMPILE_SUPPORT                   (STD_OFF)

/**
*   @brief  Switches the Development Error Detection and Notification on or off.
*        STD_ON: Enabled. STD_OFF: Disabled.
*
*/
#define MCL_DEV_ERROR_DETECT                     (STD_ON)

/**
* @{
*   @brief Configuration of Optional API's
*/
/**
*   @brief  Adds or removes the service Mcl_GetVersionInfo() from the code.
*        STD_ON: Mcl_GetVersionInfo() can be used. STD_OFF: Mcl_GetVersionInfo() can not be used.
*
*/
#define MCL_GET_VERSION_INFO_API                 (STD_ON)

/**
* @{
*   @brief Configuration of Optional API's
*/
/**
*   @brief  Adds or removes the service Mcl_DeInit() from the code.
*        STD_ON: Mcl_DeInit() can be used. STD_OFF: Mcl_DeInit() can not be used.
*
*/
#define MCL_DEINIT_API                           (STD_OFF)

/**
*   @brief   Switches DMA features initialization on or off.
*        STD_ON: Enabled. STD_OFF: Disabled.
*
*/
#define MCL_ENABLE_DMA                           (STD_ON)



/**
*   @brief   Switches the Crossbar support on or off.
*        STD_ON: Enabled. STD_OFF: Disabled.
*
*/
#define MCL_CROSSBAR_NUM_INSTANCES        (0x1U)

#define MCL_ENABLE_CROSSBAR              (STD_OFF)

#define MCL_CROSSBAR_PRS_READONLY        (STD_OFF)

#define MCL_CROSSBAR0_PRS_RESET_VALUE_U32     (0x76543210U)

#define MCL_CROSSBAR0_CRS_RESET_VALUE_U32     (0x00FF0000U)




/**
* @brief      This define specifies enable or disable initialization of DCHMID register in DMA
*
*/
#define MCL_DMA_ENABLE_INIT_DCHMID               (STD_OFF)
/**
* @brief      This define specifies the number of eDma Channels available for one eDma instance
*
*/
#define MCL_DMA_INSTANCE_CHANNELS_NO             (0x40U)
/**
* @brief      This define specifies the number of eDma Channels available for one eDma V2 instance
*
*/
/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_DMAV2_INSTANCE_CHANNELS_NO           (0x40U)
/**
* @brief      This define specifies the number of eDma instances
*
*/
#define MCL_DMA_NB_CONTROLLERS                   (0x2U)

/**
* @brief Number of groups within a DMA instance
*/
#define DMA_GROUPS                                    (0x8U)
/**
* @{
* @brief Offset of Application Extension Subsystem.
*/
#define DMAV2_OFFSET_AE_AREA                     (uint32)(0U)

#define DMAV3_INSTANCES_NUMBER_U32               (0U)

#define DMAV2_INSTANCES_NUMBER_U32               (2U)


/**
* @{
*   @brief Configuration of Optional API's
*/
/**
*   @brief  Adds or removes the service Mcl_DmaGetChannelErrorStatus() from the code.
*        STD_ON: Mcl_DmaGetChannelErrorStatusApi() can be used. STD_OFF: Mcl_DmaGetChannelErrorStatusApi() can not be used.
*
*/
#define MCL_DMA_GET_CH_ERR_STATUS_API            (STD_OFF)

/**
*   @brief  Adds or removes the service Mcl_DmaGetGlobalErrorStatusApi() from the code.
*        STD_ON: Mcl_DmaGetGlobalErrorStatusApi() can be used. STD_OFF: Mcl_DmaGetGlobalErrorStatusApi() can not be used.
*
*/
#define MCL_DMA_GET_GLOBAL_ERR_STATUS_API        (STD_OFF)

/**
* @brief      This define specifies the number of eDMA channels available
*             on the current platform
*
*/
#define MCL_EDMA_TOTAL_CHANNELS_NO               (128U)

/**
* @brief      This define specifies the number of eDMAv3 channels available
*             on the current platform (eDMAv3 instances are used on the Main common chassis platform)
*
*/
#define MCL_EDMAV3_CHANNELS_NO                   (0U)

/**
* @brief      This define specifies the number of eTimer channels in a group of channels available
*             on the current platform
*
*/
/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_EDMA_CHANNELS_IN_GROUP               (16U)

/**
* @brief      This define specifies the number of eTimer channels in a group of channels available
*             on the current platform
*
*/
#define MCL_EDMA_TCD_GAP_CHANNELS                (0x1000U)

/**
* @brief      This define specifies the number of eTimer channels in a group of channels available
*             on the current platform
*
*/
#define MCL_EDMA_TCD_GAP_GROUP_CHANNELS          (0x0U)

/**
* @brief      This define specifies the number of eTimer channels in a group of channels available
*             on the current platform
*
*/
#define MCL_DMA_ERROR_INTERRUPTS_USED            (STD_OFF)

/**
* @brief  Define if current platform has EARS registers or not
*/
#define MCL_DMA_SETUP_EARS                       (STD_OFF)

/**
* @brief      This definition specify error notification for channel is supporrted
*             on the current platform
*/
#define MCL_DMA_COMBINED_ERROR_COMPLETION_PER_CHANNEL_ISR        (STD_ON)

/**
* @brief      This define specifies if there is only one transfer completion ISR for all DMA channels within a DMA instance
*             or if there is a transfer completion ISR for each channel
*
*/
#define MCL_DMA_COMBINED_TR_COMPLETION_ISR       (STD_OFF)

/**
* @brief      This define specifies if there is one transfer completion ISR for each group of DMA channels within a DMA instance
*
*/
#define MCL_DMA_COMBINED_GROUP_COMPLETION_ISR    (STD_ON)

#if (MCL_DMA_COMBINED_GROUP_COMPLETION_ISR == STD_ON)
#define MCL_DMA_GROUP0_ISR_USED
#define MCL_DMA_GROUP1_ISR_USED
#define MCL_DMA_GROUP2_ISR_USED
#define MCL_DMA_GROUP3_ISR_USED
#endif

/**
* @brief      This define specifies if there are 2 types of DMA IP
*
*/
#define MCL_DMA_V3_INSTANCE_AVAILABLE            (STD_OFF)
#define MCL_DMA_V2_INSTANCE_AVAILABLE            (STD_ON)
/**
* @brief      This define specifies if there is only one error ISR for all DMA instances
*             or if there is an error ISR for each DMA instance
*
*/
#define MCL_DMA_COMBINED_ERROR_ISR               (STD_ON)
/**
* @brief      This define specifies if there is Ecc error reporting available
*
*/
#define MCL_DMA_ECC_REPORTING_ENABLED            (STD_ON)

/**
* @brief  Switch to globaly enable/disable the production error reporting.
*/
#define MCL_DISABLE_DEM_REPORT_ERROR_STATUS      (STD_OFF)


/**
* @brief      This define specifies if there is only one transfer completion ISR for a DMA channel within a DMA instance
*             or if there is a transfer completion ISR for each channel
*
*/
#define MCL_DMA_TR_SEPARATED_ISR                 (STD_OFF)

/**
* @brief      This define specifies if inside a DMA instance some channels have the same transfer completion ISR assigned,
*             and other channels have their own transfer completion ISR.
*
*/
#define MCL_DMA_TR_COMPLETION_MIXED_ISR          (STD_OFF)

#define MCL_DMAV2_COMPLETION_GROUP_ISR                        (STD_ON) 
/** Define to specify if least one transfer completion interrupt and notification is used,
*      needed for removing at precompile time the code for ISR handling for the transfer
*      completion notification processing. This define is needed in both combined transfer
*      completion interrupt and single channel mode. */
#define MCL_DMA_NOTIFICATION_SUPPORTED           (STD_OFF)

/* Transfer size options available */
#define MCL_TRANSFER_SIZE_1_BYTE 
#define MCL_TRANSFER_SIZE_2_BYTE 
#define MCL_TRANSFER_SIZE_4_BYTE 
#define MCL_TRANSFER_SIZE_8_BYTE 
#define MCL_TRANSFER_SIZE_16_BYTE 
#define MCL_TRANSFER_SIZE_32_BYTE 
#define MCL_TRANSFER_SIZE_64_BYTE 




/**
* @brief            Support for User mode.
*                   STD_ON: the Mcl driver can be executed from both supervisor and user mode.
*                   STD_OFF: the Mcl driver can be executed only from supervisor mode.
*/
#define MCL_ENABLE_USER_MODE_SUPPORT             (STD_OFF)
#define MCL_LOGICAL_ADDRESS_USED                 (STD_OFF)

#define MCL_DMAMUX_USER_MODE_SUPPORT             (STD_ON)

/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_AXBS_USER_MODE_SUPPORT               (STD_ON)
/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_LMEM_USER_MODE_SUPPORT               (STD_ON)

/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_M7_USER_MODE_SUPPORT               (STD_ON)

/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_TRGMUX_USER_MODE_SUPPORT             (STD_ON)

#if (MCL_ENABLE_USER_MODE_SUPPORT == STD_ON)
/**
* @brief            Protected Register in User mode
*                   Macro use to enable if IP hw need to configure Reg_Prot to access from user mode
*/

/* @violates @ref CDD_Mcl_Cfg_h_REF_1 MISRA 2012 Advisory 2.5*/
#define MCL_DMAMUX_REG_PROT_AVAILABLE            (STD_ON)

#define MCL_DMA_REG_PROT_AVAILABLE               (STD_ON)

#endif

#ifndef MCAL_ENABLE_USER_MODE_SUPPORT
    #if (STD_ON == MCL_ENABLE_USER_MODE_SUPPORT)
        #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Mcl in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
    #endif /* (STD_ON == MCL_ENABLE_USER_MODE_SUPPORT) */
#endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */

#define M7_CACHE_ENABLE                        (0U)
#define LMEM_CACHE_ENABLE                      (1U)
/* Core used in this configuration
The define is used to lock the semaphores correctly with*/

#define  MCL_CORE_USED                           ((uint8)0)


/*********************************** SEMAPHORE SECTION ********************************/

/* Define that allows the use of the Semaphore API's */
#define  MCL_SEMA4_FEATURE_API                   (STD_OFF)

#if(STD_ON == MCL_SEMA4_FEATURE_API)
/* Number of semaphore channels present on the platform */
#define  MCL_SEMA4_NUMBER                        ((uint8)64)
#define  MCL_SEMA42_SUPPORT                       (STD_OFF)

#endif


/*********************************** SEMAPHORE SECTION ********************************/

/** Variant aware structure.c file. */

#define MCL_CONF_PB \
 extern CONST(Mcl_ConfigType, MCL_CONST) MclConfigSet_0;

/********************************** Check MCL enable features *********************/
/*==================================================================================================
                                             ENUMS
==================================================================================================*/
#if (MCL_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
/**
* @brief            DEM error reporting configuration.
* @details          This structure contains information DEM error reporting
*/
typedef struct
{
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Bus;
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Descriptor;
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Ecc;
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Priority;
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Unrecognized;
    VAR( Mcal_DemErrorType, MCL_VAR) Mcl_E_Dma_Inconsistency;
} Mcl_DemConfigType;

extern CONST( Mcl_DemConfigType, MCL_CONST) Mcl_Dem_Config;

#endif


/*==================================================================================================
                                 STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/


/*==================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/

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

#ifdef __cplusplus
}
#endif

#endif    /* CDD_MCL_CFG_H */
/**@}*/


