/*
*
* Copyright (c) 2024 Texas Instruments Incorporated
*
* All rights reserved not granted herein.
*
* Limited License.
*
* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
* license under copyrights and patents it now or hereafter owns or controls to make,
* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
* terms herein.  With respect to the foregoing patent license, such license is granted
* solely to the extent that any such patent is necessary to Utilize the software alone.
* The patent license shall not apply to any combinations which include this software,
* other than combinations with devices manufactured by or for TI ("TI Devices").
* No hardware patent is licensed hereunder.
*
* Redistributions must preserve existing copyright notices and reproduce this license
* (including the above copyright notice and the disclaimer and (if applicable) source
* code license limitations below) in the documentation and/or other materials provided
* with the distribution
*
* Redistribution and use in binary form, without modification, are permitted provided
* that the following conditions are met:
*
* *       No reverse engineering, decompilation, or disassembly of this software is
* permitted with respect to any software provided in binary form.
*
* *       any redistribution and use are licensed by TI for use only with TI Devices.
*
* *       Nothing shall obligate TI to provide you with source code for the software
* licensed and provided to you in object code.
*
* If software source code is provided to you, modification and redistribution of the
* source code are permitted provided that the following conditions are met:
*
* *       any redistribution and use of the source code, including any resulting derivative
* works, are licensed by TI for use only with TI Devices.
*
* *       any redistribution and use of any object code compiled from the source code
* and any resulting derivative works, are licensed by TI for use only with TI Devices.
*
* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
*
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* DISCLAIMER.
*
* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

/**
 *  \file     Spi_PBcfg.c
 *
 *  \brief    This file contains generated post build configuration file
 *            for SPI MCAL driver
 */

  /*****************************************************************************
    Project         : j784s4_spi
    Date            : 2024-10-22 14:16:21
    SW Ver          : 9.0.1
    Module Rele Ver : AUTOSAR 4.3.1 0
	
    This file is generated by EB Tresos
    Do not modify this file, otherwise the software may behave in unexpected way
 ******************************************************************************/

/*******************************************************************************
 *  INCLUDES
 ******************************************************************************/
#include "Spi.h"
#include "Spi_Irq.h"

/*
 * Design: MCAL-6472
 */

/*******************************************************************************
 *  VERSION CHECK
 ******************************************************************************/
#if ((SPI_SW_MAJOR_VERSION != (9U)) || (SPI_SW_MINOR_VERSION != (2U)))
  #error "Version numbers of Spi_PBcfg.c and Spi.h are inconsistent!"
#endif
/*******************************************************************************
 *  LOCAL CONSTANT MACROS
 ******************************************************************************/

/*******************************************************************************
 *  LOCAL FUNCTION MACROS
 ******************************************************************************/

/*******************************************************************************
 *  LOCAL DATA TYPES AND STRUCTURES
 ******************************************************************************/

/*******************************************************************************
 *  LOCAL DATA PROTOTYPES
 ******************************************************************************/

/*******************************************************************************
 *  GLOBAL DATA
 ******************************************************************************/
#define  SPI_START_SEC_CONFIG_DATA
#include "Spi_MemMap.h"
/* generation of runtime configuration       */

#ifdef __cplusplus
extern "C" {
#endif




extern void SpiApp_McuMcspiJob0EndNotification(void);

extern void SpiApp_McuMcspiSeq0EndNotification(void);

CONST(struct Spi_ConfigType_s, SPI_CONFIG_DATA) SpiDriver =
{
    .maxChannels = 1U,
    .maxJobs = 1U,
    .maxSeq  = 1U,
    .maxHwUnit = 1U,
    .maxExtDevCfg = 1U,
    .udmaInstId  = (uint32)UDMA_INST_ID_MCU_0,
    .cacheWbInv = (Spi_CacheWbInv)SpiApp_wbInvCache,
    .cacheWb = (Spi_CacheWb)SpiApp_wbCache,
    .cacheInv = (Spi_CacheInv)SpiApp_invCache,
    .channelCfg =
    {
            [0] =
            {
                .channelBufType = SPI_EB,
                .dataWidth = 32U,
                .defaultTxData = 0U,
                .maxBufLength = 10000U,
                .transferType = SPI_MSB,
            },
        },
    .jobCfg =
    {
            [0] =
            {
                .jobPriority = SPI_JOB_PRIORITY_0,
                .hwUnitId = SPI_UNIT_MCU_MCSPI0,
                .Spi_JobEndNotification = SpiApp_McuMcspiJob0EndNotification,
                .channelPerJob = 1U,
                .channelList =
                {
                    [0] = 0U,
                },
            },
        },
    .seqCfg =
    {
            [0] =
            {
                .seqInterruptible = (uint8) TRUE,
                .Spi_SequenceEndNotification = SpiApp_McuMcspiSeq0EndNotification,
                .jobPerSeq = 1U,
                .jobList =
                {
                    0U,
                },
            },
        },
    .hwUnitCfg =
    {
            [0] =
            {
                .hwUnitId = SPI_UNIT_MCU_MCSPI0,
                .enabledmaMode = (boolean)TRUE,
                .dmaTxChIntrNum = 80,
                .dmaRxChIntrNum = 81,
            },
            [1] =
            {
                .hwUnitId = SPI_UNIT_MCU_MCSPI1,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [2] =
            {
                .hwUnitId = SPI_UNIT_MCU_MCSPI2,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [3] =
            {
                .hwUnitId = SPI_UNIT_MCSPI0,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [4] =
            {
                .hwUnitId = SPI_UNIT_MCSPI1,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [5] =
            {
                .hwUnitId = SPI_UNIT_MCSPI2,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [6] =
            {
                .hwUnitId = SPI_UNIT_MCSPI3,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
            [7] =
            {
                .hwUnitId = SPI_UNIT_MCSPI4,
                .enabledmaMode = (boolean)FALSE,
                .dmaTxChIntrNum = 0,
                .dmaRxChIntrNum = 0,
            },
        },
    .extDevCfg =
    {
            [0] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_1_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [1] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [2] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [3] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [4] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [5] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [6] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) FALSE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
            [7] =
            {
        .mcspi =
                {
                    .csEnable = (uint16) TRUE,
                    .csMode   = SPI_CONTINUOUS,
                    .csPolarity = SPI_HIGH,
                    .csIdleTime = SPI_DATADELAY_0,
                    .clkDivider = 0U,
                    .clkMode = SPI_CLK_MODE_0,
                    .txRxMode     = SPI_TX_RX_MODE_BOTH,
                    .startBitEnable =  (uint16) TRUE,
                    .startBitLevel  = SPI_LOW,
                    .receptionLineEnable  = DATA_LINE_0_RECEPTION,
                    .transmissionLineEnable  = DATA_LINE_1_TRANSMISSION,
                },
            },
        },
};

#ifdef __cplusplus
}
#endif

#define  SPI_STOP_SEC_CONFIG_DATA
#include "Spi_MemMap.h"

#define  SPI_START_SEC_ISR_CODE
#include "Spi_MemMap.h"
/**
 *  \brief SPI Hwunit ISR
 */
/** \brief SPI MCU_MCSPI0 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi0TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCU_MCSPI0);
}
/** \brief SPI MCU_MCSPI1 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi1TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCU_MCSPI1);
}
/** \brief SPI MCU_MCSPI2 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi2TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCU_MCSPI2);
}
/** \brief SPI MCSPI0 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcspi0TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCSPI0);
}
/** \brief SPI MCSPI1 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcspi1TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCSPI1);
}
/** \brief SPI MCSPI2 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcspi2TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCSPI2);
}
/** \brief SPI MCSPI3 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcspi3TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCSPI3);
}
/** \brief SPI MCSPI4 ISR */
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcspi4TxRx(void)
{
    Spi_IntISR_McuMcspiTxRx(SPI_UNIT_MCSPI4);
}

FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi0DmaTx(void)
{
    Spi_IntISR_McuMcspiDmaTx(SPI_MAX_HW_DMA_UNIT, SPI_UNIT_MCU_MCSPI0 );
}
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi0DmaRx(void)
{
    Spi_IntISR_McuMcspiDmaRx(SPI_MAX_HW_DMA_UNIT, SPI_UNIT_MCU_MCSPI0 );
}

FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi1DmaTx(void)
{
    Spi_IntISR_McuMcspiDmaTx(SPI_MAX_HW_DMA_UNIT, SPI_UNIT_MCU_MCSPI1 );
}
FUNC(void, SPI_CODE_FAST) Spi_IrqUnitMcuMcspi1DmaRx(void)
{
    Spi_IntISR_McuMcspiDmaRx(SPI_MAX_HW_DMA_UNIT, SPI_UNIT_MCU_MCSPI1 );
}

#define  SPI_STOP_SEC_ISR_CODE
#include "Spi_MemMap.h"


/*******************************************************************************
 *  END OF FILE: Spi_PBcfg.c
 ******************************************************************************/
