/**
*   @file    Adc_Cfg.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Adc - Module configuration interface for Adc driver.
*   @details Contains the module configuration interface for Adc driver.
*
*   @addtogroup ADC
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : EQADC
*   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 ADC_CFG_H
#define ADC_CFG_H

#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section Adc_cfg_h_REF_1
*          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 constant needs external linkage if threshold watchdog feature is enabled in the configuration.
*
* @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.
*
*/

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

#if (ADC_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  #include "Dem.h"
#endif


/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define ADC_VENDOR_ID_CFG                       43
#define ADC_AR_RELEASE_MAJOR_VERSION_CFG        4
#define ADC_AR_RELEASE_MINOR_VERSION_CFG        3
#define ADC_AR_RELEASE_REVISION_VERSION_CFG     1
#define ADC_SW_MAJOR_VERSION_CFG                1
#define ADC_SW_MINOR_VERSION_CFG                0
#define ADC_SW_PATCH_VERSION_CFG                0

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

#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
 #if (ADC_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
 /* Check if source file and Dem header file are of the same version */
 #if ((ADC_AR_RELEASE_MAJOR_VERSION_CFG != DEM_AR_RELEASE_MAJOR_VERSION) || \
      (ADC_AR_RELEASE_MINOR_VERSION_CFG != DEM_AR_RELEASE_MINOR_VERSION) \
     )
    #error "AutoSar Version Numbers of Adc_Cfg.h and Dem.h are different"
 #endif
 #endif /* (ADC_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF) */
#endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */

/* Check if header file and Adc_CfgDefines header file are of the same vendor */
#if (ADC_VENDOR_ID_CFG != ADC_VENDOR_ID_CFG_DEFINES)
    #error "Adc_Cfg.h and Adc_CfgDefines.h have different vendor ids"
#endif

/* Check if header file and Adc_CfgDefines header file are of the same Autosar version */
#if ((ADC_AR_RELEASE_MAJOR_VERSION_CFG != ADC_AR_RELEASE_MAJOR_VERSION_CFG_DEFINES) || \
     (ADC_AR_RELEASE_MINOR_VERSION_CFG != ADC_AR_RELEASE_MINOR_VERSION_CFG_DEFINES) || \
     (ADC_AR_RELEASE_REVISION_VERSION_CFG != ADC_AR_RELEASE_REVISION_VERSION_CFG_DEFINES) \
    )
    #error "AutoSar Version Numbers of Adc_Cfg.h and Adc_CfgDefines.h are different"
#endif

/* Check if header file and Adc Cfg header file are of the same Software version */
#if ((ADC_SW_MAJOR_VERSION_CFG != ADC_SW_MAJOR_VERSION_CFG_DEFINES) || \
     (ADC_SW_MINOR_VERSION_CFG != ADC_SW_MINOR_VERSION_CFG_DEFINES) || \
     (ADC_SW_PATCH_VERSION_CFG != ADC_SW_PATCH_VERSION_CFG_DEFINES) \
    )
    #error "Software Version Numbers of Adc_Cfg.h and Adc_CfgDefines.h are different"
#endif

/* Check if source file and Adc_Eqadc_CfgEx header file are of the same vendor */
#if (ADC_VENDOR_ID_CFG != ADC_VENDOR_ID_EQADC_CFGEX)
    #error "Adc_Cfg.h and Adc_Eqadc_CfgEx.h have different vendor ids"
#endif

/* Check if source file and Adc_Eqadc_CfgEx header file are of the same Autosar version */
#if ((ADC_AR_RELEASE_MAJOR_VERSION_CFG != ADC_AR_RELEASE_MAJOR_VERSION_EQADC_CFGEX) || \
     (ADC_AR_RELEASE_MINOR_VERSION_CFG != ADC_AR_RELEASE_MINOR_VERSION_EQADC_CFGEX) || \
     (ADC_AR_RELEASE_REVISION_VERSION_CFG != ADC_AR_RELEASE_REVISION_VERSION_EQADC_CFGEX) \
    )
    #error "AutoSar Version Numbers of Adc_Cfg.h and Adc_Eqadc_CfgEx.h are different"
#endif

/* Check if source file and Adc_Eqadc_CfgEx header file are of the same Software version */
#if ((ADC_SW_MAJOR_VERSION_CFG != ADC_SW_MAJOR_VERSION_EQADC_CFGEX) || \
     (ADC_SW_MINOR_VERSION_CFG != ADC_SW_MINOR_VERSION_EQADC_CFGEX) || \
     (ADC_SW_PATCH_VERSION_CFG != ADC_SW_PATCH_VERSION_EQADC_CFGEX) \
    )
    #error "Software Version Numbers of Adc_Cfg.h and Adc_Eqadc_CfgEx.h are different"
#endif

/* Check if header file and Adc_EnvCfg header file are of the same vendor */
#if (ADC_VENDOR_ID_CFG != ADC_VENDOR_ID_ENVCFG)
    #error "Adc_Cfg.h and Adc_EnvCfg.h have different vendor ids"
#endif

/* Check if header file and Adc_EnvCfg header file are of the same Autosar version */
#if ((ADC_AR_RELEASE_MAJOR_VERSION_CFG != ADC_AR_RELEASE_MAJOR_VERSION_ENVCFG) || \
     (ADC_AR_RELEASE_MINOR_VERSION_CFG != ADC_AR_RELEASE_MINOR_VERSION_ENVCFG) || \
     (ADC_AR_RELEASE_REVISION_VERSION_CFG != ADC_AR_RELEASE_REVISION_VERSION_ENVCFG) \
    )
    #error "AutoSar Version Numbers of Adc_Cfg.h and Adc_EnvCfg.h are different"
#endif

/* Check if header file and Adc Cfg header file are of the same Software version */
#if ((ADC_SW_MAJOR_VERSION_CFG != ADC_SW_MAJOR_VERSION_ENVCFG) || \
     (ADC_SW_MINOR_VERSION_CFG != ADC_SW_MINOR_VERSION_ENVCFG) || \
     (ADC_SW_PATCH_VERSION_CFG != ADC_SW_PATCH_VERSION_ENVCFG) \
    )
    #error "Software Version Numbers of Adc_Cfg.h and Adc_EnvCfg.h are different"
#endif

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


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

/** 
* @brief           Number of channels configured for each group.
*/

#define ADC_CFGSET_GROUP_0_CHANNELS      1
/*==================================================================================================
*                                             ENUMS
==================================================================================================*/


/*==================================================================================================
*                                STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/
/**
* @brief          Structure for Configuration data.
* @details        Data structure containing the set of configuration parameters required 
*                 for initializing the ADC Driver and ADC HW Unit(s).
* @api
* @implements     Adc_ConfigType_struct
*/
typedef struct
{
    /**< @brief Hw unit configurations */
    P2CONST(Adc_Eqadc_HwUnitConfigurationType, ADC_VAR, ADC_APPL_CONST) pAdc;
    /**< @brief Group configurations */
    P2CONST(Adc_GroupConfigurationType, AUTOMATIC, ADC_APPL_CONST) pGroups;
    /**< @brief Channel configurations */
    P2P2CONST(Adc_Eqadc_ChannelConfigurationType, ADC_VAR, ADC_APPL_CONST) pChannels;
    /**< @brief Total number of groups */
    VAR(Adc_GroupType, ADC_VAR) GroupCount;
    /**< @brief Miscellaneous configuration parameters */
    CONST(Adc_Eqadc_MultiConfigType, ADC_CONST) Misc;
} Adc_ConfigType;

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

#define ADC_START_SEC_CONFIG_DATA_UNSPECIFIED

#include "Adc_MemMap.h"

    
extern CONST(Adc_ConfigType, ADC_CONST) AdcConfigSet_0;


#define ADC_STOP_SEC_CONFIG_DATA_UNSPECIFIED

#include "Adc_MemMap.h"


/*==================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/
#define ADC_START_SEC_CONST_UNSPECIFIED

#include "Adc_MemMap.h"

/** @violates @ref Adc_cfg_h_REF_1 An object should be defined at block scope if its identifier
*only appears in a single function.*/
extern CONST(Mcal_DemErrorType, ADC_CONST) Adc_E_TimeoutCfg;

#define ADC_STOP_SEC_CONST_UNSPECIFIED

#include "Adc_MemMap.h"

#define ADC_START_SEC_VAR_INIT_UNSPECIFIED

#include "Adc_MemMap.h"

#if (ADC_ENABLE_LIMIT_CHECK == STD_ON)
   
extern P2CONST(Adc_Eqadc_ChannelLimitCheckingType, ADC_VAR, ADC_APPL_CONST) Adc_aChannelsLimitCheckingCfg[];    
#endif

#define ADC_STOP_SEC_VAR_INIT_UNSPECIFIED

#include "Adc_MemMap.h"

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

#ifdef __cplusplus
}
#endif

#endif /* ADC_CFG_H */

/** @} */
