/**
*   @file           Pwm_Ipw.h
*   @version        1.0.0
*
*   @brief          AUTOSAR Pwm - PWM IP wrapper API header file.
*   @details        PWM IP wrapper API header file.
*
*   @addtogroup     PWM_MODULE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : eMios
*   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 PWM_IPW_H
#define PWM_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 Pwm_Ipw_h_REF_1
* 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.
*
* @section Pwm_Ipw_h_REF_2
* 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
===============================================================================================*/

#include "Pwm_Ipw_Types.h"
#include "Pwm_Cfg.h"



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

/**
* @{
* @file           Pwm_Ipw.h
*/
#define PWM_IPW_VENDOR_ID                         43
#define PWM_IPW_AR_RELEASE_MAJOR_VERSION          4
#define PWM_IPW_AR_RELEASE_MINOR_VERSION          3
#define PWM_IPW_AR_RELEASE_REVISION_VERSION       1
#define PWM_IPW_SW_MAJOR_VERSION                  1
#define PWM_IPW_SW_MINOR_VERSION                  0
#define PWM_IPW_SW_PATCH_VERSION                  0
/**@}*/



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

/* Check if header file and Pwm_Ipw_Types header file are of the same vendor */
#if (PWM_IPW_VENDOR_ID != PWM_IPW_TYPES_VENDOR_ID)
    #error "Pwm_Ipw.h and Pwm_Ipw_Types.h have different vendor ids"
#endif

/* Check if header file and Pwm_Ipw_Types header file are of the same AUTOSAR version */
#if ((PWM_IPW_AR_RELEASE_MAJOR_VERSION    != PWM_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_IPW_AR_RELEASE_MINOR_VERSION    != PWM_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (PWM_IPW_AR_RELEASE_REVISION_VERSION != PWM_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AUTOSAR version numbers of Pwm_Ipw.h and Pwm_Ipw_Types.h are different"
#endif

/* Check if header file and Pwm_Ipw_Types header file are of the same software version */
#if ((PWM_IPW_SW_MAJOR_VERSION != PWM_IPW_TYPES_SW_MAJOR_VERSION) || \
     (PWM_IPW_SW_MINOR_VERSION != PWM_IPW_TYPES_SW_MINOR_VERSION) || \
     (PWM_IPW_SW_PATCH_VERSION != PWM_IPW_TYPES_SW_PATCH_VERSION))
    #error "Software version numbers of Pwm_Ipw.h and Pwm_Ipw_Types.h are different"
#endif



/* Check if header file and Pwm_Cfg header file are of the same vendor */
#if (PWM_IPW_VENDOR_ID != PWM_CFG_VENDOR_ID)
    #error "Pwm_Ipw.h and Pwm_Cfg.h have different vendor ids"
#endif

/* Check if header file and Pwm_Cfg header file are of the same AUTOSAR version */
#if ((PWM_IPW_AR_RELEASE_MAJOR_VERSION    != PWM_CFG_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_IPW_AR_RELEASE_MINOR_VERSION    != PWM_CFG_AR_RELEASE_MINOR_VERSION) || \
     (PWM_IPW_AR_RELEASE_REVISION_VERSION != PWM_CFG_AR_RELEASE_REVISION_VERSION))
    #error "AUTOSAR version numbers of Pwm_Ipw.h and Pwm_Cfg.h are different"
#endif

/* Check if header file and Pwm_Cfg header file are of the same software version */
#if ((PWM_IPW_SW_MAJOR_VERSION != PWM_CFG_SW_MAJOR_VERSION) || \
     (PWM_IPW_SW_MINOR_VERSION != PWM_CFG_SW_MINOR_VERSION) || \
     (PWM_IPW_SW_PATCH_VERSION != PWM_CFG_SW_PATCH_VERSION))
    #error "Software version numbers of Pwm_Ipw.h and Pwm_Cfg.h are different"
#endif



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

#define PWM_START_SEC_CODE
/*
* @violates @ref Pwm_Ipw_h_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_Ipw_h_REF_1 Pwm_MemMap.h is included after each section define
*                in order to set the current memory section as defined by AUTOSAR
*/
#include "Pwm_MemMap.h"

/* Check if source file and Pwm_MemMap.h are of the same AUTOSAR version */
#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
#if ((PWM_IPW_AR_RELEASE_MAJOR_VERSION != PWM_MEMMAP_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_IPW_AR_RELEASE_MINOR_VERSION != PWM_MEMMAP_AR_RELEASE_MINOR_VERSION))
    #error "AUTOSAR version numbers of Pwm_Ipw.h and Pwm_MemMap.h are different."
#endif
#endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */



/*=============================================================================================*/
FUNC(void, PWM_CODE) Pwm_Ipw_Init
(   
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);


/*=============================================================================================*/
#if (PWM_DE_INIT_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_DeInit
(
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC, PWM_APPL_CONST)      pIpConfig
);
#endif /* PWM_DE_INIT_API */


/*=============================================================================================*/
#if (PWM_SET_DUTY_CYCLE_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetDutyCycle
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (uint16,                        AUTOMATIC)                      u16DutyCycle,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_DUTY_CYCLE_API */


/*=============================================================================================*/
#if (PWM_SET_PERIOD_AND_DUTY_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetPeriodAndDuty
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_PeriodType,                AUTOMATIC)                      nPeriod,
    VAR         (uint16,                        AUTOMATIC)                      u16DutyCycle,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_PERIOD_AND_DUTY_API */


/*=============================================================================================*/
#if (PWM_SET_OUTPUT_TO_IDLE_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetOutputToIdle
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_OUTPUT_TO_IDLE_API */


/*=============================================================================================*/
#if (PWM_GET_OUTPUT_STATE_API == STD_ON)
FUNC(Pwm_OutputStateType, PWM_CODE) Pwm_Ipw_GetOutputState
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_GET_OUTPUT_STATE_API */


/*=============================================================================================*/
#if (PWM_NOTIFICATION_SUPPORTED == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_DisableNotification
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_NOTIFICATION_SUPPORTED */


/*=============================================================================================*/
#if (PWM_NOTIFICATION_SUPPORTED == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_EnableNotification
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_EdgeNotificationType,      AUTOMATIC)                      eNotification,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_NOTIFICATION_SUPPORTED */








/*=============================================================================================*/
#if (PWM_GET_CHANNEL_STATE_API == STD_ON)
FUNC(uint16, PWM_CODE) Pwm_Ipw_GetChannelState
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_GET_CHANNEL_STATE_API */


/*=============================================================================================*/
#if (PWM_SET_CLOCK_MODE_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetClockMode
(
    VAR         (Pwm_PrescalerType,             AUTOMATIC)                      ePrescaler,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_CLOCK_MODE_API */


/*=============================================================================================*/
#if (PWM_SET_COUNTER_BUS_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetCounterBus
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (uint32,                        AUTOMATIC)                      u32Bus,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_COUNTER_BUS_API */


/*=============================================================================================*/
#if (PWM_SET_CHANNEL_OUTPUT_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetChannelOutput
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_StateType,                 AUTOMATIC)                      nState,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_CHANNEL_OUTPUT_API */


/*=============================================================================================*/
#if (PWM_SET_PHASE_SHIFT_API == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetPhaseShift
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_PeriodType,                AUTOMATIC)                      nPeriod,
    VAR         (uint16,                        AUTOMATIC)                      u16PhaseShift,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_PHASE_SHIFT_API */


/*=============================================================================================*/
#if ((PWM_UPDATE_DUTY_SYNCHRONOUS == STD_ON) && (PWM_SET_DUTY_CYCLE_NO_UPDATE_API == STD_ON))
FUNC(void, PWM_CODE) Pwm_Ipw_SetDutyCycle_NoUpdate
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (uint16,                        AUTOMATIC)                      u16DutyCycle,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_DUTY_CYCLE_NO_UPDATE_API */


/*=============================================================================================*/
#if ((PWM_UPDATE_DUTY_SYNCHRONOUS == STD_ON) && (PWM_SET_PERIOD_AND_DUTY_NO_UPDATE_API == STD_ON))
FUNC(void, PWM_CODE) Pwm_Ipw_SetPeriodAndDuty_NoUpdate
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_PeriodType,                AUTOMATIC)                      nPeriod,
    VAR         (uint16,                        AUTOMATIC)                      u16DutyCycle,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_PERIOD_AND_DUTY_NO_UPDATE_API */


/*=============================================================================================*/
#if ((PWM_UPDATE_DUTY_SYNCHRONOUS == STD_ON) && (PWM_SET_PHASE_SHIFT_NO_UPDATE_API == STD_ON))
FUNC(void, PWM_CODE) Pwm_Ipw_SetPhaseShift_NoUpdate
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_PeriodType,                AUTOMATIC)                      nPeriod,
    VAR         (uint16,                        AUTOMATIC)                      u16PhaseShift,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SET_PHASE_SHIFT_NO_UPDATE_API */


/*=============================================================================================*/
#if ((PWM_UPDATE_DUTY_SYNCHRONOUS == STD_ON) && (PWM_SYNC_UPDATE_API == STD_ON))
FUNC(void, PWM_CODE) Pwm_Ipw_SyncUpdate
(
    VAR         (uint8,                         AUTOMATIC)                      u8ModuleIndex,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_SYNC_UPDATE_API */








/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && (PWM_NOTIFICATION_SUPPORTED == STD_ON))
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateNotification
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (Pwm_EdgeNotificationType,      AUTOMATIC)                      eNotification,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif


/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && ((PWM_SET_DUTY_CYCLE_API == STD_ON) || (PWM_SET_DUTY_CYCLE_NO_UPDATE_API == STD_ON)))
FUNC(uint8, PWM_CODE) Pwm_Ipw_ValidateParamParamOffsetDuty
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    VAR         (uint16,                        AUTOMATIC)                      u16DutyCycle,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif


/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && (PWM_SET_COUNTER_BUS_API == STD_ON))
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateCounterBus
(
    VAR         (uint32,                        AUTOMATIC)                      u32Bus,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif


/*=============================================================================================*/
#if (PWM_PARAM_CHECK == STD_ON)
FUNC(uint8, PWM_CODE) Pwm_Ipw_ValidateParamOffset
(
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif


/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && ((PWM_SET_PHASE_SHIFT_API == STD_ON) || (PWM_SET_PHASE_SHIFT_NO_UPDATE_API == STD_ON)))
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateChannelSetPhaseShift
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_PARAM_CHECK && (PWM_SET_PHASE_SHIFT_API || PWM_SET_PHASE_SHIFT_NO_UPDATE_API) */


/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && ((PWM_SET_PHASE_SHIFT_API == STD_ON) || (PWM_SET_PHASE_SHIFT_NO_UPDATE_API == STD_ON)))
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateParamsPhaseShift
(
    VAR         (uint16,                        AUTOMATIC)                      u16PhaseShift
);
#endif /* PWM_PARAM_CHECK && (PWM_SET_PHASE_SHIFT_API || PWM_SET_PHASE_SHIFT_NO_UPDATE_API) */


/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && ((PWM_SET_DUTY_CYCLE_NO_UPDATE_API == STD_ON) || (PWM_SET_PERIOD_AND_DUTY_NO_UPDATE_API == STD_ON) || (PWM_SET_PHASE_SHIFT_NO_UPDATE_API == STD_ON)))
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateChannelSync
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_PARAM_CHECK && (PWM_SET_DUTY_CYCLE_NO_UPDATE_API || PWM_SET_PERIOD_AND_DUTY_NO_UPDATE_API) */








/*=============================================================================================*/
#if ((PWM_PARAM_CHECK == STD_ON) && ((PWM_SET_PERIOD_AND_DUTY_API == STD_ON) || (PWM_SET_PERIOD_AND_DUTY_NO_UPDATE_API == STD_ON)))
FUNC(uint32, PWM_CODE) Pwm_Ipw_GetMaxPeriodValue
(
    VAR         (Pwm_ChannelType,               AUTOMATIC)                      nChannelNumber,
    CONSTP2CONST(Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif








/*=============================================================================================*/
#if (PWM_POWER_STATE_SUPPORTED == STD_ON)
FUNC(Std_ReturnType, PWM_CODE) Pwm_Ipw_ValidateIdleState
(
    P2CONST     (Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig
);
#endif /* PWM_POWER_STATE_SUPPORTED */


/*=============================================================================================*/
#if (PWM_POWER_STATE_SUPPORTED == STD_ON)
FUNC(void, PWM_CODE) Pwm_Ipw_SetPowerState
(
    P2CONST     (Pwm_IpConfigType,              AUTOMATIC,  PWM_APPL_CONST)     pIpConfig,
    VAR         (Pwm_PowerStateType,            AUTOMATIC)                      nPowerState
);
#endif /* PWM_POWER_STATE_SUPPORTED */


#define PWM_STOP_SEC_CODE
/*
* @violates @ref Pwm_Ipw_h_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_Ipw_h_REF_1 Pwm_MemMap.h is included after each section define
*                in order to set the current memory section as defined by AUTOSAR
*/
#include "Pwm_MemMap.h"



#ifdef __cplusplus
}
#endif

#endif /* PWM_IPW_H */

/** @} */
