/*!
* @file     Icu_PBCfg.c
*
* @version  1.0.0
*
* @brief    This source file includes the configuration parameters of the Icu module
*
* @attention
*
* Project Name      : AUTOSAR MCAL
*
* Platform          : Arm
*
* Autosar Standard  : Classic Platform 4.4.0
*
* 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 usefull 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.
*/

#ifdef __cplusplus
extern "C"{
#endif

#include "Icu.h"

#if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
#include "CDD_Pdl.h"
#endif

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup ICU_Driver
  * @brief ICU driver modules
  @{
*/

/** @defgroup ICU_Macros
  @{
*/
/**********************************************************************************************************************
                                            VENDOR ID & AUTOSAR VERSION INFO
***********************************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define ICU_PBCFG_VENDOR_ID                   0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_PBCFG_AR_RELEASE_MAJOR_VERSION    0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_PBCFG_AR_RELEASE_MINOR_VERSION    0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ICU_PBCFG_AR_RELEASE_REVISION_VERSION 0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_PBCFG_SW_MAJOR_VERSION            0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_PBCFG_SW_MINOR_VERSION            0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ICU_PBCFG_SW_PATCH_VERSION            0x00U

/**@} end of group ICU_Macros */

/**********************************************************************************************************************
                                            VERSION INFOMATION VERIFICATION
***********************************************************************************************************************/
/* Make sure the vendor id is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_VENDOR_ID != ICU_H_VENDOR_ID)
    #error "Vendor id mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the AUTOSAR major version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_AR_RELEASE_MAJOR_VERSION != ICU_H_AR_RELEASE_MAJOR_VERSION)
    #error "AUTOSAR Major Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_AR_RELEASE_MINOR_VERSION != ICU_H_AR_RELEASE_MINOR_VERSION)
    #error "AUTOSAR Minor Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_AR_RELEASE_REVISION_VERSION != ICU_H_AR_RELEASE_REVISION_VERSION)
    #error "AUTOSAR Revision Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the software major version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_SW_MAJOR_VERSION != ICU_H_SW_MAJOR_VERSION)
    #error "Software Major Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the software minor version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_SW_MINOR_VERSION != ICU_H_SW_MINOR_VERSION)
    #error "Software Minor Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif
/* Make sure the software patch version number is the same between Icu_PBCfg.c and Gpt_Cfg.h */
#if(ICU_PBCFG_SW_PATCH_VERSION != ICU_H_SW_PATCH_VERSION)
    #error "Software Patch Version Number mismatch between Icu_PBCfg.c and Gpt_Cfg.h"
#endif

#if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
    /* Make sure the vendor id is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_VENDOR_ID != CDD_PDL_H_VENDOR_ID)
        #error "Vendor id mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the AUTOSAR major version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_AR_RELEASE_MAJOR_VERSION != CDD_PDL_H_AR_RELEASE_MAJOR_VERSION)
        #error "AUTOSAR Major Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the AUTOSAR minor version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_AR_RELEASE_MINOR_VERSION != CDD_PDL_H_AR_RELEASE_MINOR_VERSION)
        #error "AUTOSAR Minor Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the AUTOSAR revision version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_AR_RELEASE_REVISION_VERSION != CDD_PDL_H_AR_RELEASE_REVISION_VERSION)
        #error "AUTOSAR Revision Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the software major version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_SW_MAJOR_VERSION != CDD_PDL_H_SW_MAJOR_VERSION)
        #error "Software Major Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the software minor version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_SW_MINOR_VERSION != CDD_PDL_H_SW_MINOR_VERSION)
        #error "Software Minor Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
    /* Make sure the software patch version number is the same between Icu_PBCfg.c and CDD_Pdl.h */
    #if(ICU_PBCFG_SW_PATCH_VERSION != CDD_PDL_H_SW_PATCH_VERSION)
        #error "Software Patch Version Number mismatch between Icu_PBCfg.c and CDD_Pdl.h"
    #endif
#endif

/**********************************************************************************************************************
                                                    GLOBAL VARIABLE
***********************************************************************************************************************/
#define ICU_START_SEC_CODE
#include "Icu_MemMap.h"

/** @defgroup ICU_Fuctions
  @{
*/

/** IcuChannel_0 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH0(void);

/** IcuChannel_1 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH1(void);

/** IcuChannel_3 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH3(void);

/** IcuChannel_4 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH4(void);

/** IcuChannel_5 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH5(void);

/** IcuChannel_6 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH6(void);

/** IcuChannel_7 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH7(void);

/** IcuChannel_10 notification handlers */
extern FUNC (void, ICU_CODE) Icu_SignalNotification_CH10(void);

/**@} end of group ICU_Fuctions */

#define ICU_STOP_SEC_CODE
#include "Icu_MemMap.h"

#define ICU_START_SEC_CONFIG_DATA_UNSPECIFIED
#include "Icu_MemMap.h"

/** @defgroup ICU_Variable
  @{
*/

/** This index relates the Hardware channels with the respective ICU channel. 
    When Calling the notifications,the TMR or PORT hardware channel(eg: ICU_TMR1_CH1/ICU_PORT0_CH0) 
    will be transmiteed by the array,acording the IcuChannel_x to find the notification function from the 
    g_IcuInitChannel_PB array.
  */
static CONST(Icu_ChannelType,ICU_CONST) g_IcuInitHWMap_PB[ICU_TOTAL_CHANNELS_NUMBER] =
{
    ICU_CHANNEL_NUMBER,/** maps to TMR0_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to TMR0_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to TMR0_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to TMR0_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to TMR0_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to TMR1_CH0 */
    IcuChannel_8,      /** maps to TMR1_CH1 */
    IcuChannel_5,      /** maps to TMR1_CH2 */
    IcuChannel_11,     /** maps to TMR1_CH3 */
    IcuChannel_6,      /** maps to TMR1_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to TMR2_CH0 */
    IcuChannel_12,     /** maps to TMR2_CH1 */
    IcuChannel_10,     /** maps to TMR2_CH2 */
    IcuChannel_9,      /** maps to TMR2_CH3 */
    IcuChannel_7,      /** maps to TMR2_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to TMR3_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to TMR3_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to TMR3_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to TMR3_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to TMR3_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to TMR4_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to TMR4_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to TMR4_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to TMR4_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to TMR4_CH4 */
    IcuChannel_0,      /** maps to PORT0_CH0 */
    IcuChannel_1,      /** maps to PORT0_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH6 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT0_CH14 */
    IcuChannel_3,      /** maps to PORT0_CH15 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH1 */
    IcuChannel_2,      /** maps to PORT1_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH6 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH14 */
    ICU_CHANNEL_NUMBER,/** maps to PORT1_CH15 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH6 */
    IcuChannel_4,      /** maps to PORT2_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH14 */
    ICU_CHANNEL_NUMBER,/** maps to PORT2_CH15 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH6 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH14 */
    ICU_CHANNEL_NUMBER,/** maps to PORT3_CH15 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH6 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH14 */
    ICU_CHANNEL_NUMBER,/** maps to PORT4_CH15 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH0 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH1 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH2 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH3 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH4 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH5 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH6 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH7 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH8 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH9 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH10 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH11 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH12 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH13 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH14 */
    ICU_CHANNEL_NUMBER,/** maps to PORT5_CH15 */
};

/***************************************************************************************************************
                                           PORT START
***************************************************************************************************************/

/** Default PORT Configuration:
    Only one port pin configured for one Eint chnnel, and the same pin id of the other port 
    cannot be configured for the Eint channel, for example:ICU_PORT0_CH0 and ICU_PORT1_CH0 cannot
    be configured at the same time.
 */
static CONST(Icu_Port_CiCHCfgType, ICU_CONST) g_IcuPortChannelConfig_PB[ICU_PORT_CFG_CH_CNT] =
{
    /** IcuChannel_0 */
    {
        /** Port HW Module and Channel configurations */
        (uint16)ICU_PORT0_CH0,
        /** Default start Edge */
        (uint8)ICU_FALLING_EDGE,
        /** Port pin mode */
        ICU_PORT_INTERRUPT_MODE
    },
        /** IcuChannel_1 */
    {
        /** Port HW Module and Channel configurations */
        (uint16)ICU_PORT0_CH1,
        /** Default start Edge */
        (uint8)ICU_FALLING_EDGE,
        /** Port pin mode */
        ICU_PORT_INTERRUPT_MODE
    },
    /** IcuChannel_2 */
    {
        /** Port HW Module and Channel configurations */
        (uint16)ICU_PORT1_CH2,
        /** Default start Edge */
        (uint8)ICU_FALLING_EDGE,
        /** Port pin mode */
        ICU_PORT_EVENT_MODE
    },
        /** IcuChannel_3 */
    {
        /** Port HW Module and Channel configurations */
        (uint16)ICU_PORT0_CH15,
        /** Default start Edge */
        (uint8)ICU_FALLING_EDGE,
        /** Port pin mode */
        ICU_PORT_INTERRUPT_MODE
    },
    /** IcuChannel_4 */
    {
        /** Port HW Module and Channel configurations */
        (uint16)ICU_PORT2_CH7,
        /** Default start Edge */
        (uint8)ICU_FALLING_EDGE,
        /** Port pin mode */
        ICU_PORT_INTERRUPT_MODE
    }
};

static CONST(Icu_Port_CiIPCfgType, ICU_CONST) g_IcuPortCiIpConfig_PB =
{
    /** Define number of Port channels */
    (uint8)ICU_PORT_CFG_CH_CNT,
    /** Configurations of Icu channel array pointer that Port enbaled */
    &g_IcuPortChannelConfig_PB
};

/***************************************************************************************************************
                                           PORT END
***************************************************************************************************************/

/***************************************************************************************************************
                                           TMR START
***************************************************************************************************************/
/** Default Tmr channels Configuration */
static CONST(Icu_TmrChCfgType, ICU_CONST) g_IcuTmrChannelConfig_PB[ICU_TMR_CFG_CH_CNT] =
{
    /** IcuChannel_5 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR1_CH2,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_FALLING_EDGE,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_SIGNAL_EDGE_DETECT
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_6 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR1_CH4,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_BOTH_EDGES,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_SIGNAL_EDGE_DETECT
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
         /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_7 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR2_CH4,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_BOTH_EDGES,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_SIGNAL_EDGE_DETECT
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_8 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR1_CH1,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_FALLING_EDGE,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_EDGE_COUNTER
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_9 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR2_CH3,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_BOTH_EDGES,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_EDGE_COUNTER
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_10 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR2_CH2,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_BOTH_EDGES,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_TIMESTAMP
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,TRUE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_11 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR1_CH3,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_RISING_EDGE,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_SIGNAL_MEASUREMENT
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    /** IcuChannel_12 */
    {
        /** Tmr HW Channel id */
        (uint8)ICU_TMR2_CH1,
        /** Tmr channel PSC */
        ICU_TMR_ICPSC_DIV1,
        /** Tmr channel */
        ICU_TMR_IC_SELECTION_DIRECT_TI,
        (uint8)ICU_FALLING_EDGE,
        TMR_IC_FILTER_DIS,
        (uint8)ICU_MODE_SIGNAL_MEASUREMENT
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        ,FALSE
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr channel interrupt notification callback */
        ,NULL_PTR
    #endif
    },
};

/** Default Tmr IP Configuration */
static CONST(Icu_TmrGlobalCfgType,ICU_CONST) g_IcuTmrGlobalConfiguration_PB[ICU_TMR_IP_CFG_CNT] =
{
    {
        /** Tmr id */
        ICU_TMR1,
        /** Tmr filter input clock Div */
        ICU_TMR_CKD_DIV1,
        /** Tmr clock PSC */
        0,
        /** Tmr count mode */
        ICU_TMR_CNTER_MODE_UP,
        /** Tmr auto reload value */
        0xFFFF
    #if (STD_ON == ICU_DUAL_CLOCK_MODE_API_ENABLE)
        ,
        0
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr overflow interrupt notification callback */
        ,NULL_PTR
    #endif
    },
    {
        /** Tmr id */
        ICU_TMR2,
        /** Tmr filter input clock Div */
        ICU_TMR_CKD_DIV1,
        /** Tmr clock PSC */
        0,
        /** Tmr count mode */
        ICU_TMR_CNTER_MODE_UP,
        /** Tmr auto reload value */
        0xFFFF
    #if (STD_ON == ICU_DUAL_CLOCK_MODE_API_ENABLE)
        ,
        0
    #endif
    #if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
        /** Tmr overflow interrupt notification callback */
        ,NULL_PTR
    #endif
    }

};

static CONST(Icu_TmrIPCfgType, ICU_CONST) g_IcuTmrIpConfig_PB =
{
    /** Define number of Tmr channels */
    (uint8)ICU_TMR_CFG_CH_CNT,
    /** Define number of Tmrs */
    ICU_TMR_IP_CFG_CNT,
#if (STD_ON == ICU_TMR_CUSTOM_FEATURE_ENABLE)
    /** This pointer maps the Tmr module id to the index of the Tmr module configuration structure */
    NULL_PTR,
#endif
    /** Global configured of Tmr */
    &g_IcuTmrGlobalConfiguration_PB,
    /** Configurations of Icu channel array */
    &g_IcuTmrChannelConfig_PB
};

/***************************************************************************************************************
                                           TMR END
***************************************************************************************************************/

/***************************************************************************************************************
                                           ICU START
***************************************************************************************************************/
/** The configuration array related Icu channels IP */
static CONST(Icu_WorkingCHCfgType, ICU_CONST) g_IcuWorkingChannelConfig_PB[ICU_MAX_CFG_CH_CNT] =
{
    /** IcuChannel_0 */
    {
        /** IP type */
        ICU_PORT_CI_CH_TYPE,
        /** The configuration table Index of the Port channels */
        (uint8)0,
    },
    /** IcuChannel_1 */
    {
        /** IP type */
        ICU_PORT_CI_CH_TYPE,
        /** The configuration table Index of the Port channels */
        (uint8)1,
    },
    /** IcuChannel_2 */
    {
        /** IP type */
        ICU_PORT_CI_CH_TYPE,
        /** The configuration table Index of the Port channels */
        (uint8)2,
    },
    /** IcuChannel_3 */
    {
        /** IP type */
        ICU_PORT_CI_CH_TYPE,
        /** The configuration table Index of the Port channels */
        (uint8)3,
    },
    /** IcuChannel_4 */
    {
        /** IP type */
        ICU_PORT_CI_CH_TYPE,
        /** The configuration table Index of the Port channels */
        (uint8)4,
    },
    /** IcuChannel_5 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)0,
    },
    /** IcuChannel_6 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)1,
    },
    /** IcuChannel_7 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)2,
    },
    /** IcuChannel_8 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)3,
    },
    /** IcuChannel_9 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)4,
    },
    /** IcuChannel_10 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)5,
    },
    /** IcuChannel_11 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)6,
    },
    /** IcuChannel_12 */
    {
        /** IP type */
        ICU_TMR_CH_TYPE,
        /** The configuration table Index of the Tmr channels */
        (uint8)7,
    }
};


/**
    The Icu channel configuration structure:if the ICU_TIMESTAMP_USES_DMA_ENABLE is enabled,
    the DMA channel number should be configured:
    ICU_TMR1_CH1 - DMA_HW_CH2
    ICU_TMR1_CH2 - DMA_HW_CH3
    ICU_TMR1_CH3 - DMA_HW_CH5
    ICU_TMR1_CH4 - DMA_HW_CH4
    ICU_TMR2_CH1 - DMA_HW_CH1
    ICU_TMR2_CH2 - DMA_HW_CH3
    ICU_TMR2_CH3 - DMA_HW_CH5
    ICU_TMR2_CH4 - DMA_HW_CH2
    ICU_TMR3_CH1 - DMA_HW_CH4
    ICU_TMR3_CH2 - DMA_HW_CH5
    ICU_TMR3_CH3 - DMA_HW_CH2
    ICU_TMR3_CH4 - DMA_HW_CH3
    ICU_TMR4_CH1 - DMA_HW_CH3
    ICU_TMR4_CH2 - DMA_HW_CH2
    ICU_TMR4_CH3 - DMA_HW_CH1
    ICU_TMR4_CH4 - DMA_HW_CH4
*/
static CONST(Icu_ChCfgType, ICU_CONST) g_IcuInitChannel_PB[ICU_MAX_CFG_CH_CNT]=
{
    /** IcuChannel_0 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET) | 
          ((Icu_EdgeAndWakeupFlagType)ICU_WAKEUP_CAPABLE_YES << (uint32)ICU_CH_WAKEUP_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH0,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_1 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH1,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_2 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET) | 
          ((Icu_EdgeAndWakeupFlagType)ICU_WAKEUP_CAPABLE_YES << (uint32)ICU_CH_WAKEUP_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        NULL_PTR,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_3 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH3,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_4 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH4,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_5 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET) | 
          ((Icu_EdgeAndWakeupFlagType)ICU_WAKEUP_CAPABLE_YES << (uint32)ICU_CH_WAKEUP_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH5,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_6 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_BOTH_EDGES << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET) | 
          ((Icu_EdgeAndWakeupFlagType)ICU_WAKEUP_CAPABLE_YES << (uint32)ICU_CH_WAKEUP_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH6,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_7 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_BOTH_EDGES << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_EDGE_DETECT,
        (Icu_ModeCfgItemType)0,
        &Icu_SignalNotification_CH7,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_8 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_EDGE_COUNTER,
        (Icu_ModeCfgItemType)0,
        NULL_PTR,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_9 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_BOTH_EDGES << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_EDGE_COUNTER,
        (Icu_ModeCfgItemType)0,
        NULL_PTR,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_10 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_BOTH_EDGES << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_TIMESTAMP,
        (Icu_ModeCfgItemType)ICU_CIRCULAR_BUFFER,
        &Icu_SignalNotification_CH10,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)DMA_HW_CH3,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_11 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_RISING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_MEASUREMENT,
        (Icu_ModeCfgItemType)ICU_DUTY_CYCLE,
        NULL_PTR,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
    /** IcuChannel_12 */
    {
        ((Icu_EdgeAndWakeupFlagType)((Icu_EdgeAndWakeupFlagType)ICU_FALLING_EDGE << (uint32)ICU_CH_ACTIVE_EDGE_BIT_OFFSET)),
        (Icu_MeasurementModeType)ICU_MODE_SIGNAL_MEASUREMENT,
        (Icu_ModeCfgItemType)ICU_DUTY_CYCLE,
        NULL_PTR,
    #if (STD_ON == ICU_TIMESTAMP_USES_DMA_ENABLE)
        (Pdl_ChType)ICU_PDL_DMA_CHANNEL_NUMBER,
    #endif
    #if (STD_ON == ICU_OVERFLOW_NOTIFICATION_API_ENABLE)
        NULL_PTR,
    #endif
    #if (STD_ON == ICU_REPORT_WAKEUP_SOURCE_ENABLE)
        (Icu_WakeupfeatureValueType)0
    #endif
    },
};

CONST(Icu_ConfigType, ICU_CONST) g_IcuConfig=
{
    (Icu_ChannelType)ICU_MAX_CFG_CH_CNT, //!< The number of Icu channels
    &g_IcuInitChannel_PB,
    {
        /** containing Tmr configuration */
        &g_IcuTmrIpConfig_PB,
        /** containing Port configuration */
        &g_IcuPortCiIpConfig_PB,
        /** containing channel IP related information */
        &g_IcuWorkingChannelConfig_PB
    },
    &g_IcuInitHWMap_PB
};

/***************************************************************************************************************
                                           ICU END
***************************************************************************************************************/

/**@} end of group ICU_Variable */

#define ICU_STOP_SEC_CONFIG_DATA_UNSPECIFIED
#include "Icu_MemMap.h"

#ifdef __cplusplus
}
#endif

/**@} end of group ICU_Driver */
/**@} end of group G32A10xx_StdPeriphDriver */
