/**********************************************************************************************************************
 *  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 - 2011.  All rights reserved.
 *
 *  \endverbatim
 *  -------------------------------------------------------------------------------------------------------------------
 *  FILE DESCRIPTION
 *  -------------------------------------------------------------------------------------------------------------------
 *         File:  Spi_PBCfg.c
 *      Project:  --
 *       Module:  SpiDriver PostBuild Configuration Source File Spi_PBCfg.c
 *    Generator:  Elektrobit Tresos
 *
 *  Description:  This file is generated by EB Tresos.Do not modify this file, otherwise the software may 
 *                behave in unexpected way.
 *---------------------------------------------------------------------------------------------------------------------
 * Author:  Prathap Srinivasan
 *---------------------------------------------------------------------------------------------------------------------
 * Template Revision History
 *---------------------------------------------------------------------------------------------------------------------
 * Version        Date         Author               Change ID        Description
 *---------------------------------------------------------------------------------------------------------------------
 * 02.10.00       24Jan2013    Prathap Srinivasan  0000000000000    Initial Version adapted for TMS570LS1227
 * 02.20.00       08Aug2013    Enrique Lizarraga   SDOCM00103201    -SpiCsPolarity and SpiShiftClockIdleLevel were 
 *                                                                   inverted.
 *                                                                  -Use SpiDefaultData configuration parameter instead
 *                                                                   of hard coded value.
 *                                                                  -Corrected line indentation.
 *                                                                  -Corrected error if SpiCsIdleTime is set to 0.
 *                                                                  -SpiShiftClockIdleLevel was used incorrectly to
 *                                                                   select SPI Mode.
 *                                                                  -Update version info
 *                                                                  -Added traceability tags
 *                                                                  -Added protection to avoid selecting invalid CS
 *                                                                   pins in SPI2 and SPI4 HW Units
 * 02.21.00       30Sep2014    Enrique Lizarraga   SDOCM00112317    -Update version info
 *                                                                  -Traceability tags
 * 02.21.01       29Feb2016    Enrique Lizarraga   SDOCM00121246    -Update version info
 *                                                                  -Change SpiDataWidth type from enum to int
 *                                                                  -Change SpiCsIdentifier type from enum to string
 * 02.22.00       18Jul2016    Prathap Srinivasan  SDOCM00122408    -Update version info
 * 02.22.01       10Aug2016    Prathap Srinivasan  SDOCM00122593    -Bug Fix: Spi_IrqTxRxERR function checks for
 *                                                                   wrong error status bit
 * 02.22.02       23Aug2016    Vishwanath Reddy    SDOCM00121246    -Update version info
 * 02.22.03       26Sep2016    Prathap Srinivasan  SDOCM00122695    -Update version info
 *                                                                   Add code to get EXTERNAL NOTIFICATION PROTOTYPES.
 * 02.30.00       01Dec2016    Sudhakar Singh         None          -Update version info
 * 05.30.00       15Mar2017    Sudhakar Singh      SDOCM00122834    Version supports TMS570LSxx Family of Devices.
 *
 *********************************************************************************************************************/

 /**********************************************************************************************************************
    Project: TMS570LS07_Sample_Config
	Date   : 2018-03-14 10:10:01 
	
    This file is generated by EB Tresos 
    Do not modify this file, otherwise the software may behave in unexpected way.
    
 *********************************************************************************************************************/


#define SPI_PBCFG_SOURCE 1

/**********************************************************************************************************************
 *  INCLUDES
 *********************************************************************************************************************/
/* SourceId : SPI_SourceId_038 */
/* DesignId : SPI_DesignId_019 */
/* Requirements : AR_SPI_SR13 */
#include "Spi.h"
#include "Spi_Hw.h"

/**********************************************************************************************************************
 *  VERSION CHECK
 *********************************************************************************************************************/
#define SPI_CFG_C_MAJOR_VERSION               (5U)
#define SPI_CFG_C_MINOR_VERSION               (30U)
#define SPI_CFG_C_PATCH_VERSION               (0U)

#if (  (SPI_CFG_MAJOR_VERSION != SPI_CFG_C_MAJOR_VERSION) \
    || (SPI_CFG_MINOR_VERSION != SPI_CFG_C_MINOR_VERSION) \
	|| (SPI_CFG_PATCH_VERSION != SPI_CFG_C_PATCH_VERSION))
#error "Version numbers of Spi_PbCfg.c and Spi_Cfg.h are inconsistent!"
#endif

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

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

/**********************************************************************************************************************
 *  LOCAL DATA TYPES AND STRUCTURES
 **********************************************************************************************************************/

/**********************************************************************************************************************
 *  LOCAL DATA PROTOTYPES
 **********************************************************************************************************************/

 /**********************************************************************************************************************
 *  EXTERNAL NOTIFICATION PROTOTYPES
 **********************************************************************************************************************/

	

/**********************************************************************************************************************
 *  GLOBAL DATA
 **********************************************************************************************************************/
/* SourceId : SPI_SourceId_039 */
/* DesignId : SPI_DesignId_019 */
/* Requirements : AR_SPI_SR14 */
#define SPI_START_SEC_VAR_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

/* internal buffer descriptor */
/*<T_SPI_BUFFER_DEF/>*/ 
static VAR(Spi_BufferDescriptorType, SPI_VAR_INIT) Spi_Buffer[] =
{
    {
        NULL_PTR,
        NULL_PTR,
        0U
    }
};


#define SPI_STOP_SEC_VAR_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

#define SPI_START_SEC_VAR_ZERO_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"
/* job priority conversion table */
/*<T_SPI_JOB_PRIO_TBL_OPEN/>*/ 
VAR(uint8, SPI_VAR_ZERO_INIT) Spi_JobPrioConvTbl_at[] = 
{
/*<T_SPI_JOB_PRIO_TBL_DEF>*/
    0U
/*</T_SPI_JOB_PRIO_TBL_DEF>*/
/*<T_SPI_JOB_PRIO_TBL_CLOSE/>*/ 
};

/* Job priority queue */
/*<T_SPI_JOB_SORTED_DEF>*/
VAR(Spi_JobSortedType, SPI_VAR_ZERO_INIT) Spi_JobsSorted_at[] =
{
    {
        NULL_PTR, 0U, 0U, 0U
    }
};
/*</T_SPI_JOB_SORTED_DEF>*/

/* event queue */
/*<T_SPI_SEQ_EVENT_DEF>*/
VAR(Spi_HwEventType, SPI_VAR_ZERO_INIT) Spi_HwSeqEvent_at[] =
{
    {
        NULL_PTR, NULL_PTR, 0U, 0U, 0U
    }
};
/*</T_SPI_SEQ_EVENT_DEF>*/

/* SourceId : SPI_SourceId_055 */
/* DesignId : SPI_DesignId_020 */
/* Requirements : AR_SPI_SR144 */
/* job status array */
/*<T_SPI_JOB_STATUS_OPEN/>*/ 
static VAR(Spi_JobResultType, SPI_VAR_ZERO_INIT) Spi_JobStatus_at[] = 
{
    /*<T_SPI_JOB_STATUS_DEF>*/
    SPI_JOB_OK
/*</T_SPI_JOB_STATUS_DEF>*/
/*<T_SPI_JOB_STATUS_CLOSE/>*/ 
};

/* SourceId : SPI_SourceId_054 */
/* DesignId : SPI_DesignId_020 */
/* Requirements : AR_SPI_SR149 */
/* sequence status array */
/*<T_SPI_SEQ_STATUS_OPEN/>*/ 
static VAR(Spi_SeqResultType, SPI_VAR_ZERO_INIT) Spi_SequenceStatus_at[] = 
{
    /*<T_SPI_SEQ_STATUS_DEF>*/
    SPI_SEQ_OK
/*</T_SPI_SEQ_STATUS_DEF>*/
/*<T_SPI_SEQ_STATUS_CLOSE/>*/ 
};

/* dlc status array */
/*<T_SPI_DLC_STATUS_OPEN/>*/ 
static VAR(Spi_HwUnitResultType, SPI_VAR_ZERO_INIT) Spi_DlcStatus_at[] = 
{
    /*<T_SPI_DLC_STATUS_DEF>*/
    SPI_DLC_OK,
    SPI_DLC_OK,
    SPI_DLC_OK,
    SPI_DLC_OK,
    SPI_DLC_OK
/*</T_SPI_DLC_STATUS_DEF>*/
/*<T_SPI_DLC_STATUS_CLOSE/>*/ 
};

#define SPI_STOP_SEC_VAR_ZERO_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

#define SPI_START_SEC_CONST_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"
/* Hardware unit array */
/*<T_SPI_HW_UNIT_OPEN/>*/ 
CONST(Spi_RegisterPtrType, SPI_CONST) Spi_HWUnit_at[] = 
{
    /*<T_SPI_HW_UNIT_DEF>*/
    (Spi_RegisterPtrType) SPI_REGISTER_BASE_0,
    (Spi_RegisterPtrType) SPI_REGISTER_BASE_1,
    (Spi_RegisterPtrType) SPI_REGISTER_BASE_2,
    (Spi_RegisterPtrType) SPI_REGISTER_BASE_3,
    (Spi_RegisterPtrType) SPI_REGISTER_BASE_4
/*</T_SPI_HW_UNIT_DEF>*/
/*<T_SPI_HW_UNIT_CLOSE/>*/ 
};

/* Spi RAM Hardware array */
/*<T_SPI_RAM_UNIT_OPEN/>*/ 
CONST(Spi_RamBufferPtrType, SPI_CONST) Spi_RamUnit_at[] = 
{
    /*<T_SPI_RAM_UNIT_DEF>*/
    (Spi_RamBufferPtrType) SPI_RAM_BASE_0,
    (Spi_RamBufferPtrType) NULL_PTR,
    (Spi_RamBufferPtrType) SPI_RAM_BASE_2,
    (Spi_RamBufferPtrType) NULL_PTR,
    (Spi_RamBufferPtrType) SPI_RAM_BASE_4
/*</T_SPI_RAM_UNIT_DEF>*/
/*<T_SPI_RAM_UNIT_CLOSE/>*/ 
};

/*<T_SPI_UNIT_PROPERTY_OPEN/>*/ 
CONST(Spi_HWUnitPropertyType, SPI_CONST) Spi_UnitProperty_at[] = 
{
    /*<T_SPI_UNIT_PROPERTY_DEF>*/
    {1U, 0U, 0U},
    {0U, 1U, 1U},
    {1U, 0U, 2U},
    {0U, 1U, 3U},
    {1U, 0U, 4U}
/*</T_SPI_UNIT_PROPERTY_DEF>*/
/*<T_SPI_UNIT_PROPERTY_CLOSE/>*/ 
};

#define SPI_STOP_SEC_CONST_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"


#define SPI_START_SEC_VAR_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

/* global status array */
/*<T_SPI_GLOBAL_STATUS_DEF>*/
static VAR(Spi_ResultType, SPI_VAR_INIT) Spi_GlobalStatus_at =
{
    Spi_JobStatus_at,
    Spi_SequenceStatus_at,
    Spi_DlcStatus_at
};
/*</T_SPI_GLOBAL_STATUS_DEF>*/

#define SPI_STOP_SEC_VAR_INIT_UNSPECIFIED
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

#define SPI_START_SEC_PBCFG
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"


/* generation of channel assignment */
/* SourceId : SPI_SourceId_040 */
/* DesignId : SPI_DesignId_016 */
/* Requirements : AR_SPI_SR26, AR_SPI_SR28 */
/* the structure format is: { Number of channels assigned to a job, channelx .. channely } */
/*<T_SPI_JOB_TO_CHANNEL_ASSIGNMENT>*/
static CONST(Spi_ChannelType, SPI_PBCFG) SpiChannelsToJob0_Assignment_at[] =

{    
    /* Number of Channels in Job */
    1U,
    /* Channels in Job */
    Spi_SpiChannel_0
};

/*</T_SPI_JOB_TO_CHANNEL_ASSIGNMENT>*/

/* generation of job assignment to sequences */
/* the structure format is: { Number of jobs assigned to a sequence, jobx .. joby } */

/* SourceId : SPI_SourceId_041 */
/* DesignId : SPI_DesignId_016 */
/* Requirements : AR_SPI_SR29, AR_SPI_SR30 */
/*<T_SPI_SEQ_TO_JOB_ASSIGNMENT>*/
static CONST(Spi_JobType, SPI_PBCFG) SpiJobsToSeq0_Assignment_at[] =
{
   /* SPI Hardware Instance */
    1U
   /* Number of Jobs in Sequence */
   ,1U
   /* Jobs in Sequence */
   ,Spi_SpiJob_0
};

/*</T_SPI_SEQ_TO_JOB_ASSIGNMENT>*/

/* generated settings for external device container */
/* SourceId : SPI_SourceId_042 */
/* DesignId : SPI_DesignId_016 */
/* Requirements : AR_SPI_SR23 */
/*<T_SPI_EXTERNALDEVICE_CONTAINER_OPEN/>*/ 
static CONST(Spi_ExternalDeviceConfigType, SPI_PBCFG) Spi_ExternalDeviceConfig_at[] = 
{
    /*<T_SPI_EXTERNALDEVICE_CONTAINER_DEF>*/
    {
        SPI_SCS0,
        1U,
        0xc7U,
        0U,
        {0xffffU, 0x0000U },
        0x3FU,
        SPI_CONTINOUS,
        1U
    }
 /*</T_SPI_EXTERNALDEVICE_CONTAINER_DEF>*/
/*<T_SPI_EXTERNALDEVICE_CONTAINER_CLOSE/>*/ 
};

/* generated settings for channel container */
/* SourceId : SPI_SourceId_043 */
/* DesignId : SPI_DesignId_016 */
/* Requirements : AR_SPI_SR27 */
/*<T_SPI_CHANNEL_CONTAINER_OPEN/>*/ 
static CONST(Spi_ChannelConfigType, SPI_PBCFG) Spi_ChannelConfig_at[] = 
{
    /*<T_SPI_CHANNEL_CONTAINER_DEF>*/

    {
        &Spi_Buffer[0],
        0U,
        SPI_EB,
        8U,
        255U,
        255U,
        SPI_MSB
    }	
/*</T_SPI_CHANNEL_CONTAINER_DEF>*/
/*<T_SPI_CHANNEL_CONTAINER_CLOSE/>*/ 
};


/* generated settings for job container */
/*<T_SPI_JOB_CONTAINER_OPEN/>*/ 
static CONST(Spi_JobConfigType, SPI_PBCFG) Spi_JobsSettings_at[] = 
{
    /*<T_SPI_JOB_CONTAINER_DEF>*/

    {
        NULL_PTR,
        SpiChannelsToJob0_Assignment_at,
        Spi_SpiExternalDevice_0,
        0U,
        0U,
        1U
    }	
/*</T_SPI_JOB_CONTAINER_DEF>*/
/*<T_SPI_JOB_CONTAINER_CLOSE/>*/ 
};


/* generation of sequence container          */

/* generated settings for sequence container */
/*<T_SPI_SEQUENCE_CONTAINER_DEF>*/
static CONST(Spi_SequenceConfigType, SPI_PBCFG) Spi_SequenceSettings_at[] =
{

    {
        NULL_PTR,
        SpiJobsToSeq0_Assignment_at,
        0U,
        FALSE
    }	
};
/*</T_SPI_SEQUENCE_CONTAINER_DEF>*/

#define  SPI_STOP_SEC_PBCFG
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

#define  SPI_START_SEC_PBCFG_ROOT
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"
/* generation of runtime configuration       */

/*<T_SPI_CFG>*/
CONST(Spi_ConfigType, SPI_PBCFG) SpiRuntime = 
{
    Spi_ExternalDeviceConfig_at,
    Spi_ChannelConfig_at,
    Spi_JobsSettings_at,
    Spi_SequenceSettings_at,
    &Spi_GlobalStatus_at,
    1,
    1,
    1,
    1,
    5
};
/*</T_SPI_CFG>*/

#define  SPI_STOP_SEC_PBCFG_ROOT
/*SAFETYMCUSW 338 S MR:19.1 <APPROVED> "Based on Autosar Memory Map strategy" */
#include "MemMap.h"

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