Icu_Irq.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : Ftm Lpit Lptmr Port_Ci LpCmp
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. #ifndef ICU_IRQ_H
  25. #define ICU_IRQ_H
  26. /**
  27. * @file
  28. *
  29. * @addtogroup icu Icu Driver
  30. * @{
  31. */
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. /*==================================================================================================
  37. * INCLUDE FILES
  38. * 1) system and project includes
  39. * 2) needed interfaces from external units
  40. * 3) internal and external interfaces from this unit
  41. ==================================================================================================*/
  42. #include "Icu_Types.h"
  43. /*==================================================================================================
  44. * SOURCE FILE VERSION INFORMATION
  45. ==================================================================================================*/
  46. #define ICU_IRQ_VENDOR_ID 43
  47. #define ICU_IRQ_AR_RELEASE_MAJOR_VERSION 4
  48. #define ICU_IRQ_AR_RELEASE_MINOR_VERSION 4
  49. #define ICU_IRQ_AR_RELEASE_REVISION_VERSION 0
  50. #define ICU_IRQ_SW_MAJOR_VERSION 1
  51. #define ICU_IRQ_SW_MINOR_VERSION 0
  52. #define ICU_IRQ_SW_PATCH_VERSION 0
  53. /*==================================================================================================
  54. * FILE VERSION CHECKS
  55. ==================================================================================================*/
  56. /* Check if source file and ICU header file are of the same vendor */
  57. #if (ICU_IRQ_VENDOR_ID != ICU_TYPES_VENDOR_ID)
  58. #error "Icu_Irq.h and Icu_Types.h have different vendor IDs"
  59. #endif
  60. /* Check if source file and ICU header file are of the same AutoSar version */
  61. #if ((ICU_IRQ_AR_RELEASE_MAJOR_VERSION != ICU_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  62. (ICU_IRQ_AR_RELEASE_MINOR_VERSION != ICU_TYPES_AR_RELEASE_MINOR_VERSION) || \
  63. (ICU_IRQ_AR_RELEASE_REVISION_VERSION != ICU_TYPES_AR_RELEASE_REVISION_VERSION))
  64. #error "AutoSar Version Numbers of Icu_Irq.h and Icu_Types.h are different"
  65. #endif
  66. /* Check if source file and ICU header file are of the same Software version */
  67. #if ((ICU_IRQ_SW_MAJOR_VERSION != ICU_TYPES_SW_MAJOR_VERSION) || \
  68. (ICU_IRQ_SW_MINOR_VERSION != ICU_TYPES_SW_MINOR_VERSION) || \
  69. (ICU_IRQ_SW_PATCH_VERSION != ICU_TYPES_SW_PATCH_VERSION))
  70. #error "Software Version Numbers of Icu_Irq.h and Icu_Types.h are different"
  71. #endif
  72. /*==================================================================================================
  73. * FUNCTION PROTOTYPES
  74. ==================================================================================================*/
  75. #define ICU_START_SEC_CODE
  76. #include "Icu_MemMap.h"
  77. /**
  78. * @brief This function reports the wakeup and overflow events, if available.
  79. * @details This function reports the wakeup and overflow events, if available.
  80. * Called from hardware interrupt routine and route to user overflow handler
  81. *
  82. * @param[in] Channel Hardware number identifier of the ICU channel
  83. * @param[in] bOverflow Parameter that indicates the source of report is an overflow
  84. *
  85. * @return void
  86. * @pre Icu_Init must be called before.
  87. *
  88. * @implements Icu_ReportWakeupAndOverflow_Activity
  89. **/
  90. void Icu_ReportWakeupAndOverflow(uint16 Channel, boolean bOverflow);
  91. /**
  92. * @brief This function reports the wakeup event, overflow event and notification, if available
  93. * @details This function reports the wakeup event, overflow event and notification, if available
  94. *
  95. * @param[in] Channel Harware number identifier of the ICU channel
  96. * @param[in] overflow Parameter that indicates the source of report is an overflow
  97. *
  98. * @return void
  99. * @pre Icu_Init must be called before.
  100. *
  101. * @implements Icu_ReportEvents_Activity
  102. */
  103. void Icu_ReportEvents(uint16 Channel, boolean bOverflow);
  104. #if (ICU_TIMESTAMP_USES_DMA == STD_ON)
  105. /**
  106. * @brief This function saves the value of timestamps in the internal buffer
  107. * @details This function saves the value of timestamps in the internal buffer
  108. *
  109. * @param[in] Channel Logical number of the ICU channel
  110. *
  111. * @return void
  112. * @pre Icu_Init must be called before.
  113. * @implements Icu_TimestampDmaProcessing_Activity
  114. **/
  115. void Icu_TimestampDmaProcessing(Icu_ChannelType Channel);
  116. #endif
  117. #if (ICU_SIGNALMEASUREMENT_USES_DMA == STD_ON)
  118. /**
  119. * @brief This function saves the value of timestamps in the internal buffer
  120. * @details This function saves the value of timestamps in the internal buffer
  121. *
  122. * @param[in] Channel Logical number of the ICU channel
  123. * @return void
  124. * @pre Icu_Init must be called before.
  125. *
  126. * @implements Icu_TimestampDmaProcessing_Activity
  127. **/
  128. void Icu_SignalMeasurementDmaProcessing(Icu_ChannelType Channel);
  129. #endif
  130. /**
  131. * @brief Signature of change logic channel state callback function.
  132. *
  133. * @param logicChannel Logical number of the ICU channel
  134. * @param mask Bit mark
  135. * @param set Set value
  136. */
  137. void Icu_LogicChStateCallback(uint16 logicChannel, uint8 mask, boolean set);
  138. #define ICU_STOP_SEC_CODE
  139. #include "Icu_MemMap.h"
  140. #ifdef __cplusplus
  141. }
  142. #endif
  143. /** @} */
  144. #endif /* ICU_IRQ_H */