/**********************************************************************************************************************
 *  COPYRIGHT
 *  -------------------------------------------------------------------------------------------------------------------
 *  \verbatim
 *                 TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION
 *
 *                 Property of Texas Instruments, Unauthorized reproduction and/or distribution
 *                 is strictly prohibited.  This product  is  protected  under  copyright  law
 *                 and  trade  secret law as an  unpublished work.
 *                 (C) Copyright Texas Instruments - 2014.  All rights reserved.
 *
 *  \endverbatim
 *  -------------------------------------------------------------------------------------------------------------------
 *  FILE DESCRIPTION
 *  -------------------------------------------------------------------------------------------------------------------
 *         File:  Lin_Cfg.h
 *      Project:  Tms570_AutosarLinDriver
 *       Module:  LinDriver Configuration Header File Lin_Cfg.h
 *    Generator:  EB Tresos
 *
 *  Description:  This file is generated by EB Tresos.Do not modify this file, otherwise the software may 
 *                behave in unexpected way.
 *---------------------------------------------------------------------------------------------------------------------
 * Author:  Prathap Srinivasan
 *---------------------------------------------------------------------------------------------------------------------
 * Template Revision History
 *---------------------------------------------------------------------------------------------------------------------
 * Version        Date         Author               Change ID        Description
 *---------------------------------------------------------------------------------------------------------------------
 * 02.10.00       24Jan2013   Prathap Srinivasan  0000000000000   - Initial Version adapted from TMS570LS1227
 * 02.10.01		  14Mar2013   Vishwanath Reddy	  SDOCM00099800   - Moved structure Lin_ChannelData to Lin.c
 * 02.20.00		  23Aug2013   Vishwanath Reddy	  SDOCM00103357   - Version info updated.
 *                                                                  Added requirement tags for traceability.
 *                                                                  Safety requirements implementation. 
 * 02.20.02		  14Jul2014   Vishwanath Reddy	  SDOCM00112032   - Version info updated.
 * 02.20.03		  08Aug2014   Vishwanath Reddy	  SDOCM00112419   - Enum added for LIN Errors.
 *                                                                  LIN_CALL_USERCALLOUT macro added.
 *                                                                  Extern declaration for user callout API added. 
 * 02.21.00		  30Sep2014   Vishwanath Reddy	  SDOCM00113130   - Version info updated. Additional DEM Errors are now
 *                                                                  referenced from Tresos.
 * 02.21.01		  05Nov2014   Vishwanath Reddy	  SDOCM00113739   - Version info updated.
 * 02.21.02		  29Apr2016   Vishwanath Reddy	  SDOCM00122618   - Version info updated.
 * 02.30.00       01Dec2016   Sudhakar Singh         None         - Update version info
 * 05.30.00       15Mar2017   Sudhakar Singh      SDOCM00122834    Version supports TMS570LSxx Family of Devices.
 *********************************************************************************************************************/

 /*********************************************************************************************************************
    Project: [!"$project"!]
	Date   : [!"$datetime"!] 
	
    This file is generated by EB Tresos 
    Do not modify this file, otherwise the software may behave in unexpected way.
    
 *********************************************************************************************************************/
  
#ifndef LIN_CFG_H
#define LIN_CFG_H

/**********************************************************************************************************************
 *  INCLUDES 
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  VERSION DEFINES 
 *********************************************************************************************************************/

#define LIN_CFG_MAJOR_VERSION               (5U)
#define LIN_CFG_MINOR_VERSION               (30U)
#define LIN_CFG_PATCH_VERSION               (0U)

/**********************************************************************************************************************
 *  DEFINES 
 *********************************************************************************************************************/

/* SourceId : LIN_SourceId_018 */
/* DesignId : LIN_DesignId_005 */
/* Requirements : AR_LIN_SR58, AR_LIN_SR151 */
#define LIN_DEV_ERROR_DETECT                 [!IF "as:modconf('Lin')[1]/LinGeneral/LinDevErrorDetect = 'true'"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]
/* SourceId : LIN_SourceId_019 */
/* DesignId : LIN_DesignId_001 */
/* Requirements : AR_LIN_SR60 */
#define LIN_PROD_ERROR_DETECT                (STD_ON)
/* SourceId : LIN_SourceId_020 */
/* DesignId : LIN_DesignId_001 */
/* Requirements : AR_LIN_SR152 */
#define LIN_INDEX                            ([!"num:i(as:modconf('Lin')[1]/LinGeneral/LinIndex)"!]U)
/* SourceId : LIN_SourceId_021 */
/* DesignId : LIN_DesignId_001 */
/* Requirements : AR_LIN_SR153 */
#define LIN_TIMEOUT_DURATION                 ([!"num:i(as:modconf('Lin')[1]/LinGeneral/LinTimeoutDuration)"!]U)
/* SourceId : LIN_SourceId_022 */
/* DesignId : LIN_DesignId_001 */
/* Requirements : AR_LIN_SR154 */
#define LIN_VERSION_INFO_API                 [!IF "as:modconf('Lin')[1]/LinGeneral/LinVersionInfoApi = 'true'"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]
#define LIN_SAFETI_API                 		 [!IF "as:modconf('Lin')[1]/LinGeneral/LinSafeTIApi = 'true'"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]
#define LIN_LOOPBACKTEST_ENABLE              [!IF "as:modconf('Lin')[1]/LinGeneral/LinLoopBackTestEnable = 'true'"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]
/*SAFETYMCUSW 79 S MR:19.4 <REVIEWED> "Reason - ISR categories will be defined in other layer and needs to be referred
                                               here."*/
#define LIN_CFG_ISR_TYPE                     [!"as:modconf('Lin')[1]/LinGeneral/LinTypeofInterruptFunction"!]
/* Macro to select between DEM reporting or user callout API. */
#define LIN_CALL_USERCALLOUT                 [!IF "as:modconf('Lin')[1]/LinGeneral/LinCallUserCallout = 'true'"!](STD_ON)[!ELSE!](STD_OFF)[!ENDIF!]


/* Production error codes from AUTOSAR specification extensions */
#define LIN_DEM_NO_EVENT (0xFFFFFFFFU) 


#ifndef LIN_E_NORESPONSE
#define LIN_E_NORESPONSE     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_NORESPONSE)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_NORESPONSE,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif


#ifndef LIN_E_CHKSUM
#define LIN_E_CHKSUM     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_CHKSUM)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_CHKSUM,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_OVRRUN
#define LIN_E_OVRRUN     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_OVRRUN)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_OVRRUN,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_PHYBUS
#define LIN_E_PHYBUS     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_PHYBUS)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_PHYBUS,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_BIT
#define LIN_E_BIT     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_BIT)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_BIT,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_FRM
#define LIN_E_FRM     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_FRM)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_FRM,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_SYNCFIELD
#define LIN_E_SYNCFIELD     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_SYNCFIELD)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_SYNCFIELD,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

#ifndef LIN_E_PARITY
#define LIN_E_PARITY     [!IF "node:refexists(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_PARITY)"!]DemConf_DemEventParameter_[!"substring-after(substring-after(substring-after(substring-after(as:modconf('Lin')[1]/LinGlobalConfig/ *[1]/LinDemEventParameterRefs/ LIN_E_PARITY,'/'),'/'),'/'),'/')"!][!ELSE!]LIN_DEM_NO_EVENT[!ENDIF!]
#endif

/* Enum containing LIN error's */
typedef enum
{
  LIN_ERROR_PARITY = 0U,
  LIN_ERROR_SYNCFIELD,
  LIN_ERROR_FRM,
  LIN_ERROR_BIT,
  LIN_ERROR_PHYBUS,
  LIN_ERROR_OVRRUN,
  LIN_ERROR_CHKSUM,
  LIN_ERROR_NORESPONSE
}Lin_ErrorType;

/* Extern declaration for user callout API */
extern FUNC(void, LIN_CODE)[!" as:modconf('Lin')[1]/LinGeneral/LinCallOutAPIDeclaration"!](Lin_ErrorType Error);
/* Macro used in Lin_Interrupt */
#define USERCALLOUT [!" as:modconf('Lin')[1]/LinGeneral/LinCallOutAPIDeclaration"!]

#define LIN_START_SEC_CONST_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Reason - This is the format to use for specifying memorysections."*/
#include "MemMap.h"

[!LOOP "as:modconf('Lin')[1]/LinGlobalConfig/*"!][!LOOP "LinChannel/*"!]#define  [!"../../@name"!]_[!"@name"!]       ([!"@index"!]U)
[!ENDLOOP!][!ENDLOOP!]
[!VAR "maxModules" = "0"!][!LOOP "as:modconf('Lin')[1]/LinGlobalConfig/*"!][!VAR "maxModules" = "$maxModules+1"!][!ENDLOOP!]#define Lin_NumberOfModules                  ([!"num:i($maxModules)"!]U)
[!VAR "maxModules" = "0"!][!LOOP "as:modconf('Lin')[1]/LinGlobalConfig/*[1]/LinChannel/*"!][!VAR "maxModules" = "$maxModules+1"!][!ENDLOOP!]#define Lin_NumberOfChannelsPerModule        ([!"num:i($maxModules)"!]U)
[!VAR "maxModules" = "0"!][!LOOP "as:modconf('Lin')[1]/LinGlobalConfig/*[1]/LinChannel/*"!][!VAR "maxModules" = "$maxModules+1"!][!ENDLOOP!]#define Lin_TotalNumberOfChannels            ([!"num:i($maxModules)"!]U)

#define LIN_STOP_SEC_CONST_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Reason - This is the format to use for specifying memorysections."*/
#include "MemMap.h"

#endif /* LIN_CFG_H */

/**********************************************************************************************************************
 *  END OF FILE : Lin_Cfg.h 
 *********************************************************************************************************************/

