/**
*   @file    Gpt_Ipw.h
*   @version 1.0.0
*
*   @brief   AUTOSAR Gpt - Gpt driver header file.
*   @details GPT driver header file, containing variables, functions prototypes, data types and/or
*            defines and macros that:
*            - are Autosar specific and are not exported by the GPT driver.
*            - are not related to the GPT driver related IPs.
*
*   @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_IPW_H
#define GPT_IPW_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_IPW_H_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].
*
*/
/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

/*==================================================================================================
*                               SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define GPT_IPW_VENDOR_ID                      43
#define GPT_IPW_AR_RELEASE_MAJOR_VERSION       4
#define GPT_IPW_AR_RELEASE_MINOR_VERSION       3
#define GPT_IPW_AR_RELEASE_REVISION_VERSION    1
#define GPT_IPW_SW_MAJOR_VERSION               1
#define GPT_IPW_SW_MINOR_VERSION               0
#define GPT_IPW_SW_PATCH_VERSION               0

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

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

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

/*==================================================================================================
                                             ENUMS
==================================================================================================*/

/*==================================================================================================
                                 STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/
/**
* @brief Gpt channel hardware runtime information. This is the type of the data structure used by the Autosar layer to
*        receive runtime information specific to hardware IP
*
*/
typedef struct
{
    VAR(boolean, GPT_VAR) bChannelRollover;                 /**<@brief GPT channel rollover information*/
    VAR(Gpt_ValueType, GPT_VAR) uTargetTime;                /**<@brief GPT channel target value*/
} Gpt_HwChannelInfoType;
/*==================================================================================================
                                 GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/

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

#define GPT_START_SEC_CODE
/** @violates @ref GPT_IPW_H_REF_1 MISRA 2012 Required Directive 4.10, the contents of a header 
*   file being included more than once.*/
#include "Gpt_MemMap.h"

FUNC (void, GPT_CODE) Gpt_Ipw_Init(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);

FUNC (Gpt_ValueType, GPT_CODE) Gpt_Ipw_GetTimeElapsed(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig,
                                                      P2VAR(Gpt_HwChannelInfoType, AUTOMATIC,GPT_APPL_DATA) pReturnHwChannelInfo
                                                      );

FUNC (void, GPT_CODE) Gpt_Ipw_StartTimer(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig,
                                                   VAR(Gpt_ValueType, AUTOMATIC) uValue
                                                   );
                                                   
#if (GPT_CHANGE_NEXT_TIMEOUT_VALUE == STD_ON)
FUNC (Std_ReturnType, GPT_CODE) Gpt_Ipw_ChangeNextTimeoutValue
(
    P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig,
    VAR(Gpt_ValueType, AUTOMATIC) value
);
#endif /* GPT_CHANGE_NEXT_TIMEOUT_VALUE == STD_ON */                                                   

FUNC (void, GPT_CODE) Gpt_Ipw_StopTimer(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);

FUNC (void, GPT_CODE) Gpt_Ipw_EnableInterrupt(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);

#if (GPT_DEINIT_API == STD_ON)
FUNC (void, GPT_CODE) Gpt_Ipw_DeInit(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);
#endif

#if (GPT_ENABLE_DISABLE_NOTIFICATION_API == STD_ON)|| (GPT_WAKEUP_FUNCTIONALITY_API == STD_ON)
FUNC (void, GPT_CODE) Gpt_Ipw_DisableInterrupt(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);
#endif


#if (GPT_SET_CLOCK_MODE == STD_ON)
FUNC (void, GPT_CODE) Gpt_Ipw_SetClockMode(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig,
                                                VAR(Gpt_ClockModeType, AUTOMATIC) clkMode);
#endif

#if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
FUNC (void, GPT_CODE) Gpt_Ipw_StartPredefTimer
(
    P2CONST(Gpt_ConfigType, AUTOMATIC, GPT_APPL_CONST) configPtr
);
FUNC (void, GPT_CODE) Gpt_Ipw_EnableCounter
(
    P2CONST(Gpt_HwPredefChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig
);
FUNC (void, GPT_CODE) Gpt_Ipw_GetPredefTimerValue
(
    P2CONST(Gpt_HwPredefChannelConfigType, AUTOMATIC, GPT_APPL_CONST) pHwChannelConfig,
    VAR(Gpt_PredefTimerType, AUTOMATIC) PredefTimer,
    P2VAR(uint32, AUTOMATIC, GPT_APPL_DATA) TimeValuePtr
);
FUNC (void, GPT_CODE) Gpt_Ipw_StopPredefTimer
(
    P2CONST(Gpt_ConfigType, AUTOMATIC, GPT_APPL_CONST) configPtr
);
#endif

#if (GPT_CHAIN_MODE == STD_ON)
FUNC (Std_ReturnType, GPT_CODE) Gpt_Ipw_EnableChainMode(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);
FUNC (Std_ReturnType, GPT_CODE) Gpt_Ipw_DisableChainMode(P2CONST(Gpt_HwChannelConfigType, AUTOMATIC,GPT_APPL_CONST) pHwChannelConfig);
#endif
#define GPT_STOP_SEC_CODE
/** @violates @ref GPT_IPW_H_REF_1 MISRA 2012 Required Directive 4.10, the contents of a header 
*   file being included more than once.*/
#include "Gpt_MemMap.h"

#ifdef __cplusplus
}
#endif

#endif /*GPT_IPW_H*/

/** @} */
