Dem.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral :
  5. * Dependencies :
  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 DEM_H
  25. #define DEM_H
  26. /**
  27. * @file Dem.h
  28. *
  29. * @addtogroup DEM_MODULE
  30. * @{
  31. */
  32. #ifdef __cplusplus
  33. extern "C"{
  34. #endif
  35. /*
  36. * @page misra_violations MISRA-C:2012 violations
  37. *
  38. * @section Dem_h_REF_1
  39. * Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once.
  40. * This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
  41. *
  42. * @section Dem_h_REF_2
  43. * Violates MISRA 2012 Advisory Rule 20.1, #Include directives should only be preceded by preprocessor directives or comments.
  44. * <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
  45. */
  46. /*==================================================================================================
  47. * INCLUDE FILES
  48. * 1) system and project includes
  49. * 2) needed interfaces from external units
  50. * 3) internal and external interfaces from this unit
  51. ==================================================================================================*/
  52. #include "Std_Types.h"
  53. #include "Dem_IntErrId.h"
  54. #include "Dem_Types.h"
  55. #include "Rte_Dem_Type.h"
  56. /*==================================================================================================
  57. * SOURCE FILE VERSION INFORMATION
  58. ==================================================================================================*/
  59. #define DEM_VENDOR_ID 43
  60. #define DEM_MODULE_ID 54
  61. #define DEM_AR_RELEASE_MAJOR_VERSION 4
  62. #define DEM_AR_RELEASE_MINOR_VERSION 4
  63. #define DEM_AR_RELEASE_REVISION_VERSION 0
  64. #define DEM_SW_MAJOR_VERSION 1
  65. #define DEM_SW_MINOR_VERSION 0
  66. #define DEM_SW_PATCH_VERSION 0
  67. /*==================================================================================================
  68. * FILE VERSION CHECKS
  69. ==================================================================================================*/
  70. #if (DEM_VENDOR_ID != DEM_INTERRID_VENDOR_ID)
  71. #error "Dem.h and Dem_IntErrId.h have different vendor ids"
  72. #endif
  73. #if ((DEM_AR_RELEASE_MAJOR_VERSION != DEM_INTERRID_AR_RELEASE_MAJOR_VERSION) || \
  74. (DEM_AR_RELEASE_MINOR_VERSION != DEM_INTERRID_AR_RELEASE_MINOR_VERSION) || \
  75. (DEM_AR_RELEASE_REVISION_VERSION != DEM_INTERRID_AR_RELEASE_REVISION_VERSION))
  76. #error "AutoSar Version Numbers of Dem.h and Dem_IntErrId.h are different"
  77. #endif
  78. #if ((DEM_SW_MAJOR_VERSION != DEM_INTERRID_SW_MAJOR_VERSION) || \
  79. (DEM_SW_MINOR_VERSION != DEM_INTERRID_SW_MINOR_VERSION) || \
  80. (DEM_SW_PATCH_VERSION != DEM_INTERRID_SW_PATCH_VERSION))
  81. #error "Software Version Numbers of Dem.h and Dem_IntErrId.h are different"
  82. #endif
  83. #if (DEM_VENDOR_ID != DEM_TYPES_VENDOR_ID)
  84. #error "Dem.h and Dem_Types.h have different vendor ids"
  85. #endif
  86. #if ((DEM_AR_RELEASE_MAJOR_VERSION != DEM_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  87. (DEM_AR_RELEASE_MINOR_VERSION != DEM_TYPES_AR_RELEASE_MINOR_VERSION) || \
  88. (DEM_AR_RELEASE_REVISION_VERSION != DEM_TYPES_AR_RELEASE_REVISION_VERSION))
  89. #error "AutoSar Version Numbers of Dem.h and Dem_Types.h are different"
  90. #endif
  91. #if ((DEM_SW_MAJOR_VERSION != DEM_TYPES_SW_MAJOR_VERSION) || \
  92. (DEM_SW_MINOR_VERSION != DEM_TYPES_SW_MINOR_VERSION) || \
  93. (DEM_SW_PATCH_VERSION != DEM_TYPES_SW_PATCH_VERSION))
  94. #error "Software Version Numbers of Dem.h and Dem_Types.h are different"
  95. #endif
  96. /*==================================================================================================
  97. * CONSTANTS
  98. ==================================================================================================*/
  99. /*==================================================================================================
  100. * DEFINES AND MACROS
  101. ==================================================================================================*/
  102. /* Max length value of extended data kept by Dem when Dem_ReportErrorStatusPreExtData() API is called */
  103. #define DEM_MAX_EXTENDED_DATA_LENGTH_U8 (uint8)(100U)
  104. /* Max numbers of ECU cores supported */
  105. #define DEM_NO_ECU_CORES (uint8)(1U)
  106. /* Length value of DEM event ID */
  107. #define DEM_EVENT_ID (uint8)(127U)
  108. /* Length value of DEM enven status */
  109. #define DEM_EVENT_STATUS (uint8)(127U)
  110. /*==================================================================================================
  111. * ENUMS
  112. ==================================================================================================*/
  113. /*==================================================================================================
  114. * STRUCTURES AND OTHER TYPEDEFS
  115. ==================================================================================================*/
  116. /*==================================================================================================
  117. * GLOBAL VARIABLE DECLARATIONS
  118. ==================================================================================================*/
  119. #define DEM_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  120. /*
  121. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  122. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  123. */
  124. #include "Dem_MemMap.h"
  125. extern Dem_EventIdType Dem_EventId[DEM_NO_ECU_CORES][DEM_EVENT_ID]; /**< @brief DEM event ID*/
  126. extern Dem_EventStatusType Dem_EventStatus[DEM_NO_ECU_CORES][DEM_EVENT_STATUS]; /**< @brief DEM event status*/
  127. #define DEM_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  128. /*
  129. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  130. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  131. */
  132. #include "Dem_MemMap.h"
  133. #define DEM_START_SEC_VAR_CLEARED_8_NO_CACHEABLE
  134. /*
  135. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  136. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  137. */
  138. #include "Dem_MemMap.h"
  139. extern uint8 Dem_OverflowEvent[DEM_NO_ECU_CORES]; /**< @brief DEM Overflow Event*/
  140. /**< @brief DEM byte array storing reported extended data */
  141. extern uint8 Dem_au8ExtendedData[DEM_NO_ECU_CORES][DEM_MAX_EXTENDED_DATA_LENGTH_U8];
  142. #define DEM_STOP_SEC_VAR_CLEARED_8_NO_CACHEABLE
  143. /*
  144. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  145. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  146. */
  147. #include "Dem_MemMap.h"
  148. #define DEM_START_SEC_VAR_CLEARED_32_NO_CACHEABLE
  149. /*
  150. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  151. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  152. */
  153. #include "Dem_MemMap.h"
  154. extern uint32 Dem_numEventErrors[DEM_NO_ECU_CORES]; /**< @brief DEM event number of errors*/
  155. #define DEM_STOP_SEC_VAR_CLEARED_32_NO_CACHEABLE
  156. /*
  157. * @violates @ref Dem_h_REF_1 Precautions shall be taken in order to prevent the contents of a header file being included more than once
  158. * @violates @ref Dem_h_REF_2 #Include directives should only be preceded by preprocessor directives or comments
  159. */
  160. #include "Dem_MemMap.h"
  161. /*==================================================================================================
  162. * FUNCTION PROTOTYPES
  163. ==================================================================================================*/
  164. #define DEM_START_SEC_CODE
  165. #include "Dem_MemMap.h"
  166. Std_ReturnType Dem_SetEventStatus(Dem_EventIdType EventId, Dem_EventStatusType EventStatus);
  167. Std_ReturnType Dem_ReportErrorStatusPreExtData(Dem_EventIdType Dem_EventIdRaw,
  168. Dem_EventStatusType Dem_EventStatusRaw,
  169. const uint8 * const Dem_pui8_PreExtData,
  170. uint8 Dem_PreExtDataSize);
  171. #define DEM_STOP_SEC_CODE
  172. #include "Dem_MemMap.h"
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176. /** @} */
  177. #endif /* DEM_H */