Gpt.h 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  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_H
  25. #define GPT_H
  26. /**
  27. * @file Gpt.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_Ipw_Types.h"
  43. #include "Gpt_Cfg.h"
  44. #include "Gpt_EnvCfg.h"
  45. #include "Mcal.h"
  46. #if (GPT_WAKEUP_FUNCTIONALITY_API == STD_ON)
  47. #include "EcuM_Externals.h"
  48. #endif
  49. /*==================================================================================================
  50. * SOURCE FILE VERSION INFORMATION
  51. ==================================================================================================*/
  52. /**
  53. * @internal
  54. * @brief Defines used for file version checks
  55. */
  56. #define GPT_VENDOR_ID 43
  57. #define GPT_MODULE_ID 100
  58. #define GPT_AR_RELEASE_MAJOR_VERSION 4
  59. #define GPT_AR_RELEASE_MINOR_VERSION 4
  60. #define GPT_AR_RELEASE_REVISION_VERSION 0
  61. #define GPT_SW_MAJOR_VERSION 1
  62. #define GPT_SW_MINOR_VERSION 0
  63. #define GPT_SW_PATCH_VERSION 0
  64. /*==================================================================================================
  65. * FILE VERSION CHECKS
  66. ==================================================================================================*/
  67. /* Check if header file and Std_Types.h file are of the same Autosar version */
  68. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  69. #if ((GPT_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
  70. (GPT_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
  71. #error "AutoSar Version Numbers of Gpt.h and Std_Types.h are different"
  72. #endif
  73. /* Check if Gpt.h file and Mcal.h header file are of the same Autosar version */
  74. #if ((GPT_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \
  75. (GPT_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION))
  76. #error "AutoSar Version Numbers of Gpt.h and Mcal.h are different"
  77. #endif
  78. #endif
  79. /* Check if header file and EcuM_Cbk.h file are of the same Autosar version */
  80. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  81. #if (GPT_WAKEUP_FUNCTIONALITY_API == STD_ON)
  82. #if ((GPT_AR_RELEASE_MAJOR_VERSION != ECUM_CBK_AR_RELEASE_MAJOR_VERSION) || \
  83. (GPT_AR_RELEASE_MINOR_VERSION != ECUM_CBK_AR_RELEASE_MINOR_VERSION) \
  84. )
  85. #error "AutoSar Version Numbers of Gpt.h and EcuM_Externals.h are different"
  86. #endif
  87. #endif
  88. #endif
  89. #if (GPT_VENDOR_ID != GPT_IPW_TYPES_VENDOR_ID)
  90. #error "Gpt.h and Gpt_Ipw_Types.h have different vendor ids"
  91. #endif
  92. /* Check if this header file and GPT IPW header file are of the same Autosar version */
  93. #if ((GPT_AR_RELEASE_MAJOR_VERSION != GPT_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  94. (GPT_AR_RELEASE_MINOR_VERSION != GPT_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
  95. (GPT_AR_RELEASE_REVISION_VERSION != GPT_IPW_TYPES_AR_RELEASE_REVISION_VERSION) \
  96. )
  97. #error "AutoSar Version Numbers of Gpt.h and Gpt_Ipw_Types.h are different"
  98. #endif
  99. /* Check if this header file and GPT IPW header file are of the same Software version */
  100. #if ((GPT_SW_MAJOR_VERSION != GPT_IPW_TYPES_SW_MAJOR_VERSION) || \
  101. (GPT_SW_MINOR_VERSION != GPT_IPW_TYPES_SW_MINOR_VERSION) || \
  102. (GPT_SW_PATCH_VERSION != GPT_IPW_TYPES_SW_PATCH_VERSION) \
  103. )
  104. #error "Software Version Numbers of Gpt.h and Gpt_Ipw_Types.h are different"
  105. #endif
  106. #if ( GPT_VENDOR_ID!= GPT_ENVCFG_VENDOR_ID)
  107. #error "Gpt.h and Gpt_EnvCfg.h have different vendor ids"
  108. #endif
  109. /* Check if the header files are of the same Autosar version */
  110. #if ((GPT_AR_RELEASE_MAJOR_VERSION != GPT_ENVCFG_AR_RELEASE_MAJOR_VERSION) || \
  111. (GPT_AR_RELEASE_MINOR_VERSION != GPT_ENVCFG_AR_RELEASE_MINOR_VERSION) || \
  112. (GPT_AR_RELEASE_REVISION_VERSION != GPT_ENVCFG_AR_RELEASE_REVISION_VERSION) \
  113. )
  114. #error "AutoSar Version Numbers of Gpt.h and Gpt_EnvCfg.h are different"
  115. #endif
  116. /* Check if the header files are of the same Software version */
  117. #if ((GPT_SW_MAJOR_VERSION != GPT_ENVCFG_SW_MAJOR_VERSION) || \
  118. (GPT_SW_MINOR_VERSION != GPT_ENVCFG_SW_MINOR_VERSION) || \
  119. (GPT_SW_PATCH_VERSION != GPT_ENVCFG_SW_PATCH_VERSION) \
  120. )
  121. #error "Software Version Numbers of Gpt.h and Gpt_EnvCfg.h are different"
  122. #endif
  123. #if ( GPT_VENDOR_ID!= GPT_VENDOR_ID_CFG)
  124. #error "Gpt.h and Gpt_Cfg.h have different vendor ids"
  125. #endif
  126. /* Check if the header files are of the same Autosar version */
  127. #if ((GPT_AR_RELEASE_MAJOR_VERSION != GPT_AR_RELEASE_MAJOR_VERSION_CFG) || \
  128. (GPT_AR_RELEASE_MINOR_VERSION != GPT_AR_RELEASE_MINOR_VERSION_CFG) || \
  129. (GPT_AR_RELEASE_REVISION_VERSION != GPT_AR_RELEASE_REVISION_VERSION_CFG) \
  130. )
  131. #error "AutoSar Version Numbers of Gpt.h and Gpt_Cfg.h are different"
  132. #endif
  133. /* Check if the header files are of the same Software version */
  134. #if ((GPT_SW_MAJOR_VERSION != GPT_SW_MAJOR_VERSION_CFG) || \
  135. (GPT_SW_MINOR_VERSION != GPT_SW_MINOR_VERSION_CFG) || \
  136. (GPT_SW_PATCH_VERSION != GPT_SW_PATCH_VERSION_CFG) \
  137. )
  138. #error "Software Version Numbers of Gpt.h and Gpt_Cfg.h are different"
  139. #endif
  140. /*==================================================================================================
  141. * CONSTANT-LIKE DEFINES
  142. ==================================================================================================*/
  143. /*==================================================================================================
  144. * FUNCTION-LIKE DEFINES(MACROS)
  145. ==================================================================================================*/
  146. /*==================================================================================================*/
  147. /**
  148. * @brief Function Gpt_StartTimer is called when the driver is in sleep mode for a channel which is not wakeup enabled.
  149. * @details Errors and exceptions that will be detected by the GPT driver.
  150. *
  151. * @implements Gpt_Det_ErrorCodes_define
  152. */
  153. #if(GPT_VALIDATE_STATE == STD_ON)
  154. #if(((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON)) || (GPT_CHANGE_NEXT_TIMEOUT_VALUE == STD_ON))
  155. #define GPT_E_INVALID_CALL ((uint8)0xA0U)
  156. #endif
  157. #endif
  158. /**
  159. * @brief Function called without module initialization.
  160. * @details Errors and exceptions that will be detected by the GPT driver.
  161. *
  162. * @implements Gpt_Det_ErrorCodes_define
  163. */
  164. #if((GPT_VALIDATE_CHANNEL_CALL == STD_ON) || (GPT_VALIDATE_GLOBAL_CALL == STD_ON))
  165. #define GPT_E_UNINIT ((uint8)0x0AU)
  166. #endif
  167. /**
  168. * @brief Initialization called when already initialized.
  169. * @details Errors and exceptions that will be detected by the GPT driver.
  170. *
  171. * @implements Gpt_Det_ErrorCodes_define
  172. */
  173. #if(GPT_VALIDATE_GLOBAL_CALL == STD_ON)
  174. #define GPT_E_ALREADY_INITIALIZED ((uint8)0x0DU)
  175. #endif
  176. /**
  177. * @brief Function called for invalid channel.
  178. * @details Errors and exceptions that will be detected by the GPT driver.
  179. *
  180. * @implements Gpt_Det_ErrorCodes_define
  181. */
  182. #define GPT_E_PARAM_CHANNEL ((uint8)0x14U)
  183. /**
  184. * @brief Function called with parameter value out of range
  185. * @details Errors and exceptions that will be detected by the GPT driver
  186. *
  187. * @implements Gpt_Det_ErrorCodes_define
  188. */
  189. #if (GPT_VALIDATE_PARAM == STD_ON)
  190. #define GPT_E_PARAM_VALUE ((uint8)0x15U)
  191. #endif
  192. #if(((GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON) && (GPT_VALIDATE_PARAM == STD_ON)) ||\
  193. ((GPT_VERSION_INFO_API == STD_ON) && (GPT_DEV_ERROR_DETECT == STD_ON)))
  194. /**
  195. * @brief Function called with NULL pointer
  196. * @details Errors and exceptions that will be detected by the GPT driver
  197. *
  198. * @implements Gpt_Det_ErrorCodes_define
  199. */
  200. #define GPT_E_PARAM_POINTER ((uint8)0x16U)
  201. #endif
  202. #if((GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON) && (GPT_VALIDATE_PARAM == STD_ON))
  203. /**
  204. * @brief Function called with invalid the parameter in function Gpt_GetPredefTimerValue
  205. * @details Errors and exceptions that will be detected by the GPT driver
  206. *
  207. * @implements Gpt_Det_ErrorCodes_define
  208. */
  209. #define GPT_E_PARAM_PREDEF_TIMER ((uint8)0x17)
  210. #endif /* (GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON) && (GPT_VALIDATE_PARAM == STD_ON) */
  211. /**
  212. * @brief Function called when timer channel is still running.
  213. * @details Errors and exceptions that will be detected by the GPT driver.
  214. *
  215. * @implements Gpt_Det_ErrorCodes_define
  216. */
  217. #define GPT_E_BUSY ((uint8)0x0BU)
  218. #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
  219. /**
  220. * @brief Function called with invalid the parameter in function Gpt_GetPredefTimerValue
  221. * @details Errors and exceptions that will be detected by the GPT driver
  222. *
  223. * @implements Gpt_Det_ErrorCodes_define
  224. */
  225. #define GPT_E_MODE ((uint8)0x0C)
  226. #endif /* (GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON) */
  227. /**
  228. * @brief Function called when a timeout is occurred.
  229. * @details Errors and exceptions that will be detected by the GPT driver.
  230. *
  231. * @implements Gpt_Det_ErrorCodes_define
  232. */
  233. #define GPT_E_TIMEOUT ((uint8)0x2BU)
  234. /**
  235. * @brief Function called with invalid the parameter in function Gpt_Init
  236. * @details Errors and exceptions that will be detected by the GPT driver
  237. *
  238. * @implements Gpt_Det_ErrorCodes_define
  239. */
  240. #if((GPT_VALIDATE_PARAM == STD_ON) && (GPT_DEV_ERROR_DETECT == STD_ON))
  241. #define GPT_E_INIT_FAILED ((uint8)0x0E)
  242. #endif
  243. /**
  244. * @brief API Gpt_SetClockMode service called with wrong parameter.
  245. * @details Parameters used when raising an error/exception
  246. * @implements
  247. */
  248. #if((GPT_SET_CLOCK_MODE == STD_ON) && (GPT_VALIDATE_PARAM == STD_ON))
  249. #define GPT_E_PARAM_CLOCK_MODE ((uint8)0x17U)
  250. #endif
  251. /**
  252. * @brief Function called with invalid mode param.
  253. * @details Errors and exceptions that will be detected by the GPT driver
  254. *
  255. * @implements Gpt_Det_ErrorCodes_define
  256. */
  257. #if ((GPT_VALIDATE_PARAM == STD_ON) &&(GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
  258. #define GPT_E_PARAM_MODE ((uint8)0x1FU)
  259. #endif
  260. /**
  261. * @brief function called for invalid channel on the current core
  262. * @details Errors and exceptions that will be detected by the GPT driver
  263. *
  264. * @implements Gpt_Det_ErrorCodes_define
  265. */
  266. #define GPT_E_PARAM_CONFIG ((uint8)0x18U)
  267. /** API SERVICE IDs */
  268. /**
  269. * @brief API service ID for Gpt_GetVersionInfo function
  270. * @details Parameters used when raising an error/exception
  271. */
  272. #if ((GPT_VERSION_INFO_API == STD_ON) && (GPT_DEV_ERROR_DETECT == STD_ON))
  273. #define GPT_GETVERSIONINFO_ID ((uint8)0x00U)
  274. #endif
  275. /**
  276. * @brief API service ID for Gpt_Init function
  277. * @details Parameters used when raising an error/exception
  278. */
  279. #if ((GPT_VALIDATE_GLOBAL_CALL == STD_ON) || ((GPT_VALIDATE_PARAM == STD_ON) && (GPT_DEV_ERROR_DETECT == STD_ON)))
  280. #define GPT_INIT_ID ((uint8)0x01U)
  281. #endif
  282. /**
  283. * @brief API service ID for Gpt_DeInit function
  284. * @details Parameters used when raising an error/exception
  285. */
  286. #if (GPT_DEINIT_API == STD_ON)
  287. #define GPT_DEINIT_ID ((uint8)0x02U)
  288. #endif
  289. /**
  290. * @brief API service ID for Gpt_GetTimeElapsed function
  291. * @details Parameters used when raising an error/exception
  292. */
  293. #if ((GPT_TIME_ELAPSED_API == STD_ON) && (GPT_VALIDATE_CHANNEL_CALL == STD_ON))
  294. #define GPT_TIMEELAPSED_ID ((uint8)0x03U)
  295. #endif
  296. /**
  297. * @brief API service ID for Gpt_GetTimeRemaining function
  298. * @details Parameters used when raising an error/exception
  299. */
  300. #if ((GPT_TIME_REMAINING_API == STD_ON) && (GPT_VALIDATE_CHANNEL_CALL == STD_ON))
  301. #define GPT_TIMEREMAINING_ID ((uint8)0x04U)
  302. #endif
  303. /**
  304. * @brief API service ID for Gpt_StartTimer function
  305. * @details Parameters used when raising an error/exception
  306. */
  307. #define GPT_STARTTIMER_ID ((uint8)0x05U)
  308. /**
  309. * @brief API service ID for Gpt_StopTimer function
  310. * @details Parameters used when raising an error/exception
  311. */
  312. #if(GPT_VALIDATE_CHANNEL_CALL == STD_ON)
  313. #define GPT_STOPTIMER_ID ((uint8)0x06U)
  314. #endif
  315. #if((GPT_ENABLE_DISABLE_NOTIFICATION_API == STD_ON) && ((GPT_VALIDATE_CHANNEL_CALL == STD_ON) || (GPT_VALIDATE_PARAM == STD_ON)))
  316. /**
  317. * @brief API service ID for Gpt_EnableNotification function
  318. * @details Parameters used when raising an error/exception
  319. */
  320. #define GPT_ENABLENOTIFICATION_ID ((uint8)0x07U)
  321. /**
  322. * @brief API service ID for Gpt_DisableNotification function
  323. * @details Parameters used when raising an error/exception
  324. */
  325. #define GPT_DISABLENOTIFICATION_ID ((uint8)0x08U)
  326. #endif
  327. /**
  328. * @brief API service ID for Gpt_SetMode function
  329. * @details Parameters used when raising an error/exception
  330. */
  331. #if(((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_VALIDATE_GLOBAL_CALL == STD_ON)) ||\
  332. ((GPT_VALIDATE_PARAM == STD_ON) &&(GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON)))
  333. #define GPT_SETMODE_ID ((uint8)0x09U)
  334. #endif
  335. #if ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
  336. #if((GPT_VALIDATE_CHANNEL_CALL == STD_ON) || (GPT_VALIDATE_PARAM == STD_ON))
  337. /**
  338. * @brief API service ID for Gpt_DisableWakeup function
  339. * @details Parameters used when raising an error/exception
  340. */
  341. #define GPT_DISABLEWAKEUP_ID ((uint8)0x0AU)
  342. /**
  343. * @brief API service ID for Gpt_EnableWakeup function
  344. * @details Parameters used when raising an error/exception
  345. */
  346. #define GPT_ENABLEWAKEUP_ID ((uint8)0x0BU)
  347. #endif
  348. /**
  349. * @brief API service ID for Gpt_CheckWakeup function
  350. * @details Parameters used when raising an error/exception
  351. */
  352. #if (GPT_VALIDATE_GLOBAL_CALL == STD_ON)
  353. #define GPT_CHECKWAKEUP_ID ((uint8)0x0CU)
  354. #endif
  355. #endif /* ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON)) */
  356. /**
  357. * @brief API service ID for Gpt_ProcessCommonInterrupt generic ISR handler
  358. * @details Parameters used when raising an error/exception
  359. */
  360. #define GPT_PROCESSCOMMONINTERRUPT_ID ((uint8)0x11U)
  361. /**
  362. * @brief API service ID for Gpt_ChangeNextTimeoutValue function
  363. * @details Parameters used when raising an error/exception
  364. */
  365. #if (GPT_CHANGE_NEXT_TIMEOUT_VALUE == STD_ON)
  366. #define GPT_CHANGE_NEXT_TIMEOUT_VALUE_ID ((uint8)0x0FU)
  367. #endif
  368. /**
  369. * @brief API service ID for Gpt_SetClockMode function
  370. * @details Parameters used when raising an error/exception
  371. */
  372. #if((GPT_VALIDATE_GLOBAL_CALL == STD_ON) && (GPT_SET_CLOCK_MODE == STD_ON))
  373. #define GPT_SET_CLOCK_MODE_ID ((uint8)0x10U)
  374. #endif
  375. /**
  376. * @brief API service ID for Gpt_GetPredefTimerValue function
  377. * @details Parameters used when raising an error/exception
  378. */
  379. #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
  380. #define GPT_GET_PREDEF_TIMERVALUE_ID ((uint8)0x0DU)
  381. #endif
  382. /**
  383. * @brief API service ID for Gpt_Channel_EnableChainMode function
  384. * @details Parameters used when raising an error/exception
  385. */
  386. #if(GPT_CHAIN_MODE == STD_ON)
  387. #define GPT_ENABLE_CHAIN_MODE_ID ((uint8)0x21U)
  388. #define GPT_DISABLE_CHAIN_MODE_ID ((uint8)0x22U)
  389. #endif
  390. /**
  391. * @brief Instance ID of this GPT driver.
  392. *
  393. */
  394. #define GPT_INSTANCE_ID ((uint8)0U)
  395. /*==================================================================================================
  396. * ENUMS
  397. ==================================================================================================*/
  398. /**
  399. * @brief This enumerated type allows the selection of different power modes.
  400. * @details Modes of the GPT driver.
  401. *
  402. * @implements Gpt_ModeType_enumeration
  403. */
  404. typedef enum
  405. {
  406. GPT_MODE_NORMAL = 0U, /**< @brief GPT Normal operation mode of the GPT */
  407. GPT_MODE_SLEEP = 1U /**< @brief GPT Sleep mode */
  408. } Gpt_ModeType;
  409. /**
  410. * @brief Gpt channel mode type. Indicates of whether the channel mode is "CONTINUOUS" or "ONE SHOT".
  411. * @details ChannelModeType of channel.
  412. */
  413. typedef enum
  414. {
  415. GPT_CH_MODE_CONTINUOUS = 0U, /**< @brief GPT channel mode - continuous mode */
  416. GPT_CH_MODE_ONESHOT = 1U /**< @brief GPT channel mode - one-shot mode. */
  417. } Gpt_ChannelModeType;
  418. /**
  419. * @brief Prescaler type. Indicates of whether the clock channel mode is "GPT_NORMAL" or "GPT_ALTERNATE".
  420. * @details This enumeration specifies the possible types of prescalers used to configure base-clock timers
  421. */
  422. #if (GPT_SET_CLOCK_MODE == STD_ON)
  423. typedef enum
  424. {
  425. GPT_CLOCKMODE_NORMAL = 0x0U, /**< @brief Selected value is the NORMAL configured prescaler */
  426. GPT_CLOCKMODE_ALTERNATE = 0x1U /**< @brief Selected value is the ALTERNATE configured prescaler */
  427. } Gpt_ClockModeType;
  428. #endif /* GPT_SET_CLOCK_MODE */
  429. /*==================================================================================================
  430. * STRUCTURES AND OTHER TYPEDEFS
  431. ==================================================================================================*/
  432. /**
  433. * @internal
  434. * @brief Gpt channel ID data type
  435. * @details Gpt channel type
  436. * @implements Gpt_ChannelType_typedef
  437. */
  438. typedef uint8 Gpt_ChannelType;
  439. /**
  440. * @internal
  441. * @brief Used for reading and setting the timer value in number of ticks.
  442. * @details Gpt timeout value type
  443. * @implements Gpt_ValueType_typedef
  444. */
  445. typedef uint32 Gpt_ValueType;
  446. /**
  447. * @internal
  448. * @brief The callback notifications shall be configurable as pointers to
  449. * user defined functions within the configuration structure.
  450. * @details Gpt channel notification type.
  451. *
  452. */
  453. typedef void (*Gpt_NotificationType)(void);
  454. /**
  455. * @internal
  456. * @brief Gpt channel configuration type.
  457. * @details Configuration structure
  458. *
  459. */
  460. typedef struct
  461. {
  462. /** @brief GPT ch WakeUp enable */
  463. boolean Gpt_bEnableWakeup;
  464. /** @brief Pointer to external callback */
  465. Gpt_NotificationType Gpt_pfNotification;
  466. #if ((GPT_WAKEUP_FUNCTIONALITY_API == STD_ON) && (GPT_REPORT_WAKEUP_SOURCE == STD_ON))
  467. /** @brief EcuM wake up source Id */
  468. EcuM_WakeupSourceType Gpt_uWakeupSource;
  469. #endif
  470. /** @brief Channel max tick value */
  471. Gpt_ValueType Gpt_uChannelTickValueMax;
  472. /** @brief GPT channel mode */
  473. Gpt_ChannelModeType Gpt_eChannelMode;
  474. /** @brief Hardware dependent channel configuration */
  475. Gpt_Ipw_HwChannelConfigType *Gpt_Ipw_HwChannelConfig;
  476. } Gpt_ChannelConfigType;
  477. /**
  478. * @internal
  479. * @brief Gpt configuration type.
  480. * @details This is the type of the data structure including the configuration
  481. * set required for initializing the GPT driver.
  482. *
  483. * @implements Gpt_ConfigType_structure
  484. */
  485. typedef struct
  486. {
  487. /** @brief Number of GPT channels (configured in tresos plugin builder) */
  488. Gpt_ChannelType channelCount;
  489. /** @brief Pointer to the GPT channel configuration */
  490. const Gpt_ChannelConfigType (*Gpt_pChannelConfig)[];
  491. /** @brief Number of GPT instances (configured in tresos plugin builder) */
  492. uint8 instanceCount;
  493. /** @brief Pointer to the GPT instance configuration */
  494. Gpt_Ipw_HwInstanceConfigType (*Gpt_Ipw_HwInstanceConfig)[];
  495. #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
  496. /** @brief Pointer to the GPT channel predef timer configuration */
  497. const Gpt_HwPredefChannelConfigType * const (*Gpt_pChannelPredefConfigType);
  498. #endif
  499. /** @brief channel index in each partition map table*/
  500. const uint8 (*u8GptChannelIdToIndexMap)[];
  501. } Gpt_ConfigType;
  502. /*==================================================================================================
  503. * GLOBAL VARIABLE DECLARATIONS
  504. ==================================================================================================*/
  505. #if (GPT_PRECOMPILE_SUPPORT == STD_OFF)
  506. /**
  507. * @internal
  508. * @brief MemMap section
  509. */
  510. #define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
  511. #include "Gpt_MemMap.h"
  512. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  513. /* Check if header file and MemMap.h file are of the same Autosar version */
  514. #if ((GPT_AR_RELEASE_MAJOR_VERSION != GPT_MEMMAP_AR_RELEASE_MAJOR_VERSION) || \
  515. (GPT_AR_RELEASE_MINOR_VERSION != GPT_MEMMAP_AR_RELEASE_MINOR_VERSION))
  516. #error "AutoSar Version Numbers of Gpt.h and Gpt_MemMap.h are different"
  517. #endif
  518. #endif
  519. GPT_CONFIG_EXT
  520. /**
  521. * @internal
  522. * @brief MemMap section
  523. */
  524. #define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  525. #include "Gpt_MemMap.h"
  526. #else
  527. /**
  528. * @internal
  529. * @brief MemMap section
  530. */
  531. #define GPT_START_SEC_CONFIG_DATA_UNSPECIFIED
  532. #include "Gpt_MemMap.h"
  533. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  534. /* Check if header file and MemMap.h file are of the same Autosar version */
  535. #if ((GPT_AR_RELEASE_MAJOR_VERSION != GPT_MEMMAP_AR_RELEASE_MAJOR_VERSION) || \
  536. (GPT_AR_RELEASE_MINOR_VERSION != GPT_MEMMAP_AR_RELEASE_MINOR_VERSION))
  537. #error "AutoSar Version Numbers of Gpt.h and Gpt_MemMap.h are different"
  538. #endif
  539. #endif
  540. /* Extern declarations of GPT Pre compile configuration from Gpt_PBCfg.c */
  541. #if (GPT_PRECOMPILE_SUPPORT == STD_ON)
  542. #if(GPT_MULTICORE_ENABLED == STD_ON)
  543. extern const Gpt_ConfigType* const Gpt_Config[GPT_MAX_PARTITIONS];
  544. #else
  545. extern const Gpt_ConfigType Gpt_Config;
  546. #endif
  547. #endif
  548. /**
  549. * @internal
  550. * @brief MemMap section
  551. */
  552. #define GPT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  553. #include "Gpt_MemMap.h"
  554. #endif
  555. /*==================================================================================================
  556. * FUNCTION PROTOTYPES
  557. ==================================================================================================*/
  558. /**
  559. * @internal
  560. * @brief MemMap section
  561. */
  562. #define GPT_START_SEC_CODE
  563. #include "Gpt_MemMap.h"
  564. /*================================================================================================*/
  565. #if (GPT_VERSION_INFO_API == STD_ON)
  566. /**
  567. * @brief This function returns the version information of this module.
  568. * @details This service returns the version information of this module. The version information
  569. * includes:
  570. * - Module Id
  571. * - Vendor Id
  572. * - Vendor specific version numbers
  573. * If source code for caller and callee of this function is available this function should
  574. * be realized as a macro. The macro should be defined in the modules header file.
  575. * @param[out] versioninfo - pointer to location to store version info
  576. *
  577. * @return void
  578. * @api
  579. *
  580. * @pre Gpt_Init must be called before.
  581. * @implements Gpt_GetVersionInfo_Activity
  582. */
  583. void Gpt_GetVersionInfo(Std_VersionInfoType * VersionInfoPtr);
  584. #endif
  585. /*================================================================================================*/
  586. /**
  587. * @brief GPT driver initialization function.
  588. * @details This service is a non reentrant function used for driver initialization.
  589. * The Initialization function shall initialize all relevant registers of
  590. * the configured hardware with the values of the structure referenced by the parameter ConfigPtr.
  591. * All time units used within the API services of the GPT driver shall be of the unit ticks.
  592. * This function shall only initialize the configured resources. Resources that are
  593. * not configured in the configuration file shall not be touched.
  594. * The following rules regarding initialization of controller registers shall apply
  595. * to the GPT Driver implementation:
  596. * [1] If the hardware allows for only one usage of the register, the driver
  597. * module implementing that functionality is responsible for initializing the register
  598. * [2] If the register can affect several hardware modules and if it is an IO register it
  599. * shall be initialized by the PORT driver
  600. * [3] If the register can affect several hardware modules and if it is not an IO register
  601. * it shall be initialized by the MCU driver
  602. * [4] One-time writable registers that require initialization directly after reset shall be
  603. * initialized by the startup code
  604. * [5] All other registers shall be initialized by the startup code
  605. *
  606. * @param[in] configPtr Pointer to a selected configuration structure
  607. *
  608. * @return void
  609. * @api
  610. *
  611. * @pre The data structure including the configuration set required for initializing the GPT driver..
  612. * @implements Gpt_Init_Activity
  613. */
  614. void Gpt_Init (const Gpt_ConfigType * configPtr);
  615. /*================================================================================================*/
  616. #if (GPT_DEINIT_API == STD_ON)
  617. /**
  618. * @brief GPT driver de-initialization function.
  619. * @details Service for de initializing all hardware timer channels to their power on reset state.
  620. * The state of the peripheral after DeInit shall be the same as after power on reset.
  621. * The service influences only the peripherals, which are allocated by static
  622. * configuration and the runtime configuration set passed by the previous call of Gpt_Init()
  623. * The driver needs to be initialized before calling Gpt_DeInit(). Otherwise, the
  624. * function Gpt_DeInit shall raise the development error GPT_E_UNINIT and leave the desired
  625. * de initialization functionality without any action.
  626. *
  627. * @api
  628. * @return void
  629. *
  630. * @pre The driver needs to be initialized.
  631. * @implements Gpt_DeInit_Activity
  632. */
  633. void Gpt_DeInit(void);
  634. #endif
  635. /*================================================================================================*/
  636. #if (GPT_TIME_ELAPSED_API == STD_ON)
  637. /**
  638. * @brief GPT driver function for fetching the elapsed timer value.
  639. * @details Service for querying the time already elapsed.
  640. * In one shot mode, this is the value relative to the point in time, the channel has been
  641. * started with Gpt_StartTimer (calculated by the normal operation function by subtracting
  642. * the current minus the initial timer value and returning the absolute value).
  643. * In continuous mode, the function returns the timer value relative to the last timeout or
  644. * the start of the channel.
  645. * All time units used within the API services of the GPT driver shall be of the unit ticks.
  646. * Usage of re-entrant capability is only allowed if the callers take care that
  647. * there is no simultaneous usage of the same channel.
  648. * To get times out of register values it is necessary to know the oscillator frequency, pre
  649. * prescalers and so on. Since these settings are made in MCU and(or) in other modules it is
  650. * not possible to calculate such times. Hence the conversions between time and ticks shall
  651. * be part of an upper layer.
  652. * The driver needs to be initialized before calling Gpt_GetTimeElapsed(). Otherwise, the
  653. * function shall raise the development error GPT_E_UNINIT and return 0.
  654. *
  655. * @param[in] channel - channel id
  656. *
  657. * @return Gpt_ValueType - Elapsed Time in number of ticks
  658. *
  659. * @api
  660. *
  661. * @pre The driver needs to be initialized.
  662. * @implements Gpt_GetTimeElapsed_Activity
  663. */
  664. Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType channel);
  665. #endif
  666. /*================================================================================================*/
  667. #if (GPT_TIME_REMAINING_API == STD_ON)
  668. /**
  669. * @brief GPT driver function for fetching the remaining timer value.
  670. * @details This function returns the timer value remaining until the next timeout period will
  671. * expire (calculated by the normal operation function by subtracting the timeout minus
  672. * the current timer value and returning the absolute value)
  673. * All time units used within the API services of the GPT driver shall be of the unit ticks.
  674. * Usage of re-entrant capability is only allowed if the callers take care that there is no
  675. * simultaneous usage of the same channel.
  676. * To get times out of register values it is necessary to know the oscillator frequency,
  677. * pre-scalers and so on. Since these settings are made in MCU and(or) in other modules it is
  678. * not possible to calculate such times. Hence the conversions between time and ticks shall
  679. * be part of an upper layer.
  680. * The driver needs to be initialized before calling Gpt_GetTimeRemaining(). Otherwise, the
  681. * function shall raise the development error GPT_E_UNINIT and return 0.
  682. *
  683. *
  684. * @param[in] channel - channel id
  685. *
  686. * @return Gpt_ValueType - Returns the time remaining until the target time is reached in number of ticks.
  687. *
  688. * @api
  689. *
  690. * @pre The driver needs to be initialized.
  691. * @implements Gpt_GetTimeRemaining_Activity
  692. */
  693. Gpt_ValueType Gpt_GetTimeRemaining(Gpt_ChannelType channel);
  694. #endif
  695. /*================================================================================================*/
  696. /**
  697. * @brief GPT driver function for starting a timer channel.
  698. * @details The function Gpt_StartTimer shall start the selected timer channel with a defined
  699. * time-out period.
  700. * The function Gpt_StartTimer shall invoke the configured notification for that channel
  701. * (see also GPT292) after the time-out period referenced via the parameter value (if
  702. * enabled).
  703. * All time units used within the API services of the GPT driver shall be of the unit ticks.
  704. * In production mode no error is generated. The rational is that it adds no
  705. * additional functionality to the driver. In this case the timer will be restarted with the
  706. * time-out value, given as a parameter to the service.
  707. * Usage of re-entrant capability is only allowed if the callers take care that
  708. * there is no simultaneous usage of the same channel.
  709. * To get times out of register values it is necessary to know the oscillator
  710. * frequency, pre-scalers and so on. Since these settings are made in MCU and(or) in other
  711. * modules it is not possible to calculate such times. Hence the conversions between time
  712. * and ticks shall be part of an upper layer.
  713. * The driver needs to be initialized before calling Gpt_StartTimer(). Otherwise, the
  714. * function Gpt_StartTimer shall raise the development error GPT_E_UNINIT.
  715. *
  716. * @param[in] channel channel id
  717. * @param[in] value time-out period (in number of ticks) after a notification or a wakeup event shall occur.
  718. *
  719. * @return void
  720. * @api
  721. * @pre The driver needs to be initialized.
  722. * @implements Gpt_StartTimer_Activity
  723. */
  724. void Gpt_StartTimer(Gpt_ChannelType channel,Gpt_ValueType value);
  725. /*================================================================================================*/
  726. /**
  727. * @brief GPT driver function for stopping a timer channel.
  728. * @details Service for stopping the selected timer channel
  729. * Stopping a timer channel, not been started before will not return a development error
  730. * Timer channels configured in one shot mode are stopped automatically, when the
  731. * time-out period has expired.
  732. * Usage of re-entrant capability is only allowed if the callers take care that
  733. * there is no simultaneous usage of the same channel.
  734. * The driver needs to be initialized before calling Gpt_StopTimer(). Otherwise,
  735. * the function shall raise the development error GPT_E_UNINIT.
  736. *
  737. * @param[in] channel channel id
  738. * @return void
  739. *
  740. * @api
  741. * @pre The driver needs to be initialized. Gpt_StartTimer must be called before.
  742. * @implements Gpt_StopTimer_Activity
  743. */
  744. void Gpt_StopTimer(Gpt_ChannelType channel);
  745. /*================================================================================================*/
  746. #if (GPT_ENABLE_DISABLE_NOTIFICATION_API == STD_ON)
  747. /**
  748. * @brief GPT driver function for enabling the notification for a timer channel.
  749. * @details Service for enabling the notification for a channel during runtime.
  750. * This function can be called, while the timer is already running.
  751. * Usage of re-entrant capability is only allowed if the callers take care that
  752. * there is no simultaneous usage of the same channel.
  753. * The driver needs to be initialized before calling Gpt_EnableNotification(). Otherwise,
  754. * the function Gpt_EnableNotification shall raise the development error GPT_E_UNINIT.
  755. *
  756. * @param[in] channel channel id
  757. * @return void
  758. * @api
  759. *
  760. * @pre The driver needs to be initialized.
  761. * @implements Gpt_EnableNotification_Activity
  762. */
  763. void Gpt_EnableNotification(Gpt_ChannelType channel);
  764. /*================================================================================================*/
  765. /**
  766. * @brief GPT driver function for disabling the notification for a timer channel.
  767. * @details Service for disabling the notification for a channel during runtime.
  768. * This function can be called, while the timer is already running
  769. * When disabled, no notification will be sent. When re-enabled again, the user
  770. * will not be notified of events, occurred while notifications have been disabled.
  771. * Usage of re-entrant capability is only allowed if the callers take care that
  772. * there is no simultaneous usage of the same channel.
  773. * The driver needs to be initialized before calling Gpt_DisableNotification().
  774. * Otherwise, the function shall raise the development error GPT_E_UNINIT.
  775. *
  776. * @param[in] channel channel id
  777. * @return void
  778. * @api
  779. *
  780. * @pre The driver needs to be initialized.
  781. * @implements Gpt_DisableNotification_Activity
  782. */
  783. void Gpt_DisableNotification(Gpt_ChannelType channel);
  784. #endif
  785. #if (GPT_WAKEUP_FUNCTIONALITY_API == STD_ON)
  786. /*================================================================================================*/
  787. /**
  788. * @brief GPT driver function for setting the operation mode.
  789. * @details Service for GPT mode selection. This service shall set the operation mode to the given
  790. * mode parameter .
  791. * When sleep mode is requested, the ECU State Manager calls Gpt_SetMode with mode
  792. * parameter "GPT_MODE_SLEEP" and prepares the GPT for sleep mode. The MCU Driver is then
  793. * putting the controller into SLEEP mode
  794. * The driver needs to be initialized before calling Gpt_SetMode(). Otherwise, the
  795. * function Gpt_SetMode shall raise the development error GPT_E_UNINIT.
  796. *
  797. * @param[in] eMode operation mode :
  798. * - GPT_MODE_NORMAL: Normal operation mode of the GPT driver.
  799. * - GPT_MODE_SLEEP: Sleep mode of the GPT driver (wakeup capable)
  800. * @return void
  801. * @api
  802. *
  803. * @pre The driver needs to be initialized.
  804. * @implements Gpt_SetMode_Activity
  805. */
  806. void Gpt_SetMode(Gpt_ModeType eMode);
  807. /*================================================================================================*/
  808. /**
  809. * @brief GPT driver function for disabling the wakeup interrupt invocation for a timer channel.
  810. * @details This service shall disable the wakeup interrupt invocation of a single GPT
  811. * channel.
  812. * Usage of re-entrant capability is only allowed if the callers take care that
  813. * there is no simultaneous usage of the same channel.
  814. * The driver needs to be initialized before calling Gpt_DisableWakeup(). Otherwise, the
  815. * function Gpt_DisableWakeup shall raise the development error GPT_E_UNINIT.
  816. *
  817. * @param[in] channel channel id
  818. * @return void
  819. * @api
  820. *
  821. * @pre The driver needs to be initialized.
  822. * @implements Gpt_DisableWakeup_Activity
  823. */
  824. void Gpt_DisableWakeup(Gpt_ChannelType channel);
  825. /*================================================================================================*/
  826. /**
  827. * @brief GPT driver function for enabling the wakeup interrupt invocation for a timer channel.
  828. * @details This service shall re-enable the wakeup interrupt invocation of a single GPT
  829. * channel.
  830. * If supported by hardware and enabled, an internal hardware timer can serve as a
  831. * wakeup source
  832. * Usage of re-entrant capability is only allowed if the callers take care that
  833. * there is no simultaneous usage of the same channel.
  834. *
  835. * @param[in] channel channel id
  836. * @return void
  837. * @api
  838. *
  839. * @pre The driver needs to be initialized. The channel must be configured as wakeup capable.
  840. * @implements Gpt_EnableWakeup_Activity
  841. */
  842. void Gpt_EnableWakeup(Gpt_ChannelType channel);
  843. /*================================================================================================*/
  844. /**
  845. * @brief GPT driver function for checking if a wakeup capable GPT channel is the source for a
  846. * wakeup event.
  847. * @details Checks if a wakeup capable GPT channel is the source for a wakeup event and calls the ECU
  848. * state manager service EcuM_SetWakeupEvent in case of a valid GPT channel wakeup event.
  849. * The driver needs to be initialized before calling Gpt_CheckWakeup(). Otherwise, the
  850. * function Gpt_CheckWakeup shall raise the development error GPT_E_UNINIT.
  851. *
  852. * @param[in] wakeupSource wakeup source
  853. * @return void
  854. * @api
  855. *
  856. * @pre The driver needs to be initialized. The channel must be configured as wakeup capable.
  857. * @implements Gpt_CheckWakeup_Activity
  858. */
  859. void Gpt_CheckWakeup(EcuM_WakeupSourceType wakeupSource);
  860. #endif
  861. /*================================================================================================*/
  862. #if (GPT_CHANGE_NEXT_TIMEOUT_VALUE == STD_ON)
  863. /**
  864. * @brief The function changes the time out period value of the requested running channel.
  865. * @details The function changes the time out period (in number of ticks) of the channel is
  866. * running which will be used after the first compare matching.
  867. * This is a non-autosar function.
  868. * @param[in] channel channel id
  869. * @param[in] value time out period (in number of ticks) after a notification shall occur
  870. * @return void
  871. * @pre Gpt_Init and Gpt_StartTimer must be called before.
  872. * @implements
  873. */
  874. void Gpt_ChangeNextTimeoutValue
  875. (
  876. Gpt_ChannelType channel,
  877. Gpt_ValueType value
  878. );
  879. #endif
  880. /*================================================================================================*/
  881. #if (GPT_SET_CLOCK_MODE == STD_ON)
  882. /**
  883. * @brief This function changes the channel pre scaler.
  884. * @details This function sets all channels pre scalers based on the input mode.
  885. *
  886. * @param[in] eClkMode pre scaler setting ( NORMAL or ALTERNATE )
  887. * @return void
  888. * @pre Gpt_Init must be called before.
  889. *
  890. *
  891. *
  892. * @implements Gpt_SetClockMode_Activity
  893. */
  894. void Gpt_SetClockMode(Gpt_ClockModeType eClkMode);
  895. #endif
  896. /*================================================================================================*/
  897. #if (GPT_CHAIN_MODE == STD_ON)
  898. /**
  899. * @brief The function enables the chain functionality for timer.
  900. * @details The function enables the chain functionality for timer. Timer will be chained with timer n-1.
  901. Channel 0 cannot be chained.
  902. * This is a non-autosar function.
  903. * @param[in] channel channel id
  904. * @return void
  905. * @pre Gpt_Init must be called before.
  906. *
  907. * @implements Gpt_Channel_EnableChainMode_Activity
  908. */
  909. void Gpt_Channel_EnableChainMode(Gpt_ChannelType channel);
  910. /*================================================================================================*/
  911. /**
  912. * @brief The function disables the chain functionality for timer.
  913. * @details The function disables the chain functionality for timer. Timer will not be chained with timer n-1.
  914. Channel 0 cannot be chained or unchained.
  915. * This is a non-autosar function.
  916. * @param[in] channel channel id
  917. * @return void
  918. * @pre Gpt_Init must be called before.
  919. *
  920. * @implements Gpt_Channel_DisableChainMode_Activity
  921. */
  922. void Gpt_Channel_DisableChainMode(Gpt_ChannelType channel);
  923. #endif
  924. /*================================================================================================*/
  925. #if(GPT_PREDEFTIMER_FUNCTIONALITY_API == STD_ON)
  926. /**
  927. * @brief Provides the current value of the given predefined free-running timer
  928. * @details This function provides the current value of the given predefined free-running timer.
  929. *
  930. * @param[in] PredefTimer: Gpt_PredefTimerType ( GPT_PREDEF_TIMER_1US_16BIT,
  931. * GPT_PREDEF_TIMER_1US_24BIT,
  932. * GPT_PREDEF_TIMER_1US_32BIT
  933. * GPT_PREDEF_TIMER_100US_32BIT)
  934. * @param[out] TimeValuePtr: Pointer to time value destination data in RAM
  935. * @pre Gpt_Init must be called before.
  936. * @return returnValue - E_OK: no error has been detected.
  937. * - E_NOT_OK: aborted due to errors.
  938. *
  939. *
  940. * @implements Gpt_GetPredefTimerValue_Activity
  941. */
  942. Std_ReturnType Gpt_GetPredefTimerValue
  943. (
  944. Gpt_PredefTimerType PredefTimer,
  945. uint32 * TimeValuePtr
  946. );
  947. #endif
  948. /**
  949. * @internal
  950. * @brief MemMap section
  951. */
  952. #define GPT_STOP_SEC_CODE
  953. #include "Gpt_MemMap.h"
  954. #ifdef __cplusplus
  955. }
  956. #endif
  957. /** @} */
  958. #endif /* GPT_H */