1 /* 2 * Copyright 2020-2023 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef EMIOS_ICU_IP_H 8 #define EMIOS_ICU_IP_H 9 10 /** 11 * @file Emios_Icu_Ip.h 12 * 13 * @addtogroup emios_icu_ip EMIOS IPL 14 * @{ 15 */ 16 17 #ifdef __cplusplus 18 extern "C" 19 { 20 #endif 21 22 /*================================================================================================== 23 INCLUDE FILES 24 1) system and project includes 25 2) needed interfaces from external units 26 3) internal and external interfaces from this unit 27 ==================================================================================================*/ 28 #include "Emios_Icu_Ip_Types.h" 29 #include "Emios_Icu_Ip_Cfg.h" 30 31 #if (STD_ON == EMIOS_ICU_IP_USED) 32 #if (STD_ON == EMIOS_ICU_USES_MCL_DRIVER) 33 /* Include common functions of EMIOS. */ 34 #include "Emios_Mcl_Ip.h" 35 #endif 36 #endif /* EMIOS_ICU_IP_USED */ 37 38 /*================================================================================================== 39 SOURCE FILE VERSION INFORMATION 40 ==================================================================================================*/ 41 #define EMIOS_ICU_IP_VENDOR_ID 43 42 #define EMIOS_ICU_IP_AR_RELEASE_MAJOR_VERSION 4 43 #define EMIOS_ICU_IP_AR_RELEASE_MINOR_VERSION 7 44 #define EMIOS_ICU_IP_AR_RELEASE_REVISION_VERSION 0 45 #define EMIOS_ICU_IP_SW_MAJOR_VERSION 3 46 #define EMIOS_ICU_IP_SW_MINOR_VERSION 0 47 #define EMIOS_ICU_IP_SW_PATCH_VERSION 0 48 49 /*================================================================================================== 50 FILE VERSION CHECKS 51 ==================================================================================================*/ 52 /* Check Emios_Icu_Ip.h against Emios_Icu_Ip_Types.h file versions */ 53 #if (EMIOS_ICU_IP_VENDOR_ID != EMIOS_ICU_IP_TYPES_VENDOR_ID) 54 #error "Emios_Icu_Ip.h and Emios_Icu_Ip_Types.h have different vendor IDs" 55 #endif 56 57 #if ((EMIOS_ICU_IP_AR_RELEASE_MAJOR_VERSION != EMIOS_ICU_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \ 58 (EMIOS_ICU_IP_AR_RELEASE_MINOR_VERSION != EMIOS_ICU_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \ 59 (EMIOS_ICU_IP_AR_RELEASE_REVISION_VERSION != EMIOS_ICU_IP_TYPES_AR_RELEASE_REVISION_VERSION)) 60 #error "AutoSar Version Numbers of Emios_Icu_Ip.h and Emios_Icu_Ip_Types.h are different" 61 #endif 62 63 #if ((EMIOS_ICU_IP_SW_MAJOR_VERSION != EMIOS_ICU_IP_TYPES_SW_MAJOR_VERSION) || \ 64 (EMIOS_ICU_IP_SW_MINOR_VERSION != EMIOS_ICU_IP_TYPES_SW_MINOR_VERSION) || \ 65 (EMIOS_ICU_IP_SW_PATCH_VERSION != EMIOS_ICU_IP_TYPES_SW_PATCH_VERSION)) 66 #error "Software Version Numbers of Emios_Icu_Ip.h and Emios_Icu_Ip_Types.h are different" 67 #endif 68 69 #if (EMIOS_ICU_IP_VENDOR_ID != EMIOS_ICU_IP_CFG_VENDOR_ID) 70 #error "Emios_Icu_Ip.h and Emios_Icu_Ip_Cfg.h have different vendor ids" 71 #endif 72 73 /* Check if header file and Emios_Icu_Ip_Cfg.h file are of the same Autosar version */ 74 #if ((EMIOS_ICU_IP_AR_RELEASE_MAJOR_VERSION != EMIOS_ICU_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \ 75 (EMIOS_ICU_IP_AR_RELEASE_MINOR_VERSION != EMIOS_ICU_IP_CFG_AR_RELEASE_MINOR_VERSION) || \ 76 (EMIOS_ICU_IP_AR_RELEASE_REVISION_VERSION != EMIOS_ICU_IP_CFG_AR_RELEASE_REVISION_VERSION)) 77 #error "AutoSar Version Numbers of Emios_Icu_Ip.h and Emios_Icu_Ip_Cfg.h are different" 78 #endif 79 80 /* Check if header file and Emios_Icu_Ip_Cfg.h file are of the same Software version */ 81 #if ((EMIOS_ICU_IP_SW_MAJOR_VERSION != EMIOS_ICU_IP_CFG_SW_MAJOR_VERSION) || \ 82 (EMIOS_ICU_IP_SW_MINOR_VERSION != EMIOS_ICU_IP_CFG_SW_MINOR_VERSION) || \ 83 (EMIOS_ICU_IP_SW_PATCH_VERSION != EMIOS_ICU_IP_CFG_SW_PATCH_VERSION)) 84 #error "Software Version Numbers of Emios_Icu_Ip.h and Emios_Icu_Ip_Cfg.h are different" 85 #endif 86 87 #if (STD_ON == EMIOS_ICU_IP_USED) 88 #if (STD_ON == EMIOS_ICU_USES_MCL_DRIVER) 89 /* Check if header file and Emios_Mcl_Ip.h file are of the same Autosar version */ 90 #if (EMIOS_ICU_IP_VENDOR_ID != EMIOS_MCL_IP_VENDOR_ID) 91 #error "Emios_Icu_Ip.h and Emios_Mcl_Ip.h have different vendor ids" 92 #endif 93 94 /* Check if header file and Emios_Mcl_Ip.h file are of the same Autosar version */ 95 #if ((EMIOS_ICU_IP_AR_RELEASE_MAJOR_VERSION != EMIOS_MCL_IP_AR_RELEASE_MAJOR_VERSION) || \ 96 (EMIOS_ICU_IP_AR_RELEASE_MINOR_VERSION != EMIOS_MCL_IP_AR_RELEASE_MINOR_VERSION) || \ 97 (EMIOS_ICU_IP_AR_RELEASE_REVISION_VERSION != EMIOS_MCL_IP_AR_RELEASE_REVISION_VERSION)) 98 #error "AutoSar Version Numbers of Emios_Icu_Ip.h and Emios_Mcl_Ip.h are different" 99 #endif 100 101 /* Check if header file and Emios_Mcl_Ip.h file are of the same Software version */ 102 #if ((EMIOS_ICU_IP_SW_MAJOR_VERSION != EMIOS_MCL_IP_SW_MAJOR_VERSION) || \ 103 (EMIOS_ICU_IP_SW_MINOR_VERSION != EMIOS_MCL_IP_SW_MINOR_VERSION) || \ 104 (EMIOS_ICU_IP_SW_PATCH_VERSION != EMIOS_MCL_IP_SW_PATCH_VERSION)) 105 #error "Software Version Numbers of Emios_Icu_Ip.h and Emios_Mcl_Ip.h are different" 106 #endif 107 #endif 108 #endif /* EMIOS_ICU_IP_USED */ 109 /*================================================================================================== 110 CONSTANTS 111 ==================================================================================================*/ 112 113 /*================================================================================================== 114 DEFINES AND MACROS 115 ==================================================================================================*/ 116 #if (STD_ON == EMIOS_ICU_IP_USED) 117 118 #if (defined EMIOS_ICU_CONFIG_EXT) 119 #define ICU_START_SEC_CONFIG_DATA_UNSPECIFIED 120 #include "Icu_MemMap.h" 121 122 /* Macro used to import SIUL2 PB generated configurations. */ 123 EMIOS_ICU_CONFIG_EXT 124 125 #define ICU_STOP_SEC_CONFIG_DATA_UNSPECIFIED 126 #include "Icu_MemMap.h" 127 #endif 128 /*================================================================================================== 129 * GLOBAL VARIABLES 130 ==================================================================================================*/ 131 132 /*================================================================================================== 133 ENUMS 134 ==================================================================================================*/ 135 136 /*================================================================================================== 137 STRUCTURES AND OTHER TYPEDEFS 138 ==================================================================================================*/ 139 140 141 /*================================================================================================== 142 GLOBAL VARIABLE DECLARATIONS 143 ==================================================================================================*/ 144 145 /*================================================================================================== 146 FUNCTION PROTOTYPES 147 ==================================================================================================*/ 148 #define ICU_START_SEC_CODE 149 #include "Icu_MemMap.h" 150 151 /** 152 * @brief Emios_Icu_Ip_Init 153 * @details This function is called separately for each EMIOS hw channel corresponding to 154 * the configured Icu channels, and: 155 * - Disables the interrupt corresponding to eMIOS channel 156 * - Initializes prescaler value, channel filter, freeze enable, and bus select fields 157 * - Defines on which edge the period starts 158 * - Clears the (pending) interrupt flag corresponding to eMIOS channel 159 * - Resets the UC A register. 160 * - Enables the SAIC mode for eMIOS channels. 161 * @param[in] instance - EMIOS instance used. 162 * @param[in] userConfig - pointer to eMios configuration structure 163 */ 164 eMios_Icu_Ip_StatusType Emios_Icu_Ip_Init(uint8 instance, const eMios_Icu_Ip_ConfigType *userConfig); 165 166 #if (EMIOS_ICU_IP_DEINIT_API == STD_ON) 167 /** 168 * @brief Emios_Icu_Ip_Deinit 169 * @details This function is called separately for each EMIOS hw channel corresponding to the 170 * configured Icu channels, and: 171 * - Resets the eMIOS channel control register 172 * - Resets the UC A register. 173 * - Clears the (pending) interrupt flag corresponding to eMIOS channel 174 * @param[in] peMiosIpConfig - pointer to eMios configuration structure 175 */ 176 eMios_Icu_Ip_StatusType Emios_Icu_Ip_Deinit(uint8 instance); 177 #endif 178 179 #if (EMIOS_ICU_IP_SET_MODE_API == STD_ON) 180 /** 181 * @brief Emios_Icu_Ip_SetSleepMode 182 * @details This function is called separately for each EMIOS hw channel corresponding to the 183 * configured Icu channels, and: 184 * - Enables the interrupt for the eMIOS channel, 185 * if the wake up functionality is enabled 186 * - Disables the interrupt for the eMIOS channel, 187 * if the wake up functionality is disabled 188 * @param[in] instance - eMIOS module index 189 * @param[in] hwChannel - eMIOS encoded hardware channel 190 * @api 191 */ 192 void Emios_Icu_Ip_SetSleepMode(uint8 instance, uint8 hwChannel); 193 194 /** 195 * @brief Emios_Icu_Ip_SetNormalMode 196 * @details This function: Set normal mode 197 * 198 * @param[in] instance - eMIOS module index 199 * @param[in] hwChannel - eMIOS encoded hardware channel 200 * @api 201 */ 202 void Emios_Icu_Ip_SetNormalMode(uint8 instance, uint8 hwChannel); 203 #endif /* ICU_SET_MODE_API */ 204 205 /** 206 * @brief Icu driver function that sets activation condition of eMIOS channel 207 * @details This function enables the requested activation condition(rising, falling or both 208 * edges) for corresponding eMIOS channels. 209 * @param[in] instance - eMIOS module index 210 * @param[in] hwChannel - eMIOS channel index 211 * @param[in] edge - type of edge to be used 212 * @api 213 */ 214 void Emios_Icu_Ip_SetActivation(uint8 instance, uint8 hwChannel, eMios_Icu_Ip_EdgeType edge); 215 216 #if (EMIOS_ICU_IP_EDGE_DETECT_API == STD_ON) 217 /** 218 * @brief Emios_Icu_Ip_EnableEdgeDetection 219 * @details eMIOS IP function that starts the edge detection service for an eMIOS channel 220 * 221 * @param[in] instance - eMIOS module index 222 * @param[in] hwChannel - eMIOS encoded hardware channel 223 * 224 * @return void 225 */ 226 void Emios_Icu_Ip_EnableEdgeDetection(uint8 instance, uint8 hwChannel); 227 228 /** 229 * @brief Emios_Icu_Ip_DisableEdgeDetection 230 * @details eMIOS IP function that stops the edge detection service for an eMIOS channel 231 * 232 * @param[in] instance - eMIOS module index 233 * @param[in] hwChannel - eMIOS encoded hardware channel 234 * 235 * @return void 236 */ 237 void Emios_Icu_Ip_DisableEdgeDetection(uint8 instance, uint8 hwChannel); 238 #endif /* ICU_EDGE_DETECT_API */ 239 240 /** 241 * @brief Driver function Enable Notification. 242 * 243 * @param[in] instance Hardware instance used. 244 * @param[in] hwChannel Hardware channel used. 245 * @return void 246 */ 247 void Emios_Icu_Ip_EnableNotification(uint8 instance, uint8 hwChannel); 248 249 /** 250 * @brief Driver function Disable Notification. 251 * 252 * @param[in] instance Hardware instance used. 253 * @param[in] hwChannel Hardware channel used. 254 * @return void 255 */ 256 void Emios_Icu_Ip_DisableNotification(uint8 instance, uint8 hwChannel); 257 258 #if (EMIOS_ICU_IP_TIMESTAMP_API == STD_ON) 259 /** 260 * @brief Icu driver function that starts time stamp measurement of eMIOS channel. 261 * @details This function: 262 * - Puts the eMIOS channel into GPIO mode 263 * - Clears the pending interrupts 264 * - Enables SAIC mode for the channel 265 * - Enbales the interrupt for the channel 266 * 267 * @param[in] instance - eMIOS module index 268 * @param[in] hwChannel - eMIOS encoded hardware channel 269 * @param[in] bufferPtr - buffer pointer for results 270 * @param[in] bufferSize - size of buffer results 271 * @param[in] notifyInterval - interval for calling notification 272 * @api 273 */ 274 void Emios_Icu_Ip_StartTimestamp 275 ( 276 uint8 instance, 277 uint8 hwChannel, 278 eMios_Icu_ValueType * bufferPtr, 279 uint16 bufferSize, 280 uint16 notifyInterval 281 ); 282 283 /** 284 * @brief This function reads the timestamp index of the given channel. 285 * @details This function reentrant and reads the timestamp index of the given channel, 286 * which is next to be written. 287 * 288 * @param[in] instance - eMIOS module index 289 * @param[in] hwChannel - Logical number of the ICU channel 290 * 291 * @return uint16 - Timestamp index of the given channel 292 * @pre Emios_Icu_Ip_Init must be called before. Icu_StartTimestamp must be called before. 293 */ 294 uint16 Emios_Icu_Ip_GetTimestampIndex 295 ( 296 uint8 instance, 297 uint8 hwChannel 298 ); 299 300 /** 301 * @brief Icu driver function that stops time stamp measurement of eMIOS channel. 302 * @details This function: 303 * - Puts the eMIOS channel into GPIO mode 304 * - Disables the interrupt for the channel 305 * 306 * @param[in] instance - eMIOS module index 307 * @param[in] hwChannel - eMIOS encoded hardware channel 308 * @api 309 */ 310 void Emios_Icu_Ip_StopTimestamp(uint8 instance, uint8 hwChannel); 311 #endif /* EMIOS_ICU_IP_TIMESTAMP_API */ 312 313 #if ((EMIOS_ICU_IP_SIGNALMEASUREMENT_USES_DMA == STD_ON) || (EMIOS_ICU_IP_TIMESTAMP_USES_DMA == STD_ON)) 314 /** 315 * @brief Emios_Icu_Ip_GetStartAddress 316 * @details eMIOS IP function that stops the edge detection service for an eMIOS channel 317 * 318 * @param[in] instance - eMIOS module index 319 * @param[in] hwChannel - eMIOS encoded hardware channel 320 * 321 * @return void 322 * 323 **/ 324 uint32 Emios_Icu_Ip_GetStartAddress 325 ( 326 uint8 instance, 327 uint8 hwChannel 328 ); 329 #endif 330 331 #if (EMIOS_ICU_IP_EDGE_COUNT_API == STD_ON) 332 /** 333 * @brief Icu driver function that resets the edge counter measurement of eMIOS channel. 334 * @details The function: 335 * - Puts the eMIOS channel into GPIO mode 336 * - Resets the counter to initial value 337 * - Loads the initial value to the RegisterA 338 * - Clears the pending interrupts 339 * - Restores the previous mode 340 * 341 * @param[in] instance - eMIOS module index 342 * @param[in] hwChannel - eMIOS encoded hardware channel 343 * 344 * @api 345 */ 346 void Emios_Icu_Ip_ResetEdgeCount 347 ( 348 uint8 instance, 349 uint8 hwChannel 350 ); 351 352 /** 353 * @brief Icu driver function that enables the edge counter measurement of eMIOS channel. 354 * @details The function: 355 * - Puts the eMIOS channel into GPIO mode 356 * - Counter register is loaded with startValue 357 * - Loads initial value to RegisterA 358 * - Clears the pending interrupts 359 * - Sets the mode to Modulus counter mode 360 * - Enables the interrupt for eMIOS channel 361 * 362 * @param[in] instance - eMIOS module index 363 * @param[in] hwChannel - eMIOS encoded hardware channel 364 */ 365 void Emios_Icu_Ip_EnableEdgeCount(uint8 instance, uint8 hwChannel); 366 367 /** 368 * @brief Icu driver function that disables the edge counter measurement of eMIOS channel. 369 * @details The function: 370 * - Disables the eMIOS channel interrupt 371 * - Clears the pending interrupts 372 * - Save the current counter value before entering into GPIO mode 373 * - Puts the channel into GPIO mode 374 * - Disables MCB mode for the channel 375 * 376 * @param[in] instance - eMIOS module index 377 * @param[in] hwChannel - eMIOS encoded hardware channel 378 * 379 * @api 380 */ 381 void Emios_Icu_Ip_DisableEdgeCount 382 ( 383 uint8 instance, 384 uint8 hwChannel 385 ); 386 387 /** 388 * @brief Icu driver function that gets edge counter measurement of eMIOS channel. 389 * @details This function returns counter value (the number of counter edges) of eMIOS channel 390 * 391 * @param[in] instance - eMIOS module index 392 * @param[in] hwChannel - eMIOS encoded hardware channel 393 * 394 * @return uint32 - Counted edges number 395 * 396 * @api 397 */ 398 eMios_Icu_ValueType Emios_Icu_Ip_GetEdgeNumbers 399 ( 400 uint8 instance, 401 uint8 hwChannel 402 ); 403 404 #if (STD_ON == EMIOS_ICU_IP_SET_INITIAL_COUNTER) 405 /** 406 * @brief Icu driver function that Set Initial setting of eMIOS Counter. 407 * @details This function Set Initial setting of eMIOS Counter 408 * 409 * @param[in] instance - eMIOS module index 410 * @param[in] hwChannel - eMIOS encoded hardware channel 411 * @param[in] offsetCounter - eMios Initial counter 412 * 413 * @pre This function is not required because the counter value is 414 * set automatically. But to arbitrarily change the Initial value 415 * of the counter value, it is necessary to call this function 416 * before the Emios_Icu_Ip_EnableEdgeCount. 417 * After call Emios_Icu_Ip_ResetEdgeCount function to reset counter value 418 * to 0, the previously set Initial value will no longer be valid. 419 */ 420 void Emios_Icu_Ip_SetInitialCounterValue 421 ( 422 uint8 instance, 423 uint8 hwChannel, 424 uint32 initialCounter 425 ); 426 #endif /* STD_ON == EMIOS_ICU_IP_SET_INITIAL_COUNTER */ 427 428 #if (STD_ON == EMIOS_ICU_IP_SET_MAX_COUNTER) 429 /** 430 * @brief Icu driver function that Set Max setting of eMIOS Counter. 431 * @details This function Set Max setting of eMIOS Counter 432 * 433 * @param[in] instance - eMIOS module index 434 * @param[in] hwChannel - eMIOS encoded hardware channel 435 * @param[in] defaultCounter - eMios Max counter 436 * 437 * @pre This function is not required because the counter value is 438 * set automatically. But to arbitrarily change the Max value 439 * of the counter value, it is necessary to call this function 440 * before the Emios_Icu_Ip_EnableEdgeCount function. 441 */ 442 void Emios_Icu_Ip_SetMaxCounterValue 443 ( 444 uint8 instance, 445 uint8 hwChannel, 446 uint32 maxCounter 447 ); 448 #endif /* STD_ON == EMIOS_ICU_IP_SET_MAX_COUNTER */ 449 #endif /* EMIOS_ICU_IP_EDGE_COUNT_API == STD_ON */ 450 451 #if (EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON) 452 /** 453 * @brief Icu driver function that starts the signal measurement of eMIOS channel. 454 * @details This function: 455 * - Disables the interrupt of eMIOS channel 456 * - Puts the eMIOS channel into GPIO mode 457 * - Sets activation condition (Rising, Falling or Both edges) 458 * - Puts the eMIOS channel into requested mode (IPWM, IPM or SAIC) 459 * - Clears pending interrupts 460 * - Enables the interrupt for eMIOS channel 461 * 462 * @param[in] instance - eMIOS module index 463 * @param[in] hwChannel - eMIOS encoded hardware channel 464 * 465 * @api 466 */ 467 void Emios_Icu_Ip_StartSignalMeasurement 468 ( 469 uint8 instance, 470 uint8 hwChannel 471 ); 472 473 /** 474 * @brief Icu driver function that stops the signal measurement of eMIOS channel. 475 * @details This function: 476 * - Puts the eMIOS channel into GPIO mode 477 * - Disables the interrupt for requsted eMIOS channel 478 * - Clears pending interrupts 479 * 480 * @param[in] instance - eMIOS module index 481 * @param[in] hwChannel - eMIOS encoded hardware channel 482 * 483 * @api 484 */ 485 void Emios_Icu_Ip_StopSignalMeasurement 486 ( 487 uint8 instance, 488 uint8 hwChannel 489 ); 490 491 /** 492 * @brief This function reads the elapsed Signal Low, High or Period Time for the given channel. 493 * @details This service is reentrant and reads the elapsed Signal Low Time for the given channel 494 * that is configured in Measurement Mode Signal Measurement, Signal Low Time. 495 * The elapsed time is measured between a falling edge and the consecutive rising edge of 496 * the channel. 497 * This service reads the elapsed Signal High Time for the given channel that is configured 498 * in Measurement Mode Signal Measurement,Signal High Time.The elapsed time is measured 499 * between a rising edge and the consecutive falling edge of the channel. 500 * This service reads the elapsed Signal Period Time for the given channel that is 501 * configured in Measurement Mode Signal Measurement, Signal Period Time.The elapsed time 502 * is measured between consecutive rising (or falling) edges of the channel. The period 503 * start edge is 504 * 505 * configurable. 506 * 507 * @param[in] instance - eMIOS module index 508 * @param[in] hwChannel - Logical number of the ICU channel 509 * 510 * @return uint16 - the elapsed Signal Low Time for the given channel that is configured in 511 * Measurement Mode Signal Measurement, Signal Low Time 512 * @pre Emios_Icu_Ip_Init must be called before. The channel must be configured in Measurement Mode Signal 513 * Measurement. 514 */ 515 eMios_Icu_ValueType Emios_Icu_Ip_GetTimeElapsed 516 ( 517 uint8 instance, 518 uint8 hwChannel 519 ); 520 521 /** 522 * @brief This function reads the coherent active time and period time for the given ICU Channel. 523 * @details The function is reentrant and reads the coherent active time and period time for 524 * the given ICU Channel, if it is configured in Measurement Mode Signal Measurement, Duty 525 * Cycle Values. 526 * 527 * @param[in] instance - eMIOS module index 528 * @param[in] hwChannel - Logical number of the ICU channel 529 * @param[out] dutyCycleValues - Pointer to a buffer where the results (active time and period time) 530 * shall be placed. 531 * 532 * @return void 533 * @pre Emios_Icu_Ip_Init must be called before. The given channel must be configured in Measurement Mode 534 * Signal Measurement, Duty Cycle Values. 535 */ 536 void Emios_Icu_Ip_GetDutyCycleValues 537 ( 538 uint8 instance, 539 uint8 hwChannel, 540 eMios_Icu_Ip_DutyCycleType* dutyCycleValues 541 ); 542 543 /** 544 * @brief Emios_Icu_Ip_SetPWandPeriod 545 * 546 * @param instance 547 * @param hwChannel 548 * @param activePulseWidth 549 * @param period 550 */ 551 void Emios_Icu_Ip_SetPWandPeriod(uint8 instance, 552 uint8 hwChannel, 553 eMios_Icu_ValueType activePulseWidth, 554 eMios_Icu_ValueType period); 555 556 #endif /* EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API */ 557 558 #if (EMIOS_ICU_IP_GET_INPUT_STATE_API == STD_ON) 559 /** 560 * @brief Icu driver function that gets the input state of eMIOS channel. 561 * @details This function: 562 * - Checks if interrupt flags for corresponding eMIOS channel is set then 563 * it clears the interrupt flag and returns the value as true. 564 * 565 * @param[in] instance - eMIOS module index 566 * @param[in] hwChannel - eMIOS encoded hardware channel 567 * 568 * @return boolean 569 * @retval true - if channel is active 570 * @retval false - if channel is idle 571 * 572 * @api 573 */ 574 boolean Emios_Icu_Ip_GetInputState 575 ( 576 uint8 instance, 577 uint8 hwChannel 578 ); 579 #endif /* EMIOS_ICU_IP_GET_INPUT_STATE_API */ 580 581 #if (EMIOS_ICU_IP_GET_INPUT_LEVEL_API == STD_ON) 582 /** 583 * @brief This function returns the actual status of PIN. 584 * @details This function returns the actual status o PIN 585 * 586 * @param[in] instance - eMIOS module index 587 * @param[in] hwChannel - eMIOS encoded hardware channel 588 * 589 * @return void 590 * 591 * @api 592 */ 593 eMios_Icu_Ip_LevelType Emios_Icu_Ip_GetInputLevel 594 ( 595 uint8 instance, 596 uint8 hwChannel 597 ); 598 #endif /* EMIOS_ICU_IP_GET_INPUT_LEVEL_API == STD_ON */ 599 600 /** 601 * @brief Emios_Icu_Ip_GetOverflow 602 * @details eMIOS IP function that get the state of the overflow flag 603 * 604 * @param[in] instance - eMIOS module index 605 * @param[in] hwChannel - eMIOS encoded hardware channel 606 * 607 * @return boolean the state of the overflow flag 608 * @retval true the overflow flag is set 609 * @retval false the overflow flag is not set 610 * 611 * @return void 612 */ 613 boolean Emios_Icu_Ip_GetOverflow 614 ( 615 uint8 instance, 616 uint8 hwChannel 617 ); 618 619 #if (EMIOS_ICU_IP_DUAL_CLOCK_MODE_API == STD_ON) 620 void Emios_Icu_Ip_SetClockMode 621 ( 622 uint8 instance, 623 const eMios_Icu_Ip_ConfigType * peMiosIpConfig, 624 const eMios_Icu_Ip_ClockModeType Prescaler 625 ); 626 #endif /* EMIOS_ICU_IP_DUAL_CLOCK_MODE_API == STD_ON */ 627 628 #if ((EMIOS_ICU_IP_CAPTURERGISTER_API == STD_ON) && ((EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON) || (EMIOS_ICU_IP_TIMESTAMP_API == STD_ON))) 629 uint32 Emios_Icu_Ip_GetCaptureRegValue 630 ( 631 uint8 instance, 632 uint8 hwChannel 633 ); 634 #endif /* EMIOS_ICU_IP_DUAL_CLOCK_MODE_API == STD_ON */ 635 636 #if ((EMIOS_ICU_IP_GET_PULSE_WIDTH_API == STD_ON) && (EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON)) 637 /** 638 * @brief This function returns the signals High time, Low time and Period without using the 639 * channel interrupt 640 * @details This function returns the signals High time, Low time and Period without using the 641 * channel interrupt 642 * 643 * @param[in] instance - eMIOS module index 644 * @param[in] hwChannel - eMIOS hardware channel 645 */ 646 void Emios_Icu_Ip_GetPulseWidth 647 ( 648 uint8 instance, 649 uint8 hwChannel 650 ); 651 #endif /* ((EMIOS_ICU_IP_GET_PULSE_WIDTH_API == STD_ON) && (EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON))*/ 652 653 #if ((EMIOS_ICU_IP_VALIDATE_GLOBAL_CALL == STD_ON) && ((EMIOS_ICU_IP_GET_PULSE_WIDTH_API == STD_ON) && (EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON))) 654 Std_ReturnType Emios_Icu_Ip_ValidateSignalMeasureWithoutInterrupt 655 ( 656 uint8 instance, 657 uint8 hwChannel 658 ); 659 #endif /* ((EMIOS_ICU_IP_GET_PULSE_WIDTH_API == STD_ON) && (EMIOS_ICU_IP_SIGNAL_MEASUREMENT_API == STD_ON))*/ 660 661 /** 662 * @brief Emios_Icu_Ip_EnableInterrupt 663 * @details This function Clears the pending interrupts of eMIOS channels and 664 * enables eMIOS Channel interrupt 665 * 666 * @param[in] instance - eMIOS module index 667 * @param[in] hwChannel - eMIOS Channel index 668 * @api 669 */ 670 void Emios_Icu_Ip_EnableInterrupt(uint8 instance, uint8 hwChannel); 671 672 /** 673 * @brief Emios_Icu_Ip_DisableInterrupt 674 * @details This function disables eMIOS Channel interrupt 675 * 676 * @param[in] instance - eMIOS module index 677 * @param[in] hwChannel - eMIOS Channel index 678 * @api 679 */ 680 void Emios_Icu_Ip_DisableInterrupt(uint8 instance, uint8 hwChannel); 681 682 683 #define ICU_STOP_SEC_CODE 684 #include "Icu_MemMap.h" 685 686 #endif /* EMIOS_ICU_IP_USED */ 687 688 #if defined(__cplusplus) 689 } 690 #endif 691 692 /** @} */ 693 694 #endif /* EMIOS_ICU_IP_H */ 695