/**
*   @file    Gpt_Cfg.h
*   
*   @version 1.0.0
*
*   @brief   AUTOSAR Gpt  - Gpt driver configuration header file.
*   @details GPT driver header file, containing C and XPath constructs for generating Gpt
*            configuration header file.
*
*   @addtogroup GPT_MODULE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eMios_Stm_Pit
*   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 GPT_CFG_H
#define GPT_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. 
*     The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*     Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space
*     shall be distinct.
*     The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*     Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
*     The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*     Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names. 
*     The used compilers use more than 31 chars for identifiers.
*
* @section GPT_CFG_H_REF_1
*     Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
*     Macros that are in <MDL>.h or <MDL>_Cfg.h� that are needed for the client (and are used only 
*     in tests)
*
* @section GPT_CFG_H_REF_2
*     Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if its
*     identifier only appears in a single function.
*     This violation is due to exporting the externally configured initialization structure used
*     by the "<MA>_Init" function.
**/
/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

#include "Mcal.h"

/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/




#define GPT_VENDOR_ID_CFG                    43
#define GPT_AR_RELEASE_MAJOR_VERSION_CFG     4
#define GPT_AR_RELEASE_MINOR_VERSION_CFG     3
#define GPT_AR_RELEASE_REVISION_VERSION_CFG  1
#define GPT_SW_MAJOR_VERSION_CFG             1
#define GPT_SW_MINOR_VERSION_CFG             0
#define GPT_SW_PATCH_VERSION_CFG             0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
     /* Check if this header file and Mcal.h file are of the same Autosar version */
    #if ((GPT_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
         (GPT_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
        #error "AutoSar Version Numbers of Gpt_Cfg.h and Mcal.h are different"
    #endif

#endif
/*==================================================================================================
*                                          CONSTANTS
==================================================================================================*/

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

/**
* @brief Gpt Dev error detect switch
*
*/
#define GPT_DEV_ERROR_DETECT (STD_ON)

/**
* @brief Report Wakeup Source switch
*/
#define GPT_REPORT_WAKEUP_SOURCE (STD_OFF)

/**
* @brief GPT_VERSION_INFO_API switch
*
*/
#define GPT_VERSION_INFO_API (STD_ON)

/**
* @brief GPT_DEINIT_API switch
*
*/
#define GPT_DEINIT_API (STD_ON)

/**
* @brief GPT_TIME_ELAPSED_API switch
*
*/
#define GPT_TIME_ELAPSED_API (STD_OFF)

/**
* @brief GPT_TIME_REMAINING_API switch
*
*/
#define GPT_TIME_REMAINING_API (STD_OFF)

/**
* @brief GPT_ENABLE_DISABLE_NOTIFICATION_API switch
*
*/
#define GPT_ENABLE_DISABLE_NOTIFICATION_API (STD_ON)

/**
* @brief GPT_WAKEUP_FUNCTIONALITY_API switch
*/
#define GPT_WAKEUP_FUNCTIONALITY_API (STD_OFF)

/**
* @brief Enable/disable support for changing timeout value during timer running
*/
#define GPT_CHANGE_NEXT_TIMEOUT_VALUE (STD_OFF)

/**
* @brief Enable/disable API for Dual Mode support.
*/
#define GPT_SET_CLOCK_MODE (STD_OFF)

/**
* @brief Enable/disable API for Chain Mode.
*/
#define GPT_CHAIN_MODE (STD_OFF)

/**
* @brief Support Clock Source Selection for STM Timers
*/
#define GPT_STM_ENABLECLOCKSWITCH   (STD_OFF)

/**
* @brief Support for User mode.
*        If this parameter has been configured to 'TRUE' the GPT driver code can be executed from both supervisor and user mode.
*/
#define GPT_ENABLE_USER_MODE_SUPPORT    (STD_OFF)

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

/**
* @brief GPT_PREDEFTIMER_FUNCTIONALITY_API switch
*/
#define GPT_PREDEFTIMER_FUNCTIONALITY_API (STD_OFF)

    /* Gpt Pre Compile Switch */
    
        #define GPT_PRECOMPILE_SUPPORT (STD_OFF)
    


/**
* @brief These defines indicate that at least one channel from each module is used in all configurations.
*/
#define GPT_EMIOS_USED (STD_OFF)
#define GPT_STM_USED (STD_OFF)
#define GPT_PIT_USED (STD_ON)
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_PIT_RTI_USED (STD_OFF)

/**
* @{
* @brief Symbolic names of channels
*/

            /** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
        #define GptConf_GptChannelConfiguration_Default_0  (0U)
            

/*@}*/

/**
* @brief This define is a reserved logical channel name representing a not existing/configured
*        hardware channel.
*
*/
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_CHN_NOT_USED    (255U)

/**
* @{
* @brief IRQ Defines for each channel used
*/
            /** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
                #define GPT_PIT_0_CH_0_ISR_USED
            
            /** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
    #define GPT_STM_ISR_1_SHARED   

/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_PIT_MODULE_SINGLE_INTERRUPT (STD_OFF)
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_STM_MODULE_SINGLE_INTERRUPT (STD_OFF)




/**
* @brief The maxiumum number of HW channels. This is used to allocate memory space for channel runtime info.
*/
#define GPT_HW_CHANNEL_NUM   (1U)



/* The real number of channels in EMIOS_0 */
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_EMIOS_0_NUM_CHANNEL_U8 (24U)
/* The real number of channels in EMIOS_1 */
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_EMIOS_1_NUM_CHANNEL_U8 (24U)
/* The maximum number of channels per module for EMIOS */
#define GPT_EMIOS_CHANNELS_PER_MODULE_U8 (24U)
        /* Number of EMIOS modules available on platform */
#define GPT_EMIOS_MODULES_NUM_U8  (2U)


/* The real number of channels in PIT_0 */
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_PIT_0_NUM_CHANNEL_U8 (5U)
/* The maximum number of channels per module for PIT */
#define GPT_PIT_CHANNELS_PER_MODULE_U8 (5U)
        /* Number of PIT modules available on platform */
#define GPT_PIT_MODULES_NUM_U8  (1U)


/* The real number of channels in STM_0 */
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_STM_0_NUM_CHANNEL_U8 (4U)
/* The maximum number of channels per module for STM */
#define GPT_STM_CHANNELS_PER_MODULE_U8 (4U)
        /* Number of STM modules available on platform */
#define GPT_STM_MODULES_NUM_U8  (1U)

/**
@{
@brief ID for peripheral. This ID need to match the order in the hardware to logic channels mapping table
*      because it is used as a base index.
*/
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_STM_MODULE      (0U)                                                           
#define GPT_PIT_MODULE      (GPT_STM_MODULE + (GPT_STM_CHANNELS_PER_MODULE_U8 * GPT_STM_MODULES_NUM_U8))
#define GPT_EMIOS_MODULE    (GPT_PIT_MODULE + (GPT_PIT_CHANNELS_PER_MODULE_U8 * GPT_PIT_MODULES_NUM_U8))
/** @} */

/**
* @brief The total number of indexes used by the hardware to logic channel map
*/
#define GPT_CHANNEL_IDX_NUM (GPT_EMIOS_MODULE + (GPT_EMIOS_CHANNELS_PER_MODULE_U8 * GPT_EMIOS_MODULES_NUM_U8))

/**
*   @brief Number of Predefined timers supported
*/
/** @violates @ref GPT_CFG_H_REF_1 MISRA 2012 Required Rule 2.5, this macro was used in test */
#define GPT_HW_PREDEFTIMER_NUM (4U)



/** 
* @brief  Switch to enable/disable the production error reporting.
*/
#define GPT_DISABLE_DEM_REPORT_ERROR_STATUS (STD_ON)

/** 
*   @brief  This is a timeout value which is used to wait till PIT_RTI_LDVAL is synchronized into the RTI clock domain
*/
#define GPT_TIMEOUT_COUNTER  (65535UL)




/**
*   @brief export configuration Gpt driver
*/


    
 #define GPT_CONF_PB     extern CONST(Gpt_ConfigType, GPT_CONST) GptChannelConfigSet_0;

/*==================================================================================================
*                                             ENUMS
==================================================================================================*/
#if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
/**
* @brief Predef Timer type. Indicates the type of predef timer.
* 
*/
typedef enum
{
    GPT_PREDEF_TIMER_1US_16BIT = 0x0U,
    GPT_PREDEF_TIMER_1US_24BIT,
    GPT_PREDEF_TIMER_1US_32BIT,
    GPT_PREDEF_TIMER_100US_32BIT
}Gpt_PredefTimerType;
#endif

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

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

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

#ifdef __cplusplus
}
#endif

#endif  /* GPT_CFG_H */

/** @} */
