/**
*   @file           Pwm_Ipw_Types.h
*   @version        1.0.0
*
*   @brief          AUTOSAR Pwm - PWM driver IP wrapper header file.
*   @details        IP wrapper defines, types used by PWM driver.
*
*   @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_TYPES_H
#define PWM_IPW_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif



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

#include "Pwm_Types.h"

#include "Pwm_eMios_Types.h"



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

/**
* @{
* @file           Pwm_Ipw_Types.h
*/
#define PWM_IPW_TYPES_VENDOR_ID                         43
#define PWM_IPW_TYPES_AR_RELEASE_MAJOR_VERSION          4
#define PWM_IPW_TYPES_AR_RELEASE_MINOR_VERSION          3
#define PWM_IPW_TYPES_AR_RELEASE_REVISION_VERSION       1
#define PWM_IPW_TYPES_SW_MAJOR_VERSION                  1
#define PWM_IPW_TYPES_SW_MINOR_VERSION                  0
#define PWM_IPW_TYPES_SW_PATCH_VERSION                  0
/**@}*/



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

/* Check if included Pwm_Types.h header file has same vendor */
#if (PWM_IPW_TYPES_VENDOR_ID != PWM_TYPES_VENDOR_ID)
    #error "Pwm_Ipw_Types.h and Pwm_Types.h have different vendor ids"
#endif

/* Check if included Pwm_Types.h header file has same AUTOSAR version */
#if ((PWM_IPW_TYPES_AR_RELEASE_MAJOR_VERSION    !=  PWM_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_IPW_TYPES_AR_RELEASE_MINOR_VERSION    !=  PWM_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (PWM_IPW_TYPES_AR_RELEASE_REVISION_VERSION !=  PWM_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AUTOSAR version numbers of Pwm_Ipw_Types.h and Pwm_Types.h are different"
#endif

/* Check if included Pwm_Types.h header file has same software version */
#if ((PWM_IPW_TYPES_SW_MAJOR_VERSION !=  PWM_TYPES_SW_MAJOR_VERSION) || \
     (PWM_IPW_TYPES_SW_MINOR_VERSION !=  PWM_TYPES_SW_MINOR_VERSION) || \
     (PWM_IPW_TYPES_SW_PATCH_VERSION !=  PWM_TYPES_SW_PATCH_VERSION))
    #error "Software version numbers of Pwm_Ipw_Types.h and Pwm_Types.h are different"
#endif



/* Check if included Pwm_eMios_Types.h header file has same vendor */
#if (PWM_IPW_TYPES_VENDOR_ID != PWM_EMIOS_TYPES_VENDOR_ID)
    #error "Pwm_Ipw_Types.h and Pwm_eMios_Types.h have different vendor ids"
#endif

/* Check if included Pwm_eMios_Types.h header file has same AUTOSAR version */
#if ((PWM_IPW_TYPES_AR_RELEASE_MAJOR_VERSION    !=  PWM_EMIOS_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_IPW_TYPES_AR_RELEASE_MINOR_VERSION    !=  PWM_EMIOS_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (PWM_IPW_TYPES_AR_RELEASE_REVISION_VERSION !=  PWM_EMIOS_TYPES_AR_RELEASE_REVISION_VERSION))
    #error "AUTOSAR version numbers of Pwm_Ipw_Types.h and Pwm_eMios_Types.h are different"
#endif

/* Check if included Pwm_eMios_Types.h header file has same software version */
#if ((PWM_IPW_TYPES_SW_MAJOR_VERSION !=  PWM_EMIOS_TYPES_SW_MAJOR_VERSION) || \
     (PWM_IPW_TYPES_SW_MINOR_VERSION !=  PWM_EMIOS_TYPES_SW_MINOR_VERSION) || \
     (PWM_IPW_TYPES_SW_PATCH_VERSION !=  PWM_EMIOS_TYPES_SW_PATCH_VERSION))
    #error "Software version numbers of Pwm_Ipw_Types.h and Pwm_eMios_Types.h are different"
#endif



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

#if (PWM_SET_CHANNEL_OUTPUT_API == STD_ON)
/**
* @brief        Defines state of PWM channel
* @details      PWM_EMIOS_ACTIVE - The PWM pin will be in the same state of configured polarity
*               PWM_EMIOS_INACTIVE - The PWM pin will be in the opposite state of configured polarity
*/
typedef enum
{
    PWM_EMIOS_ACTIVE = 0,
    PWM_EMIOS_INACTIVE
} Pwm_StateType;
#endif


/**
* @brief        PWM channel high level configuration structure
*
*/
typedef struct 
{
    /** @brief  Index in the IP specific configuration table */
    CONST       (uint8,                         PWM_CONST)                      u8IdxChannelConfig;    
} Pwm_IpChannelConfigType;


/**
* @brief        Combined IP specific configuration structure
*
*/
typedef struct 
{
    /** @brief  Pointer to the structure containing eMIOS configuration */
    CONSTP2CONST(Pwm_eMios_IpConfigType,        PWM_CONST,  PWM_APPL_CONST)     peMiosIpConfig;
    /** @brief  Pointer to array containing IP type and index in the configuration table for each PWM channel */
    CONST       (Pwm_IpChannelConfigType,       PWM_CONST)                      (*pIpChannelsConfig)[];
} Pwm_IpConfigType;



#ifdef __cplusplus
}
#endif

#endif /* PWM_IPW_TYPES_H */

/** @} */
