Platform_Ipw.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral :
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. #ifndef PLATFORM_IPW_H_
  25. #define PLATFORM_IPW_H_
  26. /**
  27. * @file
  28. *
  29. * @internal
  30. * @addtogroup Platform_Ipw
  31. * @{
  32. */
  33. /*==================================================================================================
  34. * INCLUDE FILES
  35. ==================================================================================================*/
  36. #include "Platform_Ipw_Cfg.h"
  37. #include "IntCtrl_Ip.h"
  38. #include "System_Ip.h"
  39. /*==================================================================================================
  40. * SOURCE FILE VERSION INFORMATION
  41. ==================================================================================================*/
  42. #define PLATFORM_PLATFORM_IPW_VENDOR_ID 43
  43. #define PLATFORM_PLATFORM_IPW_AR_RELEASE_MAJOR_VERSION 4
  44. #define PLATFORM_PLATFORM_IPW_AR_RELEASE_MINOR_VERSION 4
  45. #define PLATFORM_PLATFORM_IPW_AR_RELEASE_REVISION_VERSION 0
  46. #define PLATFORM_PLATFORM_IPW_SW_MAJOR_VERSION 1
  47. #define PLATFORM_PLATFORM_IPW_SW_MINOR_VERSION 0
  48. #define PLATFORM_PLATFORM_IPW_SW_PATCH_VERSION 0
  49. /*==================================================================================================
  50. * FILE VERSION CHECKS
  51. ==================================================================================================*/
  52. /* Check if current file and Platform_Ipw_Cfg header file are of the same vendor */
  53. #if (PLATFORM_PLATFORM_IPW_VENDOR_ID != PLATFORM_IPW_CFG_VENDOR_ID)
  54. #error "Platform_Ipw.h and Platform_Ipw_Cfg.h have different vendor ids"
  55. #endif
  56. /* Check if current file and Platform_Ipw_Cfg header file are of the same Autosar version */
  57. #if ((PLATFORM_PLATFORM_IPW_AR_RELEASE_MAJOR_VERSION != PLATFORM_IPW_CFG_AR_MAJOR_VERSION) || \
  58. (PLATFORM_PLATFORM_IPW_AR_RELEASE_MINOR_VERSION != PLATFORM_IPW_CFG_AR_MINOR_VERSION) || \
  59. (PLATFORM_PLATFORM_IPW_AR_RELEASE_REVISION_VERSION != PLATFORM_IPW_CFG_AR_REVISION_VERSION) \
  60. )
  61. #error "AutoSar Version Numbers of Platform_Ipw.h and Platform_Ipw_Cfg.h are different"
  62. #endif
  63. /* Check if current file and Platform_Ipw_Cfg header file are of the same Software version */
  64. #if ((PLATFORM_PLATFORM_IPW_SW_MAJOR_VERSION != PLATFORM_IPW_CFG_SW_MAJOR_VERSION) || \
  65. (PLATFORM_PLATFORM_IPW_SW_MINOR_VERSION != PLATFORM_IPW_CFG_SW_MINOR_VERSION) || \
  66. (PLATFORM_PLATFORM_IPW_SW_PATCH_VERSION != PLATFORM_IPW_CFG_SW_PATCH_VERSION) \
  67. )
  68. #error "Software Version Numbers of Platform_Ipw.h and Platform_Ipw_Cfg.h are different"
  69. #endif
  70. /* Check if current file and IntCtrl_Ip header file are of the same vendor */
  71. #if (PLATFORM_PLATFORM_IPW_VENDOR_ID != PLATFORM_INTCTRL_IP_VENDOR_ID)
  72. #error "Platform_Ipw.h and Platform_Ipw_Cfg.h have different vendor ids"
  73. #endif
  74. /* Check if current file and IntCtrl_Ip header file are of the same Software version */
  75. #if ((PLATFORM_PLATFORM_IPW_SW_MAJOR_VERSION != PLATFORM_INTCTRL_IP_SW_MAJOR_VERSION) || \
  76. (PLATFORM_PLATFORM_IPW_SW_MINOR_VERSION != PLATFORM_INTCTRL_IP_SW_MINOR_VERSION) || \
  77. (PLATFORM_PLATFORM_IPW_SW_PATCH_VERSION != PLATFORM_INTCTRL_IP_SW_PATCH_VERSION) \
  78. )
  79. #error "Software Version Numbers of Platform_Ipw.h and IntCtrl_Ip.h are different"
  80. #endif
  81. /* Check if current file and System_Ip header file are of the same vendor */
  82. #if (PLATFORM_PLATFORM_IPW_VENDOR_ID != PLATFORM_SYSTEM_IP_VENDOR_ID)
  83. #error "Platform_Ipw.h and System_Ip.h have different vendor ids"
  84. #endif
  85. /* Check if current file and System_Ip header file are of the same Software version */
  86. #if ((PLATFORM_PLATFORM_IPW_SW_MAJOR_VERSION != PLATFORM_SYSTEM_IP_SW_MAJOR_VERSION) || \
  87. (PLATFORM_PLATFORM_IPW_SW_MINOR_VERSION != PLATFORM_SYSTEM_IP_SW_MINOR_VERSION) || \
  88. (PLATFORM_PLATFORM_IPW_SW_PATCH_VERSION != PLATFORM_SYSTEM_IP_SW_PATCH_VERSION) \
  89. )
  90. #error "Software Version Numbers of Platform_Ipw.h and System_Ip.h are different"
  91. #endif
  92. /*==================================================================================================
  93. * GLOBAL VARIABLES
  94. ==================================================================================================*/
  95. extern uint32 VTABLE[((uint32)(INT_CTRL_IP_IRQ_MAX)) + 16U + 1U];
  96. /*==================================================================================================
  97. * FUNCTION PROTOTYPES
  98. ==================================================================================================*/
  99. #define PLATFORM_START_SEC_CODE
  100. #include "Platform_MemMap.h"
  101. /**
  102. * @internal
  103. * @brief Initializes the platform settings based on user configuration.
  104. */
  105. void Platform_Ipw_Init(const Platform_Ipw_ConfigType *pConfig);
  106. #if (PLATFORM_MSCM_CFG == STD_ON)
  107. /**
  108. * @internal
  109. * @brief Initializes the platform settings for non-core elements based on user configuration.
  110. */
  111. void Platform_Ipw_InitNonCore(const Platform_Ipw_NonCoreConfigType *pConfig);
  112. #endif
  113. /**
  114. * @internal
  115. * @brief Enables/disables an interrupt by calling the Interrupt Controller IP layer.
  116. */
  117. static inline void Platform_Ipw_SetIrq(IRQn_Type eIrqNumber, boolean bEnable)
  118. {
  119. if (bEnable)
  120. {
  121. IntCtrl_Ip_EnableIrq(eIrqNumber);
  122. }
  123. else
  124. {
  125. IntCtrl_Ip_DisableIrq(eIrqNumber);
  126. }
  127. }
  128. /**
  129. * @internal
  130. * @brief Sets the priority of an interrupt by calling the Interrupt Controller IP layer.
  131. */
  132. static inline void Platform_Ipw_SetIrqPriority(IRQn_Type eIrqNumber, uint8 u8Priority)
  133. {
  134. IntCtrl_Ip_SetPriority(eIrqNumber, u8Priority);
  135. }
  136. /**
  137. * @internal
  138. * @brief Returns the priority of an interrupt by calling the Interrupt Controller IP layer.
  139. */
  140. static inline uint8 Platform_Ipw_GetIrqPriority(IRQn_Type eIrqNumber)
  141. {
  142. return IntCtrl_Ip_GetPriority(eIrqNumber);
  143. }
  144. /**
  145. * @internal
  146. * @brief Installs a new interrupt handler by calling the Interrupt Controller IP layer.
  147. */
  148. static inline void Platform_Ipw_InstallIrqHandler(IRQn_Type eIrqNumber,
  149. const IntCtrl_Ip_IrqHandlerType pfNewHandler,
  150. IntCtrl_Ip_IrqHandlerType* const pfOldHandler)
  151. {
  152. IntCtrl_Ip_InstallHandler(eIrqNumber, pfNewHandler, pfOldHandler);
  153. }
  154. #define PLATFORM_STOP_SEC_CODE
  155. #include "Platform_MemMap.h"
  156. #endif /* PLATFORM_IPW_H_ */