/*!
* @file     Gpt_PBcfg.c
*
* @version  1.0.0
*
* @brief    This file includes the configuration parameters of the Gpt module.
*
*/

/*******************************************************************************
* Project Name      : AUTOSAR MCAL
* Platform          : Arm
* Autosar Standard  : Classic Platform 4.4.0
* Revision Number   :
* Compiled Version  : G32A10xx_MCAL_1_0_0_15-Nov-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.
*
*******************************************************************************/

#ifdef __cplusplus
extern "C"{
#endif  /* ifdef __cplusplus */

#include "Gpt_Cfg.h"
#include "Gpt.h"

/*******************************************************************************
                    VENDOR ID & AUTOSAR VERSION INFO
*******************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define GPT_PBCFG_VENDOR_ID                              0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define GPT_PBCFG_AR_RELEASE_MAJOR_VERSION               0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define GPT_PBCFG_AR_RELEASE_MINOR_VERSION               0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define GPT_PBCFG_AR_RELEASE_REVISION_VERSION            0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */ 
#define GPT_PBCFG_SW_MAJOR_VERSION                       0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define GPT_PBCFG_SW_MINOR_VERSION                       0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define GPT_PBCFG_SW_PATCH_VERSION                       0x00U

/**********************************************************************************************************************
                                        VERSION INFOMATION VERIFICATION
***********************************************************************************************************************/
extern void Gpt_NotificationChannel_Timer1_Channel1(void);
extern void Gpt_NotificationChannel_Timer2_Channel2(void);
/**********************************************************************************************************************
                                             GLOBAL VARIABLE
***********************************************************************************************************************/
static CONST(Gpt_ChannelType,ICU_CONST) g_gptInitHwMap[GPT_TOTAL_CHANNELS_NUMBER] =
{
    Gpt_ConfigRef_GptChannelConfiguration_0,/** maps to TMR1_CH1 */
    GPT_CHANNEL_NUMBER,/** maps to TMR1_CH2 */
    GPT_CHANNEL_NUMBER,/** maps to TMR1_CH3 */
    GPT_CHANNEL_NUMBER,/** maps to TMR1_CH4 */
    
    GPT_CHANNEL_NUMBER,/** maps to TMR2_CH1 */
    Gpt_ConfigRef_GptChannelConfiguration_1,/** maps to TMR2_CH2 */
    GPT_CHANNEL_NUMBER,/** maps to TMR2_CH3 */
    GPT_CHANNEL_NUMBER,/** maps to TMR2_CH4 */
    
    GPT_CHANNEL_NUMBER,/** maps to TMR3_CH1 */
    GPT_CHANNEL_NUMBER,/** maps to TMR3_CH2 */
    GPT_CHANNEL_NUMBER,/** maps to TMR3_CH3 */
    GPT_CHANNEL_NUMBER,/** maps to TMR3_CH4 */
    
    GPT_CHANNEL_NUMBER,/** maps to TMR4_CH1 */
    GPT_CHANNEL_NUMBER,/** maps to TMR4_CH2 */
    GPT_CHANNEL_NUMBER,/** maps to TMR4_CH3 */
    GPT_CHANNEL_NUMBER,/** maps to TMR4_CH4 */
    
    GPT_CHANNEL_NUMBER,/** maps to TMR6 */
    GPT_CHANNEL_NUMBER,/** maps to TMR7 */
    GPT_CHANNEL_NUMBER,/** maps to TMR8 */
};



static CONST(Gpt_HwUnitConfigType,ICU_CONST) g_gptTmrGlobalConfig[GPT_HW_TIMER_NUM] =
{
    {
        .HardwareUnitId = GPT_TMR1,
        .ChannelMode = GPT_COUNT_MODE_CONTINUOUS,
        .ChannelNum = 1,
        .ChannelPrescaler = 63999,
    },
    {
        .HardwareUnitId = GPT_TMR2,
        .ChannelMode = GPT_COUNT_MODE_CONTINUOUS,
        .ChannelNum = 1,
        .ChannelPrescaler = 63999, //63999
    }
};


static CONST(Gpt_ChannelConfigType,ICU_CONST) g_gptHwChannelConfig[GPT_CHANNEL_IDX_NUM] =
{
    {
        .ChannelId = Gpt_ConfigRef_GptChannelConfiguration_0,
        .HwChannel = TMR_1_CHANNEL_1,
        .Notification = Gpt_NotificationChannel_Timer1_Channel1,
        .ChannelValueMax = 999,
        .EnableWakeup = FALSE,
        .Gpt_WakeupSource = 100
    },
    {
        .ChannelId = Gpt_ConfigRef_GptChannelConfiguration_1,
        .HwChannel = TMR_2_CHANNEL_2,
        .Notification = Gpt_NotificationChannel_Timer2_Channel2,
        .ChannelValueMax = 999,
        .EnableWakeup = FALSE,
        .Gpt_WakeupSource = 300
    },
};

const Gpt_ConfigType g_gptConfg = 
{
    .Gpt_ChannelCount = GPT_CHANNEL_IDX_NUM,
    .gptHwMapPtr = g_gptInitHwMap,
    .gptTmrConfigPtr = g_gptTmrGlobalConfig,
    .ChannelConfig = g_gptHwChannelConfig,
};


#ifdef __cplusplus
}
#endif  /* ifdef __cplusplus */
