Spi_IPW.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /**
  2. * @file Spi_IPW.h
  3. * @version 1.0.0
  4. *
  5. * @brief AUTOSAR Spi - Spi middle level driver header file.
  6. * @details This file is the header containing all the necessary information for SPI
  7. * LLD.
  8. * @addtogroup SPI_DRIVER Spi Driver
  9. * @{
  10. */
  11. /*==================================================================================================
  12. * Project : RTD AUTOSAR 4.4
  13. * Platform : CORTEXM
  14. * Peripheral : LPSPI
  15. * Dependencies :
  16. *
  17. * Autosar Version : 4.4.0
  18. * Autosar Revision : ASR_REL_4_4_REV_0000
  19. * Autosar Conf.Variant :
  20. * SW Version : 1.0.0
  21. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  22. *
  23. * (c) Copyright 2020-2021 NXP Semiconductors
  24. * All Rights Reserved.
  25. *
  26. * NXP Confidential. This software is owned or controlled by NXP and may only be
  27. * used strictly in accordance with the applicable license terms. By expressly
  28. * accepting such terms or by downloading, installing, activating and/or otherwise
  29. * using the software, you are agreeing that you have read, and that you agree to
  30. * comply with and are bound by, such license terms. If you do not agree to be
  31. * bound by the applicable license terms, then you may not retain, install,
  32. * activate or otherwise use the software.
  33. ==================================================================================================*/
  34. #ifndef SPI_IPW_H
  35. #define SPI_IPW_H
  36. #ifdef __cplusplus
  37. extern "C"{
  38. #endif
  39. /*==================================================================================================
  40. * INCLUDE FILES
  41. * 1) system and project includes
  42. * 2) needed interfaces from external units
  43. * 3) internal and external interfaces from this unit
  44. ==================================================================================================*/
  45. #include "Spi.h"
  46. #include "Lpspi_Ip.h"
  47. #include "Flexio_Spi_Ip.h"
  48. #include "Spi_IPW_Types.h"
  49. /*==================================================================================================
  50. * SOURCE FILE VERSION INFORMATION
  51. ==================================================================================================*/
  52. #define SPI_IPW_VENDOR_ID 43
  53. #define SPI_IPW_AR_RELEASE_MAJOR_VERSION 4
  54. #define SPI_IPW_AR_RELEASE_MINOR_VERSION 4
  55. #define SPI_IPW_AR_RELEASE_REVISION_VERSION 0
  56. #define SPI_IPW_SW_MAJOR_VERSION 1
  57. #define SPI_IPW_SW_MINOR_VERSION 0
  58. #define SPI_IPW_SW_PATCH_VERSION 0
  59. /*==================================================================================================
  60. * FILE VERSION CHECKS
  61. ==================================================================================================*/
  62. /* Check if Spi.h and Spi_IPW.h are of the same vendor */
  63. #if (SPI_VENDOR_ID != SPI_IPW_VENDOR_ID)
  64. #error "Spi.h and Spi_IPW.h have different vendor ids"
  65. #endif
  66. /* Check if Spi.h file and Spi_IPW.h file are of the same Autosar version */
  67. #if ((SPI_AR_RELEASE_MAJOR_VERSION != SPI_IPW_AR_RELEASE_MAJOR_VERSION) || \
  68. (SPI_AR_RELEASE_MINOR_VERSION != SPI_IPW_AR_RELEASE_MINOR_VERSION) || \
  69. (SPI_AR_RELEASE_REVISION_VERSION != SPI_IPW_AR_RELEASE_REVISION_VERSION))
  70. #error "AutoSar Version Numbers of Spi.h and Spi_IPW.h are different"
  71. #endif
  72. #if ((SPI_SW_MAJOR_VERSION != SPI_IPW_SW_MAJOR_VERSION) || \
  73. (SPI_SW_MINOR_VERSION != SPI_IPW_SW_MINOR_VERSION) || \
  74. (SPI_SW_PATCH_VERSION != SPI_IPW_SW_PATCH_VERSION))
  75. #error "Software Version Numbers of Spi.h and Spi_IPW.h are different"
  76. #endif
  77. /* Check if Spi_IPW.h and Flexio_Spi_Ip.h are of the same vendor */
  78. #if (SPI_IPW_VENDOR_ID != FLEXIO_SPI_IP_VENDOR_ID)
  79. #error "Spi_IPW.h and Flexio_Spi_Ip.h have different vendor ids"
  80. #endif
  81. /* Check if Spi_IPW.h file and Flexio_Spi_Ip.h file are of the same Autosar version */
  82. #if ((SPI_IPW_AR_RELEASE_MAJOR_VERSION != FLEXIO_SPI_IP_AR_RELEASE_MAJOR_VERSION) || \
  83. (SPI_IPW_AR_RELEASE_MINOR_VERSION != FLEXIO_SPI_IP_AR_RELEASE_MINOR_VERSION) || \
  84. (SPI_IPW_AR_RELEASE_REVISION_VERSION != FLEXIO_SPI_IP_AR_RELEASE_REVISION_VERSION))
  85. #error "AutoSar Version Numbers of Spi_IPW.h and Flexio_Spi_Ip.h are different"
  86. #endif
  87. #if ((SPI_IPW_SW_MAJOR_VERSION != FLEXIO_SPI_IP_SW_MAJOR_VERSION) || \
  88. (SPI_IPW_SW_MINOR_VERSION != FLEXIO_SPI_IP_SW_MINOR_VERSION) || \
  89. (SPI_IPW_SW_PATCH_VERSION != FLEXIO_SPI_IP_SW_PATCH_VERSION))
  90. #error "Software Version Numbers of Spi_IPW.h and Flexio_Spi_Ip.h are different"
  91. #endif
  92. /* Check if Lpspi_Ip.h and Spi_IPW.h are of the same vendor */
  93. #if (LPSPI_IP_VENDOR_ID != SPI_IPW_VENDOR_ID)
  94. #error "Lpspi_Ip.h and Spi_IPW.h have different vendor ids"
  95. #endif
  96. /* Check if Lpspi_Ip.h file and Spi_IPW.h file are of the same Autosar version */
  97. #if ((LPSPI_IP_AR_RELEASE_MAJOR_VERSION != SPI_IPW_AR_RELEASE_MAJOR_VERSION) || \
  98. (LPSPI_IP_AR_RELEASE_MINOR_VERSION != SPI_IPW_AR_RELEASE_MINOR_VERSION) || \
  99. (LPSPI_IP_AR_RELEASE_REVISION_VERSION != SPI_IPW_AR_RELEASE_REVISION_VERSION))
  100. #error "AutoSar Version Numbers of Lpspi_Ip.h and Spi_IPW.h are different"
  101. #endif
  102. #if ((LPSPI_IP_SW_MAJOR_VERSION != SPI_IPW_SW_MAJOR_VERSION) || \
  103. (LPSPI_IP_SW_MINOR_VERSION != SPI_IPW_SW_MINOR_VERSION) || \
  104. (LPSPI_IP_SW_PATCH_VERSION != SPI_IPW_SW_PATCH_VERSION))
  105. #error "Software Version Numbers of Lpspi_Ip.h and Spi_IPW.h are different"
  106. #endif
  107. /* Check if Spi_IPW_Types.h and Spi_IPW.h are of the same vendor */
  108. #if (SPI_IPW_TYPES_VENDOR_ID != SPI_IPW_VENDOR_ID)
  109. #error "Spi_IPW_Types.h and Spi_IPW.h have different vendor ids"
  110. #endif
  111. /* Check if Spi_IPW_Types.h file and Spi_IPW.h file are of the same Autosar version */
  112. #if ((SPI_IPW_TYPES_AR_RELEASE_MAJOR_VERSION != SPI_IPW_AR_RELEASE_MAJOR_VERSION) || \
  113. (SPI_IPW_TYPES_AR_RELEASE_MINOR_VERSION != SPI_IPW_AR_RELEASE_MINOR_VERSION) || \
  114. (SPI_IPW_TYPES_AR_RELEASE_REVISION_VERSION != SPI_IPW_AR_RELEASE_REVISION_VERSION))
  115. #error "AutoSar Version Numbers of Spi_IPW_Types.h and Spi_IPW.h are different"
  116. #endif
  117. #if ((SPI_IPW_TYPES_SW_MAJOR_VERSION != SPI_IPW_SW_MAJOR_VERSION) || \
  118. (SPI_IPW_TYPES_SW_MINOR_VERSION != SPI_IPW_SW_MINOR_VERSION) || \
  119. (SPI_IPW_TYPES_SW_PATCH_VERSION != SPI_IPW_SW_PATCH_VERSION))
  120. #error "Software Version Numbers of Spi_IPW_Types.h and Spi_IPW.h are different"
  121. #endif
  122. /*==================================================================================================
  123. * CONSTANTS
  124. ==================================================================================================*/
  125. /*==================================================================================================
  126. * DEFINES AND MACROS
  127. ==================================================================================================*/
  128. /*==================================================================================================
  129. * ENUMS
  130. ==================================================================================================*/
  131. /*==================================================================================================
  132. * STRUCTURES AND OTHER TYPEDEFS
  133. ==================================================================================================*/
  134. /*==================================================================================================
  135. * GLOBAL VARIABLE DECLARATIONS
  136. ==================================================================================================*/
  137. /*==================================================================================================
  138. * FUNCTION PROTOTYPES
  139. ==================================================================================================*/
  140. #define SPI_START_SEC_CODE
  141. #include "Spi_MemMap.h"
  142. void Spi_Ipw_Init(const Spi_HWUnitType HWUnitId, const Spi_HWUnitConfigType * HWUnit);
  143. void Spi_Ipw_DeInit(Spi_HWUnitType HWUnit, uint32 SpiCoreID);
  144. #if ( (SPI_LEVEL_DELIVERED == LEVEL2) || (SPI_LEVEL_DELIVERED == LEVEL0))
  145. Std_ReturnType Spi_Ipw_SyncTransmit(const Spi_JobConfigType *JobConfig, uint32 SpiCoreID);
  146. #endif /* #if ( (SPI_LEVEL_DELIVERED == LEVEL2) || (SPI_LEVEL_DELIVERED == LEVEL0) ) */
  147. #if ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2))
  148. void Spi_Ipw_JobTransfer(const Spi_JobConfigType *JobConfig);
  149. #endif
  150. #if ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2))
  151. void Spi_Ipw_IrqPoll(Spi_HWUnitType HWUnit, uint32 SpiCoreID);
  152. #endif
  153. #if ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2))
  154. void Spi_Ipw_IrqConfig(Spi_HWUnitType HWUnit, Spi_AsyncModeType Mode, uint32 SpiCoreID);
  155. #endif
  156. #if ((SPI_SLAVE_SUPPORT == STD_ON) && (SPI_CANCEL_API == STD_ON))
  157. #if ((SPI_LEVEL_DELIVERED == LEVEL1) || (SPI_LEVEL_DELIVERED == LEVEL2))
  158. void Spi_Ipw_SlaveCancel(const Spi_JobConfigType *JobConfig);
  159. #endif
  160. #endif
  161. #if (SPI_DUAL_CLOCK_MODE == STD_ON)
  162. void Spi_Ipw_SetClockMode(Spi_DualClockModeType ClockMode, const Spi_HWUnitConfigType * HWUnitConfig);
  163. #endif
  164. #define SPI_STOP_SEC_CODE
  165. #include "Spi_MemMap.h"
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169. #endif /*SPI_IPW_H*/
  170. /** @} */