/*====================================================================================================
*   @file    Spi_PBcfg.c
*   @implements Spi_PBcfg.c_Artifact
*   @version 1.0.0
*
*   @brief   AUTOSAR Spi - Post-Build(PB) configuration file code template.
*   @details Code template for Post-Build(PB) configuration file generation.
*
*   @addtogroup [SPI_MODULE]
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : DSPI
*   Dependencies         : 
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

[!CODE!][!//

#ifdef __cplusplus
extern "C"
{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct. 
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space shall be distinct. 
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct. 
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* The used compilers use more than 31 chars for identifiers.
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1
* Violates MISRA 2012 Advisory Rule 20.1,
* #include directives should only be preceded by preprocessor directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2
* Violates MISRA 2012 Required Directive 4.10,
* Precautions shall be taken in order to prevent the contents of a header file being
* included more than once
* This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_3
* Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
* Macros that are used in the code only in some configuration.
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_4
* Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with external linkage 
* if they are referenced in only one translation unit.
* These functions represent the API of the driver. External linkage is needed to "export" the API.
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_5
* Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block scope if its identifier only appears in a single function.
* For generated configuration structures: This violation is due to exporting the externally configured initialization structure used by the "<MA>_Init" function.
*
* @section Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_6
* Violates MISRA 2012 Required Rule 8.5,
* An external object or function shall be declared in one and only one file.
*
*/

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/

[!NOCODE!][!//
[!INCLUDE "Spi_VersionCheck_Src_PB.m"!][!//
[!INCLUDE "Spi_RegOperations.m"!]
[!ENDNOCODE!][!//

#include "Spi.h"
#include "Reg_eSys_DSPI.h"

#if (SPI_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
#include "Dem.h"
#endif /* SPI_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF */

/*==================================================================================================
*                                    SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_3 A project should not contain unused macro declarations.
* Macros that are used in the code only in some configuration. 
*/
#define SPI_MODULE_ID_PBCFG_C                        83
#define SPI_VENDOR_ID_PBCFG_C                        43
#define SPI_AR_RELEASE_MAJOR_VERSION_PBCFG_C         4
#define SPI_AR_RELEASE_MINOR_VERSION_PBCFG_C         3

#define SPI_AR_RELEASE_REVISION_VERSION_PBCFG_C      1
#define SPI_SW_MAJOR_VERSION_PBCFG_C                 1
#define SPI_SW_MINOR_VERSION_PBCFG_C                 0
#define SPI_SW_PATCH_VERSION_PBCFG_C                 0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
[!//*File Version Checks*/
[!CALL "Spi_FileVersionCheck"!]

[!NOCODE!][!//
[!//*Check Dual Clock Support*/
[!CALL "Spi_CheckDualClockSupport"!]
[!//*Check configuration of sequences for Slave*/
[!CALL "Spi_CheckSequenceConfigForSlave"!]
[!//*Check configuration of External Devices*/
[!CALL "Spi_CheckExternalDeviceConfig"!]
[!//*Check repeat of Job, Seq, External device */
[!CALL "Spi_CheckRepeatOfJobSeqExternalDevice"!]
[!ENDNOCODE!][!//
/*==================================================================================================
*                         LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


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


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


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

/*==================================================================================================
*                                      GLOBAL FUNCTIONS
==================================================================================================*/
#define SPI_START_SEC_CODE
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"

[!//List Of Notification Functions*/
[!CALL "Spi_ListOfNotificationFunctions"!]


#define SPI_STOP_SEC_CODE
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"

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

/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/
#if ((SPI_DMA_USED == STD_ON) && \
    ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2)))  
    #define SPI_START_SEC_VAR_NO_INIT_UNSPECIFIED_NO_CACHEABLE
#else
    #define SPI_START_SEC_VAR_NO_INIT_UNSPECIFIED
#endif /* ((SPI_DMA_USED == STD_ON) && ((SPI_LEVEL_DELIVERED == LEVEL1) ||
        (SPI_LEVEL_DELIVERED == LEVEL2))) */

/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"
[!// Buffers Descriptors for EB Channels and Allocate Buffers for IB Channels */
[!CALL "Spi_BuffersDescriptorForEBchannel"!]

#if ((SPI_DMA_USED == STD_ON) && \
    ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2)))     
    #define SPI_STOP_SEC_VAR_NO_INIT_UNSPECIFIED_NO_CACHEABLE
#else
    #define SPI_STOP_SEC_VAR_NO_INIT_UNSPECIFIED
#endif /* ((SPI_DMA_USED == STD_ON) && ((SPI_LEVEL_DELIVERED == LEVEL1) ||
        (SPI_LEVEL_DELIVERED == LEVEL2))) */
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"

#define SPI_START_SEC_VAR_INIT_UNSPECIFIED
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"

[!// Buffers Descriptors for IB Channels */
[!CALL "Spi_BuffersDescriptorForIBchannel"!]

#define SPI_STOP_SEC_VAR_INIT_UNSPECIFIED
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"
/*==================================================================================================
*                                      LOCAL CONSTANTS
==================================================================================================*/
#define SPI_START_SEC_CONFIG_DATA_UNSPECIFIED
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"

[!// POSTBUILD FLASH from here onward! */
[!// Channel Configuration */
[!CALL "Spi_ChannelConfiguration"!]
[!// Channel Assignment of Jobs */
[!CALL "Spi_ChannelAssignmentOfJobs"!]
[!// Attribute Configuration of External Devices */
[!CALL "Spi_AttributeConfigurationOfExternalDevices"!]
[!// Attribute Configuration of External Devices */
[!CALL "Spi_AttributeConfigurationOfExternalDevices_ALL_IPV"!]
[!// Attribute Configuration of External Devices fo job */
[!CALL "Spi_AttributeConfigurationOfExternalDevicesForJobconfig"!]
[!// Configuration of Jobs */
[!CALL "Spi_JobConfiguration"!]
[!// Job Assignment of Sequences  */
[!CALL "Spi_JobAssignmentOfSequences"!]
[!// Configuration of Sequences */
[!CALL "Spi_SequenceConfiguration"!]
[!// Attribute Configuration of Channels  */
[!CALL "Spi_AttributeConfigurationOfChannels"!]
[!// Link to Attribute Configuration of Channels and Devices */
[!CALL "Spi_LinkToAttributeConfiguration"!]
[!// Array of DSPI Unit configurations */
[!CALL "Spi_HWUnitConfiguration"!]

/*==================================================================================================
*                                      GLOBAL CONSTANTS
==================================================================================================*/
[!// Spi Configuration */
[!CALL "Spi_ConfigurationInfo"!]

#define SPI_STOP_SEC_CONFIG_DATA_UNSPECIFIED
/*
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_1 #include directives should only be preceded by other preprocessor
*        directives or comments
* @violates @ref Spi[!IF "var:defined('postBuildVariant')"!]_[!"$postBuildVariant"!][!ENDIF!]_PBcfg_c_REF_2 Precautions shall be taken in order to prevent
*        the contents of a header file being included more than once.
*/
#include "Spi_MemMap.h"
#ifdef __cplusplus
}
#endif

/** @} */
[!ENDCODE!]
