/**********************************************************************************************************************
 *  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:  Port_PBcfg.c
 *      Project:  Tms570_AutosarPortDriver
 *       Module:  PortDriver
 *    Generator:  EB Tresos
 *
 *  Description:  This module implements a driver in ANSI C programming language to centralize the
 *                configuration of ports and pins which are used by more than one driver module.
 *                With this driver you can:
 *                - Configure all port pins
 *                - Initialize the configuration
 *                - Refresh the configuration (EMC purposes)
 *                - Switch the port pin configuration during runtime[not supported at this time]
 *
 *---------------------------------------------------------------------------------------------------------------------
 * Author:  Sunil Kumar T V
 *---------------------------------------------------------------------------------------------------------------------
 * Revision History
 *---------------------------------------------------------------------------------------------------------------------
 * Version        Date         Author            Change ID        Description
 *---------------------------------------------------------------------------------------------------------------------
 * 02.10.00       11Feb2013    Sapthagiri G     0000000000000   Initial version(adapted from TMS570LS31xx v01.10.00).
 * 02.20.00       29Aug2013    Sreyas K         SDOCM00103509   Changes for Production Version Champion
 * 02.21.00       30Sep2014    Vineeth T Alex   SDOCM00113123   Changes for 2.21.00 release; Files restructured
 * 02.21.01       23Aug2016    VishwanathReddy  SDOCM00122619   Update version info.
 * 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.
 *********************************************************************************************************************/

#define PORT_CFG_SOURCE

/**********************************************************************************************************************
 *  INCLUDES
 *********************************************************************************************************************/
#include "Std_Types.h"
#include "Port.h"

/*  Cfg C Version identification  */
#define PORT_CFG_C_MAJOR_VERSION               (5U)
#define PORT_CFG_C_MINOR_VERSION               (30U)
#define PORT_CFG_C_PATCH_VERSION               (0U)


/*  Version checking  */
#if (   (PORT_SW_MAJOR_VERSION != PORT_CFG_C_MAJOR_VERSION) || \
    (PORT_SW_MINOR_VERSION != PORT_CFG_C_MINOR_VERSION))
  #error "Version numbers of Port_PBcfg.c and Port.h are inconsistent!"
#endif

#if (   (PORT_CFG_MAJOR_VERSION != PORT_CFG_C_MAJOR_VERSION) || \
    (PORT_CFG_MINOR_VERSION != PORT_CFG_C_MINOR_VERSION))
  #error "Version numbers of Port_PBcfg.c and Port_Cfg.h are inconsistent!"
#endif

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

 /*Function Macros*/
#define PORT_PIN_MODE_ADC       0x01U   
#define PORT_PIN_MODE_CAN       0x01U 
#define PORT_PIN_MODE_DIO       0x0U 
#define PORT_PIN_MODE_DIO_GPT   0x01U 
#define PORT_PIN_MODE_DIO_WDG   0x01U
#define PORT_PIN_MODE_FLEXRAY   0x01U
#define PORT_PIN_MODE_ICU       0x01U
#define PORT_PIN_MODE_LIN       0x01U 
#define PORT_PIN_MODE_MEM       0x01U
#define PORT_PIN_MODE_PWM       0x01U
#define PORT_PIN_MODE_SPI       0x01U
#define PORT_PIN_MODE_ECLK      0x01U
#define PORT_PIN_MODE_SCI       0x01U
#define PORT_PIN_MODE_IIC       0x01U

#define RESET     ((uint32)0x01U)
#define GIO_GCR   (*(volatile uint32 *)0xFFF7BC00U)
#define SCI_GCR   (*(volatile uint32 *)0xFFF7E500U)
#define LIN_GCR   (*(volatile uint32 *)0xFFF7E400U)
#define SPI1_GCR  (*(volatile uint32 *)0xFFF7F400U)
#define SPI2_GCR  (*(volatile uint32 *)0xFFF7F600U)
#define SPI3_GCR  (*(volatile uint32 *)0xFFF7F800U)
#define SPI4_GCR  (*(volatile uint32 *)0xFFF7FA00U)
#define SPI5_GCR  (*(volatile uint32 *)0xFFF7FC00U)
#define CAN1_GCR  (*(volatile uint32 *)0xFFF7DC00U)
#define CAN2_GCR  (*(volatile uint32 *)0xFFF7DE00U)
#define CAN3_GCR  (*(volatile uint32 *)0xFFF7E000U)
 
 
 
#define GIOA_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define GIOB_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define CAN1_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define CAN2_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define CAN3_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SPI1_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SPI2_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SPI3_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SPI4_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SPI5_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define LIN_USE    [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define I2C_USE    [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define N2HET1_USE [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define N2HET2_USE [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define ADC1_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define ADC2_USE   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SCI_USE    [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
#define SYS_USE    [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortUse"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]

/* definition of the alternative pin mux values */
#define PORT_PIN_MUX_DEFAULT 0x01U
#define PORT_PIN_MUX_ALT_1   0x02U
#define PORT_PIN_MUX_ALT_2   0x04U
#define PORT_PIN_MUX_ALT_3   0x08U
#define PORT_PIN_MUX_ALT_4   0x10U
#define PORT_PIN_MUX_ALT_5   0x20U

/*Push pull level definition */
#define PORT_PUSH_PULL    0x00U
#define PORT_OPEN_DRAIN   0x01U

/* Pin Levels */
#define PORT_PIN_LEVEL_LOW   0x00U
#define PORT_PIN_LEVEL_HIGH  0x01U


/*Pull disable defines */
#define PORT_PULL_DISABLED  0x00U
#define PORT_PULL_UP        0x01U
#define PORT_PULL_DOWN      0x00U

/*Port Direction */
#define PORT_PIN_IN   0x00U
#define PORT_PIN_OUT  0x01U

/*Port Initial Values */
#define GIOA_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define GIOB_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define LIN_INITIAL_VALUE   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SCI_INITIAL_VALUE   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define IIC_INITIAL_VALUE   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SPI1_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SPI2_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SPI3_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SPI4_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SPI5_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define NHET1_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define NHET2_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define SYS_INITIAL_VALUE    ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define ADC1_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define ADC2_INITIAL_VALUE  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!"PortPinDirection"!]<<[!"PortPinId"!]U)[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define CAN1_INITIAL_VALUE   ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[1]/PortPinLevelValue"!]<< 1)))
#define CAN1_INITIAL_VALUE_1  ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*[2]/PortPinLevelValue"!]<< 1)))
#define CAN2_INITIAL_VALUE   ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[1]/PortPinLevelValue"!]<< 1)))
#define CAN2_INITIAL_VALUE_1 ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*[2]/PortPinLevelValue"!]<< 1)))
#define CAN3_INITIAL_VALUE    ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[1]/PortPinLevelValue"!]<< 1)))
#define CAN3_INITIAL_VALUE_1  ((uint32)(([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinDirection"!] << 2) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinInitialMode = 'PORT_PIN_MODE_DIO' "!]0[!ELSE!]1[!ENDIF!]<<3) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinOpenDrain"!] << 16) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<< 18) | ([!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinPullSelect = 'PORT_PULL_DISABLED' "!]1[!ELSE!]0[!ENDIF!]<< 17) | ([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*[2]/PortPinLevelValue"!]<< 1)))


/*Port Refresh Mask*/
#define PORT_GIOA_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_GIOB_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_CAN1_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_CAN2_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_CAN3_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_LIN_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SCI_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_IIC_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SPI1_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SPI2_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SPI3_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SPI4_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SPI5_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_NHET1_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_NHET2_REFRESH_MASK  ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_SYS_REFRESH_MASK    ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_ADC1_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))
#define PORT_ADC2_REFRESH_MASK   ((uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!IF " PortPinDirectionChangeable = 'false'  "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]))


/**********************************************************************************************************************
 *  LOCAL CONSTANT MACROS
 **********************************************************************************************************************/

/*<PORT_MUX_BASE_ADDR>*/
#define PORT_BASE_ADDR_PINMUX_0  ((Port_RegisterPtrType)(0xFFFFEB10U))
#define PORT_BASE_ADDR_PINMUX_1  ((Port_RegisterPtrType)(0xFFFFEB14U))
#define PORT_BASE_ADDR_PINMUX_2  ((Port_RegisterPtrType)(0xFFFFEB18U))
#define PORT_BASE_ADDR_PINMUX_3  ((Port_RegisterPtrType)(0xFFFFEB1CU))
#define PORT_BASE_ADDR_PINMUX_4  ((Port_RegisterPtrType)(0xFFFFEB20U))
#define PORT_BASE_ADDR_PINMUX_5  ((Port_RegisterPtrType)(0xFFFFEB24U))
#define PORT_BASE_ADDR_PINMUX_6  ((Port_RegisterPtrType)(0xFFFFEB28U))
#define PORT_BASE_ADDR_PINMUX_7  ((Port_RegisterPtrType)(0xFFFFEB2CU))
#define PORT_BASE_ADDR_PINMUX_8  ((Port_RegisterPtrType)(0xFFFFEB30U))
#define PORT_BASE_ADDR_PINMUX_9  ((Port_RegisterPtrType)(0xFFFFEB34U))
#define PORT_BASE_ADDR_PINMUX_10  ((Port_RegisterPtrType)(0xFFFFEB38U))
#define PORT_BASE_ADDR_PINMUX_11  ((Port_RegisterPtrType)(0xFFFFEB3CU))
#define PORT_BASE_ADDR_PINMUX_12  ((Port_RegisterPtrType)(0xFFFFEB40U))
#define PORT_BASE_ADDR_PINMUX_13  ((Port_RegisterPtrType)(0xFFFFEB44U))
#define PORT_BASE_ADDR_PINMUX_14  ((Port_RegisterPtrType)(0xFFFFEB48U))
#define PORT_BASE_ADDR_PINMUX_15  ((Port_RegisterPtrType)(0xFFFFEB4CU))
#define PORT_BASE_ADDR_PINMUX_16  ((Port_RegisterPtrType)(0xFFFFEB50U))
#define PORT_BASE_ADDR_PINMUX_17  ((Port_RegisterPtrType)(0xFFFFEB54U))
#define PORT_BASE_ADDR_PINMUX_18  ((Port_RegisterPtrType)(0xFFFFEB58U))
#define PORT_BASE_ADDR_PINMUX_19  ((Port_RegisterPtrType)(0xFFFFEB5CU))
#define PORT_BASE_ADDR_PINMUX_20  ((Port_RegisterPtrType)(0xFFFFEB60U))
#define PORT_BASE_ADDR_PINMUX_21  ((Port_RegisterPtrType)(0xFFFFEB64U))
#define PORT_BASE_ADDR_PINMUX_22  ((Port_RegisterPtrType)(0xFFFFEB68U))
#define PORT_BASE_ADDR_PINMUX_23  ((Port_RegisterPtrType)(0xFFFFEB6CU))
#define PORT_BASE_ADDR_PINMUX_24  ((Port_RegisterPtrType)(0xFFFFEB70U))
#define PORT_BASE_ADDR_PINMUX_25  ((Port_RegisterPtrType)(0xFFFFEB74U))
#define PORT_BASE_ADDR_PINMUX_26  ((Port_RegisterPtrType)(0xFFFFEB78U))
#define PORT_BASE_ADDR_PINMUX_27  ((Port_RegisterPtrType)(0xFFFFEB7CU))
#define PORT_BASE_ADDR_PINMUX_28  ((Port_RegisterPtrType)(0xFFFFEB80U))
#define PORT_BASE_ADDR_PINMUX_29  ((Port_RegisterPtrType)(0xFFFFEB84U))
#define PORT_BASE_ADDR_PINMUX_30  ((Port_RegisterPtrType)(0xFFFFEB88U))
#define PORT_BASE_ADDR_PINMUX_31  ((Port_RegisterPtrType)(0xFFFFEB8CU))
#define PORT_BASE_ADDR_PINMUX_32  ((Port_RegisterPtrType)(0xFFFFEB90U))
#define PORT_BASE_ADDR_PINMUX_33  ((Port_RegisterPtrType)(0xFFFFEB94U))
#define PORT_BASE_ADDR_PINMUX_34  ((Port_RegisterPtrType)(0xFFFFEB98U))
#define PORT_BASE_ADDR_PINMUX_35  ((Port_RegisterPtrType)(0xFFFFEB9CU))
/*</PORT_MUX_BASE_ADDR>*/

/*<PORT_BCM_BASE_ADDR1>*/
#define PORT_BASE_ADDR_BCM_KICK_REG0       ((Port_RegisterPtrType)(0xFFFFEA38U))
/*</PORT_BCM_BASE_ADDR1>*/

/*<PORT_BCM_BASE_ADDR2>*/
#define PORT_BASE_ADDR_BCM_KICK_REG1       ((Port_RegisterPtrType)(0xFFFFEA3CU))
/*</PORT_BCM_BASE_ADDR2>*/

/*<PORT_BASE_ADDR>*/
#if 0
#define PORT_BASE_ADDR_GIOA      ((Port_RegisterPtrType)(0xFFF7BC30U))
#define PORT_BASE_ADDR_GIOB      ((Port_RegisterPtrType)(0xFFF7BC50U))
#define PORT_BASE_ADDR_CAN1      ((Port_RegisterPtrType)(0xFFF7DDE0U))
#define PORT_BASE_ADDR_CAN2      ((Port_RegisterPtrType)(0xFFF7DFE0U))
#define PORT_BASE_ADDR_CAN3      ((Port_RegisterPtrType)(0xFFF7E1E0U))
#define PORT_BASE_ADDR_LIN      ((Port_RegisterPtrType)(0xFFF7E43CU))
#define PORT_BASE_ADDR_SCI      ((Port_RegisterPtrType)(0xFFF7E53CU))
#define PORT_BASE_ADDR_IIC      ((Port_RegisterPtrType)(0xFFF7D448U))
#define PORT_BASE_ADDR_SPI1      ((Port_RegisterPtrType)(0xFFF7F414U))
#define PORT_BASE_ADDR_SPI2      ((Port_RegisterPtrType)(0xFFF7F614U))
#define PORT_BASE_ADDR_SPI3      ((Port_RegisterPtrType)(0xFFF7F814U))
#define PORT_BASE_ADDR_SPI4      ((Port_RegisterPtrType)(0xFFF7FA14U))
#define PORT_BASE_ADDR_SPI5      ((Port_RegisterPtrType)(0xFFF7FC14U))
#define PORT_BASE_ADDR_NHET1      ((Port_RegisterPtrType)(0xFFF7B848U))
#define PORT_BASE_ADDR_NHET2      ((Port_RegisterPtrType)(0xFFF7B948U))
#define PORT_BASE_ADDR_SYS      ((Port_RegisterPtrType)(0xFFFFFF00U))
#define PORT_BASE_ADDR_ADC1      ((Port_RegisterPtrType)(0xFFF7C0F8U))
#define PORT_BASE_ADDR_ADC2      ((Port_RegisterPtrType)(0xFFF7C2F8U))
#define PORT_BASE_ADDR_RTP      ((Port_RegisterPtrType)(0xFFFFFA34U))
#define PORT_BASE_ADDR_DMM      ((Port_RegisterPtrType)(0xFFFFF76CU))
#endif

/*<PORT_BASE_ADDR>*/
#define PORT_BASE_ADDR_GIOA  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_GIOB  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_CAN1   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN1/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_CAN2   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN2/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_CAN3  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/CAN3/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_LIN   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SCI   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_IIC   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SPI1  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SPI2  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SPI3  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SPI4  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SPI5  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_NHET1 ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_NHET2 ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_SYS   ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_ADC1  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortRegBaseAddr"!]))
#define PORT_BASE_ADDR_ADC2  ((Port_RegisterPtrType)([!"as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortRegBaseAddr"!]))



/*</PORT_BASE_ADDR>*/
 


/**********************************************************************************************************************
 *  GLOBAL DATA
 **********************************************************************************************************************/

/*<PORT_DEFAULT_SETTINGS>*/ 
#define PORT_OPEN_DRAIN_DEFAULT_0     [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultOpenDrain  = 'PORT_PUSH_PULL'"!](0x00000000U)[!ELSE!](0xFFFFFFFFU)[!ENDIF!]
#define PORT_PULL_SELECT_DEFAULT_0    [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultPullSelect = 'PORT_PULL_UP'"!](0xFFFFFFFFU)[!ELSE!](0x00000000U)[!ENDIF!]
#define PORT_PULL_DISABLE_DEFAULT_0   [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultPullSelect = 'PORT_PULL_DISABLED'"!](0xFFFFFFFFU)[!ELSE!](0x00000000U)[!ENDIF!]
#define PORT_MODE_DEFAULT_0           (0x00000000U)
#define PORT_DATA_DEFAULT_0           [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultLevelValue  = 'PORT_PIN_LEVEL_LOW'"!](0x00000000U)[!ELSE!](0xFFFFFFFFU)[!ENDIF!]
#define PORT_DIRECTION_DEFAULT_0      [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultDirection = 'PORT_PIN_OUT'"!](0xFFFFFFFFU)[!ELSE!](0x00000000U)[!ENDIF!]
#define PORT_SLEW_RATE_DEFAULT_0      [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortDefaultSettings/PortDefaultSlewRate  = 'PORT_PIN_SLEW_RATE_NORMAL'"!](0x00000000U)[!ELSE!](0xFFFFFFFFU)[!ENDIF!]

/*</PORT_DEFAULT_SETTINGS>*/


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

/*SAFETYMCUSW 580 S MR:1.1 <APPROVED> "Reason - This is the format for specifying memory sections" */
#define PORT_START_SEC_PBCODE
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Reason - This is the format for specifying memory sections" */
#include "MemMap.h"

/*<PORT_INIT_FUNC>*/
FUNC(void, PORT_PBCODE) Port_InitPortRegs0( void )
{
[!VAR "max_configs" = "0"!]
/*</PORT_PIN_CHANNEL_LIST>*/
/* Requirement from safety manual */
#if [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortMux/PortUseMux"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]  
/* ------------- Configuration of multiplexer -----------------------------------------------*/
	volatile uint32 temp;
  volatile uint32 mask;
  volatile uint32 writePattern;

	PORT_BASE_ADDR_BCM_KICK_REG0->Mux.GnrlRg_u32 = (uint32)(0x83e70b13U);    /* Unlock MMR Registers */
  PORT_BASE_ADDR_BCM_KICK_REG1->Mux.GnrlRg_u32 = (uint32)(0x95a4f1e0U);    /* Unlock MMR Registers */
		
  [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortMux/PortMuxPin/*"!]
  temp = PORT_BASE_ADDR_PINMUX_[!"PortMuxPinRegId"!]->Mux.GnrlRg_u32;
  writePattern = [!"PortMuxPinFunc"!] << [!"PortMuxPinRegPos"!]U;
  mask = (uint32)(0xFFU << [!"PortMuxPinRegPos"!]U);
  temp &= ~mask;
  temp |= writePattern;
  PORT_BASE_ADDR_PINMUX_[!"PortMuxPinRegId"!]->Mux.GnrlRg_u32 = (uint32)temp ;
  [!VAR "max_configs" = "$max_configs+1"!]
  [!ENDLOOP!]
 
  PORT_BASE_ADDR_BCM_KICK_REG0->Mux.GnrlRg_u32 = (uint32)(0xFFFFFFFFU);    /* Lock MMR Registers */
#endif
 /* SourceId : Port_SourceId_001 */
 /* DesignId : Port_DesignId_01  */
 /* Requirements : AR_PORT_SR9, AR_PORT_SR10, AR_PORT_SR11, AR_PORT_SR12, AR_PORT_SR16 */
    /* ------------- Configuration of ports used for genera IO, SPECIFIC functionality, Default settings--------------*/
 #if (STD_ON == GIOA_USE )     
    		
		/*reg manipulation*/
	GIO_GCR = RESET;
	PORT_BASE_ADDR_GIOA->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOA->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOA->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOA->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOA->Reg.Direction_u32 = GIOA_INITIAL_VALUE;


#else
    /* -- GIO A --  */
    PORT_BASE_ADDR_GIOA->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_GIOA->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_GIOA->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_GIOA->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_GIOA->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;

#endif
[!VAR "max_configs" = "$max_configs+5"!]

 #if (STD_ON == GIOB_USE ) 		
    		
/*reg manipulation*/
	PORT_BASE_ADDR_GIOB->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOB->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOB->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOB->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_GIOB->Reg.Direction_u32 = GIOB_INITIAL_VALUE;
		
#else
 /* -- GIO B --  */
    PORT_BASE_ADDR_GIOB->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_GIOB->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_GIOB->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_GIOB->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_GIOB->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+5"!]

#if (STD_ON == LIN_USE )
		
/*reg manipulation*/
    LIN_GCR = RESET;
	PORT_BASE_ADDR_LIN->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_LIN->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_LIN->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_LIN->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_LIN->Reg.Direction_u32 = LIN_INITIAL_VALUE;

	PORT_BASE_ADDR_LIN->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);

#else
/* -- LIN --  */
    PORT_BASE_ADDR_LIN->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_LIN->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_LIN->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_LIN->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of LIN Function Register */
    PORT_BASE_ADDR_LIN->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_LIN->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif
[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == SCI_USE )

/*reg manipulation*/
    SCI_GCR = RESET;
	PORT_BASE_ADDR_SCI->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SCI->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SCI->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SCI->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SCI->Reg.Direction_u32 = SCI_INITIAL_VALUE;
	PORT_BASE_ADDR_SCI->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- SCI --  */
    PORT_BASE_ADDR_SCI->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SCI->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SCI->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SCI->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of SCI Function Register */
    PORT_BASE_ADDR_SCI->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SCI->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif
[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == I2C_USE )

/*reg manipulation*/
	PORT_BASE_ADDR_IIC->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_IIC->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_IIC->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_IIC->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_IIC->Reg.Direction_u32 = IIC_INITIAL_VALUE ;
		PORT_BASE_ADDR_IIC->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
 /* -- I2C --  */
    PORT_BASE_ADDR_IIC->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_IIC->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_IIC->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_IIC->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of I2C Function Register */
    PORT_BASE_ADDR_IIC->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_IIC->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

[!VAR "max_configs" = "$max_configs+6"!]
#if (STD_ON == SPI1_USE )
   
/*reg manipulation*/
    SPI1_GCR = RESET;
	PORT_BASE_ADDR_SPI1->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI1->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI1->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI1->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI1->Reg.Direction_u32 =  SPI1_INITIAL_VALUE;
	PORT_BASE_ADDR_SPI1->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- MBSPI 1 --  */
    PORT_BASE_ADDR_SPI1->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SPI1->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SPI1->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SPI1->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of MBSPI 1 Function Register */
    PORT_BASE_ADDR_SPI1->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SPI1->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == SPI2_USE )
    
/*reg manipulation*/
    SPI2_GCR = RESET;
	PORT_BASE_ADDR_SPI2->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI2->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI2->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI2->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI2->Reg.Direction_u32 = SPI2_INITIAL_VALUE;
	PORT_BASE_ADDR_SPI2->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- SPI 2 --  */
    PORT_BASE_ADDR_SPI2->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SPI2->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SPI2->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SPI2->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of SPI 2 Function Register */
    PORT_BASE_ADDR_SPI2->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SPI2->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		

[!VAR "max_configs" = "$max_configs+6"!]
#if (STD_ON == SPI3_USE )
    		
		/*reg manipulation*/
	SPI3_GCR = RESET;
	PORT_BASE_ADDR_SPI3->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI3->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI3->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI3->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI3->Reg.Direction_u32 = SPI3_INITIAL_VALUE;
	PORT_BASE_ADDR_SPI3->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- MBSPI 3 --  */
    PORT_BASE_ADDR_SPI3->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SPI3->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SPI3->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SPI3->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of MBSPI 3 Function Register */
    PORT_BASE_ADDR_SPI3->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SPI3->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == SPI4_USE )
    
/*reg manipulation*/
    SPI4_GCR = RESET;
	PORT_BASE_ADDR_SPI4->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI4->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI4->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI4->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI4->Reg.Direction_u32 = SPI4_INITIAL_VALUE;
	PORT_BASE_ADDR_SPI4->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- SPI 4 --  */
    PORT_BASE_ADDR_SPI4->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SPI4->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SPI4->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SPI4->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of SPI 4 Function Register */
    PORT_BASE_ADDR_SPI4->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SPI4->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		

[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == SPI5_USE )

/*reg manipulation*/
    SPI5_GCR = RESET;
	PORT_BASE_ADDR_SPI5->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI5->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI5->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI5->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SPI5->Reg.Direction_u32 = SPI5_INITIAL_VALUE;
	PORT_BASE_ADDR_SPI5->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
 /* -- MBSPI 5 --  */
    PORT_BASE_ADDR_SPI5->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SPI5->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SPI5->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SPI5->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of MBSPI 5 Function Register */
    PORT_BASE_ADDR_SPI5->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SPI5->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == N2HET1_USE )
    
/*reg manipulation*/
	PORT_BASE_ADDR_NHET1->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET1->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET1->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET1->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET1->Reg.Direction_u32 = NHET1_INITIAL_VALUE;
		
#else
/* -- NHET1 --  */
    PORT_BASE_ADDR_NHET1->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_NHET1->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_NHET1->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_NHET1->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_NHET1->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		

#if (STD_ON == N2HET2_USE )

/*reg manipulation*/
	PORT_BASE_ADDR_NHET2->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET2->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET2->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET2->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_NHET2->Reg.Direction_u32 = NHET2_INITIAL_VALUE;
		
#else
/* -- NHET2 --  */
    PORT_BASE_ADDR_NHET2->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_NHET2->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_NHET2->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_NHET2->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_NHET2->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		

[!VAR "max_configs" = "$max_configs+6"!]

#if (STD_ON == SYS_USE )

/*reg manipulation*/
	PORT_BASE_ADDR_SYS->Reg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SYS->Reg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SYS->Reg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SYS->Reg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_SYS->Reg.Direction_u32 = SYS_INITIAL_VALUE;
	PORT_BASE_ADDR_SYS->Reg.Function_u32 = (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- ECLK --  */
    PORT_BASE_ADDR_SYS->Reg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_SYS->Reg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_SYS->Reg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_SYS->Reg.SlewRate1_u32  = (uint32)PORT_SLEW_RATE_DEFAULT_0;
    PORT_BASE_ADDR_SYS->Reg.Function_u32 = (uint32)0x00000000U;    /* Configuration of ECLK Function Register */
    PORT_BASE_ADDR_SYS->Reg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_SYS->Reg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+7"!]
#if (STD_ON == ADC1_USE )
   
/*reg manipulation*/
	PORT_BASE_ADDR_ADC1->AltReg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC1->AltReg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC1->AltReg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC1->AltReg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC1->AltReg.Direction_u32 = ADC1_INITIAL_VALUE;
		
#else
/* -- MibADC 1 --  */
    PORT_BASE_ADDR_ADC1->AltReg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_ADC1->AltReg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_ADC1->AltReg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_ADC1->AltReg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_ADC1->AltReg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		
[!VAR "max_configs" = "$max_configs+5"!]

#if (STD_ON == ADC2_USE )

/*reg manipulation*/
	PORT_BASE_ADDR_ADC2->AltReg.PullSelect_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC2->AltReg.PullDisable_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC2->AltReg.OpenDrain_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC2->AltReg.DataOut_u32 = (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!"PortPinLevelValue"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	PORT_BASE_ADDR_ADC2->AltReg.Direction_u32 = ADC2_INITIAL_VALUE;
		
#else
 /* -- MibADC 2 --  */
    PORT_BASE_ADDR_ADC2->AltReg.PullSelect_u32  = (uint32)PORT_PULL_SELECT_DEFAULT_0;
    PORT_BASE_ADDR_ADC2->AltReg.PullDisable_u32  = (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    PORT_BASE_ADDR_ADC2->AltReg.OpenDrain_u32  = (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    PORT_BASE_ADDR_ADC2->AltReg.DataOut_u32 = (uint32)PORT_DATA_DEFAULT_0;
    PORT_BASE_ADDR_ADC2->AltReg.Direction_u32 = (uint32)PORT_DIRECTION_DEFAULT_0;
#endif		

#if (STD_ON == CAN1_USE )
    PORT_BASE_ADDR_CAN1->Can.IoCtrl_0_u32 = CAN1_INITIAL_VALUE; 
	PORT_BASE_ADDR_CAN1->Can.IoCtrl_1_u32 = CAN1_INITIAL_VALUE_1;
#else
    PORT_BASE_ADDR_CAN1->Can.IoCtrl_0_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 1 IO Ctrl 0 */
    PORT_BASE_ADDR_CAN1->Can.IoCtrl_1_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 1 IO Ctrl 1 */
#endif		
[!VAR "max_configs" = "$max_configs+2"!]

#if (STD_ON == CAN2_USE )
    PORT_BASE_ADDR_CAN2->Can.IoCtrl_0_u32 = CAN2_INITIAL_VALUE;
    PORT_BASE_ADDR_CAN2->Can.IoCtrl_1_u32 = CAN2_INITIAL_VALUE_1;

#else
    PORT_BASE_ADDR_CAN2->Can.IoCtrl_0_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 2 IO Ctrl 0 */
    PORT_BASE_ADDR_CAN2->Can.IoCtrl_1_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 2 IO Ctrl 1 */

#endif		
[!VAR "max_configs" = "$max_configs+2"!]

#if (STD_ON == CAN3_USE )
    PORT_BASE_ADDR_CAN3->Can.IoCtrl_0_u32 = CAN3_INITIAL_VALUE;
    PORT_BASE_ADDR_CAN3->Can.IoCtrl_1_u32 = CAN3_INITIAL_VALUE_1;

#else
    PORT_BASE_ADDR_CAN3->Can.IoCtrl_0_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 3 IO Ctrl 0 */
    PORT_BASE_ADDR_CAN3->Can.IoCtrl_1_u32 = (uint32)(0x00040000U);    /* Configuration of CAN 3 IO Ctrl 1 */

#endif	
	
[!VAR "max_configs" = "$max_configs+2"!]
		
    return;
}
/*</PORT_INIT_FUNC>*/
#if (STD_ON == PORT_SAFETI_API)
/* <Port_GetConfigRegValues>*/
/* Safety manual requirement: Read back of configuration registers*/
FUNC(void, PORT_PBCODE) Port_GetConfigRegValues_Config( uint8 initial, P2VAR(_PortConfigRegsType, AUTOMATIC, PORT_PBCFG) ConfigRegPtr )
{
#if [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortMux/PortUseMux"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
/* ------------- Configuration of multiplexer -----------------------------------------------*/
	volatile uint32 temp;
	volatile uint32 mask;
	volatile uint32 writePattern;
#endif
	uint32 i = 0;
	/* Initialize everything to 0 */
	#if(PORT_CONFIG_REG_SIZE<[!"num:i($max_configs)"!]U)
		#error "Number of registers in the structure is less than the number of configurations from the GUI, Check Tresos"
	#endif
	for(i=0;i<PORT_CONFIG_REG_SIZE;i++)
	{
		ConfigRegPtr->configRegs[i]=0;
	}
	i=0;
#if [!IF "as:modconf('Port')[1]/PortConfigSet/*[1]/PortMux/PortUseMux"!] (STD_ON) [!ELSE!] (STD_OFF) [!ENDIF!]
/* ------------- Configuration of multiplexer -----------------------------------------------*/

	[!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortMux/PortMuxPin/*"!]
	temp = 0U;
	writePattern = [!"PortMuxPinFunc"!] << [!"PortMuxPinRegPos"!];
	mask = (uint32)(0xFFU << [!"PortMuxPinRegPos"!]);
	temp |= writePattern;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_PINMUX_[!"PortMuxPinRegId"!]->Mux.GnrlRg_u32 & mask) : (uint32)temp ;
	[!ENDLOOP!]
#endif
 /* SourceId : Port_SourceId_001 */
 /* DesignId : Port_DesignId_01 */
 /* Requirements : AR_PORT_SR9, AR_PORT_SR10, AR_PORT_SR11, AR_PORT_SR12, AR_PORT_SR16 */
    /* ------------- Configuration of ports used for genera IO, SPECIFIC functionality, Default settings--------------*/
#if (STD_ON == GIOA_USE )

	/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? GIO_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOA/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.Direction_u32 : (uint32)GIOA_INITIAL_VALUE;


#else
    /* -- GIO A --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOA->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;

#endif

 #if (STD_ON == GIOB_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/GIOB/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.Direction_u32 : (uint32)GIOB_INITIAL_VALUE;

#else
 /* -- GIO B --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_GIOB->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == LIN_USE )

   /*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? LIN_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.Direction_u32 : (uint32)LIN_INITIAL_VALUE;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/LIN/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);

#else
/* -- LIN --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.Function_u32 : (uint32)0x00000000U;    /* Configuration of LIN Function Register */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_LIN->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == SCI_USE )

/*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SCI_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.Direction_u32 : (uint32)SCI_INITIAL_VALUE;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SCI/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- SCI --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.Function_u32 : (uint32)0x00000000U;    /* Configuration of SCI Function Register */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SCI->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == I2C_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.Direction_u32 : (uint32)IIC_INITIAL_VALUE ;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.Function_u32 : (uint32)(([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/I2C/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]) & 0x1U);
#else
 /* -- I2C --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.Function_u32 : (uint32)0x00000000U;    /* Configuration of I2C Function Register */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_IIC->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == SPI1_USE )

 /*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SPI1_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.Direction_u32 :  (uint32)SPI1_INITIAL_VALUE));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI1/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
#else
/* -- MBSPI 1 --  */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.Function_u32 : (uint32)0x00000000U));    /* Configuration of MBSPI 1 Function Register */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0x2020F3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI1->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0));
#endif

#if (STD_ON == SPI2_USE )

/*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SPI2_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.Direction_u32 : (uint32)SPI2_INITIAL_VALUE));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI2/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
#else
/* -- SPI 2 --  */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.Function_u32 : (uint32)0x00000000U));    /* Configuration of SPI 2 Function Register */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF03) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI2->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0));
#endif

#if (STD_ON == SPI3_USE )

		/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SPI3_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.Direction_u32 : (uint32)SPI3_INITIAL_VALUE));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI3/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
#else
/* -- MBSPI 3 --  */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.Function_u32 : (uint32)0x00000000U));    /* Configuration of MBSPI 3 Function Register */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF3F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI3->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0));
#endif

#if (STD_ON == SPI4_USE )

/*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SPI4_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.Direction_u32 : SPI4_INITIAL_VALUE));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI4/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
#else
/* -- SPI 4 --  */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.Function_u32 : (uint32)0x00000000U));    /* Configuration of SPI 4 Function Register */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xF01) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI4->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0));
#endif

#if (STD_ON == SPI5_USE )

/*reg manipulation*/
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? SPI5_GCR : RESET;
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.Direction_u32 : (uint32)SPI5_INITIAL_VALUE));
	ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SPI5/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!])));
#else
 /* -- MBSPI 5 --  */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0));
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.Function_u32 : (uint32)0x00000000U));    /* Configuration of MBSPI 5 Function Register */
    ConfigRegPtr->configRegs[i++] = (uint32) ((0xE0E0F0F) & ((initial == FALSE) ? PORT_BASE_ADDR_SPI5->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0));
#endif

#if (STD_ON == N2HET1_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.Direction_u32 : (uint32)NHET1_INITIAL_VALUE;

#else
/* -- NHET1 --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET1->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == N2HET2_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/N2HET2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.Direction_u32 : (uint32)NHET2_INITIAL_VALUE;

#else
/* -- NHET2 --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_NHET2->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == SYS_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.Direction_u32 : (uint32)SYS_INITIAL_VALUE;
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.Function_u32 : (uint32)([!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/SYS/PortPin/*"!]([!IF "PortPinInitialMode  = 'PORT_PIN_MODE_DIO'"!]0[!ELSE!]1[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
#else
/* -- ECLK --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.SlewRate1_u32  : (uint32)PORT_SLEW_RATE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.Function_u32 : (uint32)0x00000000U;    /* Configuration of ECLK Function Register */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_SYS->Reg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == ADC1_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC1/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.Direction_u32 : (uint32)ADC1_INITIAL_VALUE;

#else
/* -- MibADC 1 --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC1->AltReg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif

#if (STD_ON == ADC2_USE )

/*reg manipulation*/
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.PullSelect_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!IF "PortPinPullSelect= 'PORT_PULL_UP' "!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.PullDisable_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!IF "PortPinPullSelect = 'PORT_PULL_DISABLED'"!]1[!ELSE!]0[!ENDIF!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.OpenDrain_u32 : (uint32)( [!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/ADC2/PortPin/*"!]([!"PortPinOpenDrain"!]<<[!"PortPinId"!])[!IF "not(node:islast())"!]|[!ENDIF!][!ENDLOOP!]);
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.Direction_u32 : (uint32)ADC2_INITIAL_VALUE;

#else
 /* -- MibADC 2 --  */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.PullSelect_u32  : (uint32)PORT_PULL_SELECT_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.PullDisable_u32  : (uint32)PORT_PULL_DISABLE_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.OpenDrain_u32  : (uint32)PORT_OPEN_DRAIN_DEFAULT_0;
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? PORT_BASE_ADDR_ADC2->AltReg.Direction_u32 : (uint32)PORT_DIRECTION_DEFAULT_0;
#endif


#if (STD_ON == CAN1_USE )
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN1->Can.IoCtrl_0_u32 & (~0x3U)) : ((uint32)CAN1_INITIAL_VALUE & (~0x3U));
	ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN1->Can.IoCtrl_1_u32 & (~0x3U)) : ((uint32)CAN1_INITIAL_VALUE_1 & (~0x3U));
#else
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN1->Can.IoCtrl_0_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 1 IO Ctrl 0 */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN1->Can.IoCtrl_1_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 1 IO Ctrl 1 */
#endif

#if (STD_ON == CAN2_USE )
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN2->Can.IoCtrl_0_u32 & (~0x3U)) : ((uint32)CAN2_INITIAL_VALUE & (~0x3U));
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN2->Can.IoCtrl_1_u32 & (~0x3U)) : ((uint32)CAN2_INITIAL_VALUE_1 & (~0x3U));

#else
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN2->Can.IoCtrl_0_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 2 IO Ctrl 0 */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN2->Can.IoCtrl_1_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 2 IO Ctrl 1 */

#endif

#if (STD_ON == CAN3_USE )
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN3->Can.IoCtrl_0_u32 & (~0x3U)) : ((uint32)CAN3_INITIAL_VALUE & (~0x3U));
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN3->Can.IoCtrl_1_u32 & (~0x3U)) : ((uint32)CAN3_INITIAL_VALUE_1 & (~0x3U));

#else
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN3->Can.IoCtrl_0_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 3 IO Ctrl 0 */
    ConfigRegPtr->configRegs[i++] = (initial == FALSE) ? (PORT_BASE_ADDR_CAN3->Can.IoCtrl_1_u32 & (~0x3U)) : (uint32)(0x00040000U);    /* Configuration of CAN 3 IO Ctrl 1 */
#endif

    return;
}
#endif
/* </Port_GetConfigRegValues>*/
#define PORT_STOP_SEC_PBCODE
#include "MemMap.h"


#define PORT_START_SEC_PBCFG
#include "MemMap.h"
#if ( STD_ON == PORT_REFRESH_PORT_DIRECTION_API )
/*<PORT_REFRESHFUNC>*/
static CONST( Port_RefreshConfigType, PORT_PBCFG) Port_RefreshConfig0_at[] =
{ 
    /* ------- Configuration of refreshable direction registers -------
     *  1. Register address
     *  2. Value which has to be written to this register
     *  3. Information which bits can be refreshed (refresh-mask):
     *     ( 1 = refreshable,  0  not refreshable)
     *    Note: All pins which are set as pin-channels have to be set
     *          in the appropriate pin mask to 0
     * ----------------------------------------------------------------  */
     { (Port_RegisterPtrType)(PORT_BASE_ADDR_GIOA  ), (uint32)(GIOA_INITIAL_VALUE ), (uint32)(PORT_GIOA_REFRESH_MASK) }
    ,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_GIOB  ), (uint32)(GIOB_INITIAL_VALUE ), (uint32)(PORT_GIOB_REFRESH_MASK ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_LIN   ), (uint32)(LIN_INITIAL_VALUE ), (uint32)(PORT_LIN_REFRESH_MASK  ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SCI   ), (uint32)(SCI_INITIAL_VALUE ), (uint32)(PORT_SCI_REFRESH_MASK  ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_IIC   ), (uint32)(IIC_INITIAL_VALUE ), (uint32)(PORT_IIC_REFRESH_MASK  ) }
    ,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SPI1  ), (uint32)(SPI1_INITIAL_VALUE ), (uint32)(PORT_SPI1_REFRESH_MASK ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SPI2  ), (uint32)(SPI2_INITIAL_VALUE ), (uint32)(PORT_SPI2_REFRESH_MASK ) }
    ,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SPI3  ), (uint32)(SPI3_INITIAL_VALUE), (uint32)(PORT_SPI3_REFRESH_MASK ) }
    ,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SPI4  ), (uint32)(SPI4_INITIAL_VALUE), (uint32)(PORT_SPI4_REFRESH_MASK ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SPI5  ), (uint32)(SPI5_INITIAL_VALUE  ), (uint32)(PORT_SPI5_REFRESH_MASK ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_NHET1 ), (uint32)(NHET1_INITIAL_VALUE ), (uint32)(PORT_NHET1_REFRESH_MASK) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_NHET2 ), (uint32)(NHET2_INITIAL_VALUE ), (uint32)(PORT_NHET2_REFRESH_MASK) }
    ,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_SYS   ), (uint32)(SYS_INITIAL_VALUE  ), (uint32)(PORT_SYS_REFRESH_MASK  ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_ADC1  ), (uint32)(ADC1_INITIAL_VALUE ), (uint32)(PORT_ADC1_REFRESH_MASK ) }
	,{ (Port_RegisterPtrType)(PORT_BASE_ADDR_ADC2  ), (uint32)(ADC2_INITIAL_VALUE), (uint32)(PORT_ADC2_REFRESH_MASK ) }
	};
/*</PORT_REFRESHFUNC>*/
#endif

/**********************************************************************************************************************
 *  GLOBAL DATA
 **********************************************************************************************************************/
#if ( STD_ON == PORT_SET_PIN_DIRECTION_API )
/*<PORT_PINCHANNELCONFIG>*/
static CONST( uint32, PORT_PBCFG ) Port_PinChannelConfig0_at[] =
{

    /* ----------------- Configuration of pin channels ----------------
    *
    *          | Lower 24-Bits of Base Addr | Pin Number |
    *          31                           8            0 
    *
    *  Note: The following channels can be accessed by a symbolic name.
    *        This channel-names have to be created and its values
    *        represent the index of the following table.
    * ----------------------------------------------------------------  */
[!VAR "var1" = "0"!]    
[!LOOP "as:modconf('Port')[1]/PortConfigSet/*[1]/PortContainer/*"!][!LOOP "PortPin/*"!][!IF "PortPinDirectionChangeable"!][!IF "PortPinChannelName = ''"!][!ELSE!]    ([!"num:inttohex(bit:or(bit:shl(../../PortRegBaseAddr,8),PortPinId),8)"!]),[!VAR "var1" = "$var1+1"!][!CR!][!ENDIF!][!ENDIF!][!ENDLOOP!][!ENDLOOP!]};
/*</PORT_PINCHANNELCONFIG>*/
#endif

#define PORT_STOP_SEC_PBCFG
#include "MemMap.h"

#define PORT_START_SEC_PBCFG_ROOT
#include "MemMap.h"

/*<PORT_CONFIGURATION>*/
CONST( Port_ConfigType, PORT_PBCFG) Port_Runtime =
{
     Port_InitPortRegs0
	 #if ( STD_ON == PORT_REFRESH_PORT_DIRECTION_API )
    ,Port_RefreshConfig0_at
	#endif
	#if ( STD_ON == PORT_SET_PIN_DIRECTION_API )
    ,Port_PinChannelConfig0_at
	#endif
    #if ( STD_ON == PORT_REFRESH_PORT_DIRECTION_API )
    ,(uint8)15U
    #endif
	#if ( STD_ON == PORT_SET_PIN_DIRECTION_API )
    ,(uint8)[!"num:i($var1)"!]U
	#endif
};
/*</PORT_CONFIGURATION>*/

/*SAFETYMCUSW 580 S MR:1.1 <APPROVED> "Reason - Start Section Code is also defined Port.h" */
#define PORT_STOP_SEC_PBCFG_ROOT
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Reason - This is the format for specifying memory sections" */
#include "MemMap.h"

/**********************************************************************************************************************
 *  END OF FILE: Port_PBcfg.c                                                                                         *
 **********************************************************************************************************************/


