Mcu_IPW_Irq.c 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. /**
  25. * @file Mcu_IPW_Irq.c
  26. * @version 1.0.0
  27. *
  28. * @brief AUTOSAR Mcu - Mcu driver header file.
  29. * @details AUTOSAR specific Mcu driver header file.
  30. * @addtogroup MCU_DRIVER Mcu Driver
  31. * @{
  32. */
  33. #ifdef __cplusplus
  34. extern "C"{
  35. #endif
  36. /*==================================================================================================
  37. * INCLUDE FILES
  38. * 1) system and project includes
  39. * 2) needed interfaces from external units
  40. * 3) internal and external interfaces from this unit
  41. ==================================================================================================*/
  42. /* Header file with prototype functions defines in this layer. */
  43. #include "Mcu_IPW.h"
  44. #include "Clock_Ip_Private.h"
  45. #include "Power_Ip_PMC.h"
  46. /*==================================================================================================
  47. SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define MCU_IPW_IRQ_VENDOR_ID_C 43
  50. #define MCU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C 4
  51. #define MCU_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C 4
  52. #define MCU_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C 0
  53. #define MCU_IPW_IRQ_SW_MAJOR_VERSION_C 1
  54. #define MCU_IPW_IRQ_SW_MINOR_VERSION_C 0
  55. #define MCU_IPW_IRQ_SW_PATCH_VERSION_C 0
  56. /*==================================================================================================
  57. * FILE VERSION CHECKS
  58. ==================================================================================================*/
  59. /* Check if Mcu_IPW_Irq.c file and Mcu_IPW_Irq.h file are of the same vendor */
  60. #if (MCU_IPW_IRQ_VENDOR_ID_C != MCU_IPW_VENDOR_ID)
  61. #error "Mcu_IPW_Irq.c and Mcu_IPW.h have different vendor ids"
  62. #endif
  63. /* Check if Mcu_IPW_Irq.c file and Mcu_IPW.h file are of the same Autosar version */
  64. #if ((MCU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != MCU_IPW_AR_RELEASE_MAJOR_VERSION) || \
  65. (MCU_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != MCU_IPW_AR_RELEASE_MINOR_VERSION) || \
  66. (MCU_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C != MCU_IPW_AR_RELEASE_REVISION_VERSION) \
  67. )
  68. #error "AutoSar Version Numbers of Mcu_IPW_Irq.c and Mcu_IPW.h are different"
  69. #endif
  70. /* Check if Mcu_IPW_Irq.c file and Mcu_IPW.h file are of the same Software version */
  71. #if ((MCU_IPW_IRQ_SW_MAJOR_VERSION_C != MCU_IPW_SW_MAJOR_VERSION) || \
  72. (MCU_IPW_IRQ_SW_MINOR_VERSION_C != MCU_IPW_SW_MINOR_VERSION) || \
  73. (MCU_IPW_IRQ_SW_PATCH_VERSION_C != MCU_IPW_SW_PATCH_VERSION) \
  74. )
  75. #error "Software Version Numbers of Mcu_IPW_Irq.c and Mcu_IPW.h are different"
  76. #endif
  77. /* Check if Mcu_IPW_Irq.c file and Clock_Ip_Private.h file are of the same vendor */
  78. #if (MCU_IPW_IRQ_VENDOR_ID_C != CLOCK_IP_PRIVATE_VENDOR_ID)
  79. #error "Mcu_IPW_Irq.c and Clock_Ip_Private.h have different vendor ids"
  80. #endif
  81. /* Check if Mcu_IPW_Irq.c file and Clock_Ip_Private.h file are of the same Autosar version */
  82. #if ((MCU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MAJOR_VERSION) || \
  83. (MCU_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_MINOR_VERSION) || \
  84. (MCU_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C != CLOCK_IP_PRIVATE_AR_RELEASE_REVISION_VERSION) \
  85. )
  86. #error "AutoSar Version Numbers of Mcu_IPW_Irq.c and Clock_Ip_Private.h are different"
  87. #endif
  88. /* Check if Mcu_IPW_Irq.c file and Clock_Ip_Private.h file are of the same Software version */
  89. #if ((MCU_IPW_IRQ_SW_MAJOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MAJOR_VERSION) || \
  90. (MCU_IPW_IRQ_SW_MINOR_VERSION_C != CLOCK_IP_PRIVATE_SW_MINOR_VERSION) || \
  91. (MCU_IPW_IRQ_SW_PATCH_VERSION_C != CLOCK_IP_PRIVATE_SW_PATCH_VERSION) \
  92. )
  93. #error "Software Version Numbers of Mcu_IPW_Irq.c and Clock_Ip_Private.h are different"
  94. #endif
  95. /* Check if Mcu_IPW_Irq.c file and Power_Ip_PMC.h file are of the same vendor */
  96. #if (MCU_IPW_IRQ_VENDOR_ID_C != POWER_IP_PMC_VENDOR_ID)
  97. #error "Mcu_IPW_Irq.c and Power_Ip_PMC.h have different vendor ids"
  98. #endif
  99. /* Check if Mcu_IPW_Irq.c file and Power_Ip_PMC.h file are of the same Autosar version */
  100. #if ((MCU_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != POWER_IP_PMC_AR_RELEASE_MAJOR_VERSION) || \
  101. (MCU_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != POWER_IP_PMC_AR_RELEASE_MINOR_VERSION) || \
  102. (MCU_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C != POWER_IP_PMC_AR_RELEASE_REVISION_VERSION) \
  103. )
  104. #error "AutoSar Version Numbers of Mcu_IPW_Irq.c and Power_Ip_PMC.h are different"
  105. #endif
  106. /* Check if Mcu_IPW_Irq.c file and Power_Ip_PMC.h file are of the same Software version */
  107. #if ((MCU_IPW_IRQ_SW_MAJOR_VERSION_C != POWER_IP_PMC_SW_MAJOR_VERSION) || \
  108. (MCU_IPW_IRQ_SW_MINOR_VERSION_C != POWER_IP_PMC_SW_MINOR_VERSION) || \
  109. (MCU_IPW_IRQ_SW_PATCH_VERSION_C != POWER_IP_PMC_SW_PATCH_VERSION) \
  110. )
  111. #error "Software Version Numbers of Mcu_IPW_Irq.c and Power_Ip_PMC.h are different"
  112. #endif
  113. /*==================================================================================================
  114. LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  115. ==================================================================================================*/
  116. /*==================================================================================================
  117. LOCAL MACROS
  118. ==================================================================================================*/
  119. /*==================================================================================================
  120. LOCAL CONSTANTS
  121. ==================================================================================================*/
  122. /*==================================================================================================
  123. LOCAL VARIABLES
  124. ==================================================================================================*/
  125. /*==================================================================================================
  126. GLOBAL CONSTANTS
  127. ==================================================================================================*/
  128. /*==================================================================================================
  129. GLOBAL VARIABLES
  130. ==================================================================================================*/
  131. /*==================================================================================================
  132. GLOBAL FUNCTION PROTOTYPES
  133. ==================================================================================================*/
  134. #define MCU_START_SEC_CODE
  135. #include "Mcu_MemMap.h"
  136. #if (MCU_CMU_PMC_SCG_INTERRUPT == STD_ON)
  137. ISR( Mcu_PMC_SCG_CMU_Isr );
  138. /*==================================================================================================
  139. GLOBAL FUNCTIONS
  140. ==================================================================================================*/
  141. /**
  142. * @brief This function represents the ISR handler for CMU PMC SCG related events.
  143. * @details This interrupt is triggered if one of the enabled CMU PMC SCG detect an out of range clock.
  144. * this function exist only on S32K11X.
  145. *
  146. *
  147. * @isr
  148. *
  149. */
  150. ISR( Mcu_PMC_SCG_CMU_Isr )
  151. {
  152. #if CMU_INSTANCES_ARRAY_SIZE > 0U
  153. if (Mcu_CMU_GetInterruptStatus(1U) != 0U)
  154. {
  155. #ifdef MCU_CMU_ERROR_ISR_USED
  156. #if (STD_ON == MCU_CMU_ERROR_ISR_USED)
  157. /* CMU1 interrupt */
  158. Mcu_CMU_ClockFailInt();
  159. #endif
  160. #endif
  161. }
  162. #endif
  163. #ifdef MCU_VOLTAGE_ERROR_ISR_USED
  164. #if (STD_ON == MCU_VOLTAGE_ERROR_ISR_USED)
  165. if (Power_Ip_PMC_GetInterruptStatus() != 0U)
  166. {
  167. /* PMC interrupt */
  168. Power_Ip_PMC_VoltageErrorIsr();
  169. }
  170. #endif
  171. #endif
  172. /* SCG Interrupt */
  173. EXIT_INTERRUPT();
  174. }
  175. #endif
  176. #define MCU_STOP_SEC_CODE
  177. #include "Mcu_MemMap.h"
  178. /*==================================================================================================
  179. LOCAL FUNCTION PROTOTYPES
  180. ==================================================================================================*/
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184. /** @} */