Icu_Ipw.c 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  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. /**
  25. * @file
  26. * @internal
  27. * @addtogroup icu_ipw Icu Driver
  28. * @{
  29. */
  30. #ifdef __cplusplus
  31. extern "C"{
  32. #endif
  33. /*==================================================================================================
  34. * INCLUDE FILES
  35. * 1) system and project includes
  36. * 2) needed interfaces from external units
  37. * 3) internal and external interfaces from this unit
  38. ==================================================================================================*/
  39. #include "Icu_Ipw.h"
  40. #include "Ftm_Icu_Ip.h"
  41. #include "Lpit_Icu_Ip.h"
  42. #include "Lptmr_Icu_Ip.h"
  43. #include "Port_Ci_Icu_Ip.h"
  44. #include "Cmp_Ip.h"
  45. /*==================================================================================================
  46. * SOURCE FILE VERSION INFORMATION
  47. ==================================================================================================*/
  48. #define ICU_IPW_VENDOR_ID_C 43
  49. #define ICU_IPW_AR_RELEASE_MAJOR_VERSION_C 4
  50. #define ICU_IPW_AR_RELEASE_MINOR_VERSION_C 4
  51. #define ICU_IPW_AR_RELEASE_REVISION_VERSION_C 0
  52. #define ICU_IPW_SW_MAJOR_VERSION_C 1
  53. #define ICU_IPW_SW_MINOR_VERSION_C 0
  54. #define ICU_IPW_SW_PATCH_VERSION_C 0
  55. /*==================================================================================================
  56. * FILE VERSION CHECKS
  57. ==================================================================================================*/
  58. /* Check if source file and ICU header file are of the same vendor */
  59. #if (ICU_IPW_VENDOR_ID_C != ICU_IPW_VENDOR_ID)
  60. #error "Icu_Ipw.c and Icu_Ipw.h have different vendor IDs"
  61. #endif
  62. /* Check if source file and ICU header file are of the same AutoSar version */
  63. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != ICU_IPW_AR_RELEASE_MAJOR_VERSION) || \
  64. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != ICU_IPW_AR_RELEASE_MINOR_VERSION) || \
  65. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != ICU_IPW_AR_RELEASE_REVISION_VERSION))
  66. #error "AutoSar Version Numbers of Icu_Ipw.c and Icu_Ipw.h are different"
  67. #endif
  68. /* Check if source file and ICU header file are of the same Software version */
  69. #if ((ICU_IPW_SW_MAJOR_VERSION_C != ICU_IPW_SW_MAJOR_VERSION) || \
  70. (ICU_IPW_SW_MINOR_VERSION_C != ICU_IPW_SW_MINOR_VERSION) || \
  71. (ICU_IPW_SW_PATCH_VERSION_C != ICU_IPW_SW_PATCH_VERSION))
  72. #error "Software Version Numbers of Icu_Ipw.c and Icu_Ipw.h are different"
  73. #endif
  74. /* Check if source file and ICU header file are of the same vendor */
  75. #if (ICU_IPW_VENDOR_ID_C != PORT_CI_ICU_IP_VENDOR_ID)
  76. #error "Icu_Ipw.c and Port_Ci_Icu_Ip.h have different vendor IDs"
  77. #endif
  78. /* Check if source file and ICU header file are of the same AutoSar version */
  79. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != PORT_CI_ICU_IP_AR_RELEASE_MAJOR_VERSION) || \
  80. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != PORT_CI_ICU_IP_AR_RELEASE_MINOR_VERSION) || \
  81. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != PORT_CI_ICU_IP_AR_RELEASE_REVISION_VERSION))
  82. #error "AutoSar Version Numbers of Icu_Ipw.c and Port_Ci_Icu_Ip.h are different"
  83. #endif
  84. /* Check if source file and ICU header file are of the same Software version */
  85. #if ((ICU_IPW_SW_MAJOR_VERSION_C != PORT_CI_ICU_IP_SW_MAJOR_VERSION) || \
  86. (ICU_IPW_SW_MINOR_VERSION_C != PORT_CI_ICU_IP_SW_MINOR_VERSION) || \
  87. (ICU_IPW_SW_PATCH_VERSION_C != PORT_CI_ICU_IP_SW_PATCH_VERSION))
  88. #error "Software Version Numbers of Icu_Ipw.c and Port_Ci_Icu_Ip.h are different"
  89. #endif
  90. /* Check if source file and ICU header file are of the same vendor */
  91. #if (ICU_IPW_VENDOR_ID_C != FTM_ICU_IP_VENDOR_ID)
  92. #error "Icu_Ipw.c and Ftm_Icu_Ip.h have different vendor IDs"
  93. #endif
  94. /* Check if source file and ICU header file are of the same AutoSar version */
  95. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != FTM_ICU_IP_AR_RELEASE_MAJOR_VERSION) || \
  96. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != FTM_ICU_IP_AR_RELEASE_MINOR_VERSION) || \
  97. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != FTM_ICU_IP_AR_RELEASE_REVISION_VERSION))
  98. #error "AutoSar Version Numbers of Icu_Ipw.c and Ftm_Icu_Ip.h are different"
  99. #endif
  100. /* Check if source file and ICU header file are of the same Software version */
  101. #if ((ICU_IPW_SW_MAJOR_VERSION_C != FTM_ICU_IP_SW_MAJOR_VERSION) || \
  102. (ICU_IPW_SW_MINOR_VERSION_C != FTM_ICU_IP_SW_MINOR_VERSION) || \
  103. (ICU_IPW_SW_PATCH_VERSION_C != FTM_ICU_IP_SW_PATCH_VERSION))
  104. #error "Software Version Numbers of Icu_Ipw.c and Ftm_Icu_Ip.h are different"
  105. #endif
  106. /* Check if source file and ICU header file are of the same vendor */
  107. #if (ICU_IPW_VENDOR_ID_C != LPTMR_ICU_IP_VENDOR_ID)
  108. #error "Icu_Ipw.c and Lptmr_Icu_Ip.h have different vendor IDs"
  109. #endif
  110. /* Check if source file and ICU header file are of the same AutoSar version */
  111. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != LPTMR_ICU_IP_AR_RELEASE_MAJOR_VERSION) || \
  112. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != LPTMR_ICU_IP_AR_RELEASE_MINOR_VERSION) || \
  113. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != LPTMR_ICU_IP_AR_RELEASE_REVISION_VERSION))
  114. #error "AutoSar Version Numbers of Icu_Ipw.c and Lptmr_Icu_Ip.h are different"
  115. #endif
  116. /* Check if source file and ICU header file are of the same Software version */
  117. #if ((ICU_IPW_SW_MAJOR_VERSION_C != LPTMR_ICU_IP_SW_MAJOR_VERSION) || \
  118. (ICU_IPW_SW_MINOR_VERSION_C != LPTMR_ICU_IP_SW_MINOR_VERSION) || \
  119. (ICU_IPW_SW_PATCH_VERSION_C != LPTMR_ICU_IP_SW_PATCH_VERSION))
  120. #error "Software Version Numbers of Icu_Ipw.c and Lptmr_Icu_Ip.h are different"
  121. #endif
  122. /* Check if source file and ICU Lpit_Icu_Ip.h header file are of the same vendor */
  123. #if (ICU_IPW_VENDOR_ID_C != LPIT_ICU_IP_VENDOR_ID)
  124. #error "Icu_Ipw.c and Lpit_Icu_Ip.h have different vendor IDs!"
  125. #endif
  126. /* Check if source file and ICU Lpit_Icu_Ip.h header file are of the same AutoSar version */
  127. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != LPIT_ICU_IP_AR_RELEASE_MAJOR_VERSION) || \
  128. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != LPIT_ICU_IP_AR_RELEASE_MINOR_VERSION) || \
  129. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != LPIT_ICU_IP_AR_RELEASE_REVISION_VERSION))
  130. #error "AutoSar Version Numbers of Icu_Ipw.c and Lpit_Icu_Ip.h are different!"
  131. #endif
  132. /* Check if source file and ICU Lpit_Icu_Ip.h header file are of the same Software version */
  133. #if ((ICU_IPW_SW_MAJOR_VERSION_C != LPIT_ICU_IP_SW_MAJOR_VERSION) || \
  134. (ICU_IPW_SW_MINOR_VERSION_C != LPIT_ICU_IP_SW_MINOR_VERSION) || \
  135. (ICU_IPW_SW_PATCH_VERSION_C != LPIT_ICU_IP_SW_PATCH_VERSION))
  136. #error "Software Version Numbers of Icu_Ipw.c and Lpit_Icu_Ip.h are different!"
  137. #endif
  138. /* Check if source file and ICU Cmp_Ip.h header file are of the same vendor */
  139. #if (ICU_IPW_VENDOR_ID_C != CMP_IP_VENDOR_ID)
  140. #error "Icu_Ipw.c and Cmp_Ip.h have different vendor IDs!"
  141. #endif
  142. /* Check if source file and ICU Cmp_Ip.h header file are of the same AutoSar version */
  143. #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION_C != CMP_IP_AR_RELEASE_MAJOR_VERSION) || \
  144. (ICU_IPW_AR_RELEASE_MINOR_VERSION_C != CMP_IP_AR_RELEASE_MINOR_VERSION) || \
  145. (ICU_IPW_AR_RELEASE_REVISION_VERSION_C != CMP_IP_AR_RELEASE_REVISION_VERSION))
  146. #error "AutoSar Version Numbers of Icu_Ipw.c and Cmp_Ip.h are different!"
  147. #endif
  148. /* Check if source file and ICU Cmp_Ip.h header file are of the same Software version */
  149. #if ((ICU_IPW_SW_MAJOR_VERSION_C != CMP_IP_SW_MAJOR_VERSION) || \
  150. (ICU_IPW_SW_MINOR_VERSION_C != CMP_IP_SW_MINOR_VERSION) || \
  151. (ICU_IPW_SW_PATCH_VERSION_C != CMP_IP_SW_PATCH_VERSION))
  152. #error "Software Version Numbers of Icu_Ipw.c and Cmp_Ip.h are different!"
  153. #endif
  154. /*==================================================================================================
  155. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  156. ==================================================================================================*/
  157. /*==================================================================================================
  158. * LOCAL MACROS
  159. ==================================================================================================*/
  160. /*==================================================================================================
  161. * LOCAL CONSTANTS
  162. ==================================================================================================*/
  163. /*==================================================================================================
  164. * LOCAL VARIABLES
  165. ==================================================================================================*/
  166. /*==================================================================================================
  167. * GLOBAL CONSTANTS
  168. ==================================================================================================*/
  169. /*==================================================================================================
  170. * GLOBAL VARIABLES
  171. ==================================================================================================*/
  172. /*==================================================================================================
  173. * LOCAL FUNCTION PROTOTYPES
  174. ==================================================================================================*/
  175. /*==================================================================================================
  176. * LOCAL FUNCTIONS
  177. ==================================================================================================*/
  178. #define ICU_START_SEC_CODE
  179. #include "Icu_MemMap.h"
  180. /*==================================================================================================
  181. * GLOBAL FUNCTIONS
  182. ==================================================================================================*/
  183. /**
  184. * @brief Icu_Ipw_Init
  185. * @details Initialize a hardware Icu IP Instance
  186. *
  187. * @param[in] count - Number of instances to be configured
  188. * @param[in] pIpConfig - Pointer that contains IP specific configuration data for the Icu driver
  189. *
  190. * @return void
  191. *
  192. * @pre Icu_DeInit must be called before.
  193. *
  194. */
  195. void Icu_Ipw_Init(uint8 count, const Icu_Ipw_IpConfigType (*pIpConfig)[])
  196. {
  197. uint8 index;
  198. for(index = 0; index < count; index++)
  199. {
  200. if (ICU_FTM_MODULE == (*pIpConfig)[index].instanceIp)
  201. {
  202. (void)Ftm_Icu_Ip_Init((*pIpConfig)[index].instanceNo, \
  203. (*pIpConfig)[index].pFtmHwIpConfig);
  204. }
  205. else if (ICU_LPIT_MODULE == (*pIpConfig)[index].instanceIp)
  206. {
  207. (void)Lpit_Icu_Ip_Init((*pIpConfig)[index].instanceNo, \
  208. (*pIpConfig)[index].pLpitHwInstanceConfig);
  209. }
  210. else if (ICU_LPTMR_MODULE == (*pIpConfig)[index].instanceIp)
  211. {
  212. (void)Lptmr_Icu_Ip_Init((*pIpConfig)[index].instanceNo, \
  213. (*pIpConfig)[index].pLptmrHwIpConfig);
  214. }
  215. else if (ICU_PORT_CI_MODULE == (*pIpConfig)[index].instanceIp)
  216. {
  217. (void)Port_Ci_Icu_Ip_Init((*pIpConfig)[index].instanceNo, \
  218. (*pIpConfig)[index].pPortCiHwIpConfig);
  219. }
  220. else if (ICU_CMP_MODULE == (*pIpConfig)[index].instanceIp)
  221. {
  222. (void)Cmp_Ip_Init((*pIpConfig)[index].instanceNo, \
  223. (*pIpConfig)[index].pCmpHwIpConfig);
  224. }
  225. else
  226. {
  227. /* Default do nothing. */
  228. }
  229. }
  230. }
  231. #if (STD_ON == ICU_DE_INIT_API)
  232. /**
  233. * @brief Icu_Ipw_DeInit
  234. * @details De-initialize ICU hardware channel
  235. *
  236. * @param[in] pIpConfig - Pointer to ICU top configuration structure
  237. *
  238. * @return void
  239. *
  240. * @pre Icu_Init must be called before.
  241. *
  242. */
  243. void Icu_Ipw_DeInit(uint8 count, const Icu_Ipw_IpConfigType (*pIpConfig)[])
  244. {
  245. uint8 index;
  246. for(index = 0; index < count; index++)
  247. {
  248. if (ICU_FTM_MODULE == (*pIpConfig)[index].instanceIp)
  249. {
  250. (void)Ftm_Icu_Ip_DeInit((*pIpConfig)[index].instanceNo);
  251. }
  252. else if (ICU_LPIT_MODULE == (*pIpConfig)[index].instanceIp)
  253. {
  254. (void)Lpit_Icu_Ip_Deinit((*pIpConfig)[index].instanceNo);
  255. }
  256. else if (ICU_LPTMR_MODULE == (*pIpConfig)[index].instanceIp)
  257. {
  258. (void)Lptmr_Icu_Ip_Deinit((*pIpConfig)[index].instanceNo);
  259. }
  260. else if (ICU_PORT_CI_MODULE == (*pIpConfig)[index].instanceIp)
  261. {
  262. (void)Port_Ci_Icu_Ip_DeInit((*pIpConfig)[index].instanceNo);
  263. }
  264. else if (ICU_CMP_MODULE == (*pIpConfig)[index].instanceIp)
  265. {
  266. (void)Cmp_Ip_Deinit((*pIpConfig)[index].instanceNo);
  267. }
  268. else
  269. {
  270. /* Default do nothing. */
  271. }
  272. }
  273. }
  274. #endif /* ICU_DE_INIT_API == STD_ON */
  275. #if (ICU_SET_MODE_API == STD_ON)
  276. /**
  277. * @brief Put the channel in a reduce power state.
  278. * @details Set sleep mode
  279. *
  280. * @param ChannelConfig - configuration of the channel
  281. *
  282. * @return void
  283. * @internal
  284. */
  285. void Icu_Ipw_SetSleepMode(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  286. {
  287. uint8 channel;
  288. uint8 module = ChannelConfig->instanceNo;
  289. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  290. /* Select IP type case. */
  291. switch(ipType)
  292. {
  293. case ICU_FTM_MODULE:
  294. {
  295. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  296. Ftm_Icu_Ip_SetSleepMode(module, channel);
  297. break;
  298. }
  299. case ICU_LPTMR_MODULE:
  300. {
  301. Lptmr_Icu_Ip_SetSleepMode(module);
  302. break;
  303. }
  304. case ICU_PORT_CI_MODULE:
  305. {
  306. channel = (ChannelConfig->pPortCiHwChannelConfig)->pinId;
  307. Port_Ci_Icu_Ip_SetSleepMode(module, channel);
  308. break;
  309. }
  310. default:
  311. {
  312. /* Do nothing. */
  313. }
  314. break;
  315. }
  316. }
  317. /**
  318. * @brief Icu_Ipw_SetNormalMode
  319. * @details Set normal mode
  320. *
  321. * @param[in] ChannelConfig - The index of ICU channel for current configuration structure
  322. *
  323. * @return void
  324. * @internal
  325. */
  326. void Icu_Ipw_SetNormalMode (const Icu_Ipw_ChannelConfigType* ChannelConfig)
  327. {
  328. uint8 channel;
  329. uint8 module = ChannelConfig->instanceNo;
  330. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  331. /* Select IP type case. */
  332. switch(ipType)
  333. {
  334. case ICU_FTM_MODULE:
  335. {
  336. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  337. Ftm_Icu_Ip_SetNormalMode(module, channel);
  338. break;
  339. }
  340. case ICU_LPTMR_MODULE:
  341. {
  342. Lptmr_Icu_Ip_SetNormalMode(module);
  343. break;
  344. }
  345. case ICU_PORT_CI_MODULE:
  346. {
  347. channel = (ChannelConfig->pPortCiHwChannelConfig)->pinId;
  348. Port_Ci_Icu_Ip_SetNormalMode(module, channel);
  349. break;
  350. }
  351. default:
  352. {
  353. /* Do nothing. */
  354. }
  355. break;
  356. }
  357. }
  358. #endif /* ICU_SET_MODE_API */
  359. /**
  360. * @brief Icu_Ipw_SetActivationCondition
  361. * @brief
  362. *
  363. * @param activation - the type of activation for the ICU channel.
  364. * @param ChannelConfig - channel to be configured.
  365. *
  366. * @return void
  367. *
  368. */
  369. void Icu_Ipw_SetActivationCondition(Icu_ActivationType activation,
  370. const Icu_Ipw_ChannelConfigType* ChannelConfig)
  371. {
  372. uint8 channel;
  373. uint8 module = ChannelConfig->instanceNo;
  374. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  375. /* Select IP type case. */
  376. switch(ipType)
  377. {
  378. case ICU_FTM_MODULE:
  379. {
  380. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  381. if (ICU_FALLING_EDGE == activation)
  382. {
  383. Ftm_Icu_Ip_SetActivationCondition(module, channel, FTM_ICU_FALLING_EDGE);
  384. }
  385. else if (ICU_RISING_EDGE == activation)
  386. {
  387. Ftm_Icu_Ip_SetActivationCondition(module, channel, FTM_ICU_RISING_EDGE);
  388. }
  389. else if (ICU_BOTH_EDGES == activation)
  390. {
  391. Ftm_Icu_Ip_SetActivationCondition(module, channel, FTM_ICU_BOTH_EDGES);
  392. }
  393. else
  394. {
  395. Ftm_Icu_Ip_SetActivationCondition(module, channel, FTM_ICU_NO_PIN_CONTROL);
  396. }
  397. break;
  398. }
  399. case ICU_PORT_CI_MODULE:
  400. {
  401. channel = (ChannelConfig->pPortCiHwChannelConfig)->pinId;
  402. if (ICU_FALLING_EDGE == activation)
  403. {
  404. Port_Ci_Icu_Ip_SetActivationCondition(module, channel, PORT_CI_ICU_FALLING_EDGE);
  405. }
  406. else if (ICU_RISING_EDGE == activation)
  407. {
  408. Port_Ci_Icu_Ip_SetActivationCondition(module, channel, PORT_CI_ICU_RISING_EDGE);
  409. }
  410. else if (ICU_BOTH_EDGES == activation)
  411. {
  412. Port_Ci_Icu_Ip_SetActivationCondition(module, channel, PORT_CI_ICU_BOTH_EDGES);
  413. }
  414. else
  415. {
  416. Port_Ci_Icu_Ip_SetActivationCondition(module, channel, PORT_CI_ICU_NO_PIN_CONTROL);
  417. }
  418. break;
  419. }
  420. case ICU_LPTMR_MODULE:
  421. {
  422. if (ICU_FALLING_EDGE == activation)
  423. {
  424. Lptmr_Icu_Ip_SetActivationCondition(module, LPTMR_ICU_FALLING_EDGE);
  425. }
  426. else
  427. {
  428. Lptmr_Icu_Ip_SetActivationCondition(module, LPTMR_ICU_RISING_EDGE);
  429. }
  430. break;
  431. }
  432. case ICU_CMP_MODULE:
  433. {
  434. if (ICU_FALLING_EDGE == activation)
  435. {
  436. Cmp_Ip_SetInterruptActivation(module, CMP_IP_INTTRIG_FALLING_EDGE);
  437. }
  438. else if (ICU_RISING_EDGE == activation)
  439. {
  440. Cmp_Ip_SetInterruptActivation(module, CMP_IP_INTTRIG_RISING_EDGE);
  441. }
  442. else if (ICU_BOTH_EDGES == activation)
  443. {
  444. Cmp_Ip_SetInterruptActivation(module, CMP_IP_INTTRIG_BOTH_EDGES);
  445. }
  446. else
  447. {
  448. Cmp_Ip_SetInterruptActivation(module, CMP_IP_INTTRIG_NONE);
  449. }
  450. break;
  451. }
  452. default:
  453. {
  454. /* Do nothing. */
  455. }
  456. break;
  457. }
  458. }
  459. #if (ICU_GET_INPUT_STATE_API == STD_ON)
  460. /**
  461. * @brief Service that returns the state of the ICU driver.
  462. *
  463. * @param ChannelConfig
  464. * @return boolean
  465. */
  466. boolean Icu_Ipw_GetInputState(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  467. {
  468. boolean retState = FALSE;
  469. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  470. {
  471. retState = Ftm_Icu_Ip_GetInputState(ChannelConfig->instanceNo, \
  472. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  473. }
  474. else if (ICU_LPIT_MODULE == ChannelConfig->channelIp)
  475. {
  476. retState = Lpit_Icu_Ip_GetInputState(ChannelConfig->instanceNo, \
  477. (ChannelConfig->pLpitHwChannelConfig)->hwChannel);
  478. }
  479. else if (ICU_LPTMR_MODULE == ChannelConfig->channelIp)
  480. {
  481. retState = Lptmr_Icu_Ip_GetInputState(ChannelConfig->instanceNo);
  482. }
  483. else if (ICU_PORT_CI_MODULE == ChannelConfig->channelIp)
  484. {
  485. retState = Port_Ci_Icu_Ip_GetInputState(ChannelConfig->instanceNo, \
  486. (ChannelConfig->pPortCiHwChannelConfig)->pinId);
  487. }
  488. else if (ICU_CMP_MODULE == ChannelConfig->channelIp)
  489. {
  490. retState = Cmp_Ip_GetStatus(ChannelConfig->instanceNo);
  491. }
  492. else
  493. {
  494. retState = FALSE;
  495. }
  496. return (retState);
  497. }
  498. #endif /* ICU_GET_INPUT_STATE_API */
  499. #if (STD_ON == ICU_TIMESTAMP_API)
  500. void Icu_Ipw_StartTimestamp(const Icu_Ipw_ChannelConfigType* channelConfig,
  501. uint16* bufferPtr,
  502. uint16 bufferSize,
  503. uint16 notifyInterval)
  504. {
  505. /* Select IP type. */
  506. switch(channelConfig->channelIp)
  507. {
  508. case ICU_FTM_MODULE:
  509. {
  510. /* Call FTM start timestamp function. */
  511. Ftm_Icu_Ip_StartTimestamp(channelConfig->instanceNo,
  512. (channelConfig->pFtmHwChannelConfig)->hwChannel,
  513. bufferPtr,
  514. bufferSize,
  515. notifyInterval);
  516. break;
  517. }
  518. case ICU_LPIT_MODULE:
  519. {
  520. Lpit_Icu_Ip_StartTimestamp(channelConfig->instanceNo,
  521. (channelConfig->pLpitHwChannelConfig)->hwChannel,
  522. bufferPtr,
  523. bufferSize,
  524. notifyInterval);
  525. break;
  526. }
  527. default:
  528. {
  529. /* Do nothing. */
  530. break;
  531. }
  532. }
  533. }
  534. void Icu_Ipw_StopTimestamp(const Icu_Ipw_ChannelConfigType *channelConfig)
  535. {
  536. /* Select IP type. */
  537. switch(channelConfig->channelIp)
  538. {
  539. case ICU_FTM_MODULE:
  540. {
  541. /* Call FTM stop timestamp function. */
  542. Ftm_Icu_Ip_StopTimestamp(channelConfig->instanceNo, \
  543. (channelConfig->pFtmHwChannelConfig)->hwChannel);
  544. break;
  545. }
  546. case ICU_LPIT_MODULE:
  547. {
  548. Lpit_Icu_Ip_DisableDetectionMode(channelConfig->instanceNo, \
  549. (channelConfig->pLpitHwChannelConfig)->hwChannel);
  550. break;
  551. }
  552. default:
  553. {
  554. /* Do nothing. */
  555. break;
  556. }
  557. }
  558. }
  559. uint16 Icu_Ipw_GetTimestampIndex(const Icu_Ipw_ChannelConfigType* channelConfig)
  560. {
  561. uint16 timestampIndex = 0U;
  562. /* Select IP type. */
  563. switch(channelConfig->channelIp)
  564. {
  565. case ICU_FTM_MODULE:
  566. {
  567. timestampIndex = Ftm_Icu_Ip_GetTimestampIndex(channelConfig->instanceNo, \
  568. (channelConfig->pFtmHwChannelConfig)->hwChannel);
  569. break;
  570. }
  571. case ICU_LPIT_MODULE:
  572. {
  573. timestampIndex = Lpit_Icu_Ip_GetTimestampIndex(channelConfig->instanceNo,
  574. (channelConfig->pLpitHwChannelConfig)->hwChannel);
  575. break;
  576. }
  577. default:
  578. {
  579. /* Do nothing. */
  580. break;
  581. }
  582. }
  583. return timestampIndex;
  584. }
  585. #if (ICU_TIMESTAMP_USES_DMA == STD_ON)
  586. uint32 Icu_Ipw_GetStartAddress(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  587. {
  588. uint32 startAddr = 0U;
  589. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  590. {
  591. startAddr = Ftm_Icu_Ip_GetStartAddress(ChannelConfig->instanceNo, \
  592. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  593. }
  594. return startAddr;
  595. }
  596. #endif /* ICU_TIMESTAMP_USES_DMA == STD_ON */
  597. #endif /* ICU_TIMESTAMP_API == STD_ON */
  598. #if (STD_ON == ICU_EDGE_COUNT_API)
  599. void Icu_Ipw_ResetEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  600. {
  601. /* Select IP type case. */
  602. if(ICU_FTM_MODULE == ChannelConfig->channelIp)
  603. {
  604. Ftm_Icu_Ip_ResetEdgeCount(ChannelConfig->instanceNo, \
  605. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  606. }
  607. else if(ICU_LPTMR_MODULE == ChannelConfig->channelIp)
  608. {
  609. Lptmr_Icu_Ip_ResetEdgeCount(ChannelConfig->instanceNo);
  610. }
  611. else
  612. {
  613. /* Default do nothing. */
  614. }
  615. }
  616. void Icu_Ipw_EnableEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  617. {
  618. /* Select IP type case. */
  619. if(ICU_FTM_MODULE == ChannelConfig->channelIp)
  620. {
  621. (void)Ftm_Icu_Ip_EnableEdgeCount(ChannelConfig->instanceNo, \
  622. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  623. }
  624. else if(ICU_LPTMR_MODULE == ChannelConfig->channelIp)
  625. {
  626. Lptmr_Icu_Ip_EnableEdgeCount(ChannelConfig->instanceNo);
  627. }
  628. else
  629. {
  630. /* Default do nothing. */
  631. }
  632. }
  633. void Icu_Ipw_DisableEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  634. {
  635. /* Select IP type case. */
  636. if(ICU_FTM_MODULE == ChannelConfig->channelIp)
  637. {
  638. (void)Ftm_Icu_Ip_DisableEdgeCount(ChannelConfig->instanceNo, \
  639. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  640. }
  641. else if(ICU_LPTMR_MODULE == ChannelConfig->channelIp)
  642. {
  643. (void)Lptmr_Icu_Ip_DisableEdgeCount(ChannelConfig->instanceNo);
  644. }
  645. else
  646. {
  647. /* Default do nothing. */
  648. }
  649. }
  650. uint16 Icu_Ipw_GetEdgeNumbers(const Icu_Ipw_ChannelConfigType *ChannelConfig)
  651. {
  652. uint16 edgeNumber = (uint16)0U;
  653. /* Select IP type case. */
  654. if(ICU_FTM_MODULE == ChannelConfig->channelIp)
  655. {
  656. edgeNumber = (uint16)Ftm_Icu_Ip_GetEdgeNumbers(ChannelConfig->instanceNo, \
  657. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  658. }
  659. else if(ICU_LPTMR_MODULE == ChannelConfig->channelIp)
  660. {
  661. edgeNumber = (uint16)Lptmr_Icu_Ip_GetEdgeNumbers(ChannelConfig->instanceNo);
  662. }
  663. else
  664. {
  665. edgeNumber = (uint16)0U;
  666. }
  667. return edgeNumber;
  668. }
  669. #endif /* STD_ON == ICU_EDGE_COUNT_API */
  670. #if (STD_ON == ICU_EDGE_DETECT_API)
  671. /**
  672. * @brief Retrieve the number of edges
  673. *
  674. * @param[in] nChannelNumber - The index of ICU channel for current configuration structure
  675. * @return void
  676. */
  677. void Icu_Ipw_EnableEdgeDetection(const Icu_Ipw_ChannelConfigType * ChannelConfig)
  678. {
  679. uint8 channel;
  680. uint8 module = ChannelConfig->instanceNo;
  681. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  682. /* Select IP type case. */
  683. switch(ipType)
  684. {
  685. case ICU_FTM_MODULE:
  686. {
  687. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  688. (void)Ftm_Icu_Ip_EnableEdgeDetection(module, channel);
  689. break;
  690. }
  691. case ICU_LPIT_MODULE:
  692. {
  693. channel = (ChannelConfig->pLpitHwChannelConfig)->hwChannel;
  694. Lpit_Icu_Ip_EnableEdgeDetection(module, channel);
  695. break;
  696. }
  697. case ICU_LPTMR_MODULE:
  698. {
  699. Lptmr_Icu_Ip_EnableEdgeDetection(module);
  700. break;
  701. }
  702. case ICU_PORT_CI_MODULE:
  703. {
  704. channel = (ChannelConfig->pPortCiHwChannelConfig)->pinId;
  705. Port_Ci_Icu_Ip_EnableEdgeDetection(module, channel);
  706. break;
  707. }
  708. case ICU_CMP_MODULE:
  709. {
  710. Cmp_Ip_EnableInterrupt(module);
  711. Cmp_Ip_EnableNotification(module);
  712. break;
  713. }
  714. default:
  715. {
  716. /* Do nothing. */
  717. break;
  718. }
  719. }
  720. }
  721. #endif /* ICU_EDGE_DETECT_API */
  722. #if (ICU_EDGE_DETECT_API == STD_ON)
  723. /**
  724. * @brief
  725. *
  726. * @param ChannelConfig - channel configuration used.
  727. */
  728. void Icu_Ipw_DisableEdgeDetection(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  729. {
  730. uint8 channel;
  731. uint8 module = ChannelConfig->instanceNo;
  732. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  733. /* Select IP type case. */
  734. switch(ipType)
  735. {
  736. case ICU_FTM_MODULE:
  737. {
  738. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  739. (void)Ftm_Icu_Ip_DisableEdgeDetection(module, channel);
  740. break;
  741. }
  742. case ICU_LPIT_MODULE:
  743. {
  744. channel = (ChannelConfig->pLpitHwChannelConfig)->hwChannel;
  745. Lpit_Icu_Ip_DisableDetectionMode(module, channel);
  746. break;
  747. }
  748. case ICU_LPTMR_MODULE:
  749. {
  750. Lptmr_Icu_Ip_DisableDetection(module);
  751. break;
  752. }
  753. case ICU_PORT_CI_MODULE:
  754. {
  755. channel = (ChannelConfig->pPortCiHwChannelConfig)->pinId;
  756. Port_Ci_Icu_Ip_DisableDetection(module, channel);
  757. break;
  758. }
  759. case ICU_CMP_MODULE:
  760. {
  761. Cmp_Ip_DisableInterrupt(module);
  762. Cmp_Ip_DisableNotification(module);
  763. break;
  764. }
  765. default:
  766. {
  767. /* Do nothing. */
  768. break;
  769. }
  770. }
  771. }
  772. #endif /* ICU_EDGE_DETECT_API */
  773. #if ((ICU_OVERFLOW_NOTIFICATION_API == STD_OFF) && (ICU_VALIDATE_PARAMS == STD_ON))
  774. #if ((ICU_EDGE_COUNT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON) || \
  775. (ICU_GET_TIME_ELAPSED_API == STD_ON) || (ICU_GET_DUTY_CYCLE_VALUES_API == STD_ON) )
  776. /**
  777. * @brief The function get the state of the overflow flag
  778. * @internal
  779. * @param ChannelConfig Channel configuration pointer
  780. * @return boolean the state of the overflow flag
  781. * @retval TRUE the overflow flag is set
  782. * @retval FALSE the overflow flag is not set
  783. */
  784. boolean Icu_Ipw_Get_Overflow(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  785. {
  786. boolean bOverflow = FALSE;
  787. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  788. {
  789. /* Check if FTM Module Overflow. */
  790. bOverflow = (boolean)Ftm_Icu_Ip_GetOverflow(ChannelConfig->instanceNo);
  791. }
  792. return bOverflow;
  793. }
  794. #endif /* ICU_EDGE_COUNT_API == STD_ON */
  795. #endif /* (ICU_OVERFLOW_NOTIFICATION_API == STD_OFF) && (ICU_VALIDATE_PARAMS == STD_ON) */
  796. #if (STD_ON == ICU_GET_INPUT_LEVEL_API)
  797. Icu_LevelType Icu_Ipw_GetInputLevel(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  798. {
  799. Icu_LevelType nInputLevel;
  800. /* Select IP type case. */
  801. switch(ChannelConfig->channelIp)
  802. {
  803. case ICU_FTM_MODULE:
  804. {
  805. nInputLevel = (Ftm_Icu_Ip_GetInputLevel(ChannelConfig->instanceNo, \
  806. (ChannelConfig->pFtmHwChannelConfig)->hwChannel) == FTM_ICU_LEVEL_HIGH)?ICU_LEVEL_HIGH:ICU_LEVEL_LOW;
  807. break;
  808. }
  809. default:
  810. {
  811. nInputLevel = ICU_LEVEL_LOW;
  812. break;
  813. }
  814. }
  815. return nInputLevel;
  816. }
  817. #endif /* STD_ON == ICU_GET_INPUT_LEVEL_API */
  818. #if ((ICU_CAPTURERGISTER_API == STD_ON) && ((ICU_SIGNAL_MEASUREMENT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON)))/**
  819. * @brief Capture the value of counter register for a specified channel.
  820. *
  821. * @details The API shall return the value stored in capture register.
  822. * The API is the equivalent of AUTOSAR API GetCaptureRegisterValue.
  823. *
  824. * @param ChannelConfig Channel configuration pointer
  825. * @return uint32 Value of the register captured.
  826. */
  827. Icu_ValueType Icu_Ipw_GetCaptureRegisterValue (const Icu_Ipw_ChannelConfigType* ChannelConfig)
  828. {
  829. Icu_ValueType nRValue;
  830. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  831. {
  832. /* Get FTM Module Capture Register Value */
  833. nRValue = (Icu_ValueType)Ftm_Icu_Ip_GetCaptureRegisterValue(ChannelConfig->instanceNo, \
  834. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  835. }
  836. else
  837. {
  838. nRValue = (Icu_ValueType)0U;
  839. }
  840. return nRValue;
  841. }
  842. #endif
  843. #if (STD_ON == ICU_SIGNAL_MEASUREMENT_API)
  844. void Icu_Ipw_StartSignalMeasurement (const Icu_Ipw_ChannelConfigType* ChannelConfig)
  845. {
  846. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  847. {
  848. /* Start Signal Measurement. */
  849. Ftm_Icu_Ip_StartSignalMeasurement(ChannelConfig->instanceNo, \
  850. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  851. }
  852. }
  853. void Icu_Ipw_StopSignalMeasurement(const Icu_Ipw_ChannelConfigType * ChannelConfig)
  854. {
  855. if (ICU_FTM_MODULE == ChannelConfig->channelIp)
  856. {
  857. /* Start Signal Measurement. */
  858. Ftm_Icu_Ip_StopSignalMeasurement(ChannelConfig->instanceNo, \
  859. (ChannelConfig->pFtmHwChannelConfig)->hwChannel);
  860. }
  861. }
  862. void Icu_Ipw_GetPWandPeriod(const Icu_Ipw_ChannelConfigType* channelConfig, \
  863. Icu_ValueType* Icu_aActivePulseWidth, \
  864. Icu_ValueType* Icu_aPeriod)
  865. {
  866. /* Select IP type case. */
  867. if(ICU_FTM_MODULE == channelConfig->channelIp)
  868. {
  869. Ftm_Icu_Ip_GetPWandPeriod(channelConfig->instanceNo, \
  870. (channelConfig->pFtmHwChannelConfig)->hwChannel, \
  871. (uint16*)Icu_aActivePulseWidth, \
  872. (uint16*)Icu_aPeriod);
  873. }
  874. }
  875. #endif /* STD_ON == ICU_SIGNAL_MEASUREMENT_API */
  876. #if (STD_ON == ICU_GET_DUTY_CYCLE_VALUES_API)
  877. void Icu_Ipw_GetDutyCycleValues(const Icu_Ipw_ChannelConfigType* channelConfig,
  878. Icu_DutyCycleType* DutyCycleValues)
  879. {
  880. /* Select IP type case. */
  881. if(ICU_FTM_MODULE == channelConfig->channelIp)
  882. {
  883. Ftm_Icu_Ip_DutyCycleType ftmDutyCycleValues = {0, 0};
  884. Ftm_Icu_Ip_GetDutyCycleValues(channelConfig->instanceNo, \
  885. (channelConfig->pFtmHwChannelConfig)->hwChannel, \
  886. &ftmDutyCycleValues);
  887. DutyCycleValues->ActiveTime = (Icu_ValueType)ftmDutyCycleValues.ActiveTime;
  888. DutyCycleValues->PeriodTime = (Icu_ValueType)ftmDutyCycleValues.PeriodTime;
  889. }
  890. }
  891. #endif /* STD_ON == ICU_GET_DUTY_CYCLE_VALUES_API */
  892. #if (STD_ON == ICU_GET_TIME_ELAPSED_API)
  893. Icu_ValueType Icu_Ipw_GetTimeElapsed(const Icu_Ipw_ChannelConfigType* channelConfig)
  894. {
  895. uint16 timeElapsed;
  896. /* Select IP type case. */
  897. switch(channelConfig->channelIp)
  898. {
  899. case ICU_FTM_MODULE:
  900. {
  901. timeElapsed = Ftm_Icu_Ip_GetTimeElapsed(channelConfig->instanceNo, \
  902. (channelConfig->pFtmHwChannelConfig)->hwChannel);
  903. break;
  904. }
  905. default:
  906. {
  907. timeElapsed = 0U;
  908. break;
  909. }
  910. }
  911. return (Icu_ValueType)timeElapsed;
  912. }
  913. #endif /* STD_ON == ICU_GET_TIME_ELAPSED_API */
  914. #if (STD_ON == ICU_DUAL_CLOCK_MODE_API)
  915. /**
  916. * @brief This function sets the module prescalers based on the input mode.
  917. *
  918. * @param moduleConfig
  919. * @param selectPrescaler Prescaler type ( Normal or Alternate )
  920. * @param modulesNumber
  921. */
  922. void Icu_Ipw_SetClockMode(const Icu_Ipw_IpConfigType (*moduleConfig)[], Icu_SelectPrescalerType selectPrescaler, uint8 modulesNumber)
  923. {
  924. uint8 index;
  925. uint8 module;
  926. Icu_Ipw_ModuleType ipType;
  927. for(index = 0; index < modulesNumber; index++)
  928. {
  929. ipType = (*moduleConfig)[index].instanceIp;
  930. module = (*moduleConfig)[index].instanceNo;
  931. /* Select IP type case. */
  932. switch(ipType)
  933. {
  934. case ICU_FTM_MODULE:
  935. {
  936. Ftm_Icu_Ip_SetPrescaler(module, \
  937. (selectPrescaler == ICU_ALTERNATE_CLOCK_MODE) ? FTM_ICU_ALTERNATE_CLK : FTM_ICU_NORMAL_CLK);
  938. break;
  939. }
  940. default:
  941. {
  942. /* Do nothing. */
  943. break;
  944. }
  945. }
  946. }
  947. }
  948. #endif /* STD_ON == ICU_DUAL_CLOCK_MODE_API */
  949. #if ((ICU_VALIDATE_PARAMS == STD_ON) && (ICU_GET_INPUT_LEVEL_API == STD_ON))
  950. Icu_Ipw_StatusType Icu_Ipw_ValidateGetInputLevel(const Icu_Ipw_ChannelConfigType * ChannelConfig)
  951. {
  952. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  953. Icu_Ipw_StatusType result = ICU_IPW_ERROR;
  954. /* Select IP type case. */
  955. if(ICU_FTM_MODULE == ipType)
  956. {
  957. result = ICU_IPW_SUCCESS;
  958. }
  959. return result;
  960. }
  961. #endif /* (ICU_VALIDATE_PARAMS == STD_ON) && (ICU_GET_INPUT_LEVEL_API == STD_ON */
  962. void Icu_Ipw_EnableNotification(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  963. {
  964. uint8 channel;
  965. uint8 module = ChannelConfig->instanceNo;
  966. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  967. /* Select IP type case. */
  968. switch(ipType)
  969. {
  970. case ICU_FTM_MODULE:
  971. {
  972. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  973. Ftm_Icu_Ip_EnableNotification(module, channel);
  974. break;
  975. }
  976. case ICU_LPIT_MODULE:
  977. {
  978. channel = (ChannelConfig->pLpitHwChannelConfig)->hwChannel;
  979. Lpit_Icu_Ip_EnableNotification(module, channel);
  980. break;
  981. }
  982. default:
  983. {
  984. /* Do nothing. */
  985. }
  986. break;
  987. }
  988. }
  989. void Icu_Ipw_DisableNotification(const Icu_Ipw_ChannelConfigType* ChannelConfig)
  990. {
  991. uint8 channel;
  992. uint8 module = ChannelConfig->instanceNo;
  993. Icu_Ipw_ModuleType ipType = ChannelConfig->channelIp;
  994. /* Select IP type case. */
  995. switch(ipType)
  996. {
  997. case ICU_FTM_MODULE:
  998. {
  999. channel = (ChannelConfig->pFtmHwChannelConfig)->hwChannel;
  1000. Ftm_Icu_Ip_DisableNotification(module, channel);
  1001. break;
  1002. }
  1003. case ICU_LPIT_MODULE:
  1004. {
  1005. channel = (ChannelConfig->pLpitHwChannelConfig)->hwChannel;
  1006. Lpit_Icu_Ip_DisableNotification(module, channel);
  1007. break;
  1008. }
  1009. default:
  1010. {
  1011. /* Do nothing. */
  1012. }
  1013. break;
  1014. }
  1015. }
  1016. #define ICU_STOP_SEC_CODE
  1017. #include "Icu_MemMap.h"
  1018. #ifdef __cplusplus
  1019. }
  1020. #endif
  1021. /** @} */