/**
*   @file        SwcRte.h
*   @version     1.0.0
*
*   @brief       Integration Framework - SW component RTE header file
*
*   @details     This file implements SwcRte header 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.
*
*   @addtogroup SWCRTE
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   SW Version           : 1.0.0
*   Build Version        : MPC5777CXG_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190318
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/
#ifndef SWCRTE_H
#define SWCRTE_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 "typedefs.h"
#include "SwcRte_Types.h"
#include "SwcRte_Cfg.h"


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

#define SWCRTE_SW_MAJOR_VERSION                   1
#define SWCRTE_SW_MINOR_VERSION                   0
#define SWCRTE_SW_PATCH_VERSION                   0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if SwcRte.h header file and SwcRte_Types.h header file are of the same vendor */
#if (SWCRTE_VENDOR_ID != SWCRTE_TYPES_VENDOR_ID)
    #error "SwcRte.h and SwcRte_Types.h have different vendor ids"
#endif


/* Check if SwcRte.h header file and SwcRte_Types.h header file are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION != SWCRTE_TYPES_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION != SWCRTE_TYPES_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION != SWCRTE_TYPES_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of SwcRte.h and SwcRte_Types.h are different"
#endif

/* Check if SwcRte.h header file and  SwcRte_Cfg.h header file are of the same vendor */
#if (SWCRTE_VENDOR_ID != SWCRTE_CFG_VENDOR_ID)
    #error "SwcRte.h and SwcRte_Cfg.h have different vendor ids"
#endif


/* Check if SwcRte.h header file and SwcRte_Cfg.h header file are of the same Software version */
#if ((SWCRTE_SW_MAJOR_VERSION != SWCRTE_CFG_SW_MAJOR_VERSION) || \
     (SWCRTE_SW_MINOR_VERSION != SWCRTE_CFG_SW_MINOR_VERSION) || \
     (SWCRTE_SW_PATCH_VERSION != SWCRTE_CFG_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of SwcRte.h and SwcRte_Cfg.h are different"
#endif



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



/*================================================================================================*/
void SwcRte_Init( const SwcRte_GlobalConfigType * ConfigPtr);
#if (SWCRTE_SINGLE_TASK_APPLICATION == SWCRTE_STD_ON)	
void SwcRte_MainRunnable(void);
#endif /*(SWCRTE_SINGLE_TASK_APPLICATION == SWCRTE_STD_ON)	*/
/*==================================================================================================
                                 GOBAL FUNCTIONS FOR LIGHTING APP
==================================================================================================*/

#if (SWCRTE_LIGTHING_APP_ENABLED == SWCRTE_STD_ON)
	
#if (SWCRTE_VDR_APP_ENABLED  == SWCRTE_STD_ON)
void SwcRte_ReadLightingComData(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppLightingComDataType * Value);

void SwcRte_WriteLightingComData(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppLightingComDataType * Value);

void SwcRte_FetchLightingComInfo(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppMessageIdType  AppMessageId, SwcRte_AppLightingComInfoType * InputValue);

void SwcRte_WriteLightingComInfo(SwcRte_AppInstanceIdType LightingInstance,  SwcRte_AppLightingComInfoType * Value);

boolean_t SwcRte_GetLightingComInfoEvent(SwcRte_AppInstanceIdType LightingInstance);

void SwcRte_SetLightingComInfoEvent(SwcRte_AppInstanceIdType LightingInstance, boolean_t RequestTx);
#endif /*(SWCRTE_VDR_APP_ENABLED  == SWCRTE_STD_ON)*/

void SwcRte_ReadLightingSensorData(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppLightingSensorValueType *OutputValue) ;

void SwcRte_WriteLightingSensorData(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppLightingSensorValueType *InputValue) ;

void SwcRte_ReadLightingOutputRequest(SwcRte_AppInstanceIdType LightingInstance, SwcRte_AppLightingActuatorValueType * OutputValue);

void SwcRte_WriteLightingOutputRequest(SwcRte_AppInstanceIdType LightingInstance,  SwcRte_AppLightingActuatorValueType * OutputValue); 
#endif /*(SWCRTE_LIGTHING_APP_ENABLED ==SWCRTE_STD_ON)*/
/*==================================================================================================
                                 GOBAL FUNCTIONS FOR MOTOR CONTROL APP
==================================================================================================*/
#if (SWCRTE_MOTORCTRL_APP_ENABLED == SWCRTE_STD_ON)
#if (SWCRTE_VDR_APP_ENABLED == SWCRTE_STD_ON)
void SwcRte_ReadMotorCtrlComData(SwcRte_AppInstanceIdType MCInstance, SwcRte_AppMotorCtrlComDataType * Value);

void SwcRte_WriteMotorCtrlComData(SwcRte_AppInstanceIdType MCInstance, SwcRte_AppMotorCtrlComDataType * Value);

void SwcRte_ReadMotorCtrlComInfo(SwcRte_AppInstanceIdType MCInstance,  SwcRte_AppMotorCtrlComInfoType * Value);

void SwcRte_WriteMotorCtrlComInfo(SwcRte_AppInstanceIdType MCInstance,  SwcRte_AppMotorCtrlComInfoType * OutputValue);
#endif /*(SWCRTE_VDR_APP_ENABLED  ==SWCRTE_STD_ON)*/

void SwcRte_ReadMotorCtrlSensorData(SwcRte_AppInstanceIdType MCInstance, SwcRte_AppMotorCtrlSensorValueType * Value);

void SwcRte_WriteMotorCtrlSensorData(SwcRte_AppInstanceIdType MCInstance, SwcRte_AppMotorCtrlSensorValueType * Value);

void SwcRte_ReadMotorCtrlOutputRequest(SwcRte_AppInstanceIdType MCInstance, SwcRte_AppMotorCtrlActuatorValueType  *OutputValue);

void SwcRte_WriteMotorCtrlOutputRequest(SwcRte_AppInstanceIdType MCInstance,  SwcRte_AppMotorCtrlActuatorValueType * OutputValue);
#endif /*(SWCRTE_MOTORCTRL_APP_ENABLED ==SWCRTE_STD_ON)*/
/*==================================================================================================
                                 GOBAL FUNCTIONS FOR BSW INTERFACE
==================================================================================================*/
#if (SWCRTE_VDR_APP_ENABLED  ==SWCRTE_STD_ON)
SwcRte_AppReturnType SwcRte_ReadComData(SwcRte_AppMessageIdType AppRxMessageId, SwcRte_DataMessageType * DataMessagePtr);
void SwcRte_WriteComData(SwcRte_AppMessageIdType  AppRxMessageId);
#endif /*(SWCRTE_VDR_APP_ENABLED  ==SWCRTE_STD_ON)*/

#ifdef ENABLE_POWER_MODE
void SwcRte_SetPowerMode(SwcRte_PowerModeType PowerModeId);
SwcRte_PowerModeType SwcRte_GetCurrentPowerMode(void);
#endif /*ENABLE_POWER_MODE*/

#ifdef ENABLE_WDG_RESET_TEST
void SwcRte_ExecuteSwReset(void);
#endif /*ENABLE_WDG_RESET_TEST*/



void SwcRte_ReadInputs(SwcRte_AppInstanceIdType AppInstance, SwcRte_AppChannelIdType SensorChannel, SwcRte_AppInputValueType * InputValue); 

void SwcRte_WriteOutputs(SwcRte_AppInstanceIdType AppInstance, SwcRte_AppChannelIdType ActuatorChannel, SwcRte_OutputValueType OutputValue);

/*================================================================================================*/
/*================================================================================================*/
#ifdef __cplusplus
}
#endif
#endif /*SWCRTE_H*/
/** @} */
