Wdg_ChannelTypes.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. #ifndef WDG_CHANNEL_TYPES_H
  25. #define WDG_CHANNEL_TYPES_H
  26. /**
  27. * @file
  28. *
  29. * @addtogroup Wdg
  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 "Wdg_Cfg_Defines.h"
  43. #include "WdgIf_Types.h"
  44. #include "Wdg_Ipw_Types.h"
  45. #if (WDG_DIRECT_SERVICE == STD_OFF)
  46. #include "Gpt.h"
  47. #endif
  48. /*==================================================================================================
  49. * SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define WDG_CHANNEL_TYPES_VENDOR_ID 43
  52. #define WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION 4
  53. #define WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION 4
  54. #define WDG_CHANNEL_TYPES_AR_RELEASE_REVISION_VERSION 0
  55. #define WDG_CHANNEL_TYPES_SW_MAJOR_VERSION 1
  56. #define WDG_CHANNEL_TYPES_SW_MINOR_VERSION 0
  57. #define WDG_CHANNEL_TYPES_SW_PATCH_VERSION 0
  58. /*==================================================================================================
  59. * FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. /* Check if current file and WDG configuration header file are of the same vendor */
  62. #if (WDG_CHANNEL_TYPES_VENDOR_ID != WDG_VENDOR_ID_CFG)
  63. #error "Wdg_ChannelType.h and Wdg_Cfg_Defines.h have different vendor ids"
  64. #endif
  65. /* Check if current file and Wdg_Cfg_Defines header file are of the same Autosar version */
  66. #if ((WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION != WDG_AR_RELEASE_MAJOR_VERSION_CFG) || \
  67. (WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION != WDG_AR_RELEASE_MINOR_VERSION_CFG) || \
  68. (WDG_CHANNEL_TYPES_AR_RELEASE_REVISION_VERSION != WDG_AR_RELEASE_REVISION_VERSION_CFG))
  69. #error "AutoSar Version Numbers of Wdg_ChannelType.h and Wdg_Cfg_Defines.h are different"
  70. #endif
  71. /* Check if current file and Wdg_Cfg_Defines header file are of the same software version */
  72. #if ((WDG_CHANNEL_TYPES_SW_MAJOR_VERSION != WDG_SW_MAJOR_VERSION_CFG) || \
  73. (WDG_CHANNEL_TYPES_SW_MINOR_VERSION != WDG_SW_MINOR_VERSION_CFG) || \
  74. (WDG_CHANNEL_TYPES_SW_PATCH_VERSION != WDG_SW_PATCH_VERSION_CFG))
  75. #error "Software Version Numbers of Wdg_ChannelType.h and Wdg_Cfg_Defines.h are different"
  76. #endif
  77. /* Check if current file and Wdg_Ipw_Types header file are of the same vendor */
  78. #if (WDG_CHANNEL_TYPES_VENDOR_ID != WDG_IPW_TYPES_VENDOR_ID)
  79. #error "Wdg_ChannelType.h and Wdg_Ipw_Types.h have different vendor ids"
  80. #endif
  81. #if ((WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION != WDG_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  82. (WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION != WDG_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
  83. (WDG_CHANNEL_TYPES_AR_RELEASE_REVISION_VERSION != WDG_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
  84. #error "AutoSar Version Numbers of Wdg_ChannelType.h and Wdg_Ipw_Types.h are different"
  85. #endif
  86. #if ((WDG_CHANNEL_TYPES_SW_MAJOR_VERSION != WDG_IPW_TYPES_SW_MAJOR_VERSION) || \
  87. (WDG_CHANNEL_TYPES_SW_MINOR_VERSION != WDG_IPW_TYPES_SW_MINOR_VERSION) || \
  88. (WDG_CHANNEL_TYPES_SW_PATCH_VERSION != WDG_IPW_TYPES_SW_PATCH_VERSION))
  89. #error "Software Version Numbers of Wdg_ChannelType.h and Wdg_Ipw_Types.h are different"
  90. #endif
  91. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  92. /* Check if source file and WdgIf_Types header file are of the same Autosar version */
  93. #if ((WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION != WDGIF_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  94. (WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION != WDGIF_TYPES_AR_RELEASE_MINOR_VERSION))
  95. #error "AutoSar Version Numbers of Wdg_ChannelType.h and WdgIf_Types.h are different"
  96. #endif
  97. /* Check if source file and Gpt header file are of the same Autosar version */
  98. #if (WDG_DIRECT_SERVICE == STD_OFF)
  99. #if (( WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION != GPT_AR_RELEASE_MAJOR_VERSION) || \
  100. ( WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION != GPT_AR_RELEASE_MINOR_VERSION))
  101. #error "AutoSar Version Numbers of Wdg_ChannelType.h and Gpt.h are different"
  102. #endif
  103. #endif
  104. /* Check if source file and Gpt header file are of the same Autosar version */
  105. #if (WDG_DIRECT_SERVICE == STD_OFF)
  106. #if (( WDG_CHANNEL_TYPES_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  107. ( WDG_CHANNEL_TYPES_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  108. #error "AutoSar Version Numbers of Wdg_ChannelType.h and StandardTypes.h are different"
  109. #endif
  110. #endif
  111. #endif /* DISABLE_MCAL_INTERMODULE_ASR_CHECK */
  112. /*==================================================================================================
  113. * CONSTANTS
  114. ==================================================================================================*/
  115. /*==================================================================================================
  116. * DEFINES AND MACROS
  117. ==================================================================================================*/
  118. /*==================================================================================================
  119. * ENUMS
  120. ==================================================================================================*/
  121. /**
  122. * @brief This enumerated type will contain the service ids for the watchodg functions
  123. *
  124. * @pre To define WDG_GETVERSION_ID, WDG_VERSION_INFO_API has to be equal to STD_ON
  125. *
  126. */
  127. typedef enum
  128. {
  129. #if (WDG_VERSION_INFO_API == STD_ON)
  130. WDG_GETVERSION_ID = 0x04, /*< @brief The service id for the Wdg_GetVersion function,
  131. used when using DET */
  132. #endif
  133. #if (WDG_DIRECT_SERVICE == STD_ON)
  134. WDG_SERVICE_ID = 0x05, /*< @brief The service id for the Wdg_Service function, used
  135. when using DET */
  136. #endif
  137. #if (WDG_DISABLE_ALLOWED == STD_ON)
  138. #if (WDG_CLEAR_RESET_REQUEST == STD_ON)
  139. WDG_CLEARRESETREQUEST_ID = 0x06, /*< @brief The service id for the Wdg_ClearResetRequest function, used
  140. when using DET */
  141. #endif
  142. #endif
  143. WDG_INIT_ID = 0x00, /*< @brief The service id for the Wdg_Init function, used
  144. when using DET */
  145. WDG_SETMODE_ID = 0x01, /*< @brief The service id for the Wdg_SetMode function, used
  146. when using DET */
  147. WDG_SETTRIGGERCONDITION_ID = 0x02, /*< @brief The service id for the Wdg_SetTriggerCondition function, used
  148. when using DET */
  149. WDG_TRIGGER_ID = 0x03 /*< @brief The service id for the Wdg_Cbk_GptNotification function, used
  150. when using DET */
  151. } Wdg_ServiceIdType;
  152. /**
  153. * @brief Indicates the aditional det errors used by the watchdog driver
  154. * @implements Wdg_ErrorIdType_enum
  155. */
  156. typedef enum
  157. {
  158. WDG_E_DRIVER_STATE = 0x10, /*< @brief API service used in wrong context (e.g. driver not
  159. initialized) */
  160. WDG_E_PARAM_MODE, /*< @brief = 0x11 API service called with wrong/inconsistent
  161. parameter(s) */
  162. WDG_E_PARAM_CONFIG, /*< @brief = 0x12 API service called with wrong/inconsistent
  163. parameter(s) */
  164. WDG_E_PARAM_TIMEOUT, /*< @brief = 0x13 API service called with wrong/inconsistent
  165. parameter(s) */
  166. WDG_E_PARAM_POINTER, /*< @brief = 0x14 Wdg_GetVersionInfo service called with
  167. NULL_PTR */
  168. WDG_E_INIT_FAILED, /*< @brief = 0x15 Invalid configuration set selection */
  169. } Wdg_ErrorIdType;
  170. /*==================================================================================================
  171. * STRUCTURES AND OTHER TYPEDEFS
  172. ==================================================================================================*/
  173. typedef struct
  174. {
  175. uint32 Wdg_u32TimerTriggeringPeriod;
  176. const Wdg_Ipw_ConfigType *Wdg_Ipw_pConfig;
  177. } Wdg_ModeType;
  178. /**
  179. * @brief Defines the configuration structure
  180. * @implements Wdg_ConfigType_struct
  181. */
  182. typedef struct
  183. {
  184. /**
  185. @brief The number of configured channels
  186. */
  187. const WdgIf_ModeType Wdg_DefaultMode;
  188. /**
  189. @brief The instance id
  190. */
  191. const Wdg_Ipw_InstanceType Wdg_Instance;
  192. #if (WDG_DIRECT_SERVICE == STD_OFF)
  193. /**
  194. @brief Gpt Channel configured
  195. */
  196. const Gpt_ChannelType Wdg_TimerChannel;
  197. /**
  198. @brief The frequency of the configured timer channel
  199. */
  200. const uint32 Wdg_u32TriggerSourceClock;
  201. #endif
  202. /**
  203. @brief Pointer to Watchdog Specific implementation details
  204. */
  205. const Wdg_ModeType *const Wdg_ModeSettings[3];
  206. } Wdg_ConfigType;
  207. /*==================================================================================================
  208. * GLOBAL VARIABLE DECLARATIONS
  209. ==================================================================================================*/
  210. /*==================================================================================================
  211. * FUNCTION PROTOTYPES
  212. ==================================================================================================*/
  213. #ifdef __cplusplus
  214. }
  215. #endif
  216. /** @} */
  217. #endif /*WDG_CHANNEL_TYPES_H*/