/**********************************************************************************************************************
 *  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.  All rights reserved.
 *
 *  \endverbatim
 *  -------------------------------------------------------------------------------------------------------------------
 *  FILE DESCRIPTION
 *  -------------------------------------------------------------------------------------------------------------------
 *         File:  Gpt_PBCfg.c
 *      Project:  Tms570_AutosarGptDriver
 *       Module:  GptDriver
 *    Generator:  EB Tresos
 *
 *  Description:  This component provides services for initialization and control of the microcontroller internal
 *                GPT unit (General Purpose Timer).
 *  
 *********************************************************************************************************************/

/*********************************************************************************************************************
/ *---------------------------------------------------------------------------------------------------------------------
 * Author:  Vishwanath Reddy
 *---------------------------------------------------------------------------------------------------------------------
 * Revision History
 *---------------------------------------------------------------------------------------------------------------------
 * Version        Date         Author               Change ID        Description
 *---------------------------------------------------------------------------------------------------------------------
 * 02.21.00       30Sep14      Vishwanath Reddy     SDOCM00113130    Initial Version
 * 02.21.01       11Mar16      Enrique Lizarraga    SDOCM00121245    Correct GptChannelId type from Enum to Int
 * 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.
    
**********************************************************************************************************************/
#include "Std_Types.h"
#include "Gpt.h"
#include "Gpt_Cfg.h"

#define GPT_CFG_C_MAJOR_VERSION               (5U)
#define GPT_CFG_C_MINOR_VERSION               (30U)
#define GPT_CFG_C_PATCH_VERSION               (0U)

/* ---- Perform version checking  ----------------------------------------- */
#if (   (GPT_SW_MAJOR_VERSION != GPT_CFG_C_MAJOR_VERSION) \
     || (GPT_SW_MINOR_VERSION != GPT_CFG_C_MINOR_VERSION))
  #error "Version numbers of Gpt_PBcfg.c and Gpt.h are inconsistent!"
#endif

#if (   (GPT_CFG_MAJOR_VERSION != GPT_CFG_C_MAJOR_VERSION) \
     || (GPT_CFG_MINOR_VERSION != GPT_CFG_C_MINOR_VERSION))
  #error "Version numbers of Gpt_PBcfg.c and Gpt_Cfg.h are inconsistent!"
#endif

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

[!VAR "Index" = "0"!][!VAR "Index1" = "0"!]
[!LOOP "as:modconf('Gpt')[1]/GptChannelConfigSet/*[1]/GptChannelConfiguration/*"!][!VAR "Index" = "$Index+1"!][!ENDLOOP!]
/* Gpt Channel Configuration parameters */
[!LOOP "as:modconf('Gpt')[1]/GptChannelConfigSet/*"!]
static CONST(Gpt_ChannelConfigType, GPT_PBCFG) Gpt_ChannelConfig[!"num:i($Index1)"!][[!"num:i($Index)"!]] = 
{
  [!LOOP "GptChannelConfiguration/*"!]
  {
    [!"GptChannelId"!],
    [!"GptChannelMode"!],/* Gpt Channel Mode */
    [!"num:i(GptChannelTickFrequency)"!]U,/* Channel Frequency in MHz*/ 
    [!"num:inttohex(GptChannelTickValueMax)"!]U,/*Max Channel Tick Value*/
    [!"text:toupper(GptEnableWakeup)"!],/*Wakeup Enable Flag*/
    [!IF "node:exists(GptNotification)"!][!"GptNotification"!][!ELSE!]NULL_PTR[!ENDIF!],/*Notification Call Back function*/
    [!"num:i(80.0)"!]U,    /* Gpt Clock derived from Mcu in MHz*/ 
    [!IF "node:refexists(GptWakeupConfiguration/GptWakeupSourceRef)"!][!"num:i(node:ref(GptWakeupConfiguration/GptWakeupSourceRef)/EcuMWakeupSourceId)"!]U[!ELSE!]0U[!ENDIF!]
  }[!IF "not(node:islast())"!],[!ENDIF!][!ENDLOOP!]
};[!VAR "Index1" = "$Index1+1"!]
[!ENDLOOP!]

/*<GPT_CONFIGURATION>*/
[!VAR "Index" = "0"!]
[!LOOP "as:modconf('Gpt')[1]/GptChannelConfigSet/*"!]
[!VAR "Count" = "0"!]
[!LOOP "GptChannelConfiguration/*"!][!VAR "Count"="$Count+1"!][!ENDLOOP!]
CONST(Gpt_ConfigType, GPT_PBCFG) [!"@name"!] =
{
  Gpt_ChannelConfig[!"num:i($Index)"!],/*Pointer to Channel Configuration*/
  [!"num:i($Count)"!]/*Number of Channels*/
};[!VAR "Index" = "$Index+1"!]
[!ENDLOOP!]
/*</GPT_CONFIGURATION>*/

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

/*----- End of File --------------------------------------------------------*/
