Mcu_Dem_Wrapper.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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_Mcu_Dem_Wrapper.h
  26. * @version 1.0.0
  27. *
  28. * @brief AUTOSAR Mcu - Convenience macros for DEM.
  29. * @details Contains convenience macros for DEM calls to reduce code clutter in IPs.
  30. * @addtogroup MCU_DRIVER Mcu Driver
  31. * @{
  32. */
  33. #ifndef MCU_DEM_WRAPPER_H
  34. #define MCU_DEM_WRAPPER_H
  35. #ifdef __cplusplus
  36. extern "C"{
  37. #endif
  38. /*==================================================================================================
  39. INCLUDE FILES
  40. 1) system and project includes
  41. 2) needed interfaces from external units
  42. 3) internal and external interfaces from this unit
  43. ==================================================================================================*/
  44. #include "Mcu_Cfg.h"
  45. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  46. #include "Dem.h"
  47. #endif
  48. /*==================================================================================================
  49. SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define MCU_DEM_WRAPPER_VENDOR_ID 43
  52. #define MCU_DEM_WRAPPER_AR_RELEASE_MAJOR_VERSION 4
  53. #define MCU_DEM_WRAPPER_AR_RELEASE_MINOR_VERSION 4
  54. #define MCU_DEM_WRAPPER_AR_RELEASE_REVISION_VERSION 0
  55. #define MCU_DEM_WRAPPER_SW_MAJOR_VERSION 1
  56. #define MCU_DEM_WRAPPER_SW_MINOR_VERSION 0
  57. #define MCU_DEM_WRAPPER_SW_PATCH_VERSION 0
  58. /*==================================================================================================
  59. * FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. /* Check if header file and Mcu_Cfg.h file are of the same vendor */
  62. #if (MCU_DEM_WRAPPER_VENDOR_ID != MCU_CFG_VENDOR_ID)
  63. #error "Mcu_Dem_Wrapper.h and Mcu_Cfg.h have different vendor ids"
  64. #endif
  65. /* Check if header file and Mcu_Cfg.h file are of the same Autosar version */
  66. #if ((MCU_DEM_WRAPPER_AR_RELEASE_MAJOR_VERSION != MCU_CFG_AR_RELEASE_MAJOR_VERSION) || \
  67. (MCU_DEM_WRAPPER_AR_RELEASE_MINOR_VERSION != MCU_CFG_AR_RELEASE_MINOR_VERSION) || \
  68. (MCU_DEM_WRAPPER_AR_RELEASE_REVISION_VERSION != MCU_CFG_AR_RELEASE_REVISION_VERSION) \
  69. )
  70. #error "AutoSar Version Numbers of Mcu_Dem_Wrapper.h and Mcu_Cfg.h are different"
  71. #endif
  72. /* Check if header file and Mcu_Cfg.h file are of the same Software version */
  73. #if ((MCU_DEM_WRAPPER_SW_MAJOR_VERSION != MCU_CFG_SW_MAJOR_VERSION) || \
  74. (MCU_DEM_WRAPPER_SW_MINOR_VERSION != MCU_CFG_SW_MINOR_VERSION) || \
  75. (MCU_DEM_WRAPPER_SW_PATCH_VERSION != MCU_CFG_SW_PATCH_VERSION) \
  76. )
  77. #error "Software Version Numbers of Mcu_Dem_Wrapper.h and Mcu_Cfg.h are different"
  78. #endif
  79. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  80. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  81. /* Check if header file and Dem.h file are of the same Autosar version */
  82. #if ((MCU_DEM_WRAPPER_AR_RELEASE_MAJOR_VERSION != DEM_AR_RELEASE_MAJOR_VERSION) || \
  83. (MCU_DEM_WRAPPER_AR_RELEASE_MINOR_VERSION != DEM_AR_RELEASE_MINOR_VERSION))
  84. #error "AutoSar Version Numbers of Mcu_Dem_Wrapper.h and Dem.h are different"
  85. #endif
  86. #endif
  87. #endif
  88. /*==================================================================================================
  89. CONSTANTS
  90. ==================================================================================================*/
  91. /*==================================================================================================
  92. DEFINES AND MACROS
  93. ==================================================================================================*/
  94. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  95. #define Mcu_Macro_ReportDemTimeoutError() (Mcu_ReportDemTimeoutError())
  96. #define Mcu_Macro_ReportDemFxoscConfigurationError() (Mcu_ReportDemFxoscError())
  97. #define Mcu_Macro_ReportDemClockMuxSwitchError() (Mcu_ReportDemClockMuxSwitchError())
  98. #define Mcu_Macro_ReportDemSwitchModeError() (Mcu_ReportDemSwitchModeError())
  99. #endif
  100. /*==================================================================================================
  101. ENUMS
  102. ==================================================================================================*/
  103. /*==================================================================================================
  104. STRUCTURES AND OTHER TYPEDEFS
  105. ==================================================================================================*/
  106. /*==================================================================================================
  107. GLOBAL VARIABLE DECLARATIONS
  108. ==================================================================================================*/
  109. /*==================================================================================================
  110. FUNCTION PROTOTYPES
  111. ==================================================================================================*/
  112. #define MCU_START_SEC_CODE
  113. #include "Mcu_MemMap.h"
  114. #if (MCU_DISABLE_DEM_REPORT_ERROR_STATUS == STD_OFF)
  115. /*!
  116. * @brief Reports timeout error to DEM.
  117. *
  118. * Checks if the timeout expired and reports the timeout error to DEM if that is the case.
  119. *
  120. * @param[in] u32Timeout Maximum timeout to be waited.
  121. *
  122. * @return void.
  123. */
  124. void Mcu_ReportDemTimeoutError(void);
  125. /*!
  126. * @brief Reports incorrect FXOSC configuration to DEM.
  127. *
  128. * Directly reports the FXOSC configuration error to DEM.
  129. *
  130. * @param[in] void.
  131. *
  132. * @return void.
  133. */
  134. void Mcu_ReportDemFxoscError(void);
  135. /*!
  136. * @brief Reports failed clock multiplexer switch to DEM.
  137. *
  138. * Directly reports the clock multiplexer switch error to DEM.
  139. *
  140. * @param[in] void.
  141. *
  142. * @return void.
  143. */
  144. void Mcu_ReportDemClockMuxSwitchError(void);
  145. /*!
  146. * @brief Reports failed switch mode to DEM.
  147. *
  148. * Directly reports the clock multiplexer switch error to DEM.
  149. *
  150. * @param[in] void.
  151. *
  152. * @return void.
  153. */
  154. void Mcu_ReportDemSwitchModeError(void);
  155. #endif
  156. #define MCU_STOP_SEC_CODE
  157. #include "Mcu_MemMap.h"
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161. #endif /* MCU_DEM_WRAPPER_H */
  162. /** @} */