123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- /*==================================================================================================
- * Project : RTD AUTOSAR 4.4
- * Platform : CORTEXM
- * Peripheral : Ftm Lpit Lptmr Port_Ci LpCmp
- * Dependencies : none
- *
- * Autosar Version : 4.4.0
- * Autosar Revision : ASR_REL_4_4_REV_0000
- * Autosar Conf.Variant :
- * SW Version : 1.0.0
- * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
- *
- * (c) Copyright 2020-2021 NXP Semiconductors
- * All Rights Reserved.
- *
- * NXP Confidential. This software is owned or controlled by NXP and may only be
- * used strictly in accordance with the applicable license terms. By expressly
- * accepting such terms or by downloading, installing, activating and/or otherwise
- * using the software, you are agreeing that you have read, and that you agree to
- * comply with and are bound by, such license terms. If you do not agree to be
- * bound by the applicable license terms, then you may not retain, install,
- * activate or otherwise use the software.
- ==================================================================================================*/
- #ifndef ICU_IPW_H
- #define ICU_IPW_H
- /**
- * @file
- * @internal
- * @addtogroup icu_ipw Icu_Ipw Driver
- * @{
- */
- #ifdef __cplusplus
- extern "C"{
- #endif
- /*==================================================================================================
- * INCLUDE FILES
- * 1) system and project includes
- * 2) needed interfaces from external units
- * 3) internal and external interfaces from this unit
- ==================================================================================================*/
- #include "Icu_Cfg.h"
- #include "Icu_Types.h"
- #include "Icu_Ipw_Types.h"
- #include "Icu_Ipw_Cfg.h"
- /*==================================================================================================
- * SOURCE FILE VERSION INFORMATION
- ==================================================================================================*/
- #define ICU_IPW_VENDOR_ID 43
- #define ICU_IPW_AR_RELEASE_MAJOR_VERSION 4
- #define ICU_IPW_AR_RELEASE_MINOR_VERSION 4
- #define ICU_IPW_AR_RELEASE_REVISION_VERSION 0
- #define ICU_IPW_SW_MAJOR_VERSION 1
- #define ICU_IPW_SW_MINOR_VERSION 0
- #define ICU_IPW_SW_PATCH_VERSION 0
- /*==================================================================================================
- * FILE VERSION CHECKS
- ==================================================================================================*/
- /* Check if current file and ICU header file are of the same vendor */
- #if (ICU_IPW_VENDOR_ID != ICU_CFG_VENDOR_ID)
- #error "Icu_Ipw.h and Icu_Cfg.h have different vendor IDs"
- #endif
- /* Check if current file and ICU header file are of the same AutoSar version */
- #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION != ICU_CFG_AR_RELEASE_MAJOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_MINOR_VERSION != ICU_CFG_AR_RELEASE_MINOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_REVISION_VERSION != ICU_CFG_AR_RELEASE_REVISION_VERSION))
- #error "AutoSar Version Numbers of Icu_Ipw.h and Icu_Cfg.h are different"
- #endif
- /* Check if current file and ICU header file are of the same Software version */
- #if ((ICU_IPW_SW_MAJOR_VERSION != ICU_CFG_SW_MAJOR_VERSION) || \
- (ICU_IPW_SW_MINOR_VERSION != ICU_CFG_SW_MINOR_VERSION) || \
- (ICU_IPW_SW_PATCH_VERSION != ICU_CFG_SW_PATCH_VERSION))
- #error "Software Version Numbers of Icu_Ipw.h and Icu_Cfg.h are different"
- #endif
- /* Check if current file and ICU header file are of the same vendor */
- #if (ICU_IPW_VENDOR_ID != ICU_TYPES_VENDOR_ID)
- #error "Icu_Ipw.h and Icu_Types.h have different vendor IDs"
- #endif
- /* Check if current file and ICU header file are of the same AutoSar version */
- #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION != ICU_TYPES_AR_RELEASE_MAJOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_MINOR_VERSION != ICU_TYPES_AR_RELEASE_MINOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_REVISION_VERSION != ICU_TYPES_AR_RELEASE_REVISION_VERSION))
- #error "AutoSar Version Numbers of Icu_Ipw.h and Icu_Types.h are different"
- #endif
- /* Check if current file and ICU header file are of the same Software version */
- #if ((ICU_IPW_SW_MAJOR_VERSION != ICU_TYPES_SW_MAJOR_VERSION) || \
- (ICU_IPW_SW_MINOR_VERSION != ICU_TYPES_SW_MINOR_VERSION) || \
- (ICU_IPW_SW_PATCH_VERSION != ICU_TYPES_SW_PATCH_VERSION))
- #error "Software Version Numbers of Icu_Ipw.h and Icu_Types.h are different"
- #endif
- /* Check if current file and ICU header file are of the same vendor */
- #if (ICU_IPW_VENDOR_ID != ICU_IPW_TYPES_VENDOR_ID)
- #error "Icu_Ipw.h and Icu_Ipw_Types.h have different vendor IDs"
- #endif
- /* Check if current file and ICU header file are of the same AutoSar version */
- #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION != ICU_IPW_TYPES_AR_RELEASE_MAJOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_MINOR_VERSION != ICU_IPW_TYPES_AR_RELEASE_MINOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_REVISION_VERSION != ICU_IPW_TYPES_AR_RELEASE_REVISION_VERSION))
- #error "AutoSar Version Numbers of Icu_Ipw.h and Icu_Ipw_Types.h are different"
- #endif
- /* Check if current file and ICU header file are of the same Software version */
- #if ((ICU_IPW_SW_MAJOR_VERSION != ICU_IPW_TYPES_SW_MAJOR_VERSION) || \
- (ICU_IPW_SW_MINOR_VERSION != ICU_IPW_TYPES_SW_MINOR_VERSION) || \
- (ICU_IPW_SW_PATCH_VERSION != ICU_IPW_TYPES_SW_PATCH_VERSION))
- #error "Software Version Numbers of Icu_Ipw.h and Icu_Ipw_Types.h are different"
- #endif
- /* Check if current file and ICU IPW header file are of the same vendor */
- #if (ICU_IPW_VENDOR_ID != ICU_IPW_CFG_VENDOR_ID)
- #error "Icu_Ipw.h and Icu_Ipw_Cfg.h have different vendor IDs"
- #endif
- /* Check if current file and ICU IPW header file are of the same AutoSar version */
- #if ((ICU_IPW_AR_RELEASE_MAJOR_VERSION != ICU_IPW_CFG_AR_RELEASE_MAJOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_MINOR_VERSION != ICU_IPW_CFG_AR_RELEASE_MINOR_VERSION) || \
- (ICU_IPW_AR_RELEASE_REVISION_VERSION != ICU_IPW_CFG_AR_RELEASE_REVISION_VERSION))
- #error "AutoSar Version Numbers of Icu_Ipw.h and Icu_Ipw_Cfg.h are different"
- #endif
- /* Check if current file and ICU IPW header file are of the same Software version */
- #if ((ICU_IPW_SW_MAJOR_VERSION != ICU_IPW_CFG_SW_MAJOR_VERSION) || \
- (ICU_IPW_SW_MINOR_VERSION != ICU_IPW_CFG_SW_MINOR_VERSION) || \
- (ICU_IPW_SW_PATCH_VERSION != ICU_IPW_CFG_SW_PATCH_VERSION))
- #error "Software Version Numbers of Icu_Ipw.h and Icu_Ipw_Cfg.h are different"
- #endif
- /*==================================================================================================
- * CONSTANTS
- ==================================================================================================*/
- /*==================================================================================================
- * DEFINES AND MACROS
- ==================================================================================================*/
- /*==================================================================================================
- * ENUMS
- ==================================================================================================*/
- /*==================================================================================================
- * STRUCTURES AND OTHER TYPEDEFS
- ==================================================================================================*/
- /*==================================================================================================
- * GLOBAL VARIABLE DECLARATIONS
- ==================================================================================================*/
- /*==================================================================================================
- * FUNCTION PROTOTYPES
- ==================================================================================================*/
- #define ICU_START_SEC_CODE
- #include "Icu_MemMap.h"
- /**
- * @internal
- * @brief Icu_Ipw_Init
- * @details Initialize a hardware Icu IP Instance
- *
- * @param[in] count - Number of IPs instances to be configured.
- * @param[in] pIpConfig - Pointer to an array of Icu_Ipw_IpConfigType structures that contains
- * IP specific configuration data for the entire ICU driver.
- * @return void
- *
- * @pre Icu_DeInit must be called before.
- */
- void Icu_Ipw_Init(uint8 count, const Icu_Ipw_IpConfigType (*pIpConfig)[]);
- #if (ICU_DE_INIT_API == STD_ON)
- /**
- * @brief Icu_Ipw_DeInit
- * @details De-initialize ICU hardware channel
- *
- * @param[in] pIpConfig - Pointer to ICU top configuration structure
- *
- * @internal
- * @return void
- *
- * @pre Icu_Init must be called before.
- *
- */
- void Icu_Ipw_DeInit(uint8 count, const Icu_Ipw_IpConfigType (*pIpConfig)[]);
- #endif
- #if (ICU_SET_MODE_API == STD_ON)
- /**
- * @brief Put the channel in a reduce power state.
- *
- * @internal
- * @param channelConfig - configuration of the channel
- */
- void Icu_Ipw_SetSleepMode(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- /**
- * @brief Set the channel to run again.
- *
- * @internal
- * @param channelConfig - configuration of the channel
- */
- void Icu_Ipw_SetNormalMode(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- #endif /* ICU_SET_MODE_API == STD_ON */
- /**
- * @brief Icu_Ipw_SetActivationCondition
- * @details
- *
- * @param[in] activation - the type of activation for the ICU channel.
- * @param[in] ChannelConfig - the measurement mode of the channel
- *
- * @internal
- * @return void
- *
- */
- void Icu_Ipw_SetActivationCondition(Icu_ActivationType activation,
- const Icu_Ipw_ChannelConfigType* ChannelConfig);
- #if (ICU_GET_INPUT_STATE_API == STD_ON)
- /**
- * @brief Icu_Ipw_GetInputState
- * @details Service that returns the state of the ICU driver
- *
- * @param[in] ChannelConfig - The current channel configuration structure
- *
- * @internal
- * @return Icu_InputStateType
- * @retval ICU_ACTIVE An active edge has been detected
- * @retval ICU_IDLE No active edge has been detected since the cast call to
- * Icu_Ipw_Init or Icu_Ipw_GetInputState
- */
- boolean Icu_Ipw_GetInputState (const Icu_Ipw_ChannelConfigType *ChannelConfig);
- #endif /* ICU_GET_INPUT_STATE_API == STD_ON */
- #if (STD_ON == ICU_TIMESTAMP_API)
- /**
- * @brief
- * @internal
- * @param channelConfig
- * @param bDmaSupport
- */
- void Icu_Ipw_StartTimestamp(const Icu_Ipw_ChannelConfigType* channelConfig,
- uint16* bufferPtr,
- uint16 bufferSize,
- uint16 notifyInterval);
- /**
- * @brief
- * @internal
- * @param channelConfig
- */
- void Icu_Ipw_StopTimestamp(const Icu_Ipw_ChannelConfigType *channelConfig);
- /**
- * @brief
- *
- * @param channelConfig
- * @return uint16
- */
- uint16 Icu_Ipw_GetTimestampIndex(const Icu_Ipw_ChannelConfigType* channelConfig);
- #if (ICU_TIMESTAMP_USES_DMA == STD_ON)
- uint32 Icu_Ipw_GetStartAddress(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- #endif /* ICU_TIMESTAMP_USES_DMA == STD_ON */
- #endif /* ICU_TIMESTAMP_API == STD_ON */
- #if (STD_ON == ICU_EDGE_COUNT_API)
- /**
- * @brief
- * @internal
- * @param ChannelConfig
- */
- void Icu_Ipw_ResetEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- /**
- * @brief
- * @internal
- * @param ChannelConfig
- */
- void Icu_Ipw_EnableEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- /**
- * @brief
- * @internal
- * @param ChannelConfig
- */
- void Icu_Ipw_DisableEdgeCount(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- /**
- * @brief
- * @internal
- * @param ChannelConfig
- * @return uint16
- */
- uint16 Icu_Ipw_GetEdgeNumbers(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- #endif /* STD_ON == ICU_EDGE_COUNT_API */
- #if (STD_ON == ICU_EDGE_DETECT_API)
- void Icu_Ipw_EnableEdgeDetection(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- void Icu_Ipw_DisableEdgeDetection(const Icu_Ipw_ChannelConfigType* ChannelConfig);
- #endif
- #if ((ICU_OVERFLOW_NOTIFICATION_API == STD_OFF) && (ICU_VALIDATE_PARAMS == STD_ON))
- #if ((ICU_EDGE_COUNT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON) || \
- (ICU_GET_TIME_ELAPSED_API == STD_ON) || (ICU_GET_DUTY_CYCLE_VALUES_API == STD_ON))
- /**
- * @brief The function get the state of the overflow flag
- * @internal
- * @param ChannelConfig Channel configuration pointer
- * @return boolean the state of the overflow flag
- * @retval TRUE the overflow flag is set
- * @retval FALSE the overflow flag is not set
- */
- boolean Icu_Ipw_Get_Overflow(const Icu_Ipw_ChannelConfigType* ChannelConfig);
- #endif
- #endif /* (ICU_OVERFLOW_NOTIFICATION_API == STD_OFF) && (ICU_VALIDATE_PARAMS == STD_ON) */
- #if ((ICU_CAPTURERGISTER_API == STD_ON) && ((ICU_SIGNAL_MEASUREMENT_API == STD_ON) || (ICU_TIMESTAMP_API == STD_ON)))/**
- * @brief Capture the value of counter register for a specified channel.
- *
- * @details The API shall return the value stored in capture register.
- * The API is the equivalent of AUTOSAR API GetCaptureRegisterValue.
- *
- * @param ChannelConfig Channel configuration pointer
- * @return uint32 Value of the register captured.
- */
- Icu_ValueType Icu_Ipw_GetCaptureRegisterValue(const Icu_Ipw_ChannelConfigType* ChannelConfig);
- #endif
- #if (STD_ON == ICU_SIGNAL_MEASUREMENT_API)
- /**
- * @brief
- * @internal
- * @param channelConfig
- */
- void Icu_Ipw_StartSignalMeasurement(const Icu_Ipw_ChannelConfigType *ChannelConfig);
- /**
- * @brief
- * @internal
- * @param channelConfig
- */
- void Icu_Ipw_StopSignalMeasurement(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- void Icu_Ipw_GetPWandPeriod(const Icu_Ipw_ChannelConfigType* channelConfig, \
- Icu_ValueType* Icu_aActivePulseWidth, \
- Icu_ValueType* Icu_aPeriod);
- #endif /* STD_ON == ICU_SIGNAL_MEASUREMENT_API */
- #if (STD_ON == ICU_DUAL_CLOCK_MODE_API)
- /**
- * @brief
- * @internal
- * @param moduleConfig
- * @param selectPrescaler
- * @param modulesNumber
- */
- void Icu_Ipw_SetClockMode(const Icu_Ipw_IpConfigType (*moduleConfig)[], Icu_SelectPrescalerType selectPrescaler,
- uint8 modulesNumber);
- #endif /* STD_ON == ICU_DUAL_CLOCK_MODE_API */
- #if (STD_ON == ICU_GET_INPUT_LEVEL_API)
- /**
- * @brief Mapping macro between IP input level functionality and HL function.
- * @internal
- * @param channelConfig
- * @return Icu_LevelType
- */
- Icu_LevelType Icu_Ipw_GetInputLevel(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- #endif /* STD_ON == ICU_GET_INPUT_LEVEL_API */
- #if ((ICU_VALIDATE_PARAMS == STD_ON) && (ICU_GET_INPUT_LEVEL_API == STD_ON))
- /**
- * @brief
- * @internal
- * @param channelConfig
- * @return Icu_Ipw_StatusType
- */
- Icu_Ipw_StatusType Icu_Ipw_ValidateGetInputLevel(const Icu_Ipw_ChannelConfigType * ChannelConfig);
- #endif
- #if (STD_ON == ICU_GET_DUTY_CYCLE_VALUES_API)
- /**
- * @brief
- *
- * @param channelConfig
- * @param DutyCycleValues
- * @internal
- */
- void Icu_Ipw_GetDutyCycleValues(const Icu_Ipw_ChannelConfigType* channelConfig,
- Icu_DutyCycleType* DutyCycleValues);
- #endif /* STD_ON == ICU_GET_DUTY_CYCLE_VALUES_API */
- #if (STD_ON == ICU_GET_TIME_ELAPSED_API)
- /**
- * @brief
- *
- * @param channelConfig
- * @return Icu_ValueType
- * @internal
- */
- Icu_ValueType Icu_Ipw_GetTimeElapsed(const Icu_Ipw_ChannelConfigType* channelConfig);
- #endif /* STD_ON == ICU_GET_TIME_ELAPSED_API */
- /**
- * @brief Icu_Ipw_EnableNotification
- * @details Enable Notification for timestamp
- *
- * @param[in] ChannelConfig - The index of ICU channel for current configuration structure
- *
- * @return void
- * @internal
- */
- void Icu_Ipw_EnableNotification(const Icu_Ipw_ChannelConfigType* ChannelConfig);
- /**
- * @brief Icu_Ipw_DisableNotification
- * @details Disable Notification for timestamp
- *
- * @param[in] ChannelConfig - The index of ICU channel for current configuration structure
- *
- * @return void
- * @internal
- */
- void Icu_Ipw_DisableNotification(const Icu_Ipw_ChannelConfigType* ChannelConfig);
- #define ICU_STOP_SEC_CODE
- #include "Icu_MemMap.h"
- #ifdef __cplusplus
- }
- #endif
- /** @} */
- #endif /* ICU_IPW_H */
|