WdgIf.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : generic
  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 WDGIF_H
  25. #define WDGIF_H
  26. /**
  27. * @file WdgIf.h
  28. *
  29. * @addtogroup WdgIf
  30. * @{
  31. */
  32. #ifdef __cplusplus
  33. extern "C"{
  34. #endif
  35. /*==================================================================================================
  36. * INCLUDE FILES
  37. * 1) system and project includes
  38. * 2) needed interfaces from external units
  39. * 3) internal and external interfaces from this unit
  40. ==================================================================================================*/
  41. #include "StandardTypes.h"
  42. #include "WdgIf_Cfg.h"
  43. #include "WdgIf_Types.h"
  44. /*==================================================================================================
  45. * SOURCE FILE VERSION INFORMATION
  46. ==================================================================================================*/
  47. #define WDGIF_VENDOR_ID 43
  48. #define WDGIF_MODULE_ID 43
  49. #define WDGIF_AR_RELEASE_MAJOR_VERSION 4
  50. #define WDGIF_AR_RELEASE_MINOR_VERSION 4
  51. #define WDGIF_AR_RELEASE_REVISION_VERSION 0
  52. #define WDGIF_SW_MAJOR_VERSION 1
  53. #define WDGIF_SW_MINOR_VERSION 0
  54. #define WDGIF_SW_PATCH_VERSION 0
  55. /*==================================================================================================
  56. * FILE VERSION CHECKS
  57. ==================================================================================================*/
  58. /* Check if current file and WdgIf_Cfg header file are of the same vendor */
  59. #if ((WDGIF_VENDOR_ID != WDGIF_VENDOR_ID_CFG) \
  60. )
  61. #error "WdgIf.h and WdgIf_Cfg.h have different vendor ids"
  62. #endif
  63. /* Check if current file and WDGIF configuration header file are of the same Autosar version */
  64. #if ((WDGIF_AR_RELEASE_MAJOR_VERSION != WDGIF_AR_RELEASE_MAJOR_VERSION_CFG) || \
  65. (WDGIF_AR_RELEASE_MINOR_VERSION != WDGIF_AR_RELEASE_MINOR_VERSION_CFG) || \
  66. (WDGIF_AR_RELEASE_REVISION_VERSION != WDGIF_AR_RELEASE_REVISION_VERSION_CFG))
  67. #error "AutoSar Version Numbers of WdgIf.h and WdgIf_Cfg.h are different"
  68. #endif
  69. /* Check if current file and WDGIF configuration header file are of the same software version */
  70. #if ((WDGIF_SW_MAJOR_VERSION != WDGIF_SW_MAJOR_VERSION_CFG) || \
  71. (WDGIF_SW_MINOR_VERSION != WDGIF_SW_MINOR_VERSION_CFG) || \
  72. (WDGIF_SW_PATCH_VERSION != WDGIF_SW_PATCH_VERSION_CFG))
  73. #error "Software Version Numbers of WdgIf.h and WdgIf_Cfg.h are different"
  74. #endif
  75. /* Check if current file and StandardTypes header file are of the same Autosar version */
  76. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  77. #if ((WDGIF_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  78. (WDGIF_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  79. #error "AutoSar Version Numbers of WdgIf.h and StandardTypes.h are different"
  80. #endif
  81. #endif
  82. /* Check if current file and WdgIf_Types header file are of the same vendor.*/
  83. #if (WDGIF_VENDOR_ID != WDGIF_TYPES_VENDOR_ID)
  84. #error "WdgIf.h and WdgIf_Types.h have different vendor ids"
  85. #endif
  86. /* Check if current file and WDGIF configuration header file are of the same Autosar version */
  87. #if ((WDGIF_AR_RELEASE_MAJOR_VERSION != WDGIF_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  88. (WDGIF_AR_RELEASE_MINOR_VERSION != WDGIF_TYPES_AR_RELEASE_MINOR_VERSION) || \
  89. (WDGIF_AR_RELEASE_REVISION_VERSION != WDGIF_TYPES_AR_RELEASE_REVISION_VERSION))
  90. #error "AutoSar Version Numbers of WdgIf.h and WdgIf_Types.h are different"
  91. #endif
  92. /* Check if current file and WDGIF configuration header file are of the same software version */
  93. #if ((WDGIF_SW_MAJOR_VERSION != WDGIF_TYPES_SW_MAJOR_VERSION) || \
  94. (WDGIF_SW_MINOR_VERSION != WDGIF_TYPES_SW_MINOR_VERSION) || \
  95. (WDGIF_SW_PATCH_VERSION != WDGIF_TYPES_SW_PATCH_VERSION))
  96. #error "Software Version Numbers of WdgIf.h and WdgIf_Types.h are different"
  97. #endif
  98. /*==================================================================================================
  99. * CONSTANTS
  100. ==================================================================================================*/
  101. extern const WdgIf_SetModeFctPtrType WdgIf_SetModeFctPtr[];
  102. #if (WDG_DIRECT_SERVICE == STD_OFF)
  103. extern const WdgIf_SetTriggerFctPtrType WdgIf_SetTriggerConditionFctPtr[];
  104. #endif
  105. /*==================================================================================================
  106. * DEFINES AND MACROS
  107. ==================================================================================================*/
  108. /**
  109. * @brief This define indicates the error detectable by the Watchdog Driver Interface
  110. */
  111. #define WDGIF_E_PARAM_DEVICE (uint8)0x01
  112. /**
  113. * @brief Service id for the setmode function
  114. */
  115. #define WDGIF_SETMODE_ID (uint8)0x01
  116. /**
  117. * @brief Service id for the trigger function
  118. */
  119. #define WDGIF_TRIGGER_ID (uint8)0x02
  120. /**
  121. * @brief Define the setmode function
  122. */
  123. #define WdgIf_SetMode(DeviceIndex, WdgMode) WdgIf_SetModeFctPtr[DeviceIndex](WdgMode)
  124. /**
  125. * @brief Define the setmode function
  126. */
  127. #define WdgIf_SetTriggerCondition(DeviceIndex, Timeout) WdgIf_SetTriggerConditionFctPtr[DeviceIndex](Timeout)
  128. #if (WDGIF_VERSION_INFO_API==STD_ON)
  129. /**
  130. * @brief Service id for the trigger function
  131. */
  132. #define WDGIF_VERSION_ID (uint8)0x03
  133. /**
  134. * @brief WdgIf_GetVersionInfo function
  135. */
  136. #define WdgIf_GetVersionInfo(versioninfo) { (versioninfo)->vendorID = WDGIF_VENDOR_ID; \
  137. (versioninfo)->moduleID = WDGIF_MODULE_ID; \
  138. (versioninfo)->sw_major_version = WDGIF_SW_MAJOR_VERSION; \
  139. (versioninfo)->sw_minor_version = WDGIF_SW_MINOR_VERSION; \
  140. (versioninfo)->sw_patch_version = WDGIF_SW_PATCH_VERSION; \
  141. }
  142. #endif /* WDGIF_VERSION_INFO_API==STD_ON */
  143. /*==================================================================================================
  144. * STRUCTURES AND OTHER TYPEDEFS
  145. ==================================================================================================*/
  146. /*==================================================================================================
  147. * GLOBAL VARIABLE DECLARATIONS
  148. ==================================================================================================*/
  149. /*==================================================================================================
  150. * FUNCTION PROTOTYPES
  151. ==================================================================================================*/
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155. /** @} */
  156. #endif /* WDGIF_H */