/*!
* @file     WdgIf.h
*
* @version  1.0.0
*
* @brief    This file defines macros on wdg interfaces
*
* @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.
*/

#ifndef WDGIF_H
#define WDGIF_H

#ifdef __cplusplus
extern "C"{
#endif

#include "Std_Types.h"
#include "WdgIf_Cfg.h"
#include "WdgIf_Types.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup WDGIF_Driver
  * @brief WDGIF driver modules
  @{
*/

/** @defgroup WDGIF_Macros
  @{
*/
/**************************************************************************************************
                    VENDOR ID & AUTOSAR VERSION INFO
**************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define WDGIF_H_VENDOR_ID                      0x00C1U
/** Module ID of this module, as defined in the BSW Module List. */
#define WDGIF_H_MODULE_ID                      0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDGIF_H_AR_RELEASE_MAJOR_VERSION       0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDGIF_H_AR_RELEASE_MINOR_VERSION       0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDGIF_H_AR_RELEASE_REVISION_VERSION    0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDGIF_H_SW_MAJOR_VERSION               0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDGIF_H_SW_MINOR_VERSION               0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDGIF_H_SW_PATCH_VERSION               0x00U

/**@} end of group WDGIF_Macros */

/**************************************************************************************************
                    VERSION INFOMATION VERIFICATION
**************************************************************************************************/
#ifdef ENABLE_INTERMODULE_MCAL_CHECK
    /* Make sure the AUTOSAR major version number is the same between WdgIf.h and Std_Types.h */
    #if (WDGIF_H_AR_RELEASE_MAJOR_VERSION != STD_TYPES_H_AR_RELEASE_MAJOR_VERSION)
        #error "AUTOSAR Major Version Number mismatch between WdgIf.h and Std_Types.h"
    #endif
    /* Make sure the AUTOSAR minor version number is the same between WdgIf.h and Std_Types.h */
    #if (WDGIF_H_AR_RELEASE_MINOR_VERSION != STD_TYPES_H_AR_RELEASE_MINOR_VERSION)
        #error "AUTOSAR Minor Version Number mismatch between WdgIf.h and Std_Types.h"
    #endif
#endif

/* Make sure the vendor id is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_VENDOR_ID != WDGIF_CFG_H_VENDOR_ID)
    #error "Vendor id mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the AUTOSAR major version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_AR_RELEASE_MAJOR_VERSION != WDGIF_CFG_H_AR_RELEASE_MAJOR_VERSION)
     #error "AUTOSAR Major Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_AR_RELEASE_MINOR_VERSION != WDGIF_CFG_H_AR_RELEASE_MINOR_VERSION)
     #error "AUTOSAR Minor Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_AR_RELEASE_REVISION_VERSION != WDGIF_CFG_H_AR_RELEASE_REVISION_VERSION)
     #error "AUTOSAR Revision Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the software major version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_SW_MAJOR_VERSION != WDGIF_CFG_H_SW_MAJOR_VERSION)
     #error "Software Major Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the software minor version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_SW_MINOR_VERSION != WDGIF_CFG_H_SW_MINOR_VERSION)
     #error "Software Minor Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif
/* Make sure the software patch version number is the same between WdgIf.h and WdgIf_Cfg.h */
#if (WDGIF_H_SW_PATCH_VERSION != WDGIF_CFG_H_SW_PATCH_VERSION)
     #error "Software Patch Version Number mismatch between WdgIf.h and WdgIf_Cfg.h"
#endif

/* Make sure the vendor id is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_VENDOR_ID != WDGIF_TYPES_H_VENDOR_ID)
    #error "Vendor id mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the AUTOSAR major version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_AR_RELEASE_MAJOR_VERSION != WDGIF_TYPES_H_AR_RELEASE_MAJOR_VERSION)
     #error "AUTOSAR Major Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the AUTOSAR minor version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_AR_RELEASE_MINOR_VERSION != WDGIF_TYPES_H_AR_RELEASE_MINOR_VERSION)
     #error "AUTOSAR Minor Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the AUTOSAR revision version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_AR_RELEASE_REVISION_VERSION != WDGIF_TYPES_H_AR_RELEASE_REVISION_VERSION)
     #error "AUTOSAR Revision Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the software major version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_SW_MAJOR_VERSION != WDGIF_TYPES_H_SW_MAJOR_VERSION)
     #error "Software Major Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the software minor version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_SW_MINOR_VERSION != WDGIF_TYPES_H_SW_MINOR_VERSION)
     #error "Software Minor Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif
/* Make sure the software patch version number is the same between WdgIf.h and WdgIf_Types.h */
#if (WDGIF_H_SW_PATCH_VERSION != WDGIF_TYPES_H_SW_PATCH_VERSION)
     #error "Software Patch Version Number mismatch between WdgIf.h and WdgIf_Types.h"
#endif

/**************************************************************************************************
                    CONSTANT DEFINITION
**************************************************************************************************/
/** @defgroup WDGIF_Variable
  @{
*/

/** @warning WdgIf_h_MISRA_REF1 Array declared with unknown size. */
extern const WdtIf_SetTriggerFuncPtrType   WdtIf_SetTriggerConditionFunctionPtr[];
/** @warning WdgIf_h_MISRA_REF1 Array declared with unknown size. */
extern const WdtIf_SetModeFuncPtrType      WdtIf_SetModeFunctionPtr[];

/**@} end of group WDGIF_Variable */

/**************************************************************************************************
                    MACRO DEFINITION
**************************************************************************************************/
/** @defgroup WDGIF_Macros
  @{
*/

/** WDGIF_E_PARAM_DEVICE, defined by AUTOSAR */
#define WDGIF_E_PARAM_DEVICE   (uint8)0x01
/** Service ID for WDGIF_TRIGGER */
#define SID_WDTIF_TRIGGER      (uint8)0x02
/** Service ID for WDGIF_SETMODE */
#define SID_WDTIF_SETMODE      (uint8)0x01

#if (STD_ON == WDG_USE_GPT)
#define WdgIf_SetTriggerCondition(DeviceIndex, Timeout)  WdtIf_SetTriggerConditionFunctionPtr[DeviceIndex](Timeout)
#else
#define WdgIf_SetTriggerCondition(DeviceIndex)  WdtIf_SetTriggerConditionFunctionPtr[DeviceIndex](void)
#endif

#define WdgIf_SetMode(DeviceIndex, WdgMode)              WdtIf_SetModeFunctionPtr[DeviceIndex](WdgMode)

#if (STD_ON == WDTIF_VER_INFORMATION_API)
     /** Service ID for WDGIF_VERSION */
    #define SID_WDTIF_VERSION   (uint8)0x03
     /** Defines  WdgIf_GetVersionInfo() function */
    #define WdgIf_GetVersionInfo(versioninfo) { (versioninfo)->vendorID = (uint16)WDGIF_H_VENDOR_ID; \
                                                (versioninfo)->moduleID = (uint16)WDGIF_H_MODULE_ID; \
                                                (versioninfo)->sw_major_version = (uint8)WDGIF_H_SW_MAJOR_VERSION; \
                                                (versioninfo)->sw_minor_version = (uint8)WDGIF_H_SW_MINOR_VERSION; \
                                                (versioninfo)->sw_patch_version = (uint8)WDGIF_H_SW_PATCH_VERSION; }
#endif

/**@} end of group WDGIF_Macros */

#ifdef __cplusplus
}
#endif

#endif

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