Icu_Cfg.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : Ftm Lpit Lptmr Port_Ci LpCmp
  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 ICU_CFG_H
  25. #define ICU_CFG_H
  26. /**
  27. * @file Icu_Cfg.h
  28. * @version 1.0.0
  29. *
  30. * @brief AUTOSAR Icu - contains the configuration data of the ICU driver
  31. * @details Contains the configuration data of the ICU driver
  32. *
  33. * @addtogroup icu Icu Driver
  34. * @{
  35. */
  36. #ifdef __cplusplus
  37. extern "C"{
  38. #endif
  39. /*==================================================================================================
  40. INCLUDE FILES
  41. 1) system and project includes
  42. 2) needed interfaces from external units
  43. 3) internal and external interfaces from this unit
  44. ==================================================================================================*/
  45. #include "Icu_EnvCfg.h"
  46. #include "StandardTypes.h"
  47. #include "Icu_VS_0_PBcfg.h"
  48. /*==================================================================================================
  49. SOURCE FILE VERSION INFORMATION
  50. ==================================================================================================*/
  51. #define ICU_CFG_VENDOR_ID 43
  52. #define ICU_CFG_AR_RELEASE_MAJOR_VERSION 4
  53. #define ICU_CFG_AR_RELEASE_MINOR_VERSION 4
  54. #define ICU_CFG_AR_RELEASE_REVISION_VERSION 0
  55. #define ICU_CFG_SW_MAJOR_VERSION 1
  56. #define ICU_CFG_SW_MINOR_VERSION 0
  57. #define ICU_CFG_SW_PATCH_VERSION 0
  58. /*==================================================================================================
  59. FILE VERSION CHECKS
  60. ==================================================================================================*/
  61. /* Check if source file and Icu_EnvCfg header file are of the same vendor */
  62. #if (ICU_CFG_VENDOR_ID != ICU_ENVCFG_VENDOR_ID)
  63. #error "Icu_Cfg.h and Icu_EnvCfg.h have different vendor IDs"
  64. #endif
  65. /* Check if source file and Icu_EnvCfg header file are of the same AutoSar version */
  66. #if ((ICU_CFG_AR_RELEASE_MAJOR_VERSION != ICU_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
  67. (ICU_CFG_AR_RELEASE_MINOR_VERSION != ICU_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
  68. (ICU_CFG_AR_RELEASE_REVISION_VERSION != ICU_ENVCFG_AR_RELEASE_REVISION_VERSION))
  69. #error "AutoSar Version Numbers of Icu_Cfg.h and Icu_EnvCfg.h are different"
  70. #endif
  71. /* Check if source file and Icu_EnvCfg header file are of the same Software version */
  72. #if ((ICU_CFG_SW_MAJOR_VERSION != ICU_ENVCFG_SW_MAJOR_VERSION) || \
  73. (ICU_CFG_SW_MINOR_VERSION != ICU_ENVCFG_SW_MINOR_VERSION) || \
  74. (ICU_CFG_SW_PATCH_VERSION != ICU_ENVCFG_SW_PATCH_VERSION))
  75. #error "Software Version Numbers of Icu_Cfg.h and Icu_EnvCfg.h are different"
  76. #endif
  77. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  78. #if ((ICU_CFG_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  79. (ICU_CFG_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  80. #error "AutoSar Version Numbers of Icu_Cfg.h and StandardTypes.h are different"
  81. #endif
  82. #endif
  83. /* Check if source file and ICU configuration header file are of the same vendor */
  84. #if (ICU_VS_0_PBCFG_VENDOR_ID != ICU_CFG_VENDOR_ID)
  85. #error "Icu_VS_0_PBcfg.h and Icu_Cfg.h have different vendor IDs"
  86. #endif
  87. /* Check if header file and Icu configuration header file are of the same Autosar version */
  88. #if ((ICU_VS_0_PBCFG_AR_RELEASE_MAJOR_VERSION != ICU_CFG_AR_RELEASE_MAJOR_VERSION) || \
  89. (ICU_VS_0_PBCFG_AR_RELEASE_MINOR_VERSION != ICU_CFG_AR_RELEASE_MINOR_VERSION) || \
  90. (ICU_VS_0_PBCFG_AR_RELEASE_REVISION_VERSION != ICU_CFG_AR_RELEASE_REVISION_VERSION))
  91. #error "AutoSar Version Numbers of Icu_VS_0_PBcfg.h and Icu_Cfg.h are different"
  92. #endif
  93. /* Check if header file and Icu configuration header file are of the same software version */
  94. #if ((ICU_VS_0_PBCFG_SW_MAJOR_VERSION != ICU_CFG_SW_MAJOR_VERSION) || \
  95. (ICU_VS_0_PBCFG_SW_MINOR_VERSION != ICU_CFG_SW_MINOR_VERSION) || \
  96. (ICU_VS_0_PBCFG_SW_PATCH_VERSION != ICU_CFG_SW_PATCH_VERSION))
  97. #error "Software Version Numbers of Icu_VS_0_PBcfg.h and Icu_Cfg.h are different"
  98. #endif
  99. /*==================================================================================================
  100. CONSTANTS
  101. ==================================================================================================*/
  102. /*==================================================================================================
  103. DEFINES AND MACROS
  104. ==================================================================================================*/
  105. #define ICU_CONFIG_EXT \
  106. ICU_CONFIG_VS_0_PB \
  107. /** @brief Maximum number of ICU channels configured. */
  108. #define ICU_MAX_CHANNEL ((Icu_ChannelType)5U)
  109. /**
  110. * @brief Switches the Development Error Detection and Notification on or off.
  111. * STD_ON: Enabled.
  112. * STD_OFF: Disabled.
  113. * @implements ICU_DEV_ERROR_DETECT_define
  114. */
  115. #define ICU_DEV_ERROR_DETECT (STD_ON)
  116. /**
  117. * @brief Switch for enabling Wakeup source reporting.
  118. * STD_ON: Report Wakeup source.
  119. * STD_OFF: Do not report Wakeup source.
  120. *
  121. */
  122. #define ICU_REPORT_WAKEUP_SOURCE (STD_ON)
  123. /**
  124. * @brief Support for User mode.
  125. * If this parameter has been configured to 'STD_ON', the ICU driver code can be executed from both supervisor and user mode.
  126. */
  127. #define ICU_ENABLE_USER_MODE_SUPPORT (STD_OFF)
  128. #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  129. #ifdef ICU_ENABLE_USER_MODE_SUPPORT
  130. #if (STD_ON == ICU_ENABLE_USER_MODE_SUPPORT)
  131. #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Icu in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined
  132. #endif /* (STD_ON == ICU_ENABLE_USER_MODE_SUPPORT) */
  133. #endif /* ifdef ICU_ENABLE_USER_MODE_SUPPORT*/
  134. #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
  135. /** @brief Configuration of Optional API's. */
  136. /**
  137. * @brief Adds or removes the service Icu_GetVersionInfo() from the code.
  138. * STD_ON: Icu_GetVersionInfo() can be used.
  139. * STD_OFF: Icu_GetVersionInfo() can not be used.
  140. *
  141. */
  142. #define ICU_GET_VERSION_INFO_API (STD_ON)
  143. /**
  144. * @brief Adds or removes the service Icu_DeInit() from the code.
  145. * STD_ON: Icu_DeInit() can be used. STD_OFF: Icu_DeInit() can not be used.
  146. * @implements ICU_DE_INIT_API_define
  147. */
  148. #define ICU_DE_INIT_API (STD_ON)
  149. /**
  150. * @brief Adds or removes the service Icu_SetMode() from the code.
  151. * STD_ON: Icu_SetMode() can be used.
  152. * STD_OFF: Icu_SetMode() can not be used.
  153. * @implements ICU_SET_MODE_API_define
  154. */
  155. #define ICU_SET_MODE_API (STD_ON)
  156. /**
  157. * @brief Adds or removes the service Icu_DisableWakeup() from the code.
  158. * STD_ON: Icu_DisableWakeup() can be used.
  159. * STD_OFF: Icu_DisableWakeup() can not be used.
  160. * @implements ICU_DISABLE_WAKEUP_API_define
  161. */
  162. #define ICU_DISABLE_WAKEUP_API (STD_ON)
  163. /**
  164. * @brief Adds or removes the service Icu_EnableWakeup() from the code.
  165. * STD_ON: Icu_EnableWakeup() can be used.
  166. * STD_OFF: Icu_EnableWakeup() can not be used.
  167. * @implements ICU_ENABLE_WAKEUP_API_define
  168. */
  169. #define ICU_ENABLE_WAKEUP_API (STD_ON)
  170. /**
  171. * @brief Adds or removes all services related to the timestamping functionality as listed
  172. * below from the code: Icu_StartTimestamp(), Icu_StopTimestamp(), Icu_GetTimestampIndex().
  173. * STD_ON: The services listed above can be used.
  174. * STD_OFF: The services listed above can not be used.
  175. * @implements ICU_TIMESTAMP_API_define
  176. */
  177. #define ICU_TIMESTAMP_API (STD_ON)
  178. /**
  179. * @brief Adds or removes all services related to the edge counting functionality as listed below,
  180. * from the code: Icu_ResetEdgeCount(), Icu_EnableEdgeCount(), Icu_DisableEdgeCount(),
  181. * Icu_GetEdgeNumbers().
  182. * STD_ON: The services listed above can be used.
  183. * STD_OFF: The services listed above can not be used.
  184. * @implements ICU_EDGE_COUNT_API_define
  185. */
  186. #define ICU_EDGE_COUNT_API (STD_ON)
  187. /**
  188. * @brief Adds or removes the service Icu_GetTimeElapsed() from the code.
  189. * STD_ON: Icu_GetTimeElapsed() can be used.
  190. * STD_OFF: Icu_GetTimeElapsed() can not be used.
  191. * @implements ICU_GET_TIME_ELAPSED_API_define
  192. */
  193. #define ICU_GET_TIME_ELAPSED_API (STD_ON)
  194. /**
  195. * @brief Adds or removes the service Icu_GetDutyCycleValues() from the code.
  196. * STD_ON: Icu_GetDutyCycleValues() can be used.
  197. * STD_OFF: Icu_GetDutyCycleValues() can not be used.
  198. * @implements ICU_GET_DUTY_CYCLE_VALUES_API_define
  199. */
  200. #define ICU_GET_DUTY_CYCLE_VALUES_API (STD_ON)
  201. /**
  202. * @brief Adds or removes the service Icu_GetInputState() from the code.
  203. * STD_ON: Icu_GetInputState() can be used.
  204. * STD_OFF: Icu_GetInputState() can not be used.
  205. * @implements ICU_GET_INPUT_STATE_API_define
  206. */
  207. #define ICU_GET_INPUT_STATE_API (STD_ON)
  208. /**
  209. * @brief Adds or removes the services Icu_StartSignalMeasurement() and
  210. * Icu_StopSignalMeasurement() from the code.
  211. * STD_ON: Icu_StartSignalMeasurement() and Icu_StopSignalMeasurement() can be used.
  212. * STD_OFF: Icu_StartSignalMeasurement() and Icu_StopSignalMeasurement() can not be used.
  213. * @implements ICU_SIGNAL_MEASUREMENT_API_define
  214. */
  215. #define ICU_SIGNAL_MEASUREMENT_API (STD_ON)
  216. /**
  217. * @brief Adds or removes the service Icu_CheckWakeup() from the code.
  218. * STD_ON: Icu_CheckWakeup() can be used.
  219. * STD_OFF: Icu_CheckWakeup() can not be used.
  220. * @implements ICU_WAKEUP_FUNCTIONALITY_API_define
  221. */
  222. #define ICU_WAKEUP_FUNCTIONALITY_API (STD_ON)
  223. /**
  224. * @brief Adds or removes the services Icu_EnableEdgeDetection() and Icu_DisableEdgeDetection()
  225. * from the code.
  226. * STD_ON: Icu_EnableEdgeDetection() and Icu_DisableEdgeDetection() can be used.
  227. * STD_OFF: Icu_EnableEdgeDetection() and Icu_DisableEdgeDetection() can not be used.
  228. *
  229. * @implements ICU_EDGE_DETECT_API_define
  230. */
  231. #define ICU_EDGE_DETECT_API (STD_ON)
  232. /**
  233. * @brief Implementation specific parameter
  234. * Adds or Removes the code related to overflow notification
  235. * STD_ON: Overflow notification function will be called if overflow occurs
  236. * STD_OFF: Overflow notification function will not be called though overflow occurs
  237. *
  238. */
  239. #define ICU_OVERFLOW_NOTIFICATION_API (STD_OFF)
  240. /**
  241. * @brief Adds or removes the service Icu_GetInputLevel() from the code.
  242. * STD_ON: Icu_GetInputLevel() can be used.
  243. * STD_OFF: Icu_GetInputLevel() can not be used.
  244. *
  245. *
  246. */
  247. #define ICU_GET_INPUT_LEVEL_API (STD_ON)
  248. /**
  249. * @brief Adds / removes the service Icu_GetPulseWidth() from the code.
  250. * STD_ON: Icu_GetPulseWidth() can be used.
  251. * STD_OFF: Icu_GetPulseWidth() can not be used.
  252. */
  253. #define ICU_GET_PULSE_WIDTH_API (STD_OFF)
  254. /**
  255. * @brief Adds or removes the support measurement with DMA
  256. * STD_ON: DMA measurement can be used.
  257. * STD_OFF: DMA measurement can not be used.
  258. */
  259. /**
  260. * @brief Adds or removes the for support Signal Measurement with DMA.
  261. * STD_ON: DMA in SM measurement can be used.
  262. * STD_OFF: DMA in SM measurement can not be used.
  263. */
  264. #define ICU_SIGNALMEASUREMENT_USES_DMA (STD_OFF)
  265. /**
  266. * @brief Adds or removes the support for TimeStamp Measurement with DMA.
  267. * STD_ON: DMA in TS measurement can be used.
  268. * STD_OFF: DMA in TS measurement can not be used.
  269. */
  270. #define ICU_TIMESTAMP_USES_DMA (STD_OFF)
  271. #if ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON))
  272. /**
  273. * @brief Implementation specific.
  274. * Each channel provides a subset of the functionality available in the unified channel,
  275. * at a resolution of 32 bits.
  276. */
  277. #define ICU_CAPTURE_REGISTER_MASK (((Icu_ValueType)0xFFFFU))
  278. /**
  279. * @brief Implementation specific.
  280. * Each channel provides a DMA resolution of 16 bits.
  281. */
  282. #define ICU_DMA_SIZE (DMA_IP_TRANSFER_SIZE_2_BYTE)
  283. /**
  284. * @brief Implementation specific.
  285. * DMA number of bytes transfer on a minor loop is 2 bytes - for 16 bits hw registers.
  286. */
  287. #define ICU_DMA_NUM_BYTES (2U)
  288. /**
  289. * @brief Implementation specific.
  290. * DMA offset is 16 bits HW registers.
  291. */
  292. #define ICU_DMA_OFFSET (2U)
  293. /** @brief Define when no MCL DMA channel is used. */
  294. #define NoMclDmaChannel ((Mcl_ChannelType)0xFF)
  295. #endif /* ((ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (ICU_TIMESTAMP_USES_DMA == STD_ON)) */
  296. /**
  297. * @brief Adds / removes the service Icu_SetClockMode() from the code.
  298. * STD_ON: Icu_SetClockMode() can be used.
  299. * STD_OFF: Icu_SetClockMode() can not be used.
  300. *
  301. */
  302. #define ICU_DUAL_CLOCK_MODE_API (STD_OFF)
  303. /**
  304. * @brief Adds / removes the service Icu_GetCaptureRegisterValue() from the code.
  305. * STD_ON: Icu_GetCaptureRegisterValue() can be used.
  306. * STD_OFF: Icu_GetCaptureRegisterValue() can not be used.
  307. */
  308. #define ICU_CAPTURERGISTER_API (STD_OFF)
  309. #define IcuChannel_0 (IcuConf_IcuChannel_IcuChannel_0)
  310. #define IcuConf_IcuChannel_IcuChannel_0 ((Icu_ChannelType)0U)
  311. #define IcuChannel_1 (IcuConf_IcuChannel_IcuChannel_1)
  312. #define IcuConf_IcuChannel_IcuChannel_1 ((Icu_ChannelType)1U)
  313. #define IcuChannel_2 (IcuConf_IcuChannel_IcuChannel_2)
  314. #define IcuConf_IcuChannel_IcuChannel_2 ((Icu_ChannelType)2U)
  315. #define IcuChannel_3 (IcuConf_IcuChannel_IcuChannel_3)
  316. #define IcuConf_IcuChannel_IcuChannel_3 ((Icu_ChannelType)3U)
  317. #define IcuChannel_4 (IcuConf_IcuChannel_IcuChannel_4)
  318. #define IcuConf_IcuChannel_IcuChannel_4 ((Icu_ChannelType)4U)
  319. /**
  320. * @brief Number of configured partitions.
  321. */
  322. #define ICU_MAX_PARTITIONS (1U)
  323. #define ICU_MULTICORE_SUPPORT (STD_OFF)
  324. /*==================================================================================================
  325. ENUMS
  326. ==================================================================================================*/
  327. /*==================================================================================================
  328. STRUCTURES AND OTHER TYPEDEFS
  329. ==================================================================================================*/
  330. /**
  331. * @brief Implementation specific. This type shall be chosen in order to have the most efficient
  332. * implementation on a specific microcontroller platform.
  333. * Range: 0 to width of the timer register.
  334. * Description: Width of the buffer for timestamp ticks and measured elapsed timeticks
  335. */
  336. typedef uint16 Icu_TimerRegisterWidthType;
  337. /**
  338. * @brief Implementation specific. This type shall be chosen in order to have the most efficient
  339. * implementation on a specific microcontroller platform.
  340. * Description: Type, to abstract the return value of the service Icu_GetTimestampIndex().
  341. */
  342. typedef uint16 Icu_HwSpecificIndexType;
  343. /**
  344. * @brief Implementation specific. This type shall be chosen in order to have the most efficient
  345. * implementation on a specific microcontroller platform.
  346. * Description: Type, to abstract the return value of the service Icu_GetEdgeNumbers().
  347. */
  348. typedef uint16 Icu_HwSpecificEdgeNumberType;
  349. /*==================================================================================================
  350. FUNCTION PROTOTYPES
  351. ==================================================================================================*/
  352. #ifdef __cplusplus
  353. }
  354. #endif
  355. #endif /* ICU_CFG_H */
  356. /** @} */