/*!
* @file     Icu_Cfg.h
*
* @version  1.0.0
*
* @brief    AUTOSAR Icu Configuration header file
*
*/
/*******************************************************************************
* Project Name      : AUTOSAR MCAL
* Platform          : Arm
* Autosar Standard  : Classic Platform 4.4.0
* Revision Number   :
* Compiled Version  : G32A10xx_MCAL_1_0_0_01-Otc-25
*
* Copyright (C) 2026 Geehy Semiconductor
*
* You may not use this file except in compliance with the GEEHY COPYRIGHT NOTICE
* (Geehy Semiconductor Software License Agreement).
*
* The program is only for reference, which is distributed in the hope that it
* will be useful and instructional for customers to develop their software.
* Unless required by applicable law or agreed to in writing, the program is
* distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTY OR CONDITIONS OF ANY
* KIND, either express or implied. See the Geehy Semiconductor Software License Agreement for
* the governing permissions and limitations under the License.
*
*******************************************************************************/

#ifndef ICU_CFG_H
#define ICU_CFG_H

#ifdef __cplusplus
extern "C"{
#endif

#include "Mcal.h"
#include "Pdl_TmrReg.h"

/*******************************************************************************
                    VENDOR ID & AUTOSAR VERSION INFO
*******************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define ICU_CFG_H_VENDOR_ID                       0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_CFG_H_AR_RELEASE_MAJOR_VERSION        0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_CFG_H_AR_RELEASE_MINOR_VERSION        0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_CFG_H_AR_RELEASE_REVISION_VERSION     0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_CFG_H_SW_MAJOR_VERSION                0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_CFG_H_SW_MINOR_VERSION                0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_CFG_H_SW_PATCH_VERSION                0x00U

/*******************************************************************************
                                VERSION CHECK
*******************************************************************************/

/* Make sure the vendor id is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_VENDOR_ID != PDL_TMR_REG_H_VENDOR_ID)
    #error "Vendor id mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif

/* Make sure the AUTOSAR major version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_AR_RELEASE_MAJOR_VERSION != PDL_TMR_REG_H_AR_RELEASE_MAJOR_VERSION)
    #error "AUTOSAR Major Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_AR_RELEASE_MINOR_VERSION != PDL_TMR_REG_H_AR_RELEASE_MINOR_VERSION)
    #error "AUTOSAR Minor Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_AR_RELEASE_REVISION_VERSION != PDL_TMR_REG_H_AR_RELEASE_REVISION_VERSION)
    #error "AUTOSAR Revision Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif
/* Make sure the software major version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_SW_MAJOR_VERSION != PDL_TMR_REG_H_SW_MAJOR_VERSION)
    #error "Software Major Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif
/* Make sure the software minor version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_SW_MINOR_VERSION != PDL_TMR_REG_H_SW_MINOR_VERSION)
    #error "Software Minor Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif
/* Make sure the software patch version number is the same between Pdl_TmrReg.h and ICU_Cfg.h */
#if(ICU_CFG_H_SW_PATCH_VERSION != PDL_TMR_REG_H_SW_PATCH_VERSION)
    #error "Software Patch Version Number mismatch between Pdl_TmrReg.h and ICU_Cfg.h"
#endif

/**************************************************************************
                    MACRO DEFINITION
**************************************************************************/
/** Enable or Disable the Det Error Detect Function */
#define ICU_DEV_ERROR_DETECT_ENABLE            (STD_OFF)

/** Enable or Disable to the Icu_Tmr_ReadTmrCCnRegValue() API */
#define ICU_READ_CCN_REG_API_ENABLE            (STD_OFF)

/** Enable or Disable to the Icu_SetClkPrescaler() API */
#define ICU_DUAL_CLOCK_MODE_API_ENABLE         (STD_OFF)

/** Enable or Disable to the measurement with DMA */
#define ICU_TIMESTAMP_USES_DMA_ENABLE          (STD_OFF)

/** Enable or Disable to the code related to overflow notification */
#define ICU_OVERFLOW_NOTIFICATION_API_ENABLE   (STD_ON)

/** Enable or Disable to the Icu_EnableEdgeDetection(),Icu_DisableEdgeDetection() Api */
#define ICU_EDGE_DETECT_API_ENABLE             (STD_OFF)

/** Enable or Disable to the Icu_CheckWakeup() Api */
#define ICU_WAKEUP_FUNCTIONALITY_API_ENABLE    (STD_OFF)

/** Enable or Disable to the Icu_StopSignalMeasurement() Api */
#define ICU_SIGNAL_MEASUREMENT_API_ENABLE      (STD_ON)

/** Enable or Disable to the Icu_GetInputState() Api */
#define ICU_GET_INPUT_STATE_API_ENABLE         (STD_OFF)

/** Enable or Disable to the Icu_GetDutyCycleValues() Api */
#define ICU_GET_DUTY_CYCLE_VALUES_API_ENABLE   (STD_OFF)

/** Enable or Disable to the Icu_GetTimeElapsed() Api */
#define ICU_GET_TIME_ELAPSED_API_ENABLE        (STD_ON)

/** Enable or Disable to the Icu_ResetEdgeCount(), Icu_EnableEdgeCount(), Icu_DisableEdgeCount(),Icu_GetEdgeNumbers() Api */
#define ICU_EDGE_COUNT_API_ENABLE              (STD_OFF)

/** Enable or Disable to the Icu_StartTimestamp() Api */
#define ICU_TIMESTAMP_API_ENABLE               (STD_OFF)

/** Enable or Disable to the Icu_EnableWakeup() Api */
#define ICU_ENABLE_WAKEUP_API_ENABLE           (STD_OFF)

/** Enable or Disable to the Icu_DisableWakeup() Api */
#define ICU_DISABLE_WAKEUP_API_ENABLE          (STD_OFF)

/** Enable or Disable to the Icu_SetMode() Api */
#define ICU_SET_MODE_API_ENABLE                (STD_OFF)

/** Enable or Disable to the Icu_DeInit() Api */
#define ICU_DE_INIT_API_ENABLE                 (STD_ON)

/** Enable or Disable to the Icu_GetVersionInfo() Api */
#define ICU_GET_VERSION_INFO_API_ENABLE        (STD_OFF)

/** Enable or Disable Icu report wakeup source function */
#define ICU_REPORT_WAKEUP_SOURCE_ENABLE        (STD_OFF)

/** Enable or Disable Tmr custom feature */
#define ICU_TMR_CUSTOM_FEATURE_ENABLE          (STD_OFF)

/** Enable or Disable Port Filter Function */
#define ICU_PORT_FILTER_ENABLE                 (STD_OFF)

/** Definition the number of Tmr hardware modules from resource file*/
#define ICU_NUM_TMR_HW_MODULE                  ((uint8)4U)

/** Defines for the symbolic names of Icu Channel */
#define ICU_CHANNEL_NUMBER                     ((Icu_ChannelType)0xFF)

/** Defines for the Number of Dma Channel */
#define ICU_PDL_DMA_CHANNEL_NUMBER              ((Pdl_ChType)0xFF)

/** The Port channels count */
#define ICU_PORT_CFG_CH_CNT                      (0U)
/** The Tmr channels count */
#define ICU_TMR_CFG_CH_CNT                       (2U)
/** Definition the Maximum number of ICU channels configured*/
#define ICU_MAX_CFG_CH_CNT                       ((Icu_ChannelType)(ICU_PORT_CFG_CH_CNT + ICU_TMR_CFG_CH_CNT))
/** The Tmr count */
#define ICU_TMR_IP_CFG_CNT                       (1U)

#define IcuChannel_0                             (0U)
#define IcuChannel_1                             (1U)

/** ISR's configured for TMR3 */
#define ICU_TMR3_ISR_ENABLE

/** Enable the Eint */
#define ICU_EINT_SUPPORT                         (STD_OFF)
/** Enable or Disable Icu eint notification */
#define ICU_EINT_NOTIFICATION_SUPPORT            (STD_OFF)

/** configured for icu driver export */
#define ICU_CONFIG_PB \
    extern CONST(Icu_ConfigType, ICU_CONST) g_IcuConfig;

/**************************************************************************
                    STRUCT DEFINITION
**************************************************************************/

typedef uint32 Icu_TimeRegBitNumberType;

typedef uint16 Icu_HWRealIndexType;

typedef uint16 Icu_HWRealEdgeNumberType;

#ifdef __cplusplus
}
#endif

#endif    /** end of ICU_CFG_H */

