/*==================================================================================================
*   Project              : RTD AUTOSAR 4.4
*   Platform             : CORTEXM
*   Peripheral           : DSPI
*   Dependencies         : 
*
*   Autosar Version      : 4.4.0
*   Autosar Revision     : ASR_REL_4_4_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 4.0.0
*   Build Version        : S32_RTD_4_0_0_D2210_ASR_REL_4_4_REV_0000_20221031
*
*   (c) Copyright 2022 NXP Semiconductors
*   All Rights Reserved.
*
*   NXP Confidential. This software is owned or controlled by NXP and may only be
*   used strictly in accordance with the applicable license terms. By expressly
*   accepting such terms or by downloading, installing, activating and/or otherwise
*   using the software, you are agreeing that you have read, and that you agree to
*   comply with and are bound by, such license terms. If you do not agree to be
*   bound by the applicable license terms, then you may not retain, install,
*   activate or otherwise use the software.
==================================================================================================*/

#ifndef SPI_IP_CFG_H
#define SPI_IP_CFG_H

/**
*   @file    Spi_Ip_Cfg.h
*   @version 4.0.0
*
*   @brief   AUTOSAR Spi - Spi configuration header file.
*   @details This file is the header containing all the necessary information for SPI
*            module configuration(s).
*   @addtogroup SPI_IP_DRIVER_CONFIGURATION Spi Ip Driver Configuration
*   @{
*/

#ifdef __cplusplus
extern "C"{
#endif

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
* 4) user callback header files
==================================================================================================*/
#include "Mcal.h"
#include "OsIf.h"

#include "Spi_Ip_VS_0_PBcfg.h"

#include "S32G399A_SPI.h"
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define SPI_IP_VENDOR_ID_CFG                       43
#define SPI_IP_AR_RELEASE_MAJOR_VERSION_CFG        4
#define SPI_IP_AR_RELEASE_MINOR_VERSION_CFG        4
#define SPI_IP_AR_RELEASE_REVISION_VERSION_CFG     0
#define SPI_IP_SW_MAJOR_VERSION_CFG                4
#define SPI_IP_SW_MINOR_VERSION_CFG                0
#define SPI_IP_SW_PATCH_VERSION_CFG                0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
#ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
    /* Check if current file and Mcal header file are of the same Autosar version */
    #if ((SPI_IP_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
         (SPI_IP_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
    #error "AutoSar Version Numbers of Spi_Ip_Cfg.h and Mcal.h are different"
    #endif

    /* Check if the current file and OsIf.h header file are of the same version */
    #if ((SPI_IP_AR_RELEASE_MAJOR_VERSION_CFG != OSIF_AR_RELEASE_MAJOR_VERSION) || \
         (SPI_IP_AR_RELEASE_MINOR_VERSION_CFG != OSIF_AR_RELEASE_MINOR_VERSION) \
        )
        #error "AutoSar Version Numbers of Spi_Ip_Cfg.h and OsIf.h are different"
    #endif
#endif



/* Check if Spi_Ip_VS_0_PBcfg header file and Spi configuration header file are of the same vendor */
#if (SPI_IP_VS_0_VENDOR_ID_PBCFG != SPI_IP_VENDOR_ID_CFG)
    #error "Spi_Ip_VS_0_PBcfg.h and Spi_Ip_Cfg.h have different vendor IDs"
#endif
    /* Check if Spi_Ip_VS_0_PBcfg header file and Spi  configuration header file are of the same Autosar version */
#if ((SPI_IP_VS_0_AR_RELEASE_MAJOR_VERSION_PBCFG != SPI_IP_AR_RELEASE_MAJOR_VERSION_CFG) || \
     (SPI_IP_VS_0_AR_RELEASE_MINOR_VERSION_PBCFG != SPI_IP_AR_RELEASE_MINOR_VERSION_CFG) || \
     (SPI_IP_VS_0_AR_RELEASE_REVISION_VERSION_PBCFG != SPI_IP_AR_RELEASE_REVISION_VERSION_CFG))
#error "AutoSar Version Numbers of Spi_Ip_VS_0_PBcfg.h and Spi_Ip_Cfg.h are different"
#endif
/* Check if Spi_Ip_VS_0_PBcfg header file and Spi configuration header file are of the same software version */
#if ((SPI_IP_VS_0_SW_MAJOR_VERSION_PBCFG != SPI_IP_SW_MAJOR_VERSION_CFG) || \
     (SPI_IP_VS_0_SW_MINOR_VERSION_PBCFG != SPI_IP_SW_MINOR_VERSION_CFG) || \
     (SPI_IP_VS_0_SW_PATCH_VERSION_PBCFG != SPI_IP_SW_PATCH_VERSION_CFG))
#error "Software Version Numbers of Spi_Ip_VS_0_PBcfg.h and Spi_Ip_Cfg.h are different"
#endif



/*==================================================================================================
*                                          CONSTANTS
==================================================================================================*/
#define SPI_IP_CONFIG_EXT \
 SPI_IP_CONFIG_VS_0_PB \


/** @brief Total number of SpiPhyUnit configured. */
#define SPI_IP_NUMBER_OF_INSTANCES           (2U)

/** @brief Number of FIFO entries supported */
#define SPI_IP_FIFO_SIZE_U16    ((uint16)5U)

/** @brief HWUnits enabled/disabled */

#define SPI_IP_5_ENABLED  (STD_ON)
    
#define SPI_IP_4_ENABLED  (STD_ON)
    
#define SPI_IP_SLAVE_SUPPORT  ((STD_OFF))


/**
* @brief Defines if transfers are made using DMA or FIFO.
* @details Defines if transfers are made using DMA or FIFO.
*/
#define SPI_IP_DMA_USED     (STD_OFF)

/**
* @brief If enabled, allows dual MCU clock configuration settings.
* @details If enabled, allows dual MCU clock configuration settings.
*/
#define SPI_IP_DUAL_CLOCK_MODE  (STD_ON)

/**
* @brief          Enable Dma Fast transfer support.
* @details        When SpiAutosarExt/SpiEnableDmaFastTransferSupport = TRUE,
*                 the SPI driver can be supported to transfer multiple Jobs, Channels and CPU used only for processing end of Sequence transfer.
*/
#define SPI_IP_ENABLE_DMAFASTTRANSFER_SUPPORT   (STD_OFF)

/**
* @brief          Enable User Mode Support.
* @details        When SpiAutosarExt/SpiEnableUserModeSupport = TRUE,
*                 the SPI driver can be executed from both supervisor and user mode.
*
* @api
*/
#define SPI_IP_ENABLE_USER_MODE_SUPPORT   (STD_OFF)

#ifndef MCAL_ENABLE_USER_MODE_SUPPORT
 #ifdef SPI_IP_ENABLE_USER_MODE_SUPPORT
  #if (STD_ON == SPI_IP_ENABLE_USER_MODE_SUPPORT)
   #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running  Spi in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
  #endif /* (STD_ON == SPI_IP_ENABLE_USER_MODE_SUPPORT) */
 #endif /* ifdef MCAL_ENABLE_USER_MODE_SUPPORT */
#endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT*/

/**
* @brief SPI registers is controlled by REG_PROT IP.
*/
#define SPI_IP_REG_PROT_AVAILABLE   (STD_ON)

#if (STD_ON == SPI_IP_REG_PROT_AVAILABLE)
/**
* @brief The protection size
*/
    #define SPI_IP_PROT_MEM_U32                           ((uint32)4U)
#endif

/**
* @brief Maximum of frame size supported.
*/
#define SPI_IP_FRAMESIZE_MAX_U8                              ((uint8)32U)

/**
* @brief Minimum of frame size supported.
*/
#define SPI_IP_FRAMESIZE_MIN_U8                              ((uint8)4U)

/**
* @brief Define Timeout Method.
* @details Define a certain timeout method from OsIf will be used in the driver.
*/
#define SPI_IP_TIMEOUT_METHOD           (OSIF_COUNTER_DUMMY)

/**
* @brief Switches ON or OFF for the detection and reporting of development errors(API parameter checking) at IP level.
*/
/** @implements SPI_IP_DEV_ERROR_DETECT_define  */
#define SPI_IP_DEV_ERROR_DETECT     (STD_OFF)
/*==================================================================================================
 *                                     DEFINES AND MACROS
==================================================================================================*/

/*==================================================================================================
*                                            ENUMS
==================================================================================================*/


/*==================================================================================================
*                               STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/


/*==================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/


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


#ifdef __cplusplus
}
#endif
#endif 

/** @} */
