1 /* 2 * Copyright 2021-2024 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef SPI_IP_TRUSTEDFUNCTIONS_H 8 #define SPI_IP_TRUSTEDFUNCTIONS_H 9 10 /** 11 * @file Spi_Ip_TrustedFunctions.h 12 * 13 * 14 * @brief SPI IP driver header file. 15 * @details SPI IP driver header file. 16 17 * @addtogroup SPI_DRIVER Spi Driver 18 * @{ 19 */ 20 21 #ifdef __cplusplus 22 extern "C"{ 23 #endif 24 25 26 /*================================================================================================== 27 * INCLUDE FILES 28 * 1) system and project includes 29 * 2) needed interfaces from external units 30 * 3) internal and external interfaces from this unit 31 ==================================================================================================*/ 32 #include "Spi_Ip_Cfg.h" 33 /*================================================================================================== 34 * SOURCE FILE VERSION INFORMATION 35 ==================================================================================================*/ 36 #define SPI_IP_TRUSTEDFUNCTIONS_VENDOR_ID 43 37 #define SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION 4 38 #define SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION 7 39 #define SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION 0 40 #define SPI_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION 2 41 #define SPI_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION 0 42 #define SPI_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION 0 43 /*================================================================================================== 44 * FILE VERSION CHECKS 45 ==================================================================================================*/ 46 /* Check if Spi_Ip_TrustedFunctions.h header file and Spi_Ip_Cfg.h configuration header file are of the same vendor */ 47 #if (SPI_IP_TRUSTEDFUNCTIONS_VENDOR_ID != SPI_IP_VENDOR_ID_CFG) 48 #error "Spi_Ip_TrustedFunctions.h and Spi_Ip_Cfg.h have different vendor IDs" 49 #endif 50 /* Check if Spi_Ip_TrustedFunctions.h header file and Spi_Ip_Cfg.h configuration header file are of the same Autosar version */ 51 #if ((SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MAJOR_VERSION != SPI_IP_AR_RELEASE_MAJOR_VERSION_CFG) || \ 52 (SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_MINOR_VERSION != SPI_IP_AR_RELEASE_MINOR_VERSION_CFG) || \ 53 (SPI_IP_TRUSTEDFUNCTIONS_AR_RELEASE_REVISION_VERSION != SPI_IP_AR_RELEASE_REVISION_VERSION_CFG)) 54 #error "AutoSar Version Numbers of Spi_Ip_TrustedFunctions.h and Spi_Ip_Cfg.h are different" 55 #endif 56 /* Check if Spi_Ip_TrustedFunctions.h header file and Spi_Ip_Cfg.h configuration header file are of the same software version */ 57 #if ((SPI_IP_TRUSTEDFUNCTIONS_SW_MAJOR_VERSION != SPI_IP_SW_MAJOR_VERSION_CFG) || \ 58 (SPI_IP_TRUSTEDFUNCTIONS_SW_MINOR_VERSION != SPI_IP_SW_MINOR_VERSION_CFG) || \ 59 (SPI_IP_TRUSTEDFUNCTIONS_SW_PATCH_VERSION != SPI_IP_SW_PATCH_VERSION_CFG)) 60 #error "Software Version Numbers of Spi_Ip_TrustedFunctions.h and Spi_Ip_Cfg.h are different" 61 #endif 62 /*================================================================================================== 63 * CONSTANTS 64 ==================================================================================================*/ 65 /*================================================================================================== 66 * DEFINES AND MACROS 67 ==================================================================================================*/ 68 /*================================================================================================== 69 * ENUMS 70 ==================================================================================================*/ 71 /*================================================================================================== 72 * STRUCTURES AND OTHER TYPEDEFS 73 ==================================================================================================*/ 74 /*================================================================================================== 75 * GLOBAL VARIABLE DECLARATIONS 76 ==================================================================================================*/ 77 78 /*================================================================================================== 79 * FUNCTION PROTOTYPES 80 ==================================================================================================*/ 81 #define SPI_START_SEC_CODE 82 #include "Spi_MemMap.h" 83 84 #if (STD_ON == SPI_IP_ENABLE_USER_MODE_SUPPORT) 85 /** 86 * @brief This function will enable writing all SPI registers under protection in User mode by configuring REG_PROT 87 * @details This function will enable writing all SPI registers under protection in User mode by configuring REG_PROT 88 * 89 * @param[in] Instance - SPI peripheral instance number. 90 * 91 * @return void. 92 */ 93 extern void Spi_Ip_SetUserAccess(uint8 Instance); 94 #endif 95 96 #define SPI_STOP_SEC_CODE 97 #include "Spi_MemMap.h" 98 99 #ifdef __cplusplus 100 } 101 #endif 102 103 /** @} */ 104 105 #endif /* SPI_IP_TRUSTEDFUNCTIONS_H */ 106