/**
*   @file    Gpt_Stm_Types.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Gpt - STM driver header file.
*   @details STM defines which need to be exported to external application
*
*   @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_STM_TYPES_H
#define GPT_STM_TYPES_H

#ifdef __cplusplus
extern "C"{
#endif
/**
* @page misra_violations MISRA-C:2012 violations
*
* @section GPT_STM_TYPES_H_REF_1
*     Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
*     Macros that are used in the code only in some configuration (they are guarded by #ifdef…)
*
*/
/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

#include "Gpt_Cfg.h"

#include "Gpt_EnvCfg.h"

/*==================================================================================================
*                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @file           Gpt_Stm_Types.h
* @{
*/
#define GPT_STM_TYPES_VENDOR_ID                       43
#define GPT_STM_TYPES_AR_RELEASE_MAJOR_VERSION        4
#define GPT_STM_TYPES_AR_RELEASE_MINOR_VERSION        3
#define GPT_STM_TYPES_AR_RELEASE_REVISION_VERSION     1
#define GPT_STM_TYPES_SW_MAJOR_VERSION                1
#define GPT_STM_TYPES_SW_MINOR_VERSION                0
#define GPT_STM_TYPES_SW_PATCH_VERSION                0
/** @} */

/*==================================================================================================
*                                      FILE VERSION CHECKS
==================================================================================================*/
#if ( GPT_STM_TYPES_VENDOR_ID != GPT_VENDOR_ID_CFG)
    #error "Gpt_Stm_Types.h and Gpt_Cfg.h have different vendor ids"
#endif
/* Check if the header files are of the same Autosar version */
#if ((GPT_STM_TYPES_AR_RELEASE_MAJOR_VERSION != GPT_AR_RELEASE_MAJOR_VERSION_CFG) || \
     (GPT_STM_TYPES_AR_RELEASE_MINOR_VERSION != GPT_AR_RELEASE_MINOR_VERSION_CFG) || \
     (GPT_STM_TYPES_AR_RELEASE_REVISION_VERSION != GPT_AR_RELEASE_REVISION_VERSION_CFG) \
    )
    #error "AutoSar Version Numbers of Gpt_Stm_Types.h and Gpt_Cfg.h are different"
#endif
/* Check if the header files are of the same Software version */
#if ((GPT_STM_TYPES_SW_MAJOR_VERSION != GPT_SW_MAJOR_VERSION_CFG) || \
     (GPT_STM_TYPES_SW_MINOR_VERSION != GPT_SW_MINOR_VERSION_CFG) || \
     (GPT_STM_TYPES_SW_PATCH_VERSION != GPT_SW_PATCH_VERSION_CFG) \
    )
    #error "Software Version Numbers of Gpt_Stm_Types.h and Gpt_Cfg.h are different"
#endif

#if ( GPT_STM_TYPES_VENDOR_ID!= GPT_ENVCFG_VENDOR_ID)
    #error "Gpt_Stm_Types.h and Gpt_EnvCfg.h have different vendor ids"
#endif
/* Check if the header files are of the same Autosar version */
#if ((GPT_STM_TYPES_AR_RELEASE_MAJOR_VERSION != GPT_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
     (GPT_STM_TYPES_AR_RELEASE_MINOR_VERSION != GPT_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
     (GPT_STM_TYPES_AR_RELEASE_REVISION_VERSION != GPT_ENVCFG_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Gpt_Stm_Types.h and Gpt_EnvCfg.h are different"
#endif
/* Check if the header files are of the same Software version */
#if ((GPT_STM_TYPES_SW_MAJOR_VERSION != GPT_ENVCFG_SW_MAJOR_VERSION) || \
     (GPT_STM_TYPES_SW_MINOR_VERSION != GPT_ENVCFG_SW_MINOR_VERSION) || \
     (GPT_STM_TYPES_SW_PATCH_VERSION != GPT_ENVCFG_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Gpt_Stm_Types.h and Gpt_EnvCfg.h are different"
#endif
/*==================================================================================================
*                                           CONSTANT-LIKE DEFINES
==================================================================================================*/

/*==================================================================================================
*                                       FUNCTION-LIKE DEFINES(MACROS)
==================================================================================================*/
#if (GPT_STM_USED == STD_ON)
/**
* @{
* @brief          STM channels defines
* @details        There are defines used for the STM channel encoding -> channel_id
*
* @note           A STM module generally has only 4 channels so by using this method
*                 there will be gaps of 12 channels between different STM modules because
*                 [              6 bit  | 2 bit               ]
*                 [ module id: 63 ... 0 | channel id: 3 ... 0 ]
*/
#define STM_MOD_MASK_U8             ((uint8)0xFC)
#define STM_MOD_SHIFT               ((uint8)2U)
#define STM_CH_MASK_U8              ((uint8)0x03)
#define STM_CH_SHIFT                ((uint8)0U)
/** @} */

/**
* @{
* @brief STM Channels defines
*/
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_0_PREDEF                ((uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_0_CH_0                  ((uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_0_CH_1                  ((uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_0_CH_2                  ((uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_0_CH_3                  ((uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_1_PREDEF                ((uint8)(1U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_1_CH_0                  ((uint8)(1U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_1_CH_1                  ((uint8)(1U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_1_CH_2                  ((uint8)(1U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_1_CH_3                  ((uint8)(1U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_2_PREDEF                ((uint8)(2U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_2_CH_0                  ((uint8)(2U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_2_CH_1                  ((uint8)(2U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_2_CH_2                  ((uint8)(2U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_2_CH_3                  ((uint8)(2U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_3_PREDEF                ((uint8)(3U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_3_CH_0                  ((uint8)(3U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_3_CH_1                  ((uint8)(3U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_3_CH_2                  ((uint8)(3U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_3_CH_3                  ((uint8)(3U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_4_PREDEF                ((uint8)(4U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_4_CH_0                  ((uint8)(4U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_4_CH_1                  ((uint8)(4U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_4_CH_2                  ((uint8)(4U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_4_CH_3                  ((uint8)(4U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_5_PREDEF                ((uint8)(5U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_5_CH_0                  ((uint8)(5U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_5_CH_1                  ((uint8)(5U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_5_CH_2                  ((uint8)(5U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_5_CH_3                  ((uint8)(5U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_6_PREDEF                ((uint8)(6U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_6_CH_0                  ((uint8)(6U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_6_CH_1                  ((uint8)(6U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_6_CH_2                  ((uint8)(6U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_6_CH_3                  ((uint8)(6U << STM_MOD_SHIFT) + (uint8)3)

/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_7_PREDEF                ((uint8)(7U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_7_CH_0                  ((uint8)(7U << STM_MOD_SHIFT) + (uint8)0)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_7_CH_1                  ((uint8)(7U << STM_MOD_SHIFT) + (uint8)1)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_7_CH_2                  ((uint8)(7U << STM_MOD_SHIFT) + (uint8)2)
/** @violates @ref GPT_STM_TYPES_H_REF_1 MISRA 2012 Advisory Rule 2.5, this macro was used 
*   in some configuration  */
#define STM_7_CH_3                  ((uint8)(7U << STM_MOD_SHIFT) + (uint8)3)
/** @} */

#endif /*GPT_STM_USED == STD_ON */
/*==================================================================================================
*                                             ENUMS
==================================================================================================*/

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

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

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

#ifdef __cplusplus
}
#endif

#endif /*GPT_STM_TYPES_H*/

/** @} */
