Wdg_Ipw_Irq.c 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : Wdog,Ewm
  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
  26. *
  27. * @addtogroup Wdg
  28. * @{
  29. */
  30. #ifdef __cplusplus
  31. extern "C"{
  32. #endif
  33. /*==================================================================================================
  34. * INCLUDE FILES
  35. * 1) system and project includes
  36. * 2) needed interfaces from external units
  37. * 3) internal and external interfaces from this unit
  38. ==================================================================================================*/
  39. #include "Mcal.h"
  40. #include "Wdg_Ipw_Cfg_Defines.h"
  41. #include "OsIf.h"
  42. /*==================================================================================================
  43. * SOURCE FILE VERSION INFORMATION
  44. ==================================================================================================*/
  45. #define WDG_IPW_IRQ_VENDOR_ID_C 43
  46. #define WDG_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C 4
  47. #define WDG_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C 4
  48. #define WDG_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C 0
  49. #define WDG_IPW_IRQ_SW_MAJOR_VERSION_C 1
  50. #define WDG_IPW_IRQ_SW_MINOR_VERSION_C 0
  51. #define WDG_IPW_IRQ_SW_PATCH_VERSION_C 0
  52. /*==================================================================================================
  53. * FILE VERSION CHECKS
  54. ==================================================================================================*/
  55. /* Check if current file and Wdog_Ip_Cfg_Defines configuration header file are of the same vendor */
  56. #if (WDG_IPW_IRQ_VENDOR_ID_C != WDG_IPW_CFG_DEFINES_VENDOR_ID)
  57. #error "Wdog_Ip_Irq.c and Wdog_Ip_Cfg_Defines.h have different vendor ids"
  58. #endif
  59. #if ((WDG_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != WDG_IPW_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION) || \
  60. (WDG_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != WDG_IPW_CFG_DEFINES_AR_RELEASE_MINOR_VERSION) || \
  61. (WDG_IPW_IRQ_AR_RELEASE_REVISION_VERSION_C != WDG_IPW_CFG_DEFINES_AR_RELEASE_REVISION_VERSION))
  62. #error "AutoSar Version Numbers of Wdog_Ip_Irq.c and Wdog_Ip_Cfg_Defines.h are different"
  63. #endif
  64. #if ((WDG_IPW_IRQ_SW_MAJOR_VERSION_C != WDG_IPW_CFG_DEFINES_SW_MAJOR_VERSION) || \
  65. (WDG_IPW_IRQ_SW_MINOR_VERSION_C != WDG_IPW_CFG_DEFINES_SW_MINOR_VERSION) || \
  66. (WDG_IPW_IRQ_SW_PATCH_VERSION_C != WDG_IPW_CFG_DEFINES_SW_PATCH_VERSION))
  67. #error "Software Version Numbers of Wdog_Ip_Irq.c and Wdog_Ip_Cfg_Defines.h are different"
  68. #endif
  69. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  70. /* Check if current file and Mcal header file are of the same Autosar version */
  71. #if ((WDG_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  72. (WDG_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != MCAL_AR_RELEASE_MINOR_VERSION))
  73. #error "AutoSar Version Numbers of Wdog_Ip_Irq.c and Mcal.h are different"
  74. #endif
  75. #endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */
  76. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  77. /* Check if current file and OsIf header file are of the same Autosar version */
  78. #if ((WDG_IPW_IRQ_AR_RELEASE_MAJOR_VERSION_C != OSIF_AR_RELEASE_MAJOR_VERSION) || \
  79. (WDG_IPW_IRQ_AR_RELEASE_MINOR_VERSION_C != OSIF_AR_RELEASE_MINOR_VERSION))
  80. #error "AutoSar Version Numbers of Wdog_Ipw_Irq.c and OsIf.h are different"
  81. #endif
  82. #endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */
  83. /*==================================================================================================
  84. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  85. ==================================================================================================*/
  86. /*==================================================================================================
  87. * LOCAL MACROS
  88. ==================================================================================================*/
  89. /*==================================================================================================
  90. * LOCAL CONSTANTS
  91. ==================================================================================================*/
  92. /*==================================================================================================
  93. * LOCAL VARIABLES
  94. ==================================================================================================*/
  95. /*==================================================================================================
  96. * GLOBAL CONSTANTS
  97. ==================================================================================================*/
  98. /*==================================================================================================
  99. * GLOBAL VARIABLES
  100. ==================================================================================================*/
  101. /*==================================================================================================
  102. * LOCAL FUNCTION PROTOTYPES
  103. ==================================================================================================*/
  104. /*==================================================================================================
  105. * LOCAL FUNCTIONS
  106. ==================================================================================================*/
  107. /*==================================================================================================
  108. GLOBAL FUNCTIONS PROTOTYPES
  109. ==================================================================================================*/
  110. #ifdef WDG_ROM
  111. #if (WDG_ROM == 1U)
  112. #define WDG_START_SEC_CODE
  113. #endif
  114. #else
  115. #if (WDG_RAM == 0U)
  116. #define WDG_START_SEC_RAMCODE
  117. #endif
  118. #endif
  119. #include "Wdg_MemMap.h"
  120. /* Common interrupt for Wdg IPS - EWM and WDOG */
  121. #if ((WDG_IPW_ISR0_USED == STD_ON) || (WDG_IPW_ISR1_USED == STD_ON))
  122. ISR(Wdg_Ipw_Isr);
  123. #endif
  124. /*==================================================================================================
  125. * GLOBAL FUNCTIONS
  126. ==================================================================================================*/
  127. #if (WDG_IPW_ISR0_USED == STD_ON)
  128. extern void Wdog_Ip_IrqHandler(uint8 Instance);
  129. #endif
  130. #if (WDG_IPW_ISR1_USED == STD_ON)
  131. extern void Ewm_Ip_IrqHandler(uint8 Instance);
  132. #endif
  133. #if ((WDG_IPW_ISR0_USED == STD_ON) || (WDG_IPW_ISR1_USED == STD_ON))
  134. /**
  135. * @brief Wdg_Ipw handler for timeout interrupt.
  136. * @details This function implements the ISR occurring on a Wdg timeout.
  137. *
  138. * @isr
  139. *
  140. */
  141. ISR(Wdg_Ipw_Isr)
  142. {
  143. #if (WDG_IPW_ISR0_USED == STD_ON)
  144. Wdog_Ip_IrqHandler(0U);
  145. #endif
  146. #if (WDG_IPW_ISR1_USED == STD_ON)
  147. Ewm_Ip_IrqHandler(0U);
  148. #endif
  149. EXIT_INTERRUPT();
  150. }
  151. #endif /* ((WDG_IPW_ISR0_USED == STD_ON) || (WDG_IPW_ISR1_USED == STD_ON)) */
  152. #ifdef WDG_ROM
  153. #if (WDG_ROM == 1U)
  154. #define WDG_STOP_SEC_CODE
  155. #endif
  156. #else
  157. #if (WDG_RAM == 0U)
  158. #define WDG_STOP_SEC_RAMCODE
  159. #endif
  160. #endif
  161. #include "Wdg_MemMap.h"
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165. /** @} */