/**
*   @file    SwcRte_PBcfg.c
*   @version 1.0.0
*
*   @brief   Integration Framework - Swc Rte Glue-layer configuration source file
*   @details This file implements the RTE configuration source file.
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2018 NXP
*   All Rights Reserved.
*   This file contains sample code only. It is not part of the production code deliverables.
*
*/
/*=========================================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   
*   SW Version           : 1.0.0
*   Build Version        : MPC5777CXG_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190318
*
============================================================================================================================*/
/*============================================================================================================================
==============================================================================================================================*/


#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2004 violations
*
* @section [global]
*     Violates MISRA 2004 Required Rule 5.1, Identifiers (internal and external) shall not rely
*     on the significance of more than 31 characters. The used compilers use more than 31 chars for
*     identifiers.
*
*/

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "typedefs.h"
#include "SwcRte_Cfg.h"
#include "SwcRte_Types.h"

#if (SWCRTE_USE_IODAL == SWCRTE_STD_ON)
    #include "IoDal_Cfg.h"
#endif

#if (SWCRTE_USE_COMDAL == SWCRTE_STD_ON)
    #include "ComDal_Cfg.h"
#endif
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define SWCRTE_VENDOR_ID_PBCFG_C                      43

#define SWCRTE_SW_MAJOR_VERSION_PBCFG_C               1
#define SWCRTE_SW_MINOR_VERSION_PBCFG_C               0
#define SWCRTE_SW_PATCH_VERSION_PBCFG_C               0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if SwcRte_PBcfg.c file and SwcRte_Types.h header file are of the same vendor */
#if ( SWCRTE_VENDOR_ID_PBCFG_C != SWCRTE_CFG_VENDOR_ID)
    #error "SwcRte_PBcfg.c and SwcRte_Cfg.h have different vendor ids"
#endif

/* Check if SwcRte_PBcfg.c and SwcRte_Cfg.h header files are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION_PBCFG_C != SWCRTE_CFG_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION_PBCFG_C != SWCRTE_CFG_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION_PBCFG_C != SWCRTE_CFG_SW_PATCH_VERSION)    \
    )
    #error "Software Version Numbers of SwcRte_PBcfg.c and SwcRte_Cfg.h are different"
#endif

/* Check if SwcRte_PBcfg.c file and SwcRte_Types.h header file are of the same vendor */
#if ( SWCRTE_VENDOR_ID_PBCFG_C != SWCRTE_TYPES_VENDOR_ID)
    #error "SwcRte_PBcfg.c and SwcRte_Types.h have different vendor ids"
#endif

/* Check if SwcRte_PBcfg.c and SwcRte_Types.h header files are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION_PBCFG_C != SWCRTE_TYPES_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION_PBCFG_C != SWCRTE_TYPES_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION_PBCFG_C != SWCRTE_TYPES_SW_PATCH_VERSION)    \
    )
    #error "Software Version Numbers of SwcRte_PBcfg.c and SwcRte_Types.h are different"
#endif

#if (SWCRTE_USE_IODAL == SWCRTE_STD_ON)
/* Check if SwcRte_PBcfg.c file and SwcRte_Types.h header file are of the same vendor */
#if ( SWCRTE_VENDOR_ID_PBCFG_C != IODAL_CFG_VENDOR_ID)
    #error "SwcRte_PBcfg.c and IoDal_Cfg.h have different vendor ids"
#endif

/* Check if SwcRte_PBcfg.c and IoDal_Cfg.h header files are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION_PBCFG_C != IODAL_CFG_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION_PBCFG_C != IODAL_CFG_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION_PBCFG_C != IODAL_CFG_SW_PATCH_VERSION)    \
    )
    #error "Software Version Numbers of SwcRte_PBcfg.c and IoDal_Cfg.h are different"
#endif
#endif

#if (SWCRTE_USE_COMDAL == SWCRTE_STD_ON)
/* Check if SwcRte_PBcfg.c file and SwcRte_Types.h header file are of the same vendor */
#if ( SWCRTE_VENDOR_ID_PBCFG_C != COMDAL_CFG_VENDOR_ID)
    #error "SwcRte_PBcfg.c and ComDal_Cfg.h have different vendor ids"
#endif

/* Check if SwcRte_PBcfg.c and IoDal_Cfg.h header files are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION_PBCFG_C != COMDAL_CFG_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION_PBCFG_C != COMDAL_CFG_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION_PBCFG_C != COMDAL_CFG_SW_PATCH_VERSION)    \
    )
    #error "Software Version Numbers of SwcRte_PBcfg.c and ComDal_Cfg.h are different"
#endif
#endif
/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/

/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/

/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/

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

/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/

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


/*array of configuration data containing the configuration for each input channel (sensors and feedback channels) for instance 0*/
const SwcRte_InputChannelConfigType SwcRte_LightingInputChannelMap_0_PB[2] = 
{
    /*Sensor channel*/
    {
        IoDal_Dio_Key1,    /*IO Channel ID*/
        SWCRTE_DIGITAL_SENS        /*IO Channel Type*/
    },    
    /*feedback channel for channel 0*/
    {
        255,        /*Channel has no configured feedback, thus no input channel*/
        SWCRTE_NO_SENS
    }
            
};            

/*array of configuration data containing the configuration for each input channel (sensors and feedback channels) for instance 1*/
const SwcRte_InputChannelConfigType SwcRte_LightingInputChannelMap_1_PB[2] = 
{
    /*Sensor channel*/
    {
        IoDal_Pwm_Key2,    /*IO Channel ID*/
        SWCRTE_DIGITAL_SENS        /*IO Channel Type*/
    },    
    /*feedback channel for channel 0*/
    {
        255,        /*Channel has no configured feedback, thus no input channel*/
        SWCRTE_NO_SENS
    }
            
};            

/*array of configuration data containing the configuration for each input channel (sensors and feedback channels) for instance 2*/
const SwcRte_InputChannelConfigType SwcRte_LightingInputChannelMap_2_PB[2] = 
{
    /*Sensor channel*/
    {
        IoDal_Adc_Pot,    /*IO Channel ID*/
        SWCRTE_ANALOG_POT_SENS        /*IO Channel Type*/
    },    
    /*feedback channel for channel 0*/
    {
        255,        /*Channel has no configured feedback, thus no input channel*/
        SWCRTE_NO_SENS
    }
            
};            

const SwcRte_OutputChannelConfigType SwcRte_LightingOutputChannelMap_0_PB[1] = 
{        
    /*Output Channel 0*/
    {
        IoDal_Dio_Out1    /*IO Channel ID*/
    }

};

const SwcRte_OutputChannelConfigType SwcRte_LightingOutputChannelMap_1_PB[1] = 
{        
    /*Output Channel 0*/
    {
        IoDal_Pwm_Out2    /*IO Channel ID*/
    }

};

const SwcRte_OutputChannelConfigType SwcRte_LightingOutputChannelMap_2_PB[1] = 
{        
    /*Output Channel 0*/
    {
        IoDal_Pwm_Out1    /*IO Channel ID*/
    }

};

/*Global configuration Data for RTE*/
const SwcRte_GlobalConfigType SwcRte_AppInstanceMapPB[SWCRTE_MAX_APP_INSTANCES] = 
{
 
    {
        SWCRTE_LIGHTING,        /*Application type*/
        SWCRTE_DIGITAL_OUT,        /*Output signal type*/
        1U,                /*Number of input channels*/ 
        1U,                /*Number of output channels*/        
        0U,               /*Number of Rx Messages*/        
        0U,               /*Number of Tx Messages*/
        SwcRte_LightingInputChannelMap_0_PB,               /*Lighting Input channel map configuration structure*/
        SwcRte_LightingOutputChannelMap_0_PB,              /*Lighting Output channel map configuration structure*/
        NULL_PTR,                               /*MC  Input instance configuration structure*/
        NULL_PTR,                               /*MC  Output instance configuration structure*/
        NULL_PTR,              /*Rx message list*/
        NULL_PTR               /*Tx message list*/
    },
 
    {
        SWCRTE_LIGHTING,        /*Application type*/
        SWCRTE_PWM_OUT,        /*Output signal type*/
        1U,                /*Number of input channels*/ 
        1U,                /*Number of output channels*/        
        0U,               /*Number of Rx Messages*/        
        0U,               /*Number of Tx Messages*/
        SwcRte_LightingInputChannelMap_1_PB,               /*Lighting Input channel map configuration structure*/
        SwcRte_LightingOutputChannelMap_1_PB,              /*Lighting Output channel map configuration structure*/
        NULL_PTR,                               /*MC  Input instance configuration structure*/
        NULL_PTR,                               /*MC  Output instance configuration structure*/
        NULL_PTR,              /*Rx message list*/
        NULL_PTR               /*Tx message list*/
    },
 
    {
        SWCRTE_LIGHTING,        /*Application type*/
        SWCRTE_PWM_OUT,        /*Output signal type*/
        1U,                /*Number of input channels*/ 
        1U,                /*Number of output channels*/        
        0U,               /*Number of Rx Messages*/        
        0U,               /*Number of Tx Messages*/
        SwcRte_LightingInputChannelMap_2_PB,               /*Lighting Input channel map configuration structure*/
        SwcRte_LightingOutputChannelMap_2_PB,              /*Lighting Output channel map configuration structure*/
        NULL_PTR,                               /*MC  Input instance configuration structure*/
        NULL_PTR,                               /*MC  Output instance configuration structure*/
        NULL_PTR,              /*Rx message list*/
        NULL_PTR               /*Tx message list*/
    }
    };



/*PostBuild configuration structure.*/
/** @violates @ref SWCRTE_PBCFG_C_REF_4 Violates MISRA 2004 Required Rule 8.10 could be made static*/

/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/

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

/*==================================================================================================
*                                       LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

#ifdef __cplusplus
}
#endif

/** @} */
