Gpt_Cfg.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : Ftm_Srtc_Lptmr_LPit
  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 GPT_CFG_H
  25. #define GPT_CFG_H
  26. /**
  27. * @file Gpt_Cfg.h
  28. *
  29. * @addtogroup gpt Gpt Driver
  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 "Gpt_VS_0_PBcfg.h"
  43. /*==================================================================================================
  44. * SOURCE FILE VERSION INFORMATION
  45. ==================================================================================================*/
  46. #define GPT_VENDOR_ID_CFG 43
  47. #define GPT_AR_RELEASE_MAJOR_VERSION_CFG 4
  48. #define GPT_AR_RELEASE_MINOR_VERSION_CFG 4
  49. #define GPT_AR_RELEASE_REVISION_VERSION_CFG 0
  50. #define GPT_SW_MAJOR_VERSION_CFG 1
  51. #define GPT_SW_MINOR_VERSION_CFG 0
  52. #define GPT_SW_PATCH_VERSION_CFG 0
  53. /*==================================================================================================
  54. * FILE VERSION CHECKS
  55. ==================================================================================================*/
  56. /* Check if source file and GPT configuration header file are of the same vendor */
  57. #if (GPT_VENDOR_ID_VS_0_PBCFG_H != GPT_VENDOR_ID_CFG)
  58. #error "Gpt_VS_0_PBcfg.h and Gpt_Cfg.h have different vendor IDs"
  59. #endif
  60. /* Check if header file and Gpt configuration header file are of the same Autosar version */
  61. #if ((GPT_AR_RELEASE_MAJOR_VERSION_VS_0_PBCFG_H != GPT_AR_RELEASE_MAJOR_VERSION_CFG) || \
  62. (GPT_AR_RELEASE_MINOR_VERSION_VS_0_PBCFG_H != GPT_AR_RELEASE_MINOR_VERSION_CFG) || \
  63. (GPT_AR_RELEASE_REVISION_VERSION_VS_0_PBCFG_H != GPT_AR_RELEASE_REVISION_VERSION_CFG) \
  64. )
  65. #error "AutoSar Version Numbers of Gpt_VS_0_PBcfg.h and Gpt_Cfg.h are different"
  66. #endif
  67. /* Check if header file and Gpt configuration header file are of the same software version */
  68. #if ((GPT_SW_MAJOR_VERSION_VS_0_PBCFG_H != GPT_SW_MAJOR_VERSION_CFG) || \
  69. (GPT_SW_MINOR_VERSION_VS_0_PBCFG_H != GPT_SW_MINOR_VERSION_CFG) || \
  70. (GPT_SW_PATCH_VERSION_VS_0_PBCFG_H != GPT_SW_PATCH_VERSION_CFG) \
  71. )
  72. #error "Software Version Numbers of Gpt_VS_0_PBcfg.h and Gpt_Cfg.h are different"
  73. #endif
  74. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  75. #if ((GPT_AR_RELEASE_MAJOR_VERSION_CFG != STD_AR_RELEASE_MAJOR_VERSION) || \
  76. (GPT_AR_RELEASE_MINOR_VERSION_CFG != STD_AR_RELEASE_MINOR_VERSION))
  77. #error "AutoSar Version Numbers of Gpt_Cfg.h and StandardTypes.h are different"
  78. #endif
  79. #endif
  80. /*==================================================================================================
  81. * CONSTANTS
  82. ==================================================================================================*/
  83. /*==================================================================================================
  84. * DEFINES AND MACROS
  85. ==================================================================================================*/
  86. /**
  87. * @brief GPT_DEV_ERROR_DETECT switch
  88. * @details Enable/disable GPT_DEV_ERROR_DETECT.
  89. */
  90. #define GPT_DEV_ERROR_DETECT (STD_ON)
  91. /*================================================================================================*/
  92. /**
  93. * @brief GPT_REPORT_WAKEUP_SOURCE switch
  94. * @details Enable/disable GPT_REPORT_WAKEUP_SOURCE.
  95. */
  96. #define GPT_REPORT_WAKEUP_SOURCE (STD_ON)
  97. /*================================================================================================*/
  98. /**
  99. * @brief GPT_VERSION_INFO_API switch
  100. * @details Enable/disable GPT_VERSION_INFO_API.
  101. */
  102. #define GPT_VERSION_INFO_API (STD_OFF)
  103. /*================================================================================================*/
  104. /**
  105. * @brief GPT_DEINIT_API switch
  106. * @details Enable/disable GPT_DEINIT_API.
  107. */
  108. #define GPT_DEINIT_API (STD_ON)
  109. /*================================================================================================*/
  110. /**
  111. * @brief GPT_TIME_ELAPSED_API switch
  112. * @details Enable/disable GPT_VERSION_INFO_API.
  113. */
  114. #define GPT_TIME_ELAPSED_API (STD_ON)
  115. /*================================================================================================*/
  116. /**
  117. * @brief GPT_TIME_REMAINING_API switch
  118. * @details Enable/disable GPT_VERSION_INFO_API.
  119. */
  120. #define GPT_TIME_REMAINING_API (STD_ON)
  121. /*================================================================================================*/
  122. /**
  123. * @brief GPT_ENABLE_DISABLE_NOTIFICATION_API switch
  124. * @details Enable/disable GPT_VERSION_INFO_API.
  125. */
  126. #define GPT_ENABLE_DISABLE_NOTIFICATION_API (STD_ON)
  127. /*================================================================================================*/
  128. /**
  129. * @brief GPT_WAKEUP_FUNCTIONALITY_API switch
  130. * @details Enable/disable GPT_VERSION_INFO_API.
  131. */
  132. #define GPT_WAKEUP_FUNCTIONALITY_API (STD_ON)
  133. /*================================================================================================*/
  134. /**
  135. * @brief GPT_CHANGE_NEXT_TIMEOUT_VALUE switch
  136. * @details Enable/disable support for changing timeout value during timer running
  137. */
  138. #define GPT_CHANGE_NEXT_TIMEOUT_VALUE (STD_ON)
  139. /*================================================================================================*/
  140. /**
  141. * @brief GPT_SET_CLOCK_MODE switch
  142. * @details Enable/disable API for Dual Mode support.
  143. */
  144. #define GPT_SET_CLOCK_MODE (STD_OFF)
  145. /*================================================================================================*/
  146. /**
  147. * @brief GPT_CHAIN_MODE switch
  148. * @details Enable/disable API for Chain Mode.
  149. */
  150. #define GPT_CHAIN_MODE (STD_OFF)
  151. /*================================================================================================*/
  152. /**
  153. * @brief GPT_STANDBY_WAKEUP_SUPPORT switch
  154. * @details Support for GPT Standby wakeup.
  155. * The driver shall NOT CLEAR the interrupt flag,
  156. * the interrupt enable bit and also should not disable the counter, during init *(Gpt_Rtc_Init()) the flag is already set.
  157. *
  158. */
  159. #define GPT_STANDBY_WAKEUP_SUPPORT (STD_ON)
  160. /*================================================================================================*/
  161. /**
  162. * @brief GPT_ENABLE_USER_MODE_SUPPORT switch
  163. * @details Enable/disable support usermode.If this parameter has been configured to 'TRUE' the GPT driver code can be executed from both supervisor and user mode.
  164. */
  165. #define GPT_ENABLE_USER_MODE_SUPPORT (STD_OFF)
  166. #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  167. #ifdef GPT_ENABLE_USER_MODE_SUPPORT
  168. #if (STD_ON == GPT_ENABLE_USER_MODE_SUPPORT)
  169. #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Gpt in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
  170. #endif /* (STD_ON == GPT_ENABLE_USER_MODE_SUPPORT) */
  171. #endif /* ifdef GPT_ENABLE_USER_MODE_SUPPORT*/
  172. #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
  173. /*================================================================================================*/
  174. /**
  175. * @brief GPT_PREDEFTIMER_FUNCTIONALITY_API switch
  176. * @details Enable/disable GPT_PREDEFTIMER_FUNCTIONALITY_API.
  177. */
  178. #define GPT_PREDEFTIMER_FUNCTIONALITY_API (STD_OFF)
  179. /*================================================================================================*/
  180. /**
  181. * @brief GPT_MULTICORE_ENABLED switch
  182. * @details Enable/disable GPT_MULTICORE_ENABLED.
  183. */
  184. #define GPT_MULTICORE_ENABLED (STD_OFF)
  185. /*================================================================================================*/
  186. /**
  187. * @brief GPT_HW_CHANNEL_USED switch
  188. * @details Enable/disable GPT_HW_CHANNEL_USED.
  189. */
  190. #define GPT_HW_CHANNEL_USED (STD_OFF)
  191. /*================================================================================================*/
  192. /**
  193. * @brief GPT_PRECOMPILE_SUPPORT Switch
  194. * @details Enable/disable GPT_PRECOMPILE_SUPPORT.
  195. */
  196. #define GPT_PRECOMPILE_SUPPORT (STD_OFF)
  197. /*================================================================================================*/
  198. /**
  199. * @brief Define symbolic names of channels
  200. * @details Symbolic names of channels.
  201. */
  202. #define GptConf_GptChannelConfiguration_GptChannelConfiguration_LPIT0_CH0 (0U)
  203. #define GptConf_GptChannelConfiguration_GptChannelConfiguration_FTM (1U)
  204. #define GptConf_GptChannelConfiguration_GptChannelConfiguration_LPTMR (2U)
  205. /*================================================================================================*/
  206. /*================================================================================================*/
  207. /**
  208. * @brief GPT_HW_CHANNEL_NUM
  209. * @details The maximum number of HW channels. This is used to allocate memory space for channel runtime info.
  210. */
  211. #define GPT_HW_CHANNEL_NUM (3U)
  212. /*================================================================================================*/
  213. /**
  214. * @brief GPT_MAX_PARTITIONS_CFG.
  215. * @details Number of configured partitions.
  216. */
  217. #define GPT_MAX_PARTITIONS_CFG (0U)
  218. /**
  219. * @brief GPT_MAX_PARTITIONS.
  220. * @details Number of maximum partitions.
  221. */
  222. #define GPT_MAX_PARTITIONS (1U)
  223. /**
  224. * @brief GPT_NUM_CONFIG.
  225. * @details Number of ChannelConfiguration
  226. */
  227. #define GPT_NUM_CONFIG (3U)
  228. /**
  229. * @brief GPT_HW_PREDEFTIMER_NUM
  230. * @details Number of Predefined timers supported
  231. */
  232. #define GPT_HW_PREDEFTIMER_NUM (4U)
  233. /*==================================================================================================
  234. * ENUMS
  235. ==================================================================================================*/
  236. #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
  237. /**
  238. * @brief Predef Timer type. Indicates the type of predef timer.
  239. * @details This enumeration specifies the possible types of Predef Timer used to configure PREDEFTIMER
  240. * @implements Gpt_PredefTimerType_enumeration
  241. */
  242. typedef enum
  243. {
  244. GPT_PREDEF_TIMER_1US_16BIT = 0x0U, /**< @brief Selected value is the PREDEF_TIMER_1US_16BIT */
  245. GPT_PREDEF_TIMER_1US_24BIT, /**< @brief Selected value is the PREDEF_TIMER_1US_24BIT */
  246. GPT_PREDEF_TIMER_1US_32BIT, /**< @brief Selected value is the PREDEF_TIMER_1US_32BIT */
  247. GPT_PREDEF_TIMER_100US_32BIT /**< @brief Selected value is the PREDEF_TIMER_100US_32BIT */
  248. }Gpt_PredefTimerType;
  249. #endif
  250. /*==================================================================================================
  251. * STRUCTURES AND OTHER TYPEDEFS
  252. ==================================================================================================*/
  253. /*==================================================================================================
  254. * GLOBAL VARIABLE DECLARATIONS
  255. ==================================================================================================*/
  256. #define GPT_CONFIG_EXT \
  257. GPT_CONFIG_VS_0_PB \
  258. /*==================================================================================================
  259. * FUNCTION PROTOTYPES
  260. ==================================================================================================*/
  261. #ifdef __cplusplus
  262. }
  263. #endif
  264. /** @} */
  265. #endif /* GPT_CFG_H */