/**
*   @file           Pwm_PBcfg.c
*   @implements     Pwm_PBcfg.c_Artifact
*   @version        1.0.0
*
*   @brief          AUTOSAR Pwm - PWM post-build configuration file.
*   @details        Post-build configuration structure instances.
*
*   @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.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#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_PBCfg_c_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_PBCfg_c_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].
*
* @section Pwm_PBcfg_c_REF_3
* Violates MISRA 2012 Required Rule 8.4, A compatible declaration shall be visible when an object or function 
* with external linkage is defined.
*
* @section Pwm_PBcfg_c_REF_4
* Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if its identifier only appears 
* in a single function.
*
* @section Pwm_PBcfg_c_REF_5
* Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations
* Macros that are in <MDL>.h or <MDL>_Cfg.h… that are needed for the client (and are used only in tests)
*
* @section Pwm_PBcfg_c_REF_6
* Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with external linkage 
* if they are referenced in only one translation unit.
* These functions represent the API of the driver. External linkage is needed to "export" the API.
*
* @section Pwm_PBcfg_c_REF_7
* Violates MISRA 2012 Required Rule 8.5, An external object or function shall be declared once in one
* and only one file.
*
*/



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

#include "Pwm.h"

#include "Reg_eSys_eMios.h"

#include "eMios_Common_Types.h"



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

/**
* @{
* @file           Pwm_PBcfg.c
*/
#define PWM_PB_CFG_VENDOR_ID_C                      43
#define PWM_PB_CFG_AR_RELEASE_MAJOR_VERSION_C       4
#define PWM_PB_CFG_AR_RELEASE_MINOR_VERSION_C       3
#define PWM_PB_CFG_AR_RELEASE_REVISION_VERSION_C    1
#define PWM_PB_CFG_SW_MAJOR_VERSION_C               1
#define PWM_PB_CFG_SW_MINOR_VERSION_C               0
#define PWM_PB_CFG_SW_PATCH_VERSION_C               0
/**@}*/



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

#if (PWM_PB_CFG_VENDOR_ID_C != PWM_VENDOR_ID)
    #error "Pwm_PBcfg.c and Pwm.h have different vendor ids"
#endif

#if ((PWM_PB_CFG_AR_RELEASE_MAJOR_VERSION_C    != PWM_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_PB_CFG_AR_RELEASE_MINOR_VERSION_C    != PWM_AR_RELEASE_MINOR_VERSION) || \
     (PWM_PB_CFG_AR_RELEASE_REVISION_VERSION_C != PWM_AR_RELEASE_REVISION_VERSION))
    #error "AUTOSAR version numbers of Pwm_PBcfg.c and Pwm.h are different"
#endif

#if ((PWM_PB_CFG_SW_MAJOR_VERSION_C != PWM_SW_MAJOR_VERSION) || \
     (PWM_PB_CFG_SW_MINOR_VERSION_C != PWM_SW_MINOR_VERSION) || \
     (PWM_PB_CFG_SW_PATCH_VERSION_C != PWM_SW_PATCH_VERSION))
    #error "Software version numbers of Pwm_PBcfg.c and Pwm.h are different"
#endif


#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    /* Check if header file and Reg_eSys_eMios.h header file are of the same vendor */
    #if (PWM_PB_CFG_VENDOR_ID_C != REG_ESYS_EMIOS_VENDOR_ID)
        #error "Pwm_PBcfg.c and Reg_eSys_eMios.h have different vendor ids"
    #endif

    /* Check if header file and Reg_eSys_eMios.h header file are of the same AUTOSAR version */
    #if ((PWM_PB_CFG_AR_RELEASE_MAJOR_VERSION_C    != REG_ESYS_EMIOS_AR_RELEASE_MAJOR_VERSION) || \
         (PWM_PB_CFG_AR_RELEASE_MINOR_VERSION_C    != REG_ESYS_EMIOS_AR_RELEASE_MINOR_VERSION) || \
         (PWM_PB_CFG_AR_RELEASE_REVISION_VERSION_C != REG_ESYS_EMIOS_AR_RELEASE_REVISION_VERSION))
        #error "AUTOSAR version numbers of Pwm_PBcfg.c and Reg_eSys_eMios.h are different"
    #endif

    /* Check if header file and Reg_eSys_eMios.h header file are of the same software version */
    #if ((PWM_PB_CFG_SW_MAJOR_VERSION_C != REG_ESYS_EMIOS_SW_MAJOR_VERSION) || \
         (PWM_PB_CFG_SW_MINOR_VERSION_C != REG_ESYS_EMIOS_SW_MINOR_VERSION) || \
         (PWM_PB_CFG_SW_PATCH_VERSION_C != REG_ESYS_EMIOS_SW_PATCH_VERSION))
        #error "Software version numbers of Pwm_PBcfg.c and Reg_eSys_eMios.h are different"
    #endif

    /* Check if source file and eMios_Common_Types.h are of the same vendor */
    #if (PWM_PB_CFG_VENDOR_ID_C != EMIOS_COMMON_TYPES_VENDOR_ID )
        #error "Pwm_PBcfg.c and eMios_Common_Types.h have different vendor ids"
    #endif
    
    /* Check if source file and eMios_Common_Types.h are of the same AUTOSAR version */
    #if ((PWM_PB_CFG_AR_RELEASE_MAJOR_VERSION_C != EMIOS_COMMON_TYPES_AR_RELEASE_MAJOR_VERSION) || \
         (PWM_PB_CFG_AR_RELEASE_MINOR_VERSION_C != EMIOS_COMMON_TYPES_AR_RELEASE_MINOR_VERSION) || \
         (PWM_PB_CFG_AR_RELEASE_REVISION_VERSION_C != EMIOS_COMMON_TYPES_AR_RELEASE_REVISION_VERSION))
        #error "AUTOSAR Version Numbers of Pwm_PBcfg.c and eMios_Common_Types.h are different"
    #endif
    
    /* Check if source file and eMios_Common_Types.h are of the same software version */
    #if ((PWM_PB_CFG_SW_MAJOR_VERSION_C != EMIOS_COMMON_TYPES_SW_MAJOR_VERSION) || \
         (PWM_PB_CFG_SW_MINOR_VERSION_C != EMIOS_COMMON_TYPES_SW_MINOR_VERSION) || \
         (PWM_PB_CFG_SW_PATCH_VERSION_C != EMIOS_COMMON_TYPES_SW_PATCH_VERSION))
        #error "Software Version Numbers of Pwm_PBcfg.c and eMios_Common_Types.h are different"
    #endif
#endif



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

#define PWM_START_SEC_CODE
/*
* @violates @ref Pwm_PBCfg_c_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_PBCfg_c_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_PB_CFG_AR_RELEASE_MAJOR_VERSION_C != PWM_MEMMAP_AR_RELEASE_MAJOR_VERSION) || \
     (PWM_PB_CFG_AR_RELEASE_MINOR_VERSION_C != 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 */


#define PWM_STOP_SEC_CODE
/*
* @violates @ref Pwm_PBCfg_c_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_PBCfg_c_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"



/*==================================================================================================
*                                       LOCAL DEFINES
==================================================================================================*/

/**
* @brief        Total number of configured PWM channels
*
*/
#define PWM_CONF_CHANNELS_PB           ((uint8)2U)

/**
* @brief        Number of configured eMIOS channels
*
*/
#define PWM_EMIOS_CONF_CHANNELS_PB     ((uint8)2U)



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

#define PWM_START_SEC_CONFIG_DATA_UNSPECIFIED
/*
* @violates @ref Pwm_PBCfg_c_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_PBCfg_c_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"

/*================================= Configuration for eMIOS ======================================*/

/**
* @brief        Configurations for PWM channels using eMIOS
*
*/
static CONST (Pwm_eMios_ChannelConfigType, PWM_CONST) Pwm_eMios_ChannelConfig_PB[PWM_EMIOS_CONF_CHANNELS_PB] =
{
    /* PwmChannel_0 */
    {
        /** @brief  PWM channel polarity */
        PWM_HIGH,
        /** @brief  PWM channel idle state */
        PWM_LOW,
        /** @brief  Default duty cycle value */
        (uint16)0x4000U,
        /** @brief  Default period value */
        (Pwm_PeriodType)1000U,
        /** @brief  eMIOS hardware module and channel */
        EMIOS_0_CH_0,
        /** @brief  eMIOS channel configuration parameters */
        (Pwm_eMios_ControlType)(PWM_BUS_INTERNAL_COUNTER_U32 | PWM_MODE_OPWFMB_U32 | (PWM_PRES_1_U32)),
        /** @brief  Offset value for OPWMB and OPWM mode */
        (Pwm_PeriodType)0U,
        /** @brief  Master mode used */
        (uint8)0,
#if (PWM_FEATURE_DAOC == STD_ON)
        /** @brief  Default period value for DAOC mode */
        (Pwm_PeriodType)0U,
#endif
#if (PWM_FEATURE_OPWMT == STD_ON)
        /** @brief  Trigger delay value for OPWMT mode */
        (Pwm_PeriodType)0U,
#endif
#if (PWM_FEATURE_OPWMCB == STD_ON)
        /** @brief  Deadtime value for OPWMCB mode */
        (uint16)0U,
#endif
        /** @brief  Offset recalculated when master bus changed, for OPWMB and OPWM mode */
        (boolean)FALSE
    },
    /* PwmChannel_1 */
    {
        /** @brief  PWM channel polarity */
        PWM_HIGH,
        /** @brief  PWM channel idle state */
        PWM_LOW,
        /** @brief  Default duty cycle value */
        (uint16)0x4000U,
        /** @brief  Default period value */
        (Pwm_PeriodType)1000U,
        /** @brief  eMIOS hardware module and channel */
        EMIOS_0_CH_1,
        /** @brief  eMIOS channel configuration parameters */
        (Pwm_eMios_ControlType)(PWM_BUS_INTERNAL_COUNTER_U32 | PWM_MODE_OPWFMB_U32 | (PWM_PRES_1_U32)),
        /** @brief  Offset value for OPWMB and OPWM mode */
        (Pwm_PeriodType)0U,
        /** @brief  Master mode used */
        (uint8)0,
#if (PWM_FEATURE_DAOC == STD_ON)
        /** @brief  Default period value for DAOC mode */
        (Pwm_PeriodType)0U,
#endif
#if (PWM_FEATURE_OPWMT == STD_ON)
        /** @brief  Trigger delay value for OPWMT mode */
        (Pwm_PeriodType)0U,
#endif
#if (PWM_FEATURE_OPWMCB == STD_ON)
        /** @brief  Deadtime value for OPWMCB mode */
        (uint16)0U,
#endif
        /** @brief  Offset recalculated when master bus changed, for OPWMB and OPWM mode */
        (boolean)FALSE
    }
};



/**
* @brief        eMIOS IP configuration
*
*/
static CONST (Pwm_eMios_IpConfigType, PWM_CONST) Pwm_eMios_IpConfig_PB=
{
    /** @brief  Number of eMIOS channels in the PWM configuration */
    (uint8)2U,
    /** @brief  Pointer to the array of eMIOS enabled PWM channel configurations */
    &Pwm_eMios_ChannelConfig_PB
};



/*============================== IP Wrapper configuration ===================================*/

/**
* @brief        Array of configured PWM channels 
*
*/
static CONST (Pwm_ChannelConfigType, PWM_CONST) Pwm_Channels_PB[PWM_CONF_CHANNELS_PB] =
{
    /* PwmChannel_0 */
    {
        /** @brief  Channel class */
        PWM_FIXED_PERIOD
#if (PWM_NOTIFICATION_SUPPORTED == STD_ON)
        ,
        /** @brief  PWM notification function */
        NULL_PTR
#endif
    },
    /* PwmChannel_1 */
    {
        /** @brief  Channel class */
        PWM_FIXED_PERIOD
#if (PWM_NOTIFICATION_SUPPORTED == STD_ON)
        ,
        /** @brief  PWM notification function */
        NULL_PTR
#endif
    }
};



/**
* @brief        PWM channels IP related configuration array
*
*/
static CONST (Pwm_IpChannelConfigType, PWM_CONST) Pwm_IpChannelConfig_PB[PWM_CONF_CHANNELS_PB] =
{
    /* PwmChannel_0 */
    {
        /** @brief  Index in the configuration table of the eMIOS channels */
        (uint8)0
    },
    /* PwmChannel_1 */
    {
        /** @brief  Index in the configuration table of the eMIOS channels */
        (uint8)1
    }
};



/*============================== High level configuration ===================================*/

/**
* @brief        PWM high level configuration structure
*
*/
/*
* @violates @ref Pwm_PBcfg_c_REF_6 Objects need external linkage in order to be called
*                as callbacks from the external (e.g. MCL) module.
*/
CONST(Pwm_ConfigType, Pwm_CONST) PwmChannelConfigSet_0=
{
    /** @brief  Number of configured PWM channels */
    (Pwm_ChannelType)PWM_CONF_CHANNELS_PB,
    /** @brief  Pointer to array of PWM channels */
    &Pwm_Channels_PB,
    /** @brief  IP specific configuration */
    {
        /** @brief  Pointer to the structures containing eMIOS configuration */
        &Pwm_eMios_IpConfig_PB,
        /** @brief  Pointer to array containing channel IP related information */
        &Pwm_IpChannelConfig_PB
    }
#if (PWM_NOTIFICATION_SUPPORTED == STD_ON)
    ,
    /** @brief  Hardware to logic channel map. Array containing a number of elements
                equal to total number of available channels on all IP. */
    {
        /*---------------------eMIOS_0---------------------------*/
        (Pwm_ChannelType)0,            /* eMIOS_0_0 */
        (Pwm_ChannelType)1,            /* eMIOS_0_1 */
        (Pwm_ChannelType)255,            /* eMIOS_0_2 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_3 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_4 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_5 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_6 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_7 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_8 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_9 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_10 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_11 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_12 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_13 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_14 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_15 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_16 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_17 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_18 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_19 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_20 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_21 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_22 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_23 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_24 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_25 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_26 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_27 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_28 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_29 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_30 unused */
        (Pwm_ChannelType)255,            /* eMIOS_0_31 unused */
    
        /*---------------------eMIOS_1---------------------------*/
        (Pwm_ChannelType)255,            /* eMIOS_1_0 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_1 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_2 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_3 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_4 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_5 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_6 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_7 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_8 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_9 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_10 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_11 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_12 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_13 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_14 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_15 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_16 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_17 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_18 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_19 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_20 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_21 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_22 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_23 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_24 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_25 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_26 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_27 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_28 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_29 unused */
        (Pwm_ChannelType)255,            /* eMIOS_1_30 unused */
        (Pwm_ChannelType)255            /* eMIOS_1_31 unused */
    

    }
#endif
};


#define PWM_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/*
* @violates @ref Pwm_PBCfg_c_REF_2 This violation is not fixed since the inclusion
*                of Pwm_MemMap.h is as per AUTOSAR requirement 
* @violates @ref Pwm_PBCfg_c_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

/** @} */

