/**
*     @file Icu_Ipw.h
*     @version 1.0.0
*
*     @brief   AUTOSAR Icu - Brief description.
*     @details Detailed description.
*
*     @addtogroup ICU_MODULE
*     @{
*/
/*==================================================================================================
*     Project AUTOSAR 4.3 MCAL
*     Platform PA
*     Peripheral eMIOS SIU
*     Dependencies none
*
*     Autosar Version 4.3.1
*     Autosar Revision ASR_REL_4_3_REV_0001
*     Autosar ConfVariant
*     SWVersion 1.0.0
*     BuildVersion 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 ICU_IPW_H
#define ICU_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 ICU_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].
*
* @section ICU_IPW_H_REF_2
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor
* directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
*/

/*==================================================================================================
*                                          INCLUDE FILES
*  1) system and project includes
*  2) needed interfaces from external units
*  3) internal and external interfaces from this unit
==================================================================================================*/

#include "Icu_Ipw_Types.h"

/*==================================================================================================
*                                SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define ICU_IPW_VENDOR_ID                       43

#define ICU_IPW_AR_RELEASE_MAJOR_VERSION        4
#define ICU_IPW_AR_RELEASE_MINOR_VERSION        3
#define ICU_IPW_AR_RELEASE_REVISION_VERSION     1
#define ICU_IPW_SW_MAJOR_VERSION                1
#define ICU_IPW_SW_MINOR_VERSION                0
#define ICU_IPW_SW_PATCH_VERSION                0

/*==================================================================================================
*                                       FILE VERSION CHECKS
==================================================================================================*/
/* Check if Icu_Ipw header and Icu_Ipw_Types header file are of the same vendor */
#if (ICU_IPW_VENDOR_ID != ICU_IPW_TYPES_VENDOR_ID)
    #error "Icu_Ipw.h and Icu_Ipw_Types.h have different vendor IDs"
#endif
    /* Check if header file and Icu_Ipw_Types header file are of the same Autosar version */
#if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION != ICU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (ICU_IPW_AR_RELEASE_MINOR_VERSION != ICU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (ICU_IPW_AR_RELEASE_REVISION_VERSION != ICU_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Icu_Ipw.h and Icu_Ipw_Types.h are different"
#endif
/* Check if header file and Icu_Ipw_Types header file are of the same software version */
#if ((ICU_IPW_SW_MAJOR_VERSION != ICU_IPW_TYPES_SW_MAJOR_VERSION) || \
     (ICU_IPW_SW_MINOR_VERSION != ICU_IPW_TYPES_SW_MINOR_VERSION) || \
     (ICU_IPW_SW_PATCH_VERSION != ICU_IPW_TYPES_SW_PATCH_VERSION))
    #error "Software Version Numbers of Icu_Ipw.h and Icu_Ipw_Types.h are different"
#endif

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

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

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


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

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

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

#define ICU_START_SEC_CODE
/**
* @violates @ref ICU_IPW_H_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_IPW_H_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"

FUNC (void, ICU_CODE) Icu_Ipw_Init
(
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

#if (ICU_DE_INIT_API == STD_ON)
FUNC (void, ICU_CODE) Icu_Ipw_DeInit
(
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif

#if (ICU_SET_MODE_API == STD_ON)
FUNC (void, ICU_CODE) Icu_Ipw_SetSleepMode
(
    VAR(Icu_ChannelType,           AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

FUNC (void, ICU_CODE) Icu_Ipw_SetNormalMode
(
    VAR(Icu_ChannelType,           AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_SET_MODE_API == STD_ON */


FUNC (void, ICU_CODE) Icu_Ipw_SetActivationCondition
(
    VAR(Icu_ChannelType,           AUTOMATIC)                 nChannelNumber,
    VAR(Icu_ActivationType,        AUTOMATIC)                 Activation,
    VAR(Icu_MeasurementModeType,   AUTOMATIC)                 Mode,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

#if (ICU_GET_INPUT_STATE_API == STD_ON)
FUNC(Icu_InputStateType, ICU_CODE)Icu_Ipw_GetInputState
(
    VAR(Icu_ChannelType,           AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_GET_INPUT_STATE_API == STD_ON */

#if (ICU_TIMESTAMP_API == STD_ON)
FUNC(void, ICU_CODE) Icu_Ipw_StartTimestamp
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig,
    VAR(boolean,                              AUTOMATIC)      bDmaSupport
);

FUNC(void, ICU_CODE) Icu_Ipw_StopTimestamp
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_TIMESTAMP_API == STD_ON */

#if (ICU_EDGE_COUNT_API == STD_ON)
FUNC(void, ICU_CODE) Icu_Ipw_ResetEdgeCount
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

FUNC(void, ICU_CODE) Icu_Ipw_EnableEdgeCount
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

FUNC(void, ICU_CODE) Icu_Ipw_DisableEdgeCount
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);

FUNC(Icu_EdgeNumberType, ICU_CODE) Icu_Ipw_GetEdgeNumbers
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_EDGE_COUNT_API == STD_ON */

#if ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON))
FUNC(uint32, ICU_CODE)Icu_Ipw_GetStartAddress
(
    VAR(Icu_ChannelType,           AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif

#if (ICU_EDGE_DETECT_API == STD_ON)
FUNC (void, ICU_CODE) Icu_Ipw_EnableEdgeDetection
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
FUNC (void, ICU_CODE) Icu_Ipw_DisableEdgeDetection
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif /* ICU_EDGE_DETECT_API */

#if (ICU_SIGNAL_MEASUREMENT_API == STD_ON)
FUNC (void, ICU_CODE) Icu_Ipw_StartSignalMeasurement
(
    VAR(Icu_ChannelType, AUTOMATIC)                             nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST)   pIpConfig,
    VAR(Icu_ParamType, AUTOMATIC)                               StartEdge,
    VAR(Icu_MeasurementSubModeType, AUTOMATIC)                  MeasProperty,
    VAR(boolean, AUTOMATIC)                                     bDmaSupport
);
#endif  /* ICU_SIGNAL_MEASUREMENT_API == STD_ON */

#if (ICU_SIGNAL_MEASUREMENT_API == STD_ON)
FUNC (void, ICU_CODE) Icu_Ipw_StopSignalMeasurement
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_SIGNAL_MEASUREMENT_API == STD_ON */

#if (ICU_GET_INPUT_LEVEL_API == STD_ON)
FUNC(Icu_LevelType, ICU_CODE) Icu_Ipw_GetInputLevel
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif   /* ICU_GET_INPUT_LEVEL_API == STD_ON */

#if ((ICU_CAPTURERGISTER_API == STD_ON) && ((ICU_SIGNAL_MEASUREMENT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON)))
FUNC(Icu_ValueType, ICU_CODE) Icu_Ipw_GetCaptureRegisterValue
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif

#if ((ICU_EDGE_COUNT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON) || \
     (ICU_GET_TIME_ELAPSED_API == STD_ON) || (ICU_GET_DUTY_CYCLE_VALUES_API == STD_ON))
FUNC(boolean, ICU_CODE) Icu_Ipw_Get_Overflow
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif  /* ICU_EDGE_COUNT_API == STD_ON */

#if ((ICU_GET_PULSE_WIDTH_API == STD_ON) && (ICU_SIGNAL_MEASUREMENT_API == STD_ON))
FUNC(void, ICU_CODE) Icu_Ipw_GetPulseWidth
(
    VAR(Icu_ChannelType,                      AUTOMATIC)      nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif /* (ICU_GET_PULSE_WIDTH_API == STD_ON) && (ICU_SIGNAL_MEASUREMENT_API == STD_ON) */

#if (ICU_DUAL_CLOCK_MODE_API == STD_ON)
FUNC(void, ICU_CODE) Icu_Ipw_SetClockMode
(
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig,
    VAR(Icu_SelectPrescalerType,   AUTOMATIC)                 Prescaler
);
#endif /* ICU_DUAL_CLOCK_MODE_API */


#if ((ICU_VALIDATE_PARAMS == STD_ON) && (ICU_GET_INPUT_LEVEL_API == STD_ON))
FUNC (Icu_ChannelType, ICU_CODE) Icu_Ipw_ValidateGetInputLevel
(
    VAR         (Icu_ChannelType,  AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif /* (ICU_VALIDATE_PARAMS == STD_ON) && (ICU_GET_INPUT_LEVEL_API == STD_ON */

#if ((ICU_VALIDATE_GLOBAL_CALL == STD_ON) && ((ICU_GET_PULSE_WIDTH_API == STD_ON) && (ICU_SIGNAL_MEASUREMENT_API == STD_ON)))
FUNC (Std_ReturnType, ICU_CODE) Icu_Ipw_ValidateSignalMeasureWithoutInterrupt
(
    VAR         (Icu_ChannelType,  AUTOMATIC)                 nChannelNumber,
    CONSTP2CONST(Icu_IpConfigType, AUTOMATIC, ICU_APPL_CONST) pIpConfig
);
#endif /* (ICU_VALIDATE_PARAMS == STD_ON) && ((ICU_GET_PULSE_WIDTH_API == STD_ON) && (ICU_SIGNAL_MEASUREMENT_API == STD_ON))*/

#define ICU_STOP_SEC_CODE
/**
* @violates @ref ICU_IPW_H_REF_1 Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once.
*
* @violates @ref ICU_IPW_H_REF_2 Advisory Rule 20.1, #include directives should only be preceded by
* preprocessor directives or comments.
*/
#include "Icu_MemMap.h"

#ifdef __cplusplus
}
#endif

#endif  /* ICU_IPW_H */
/** @} */

