/*!
* @file     Wdg_Types.h
*
* @version  1.0.0
*
* @brief    Header file of AUTOSAR Wdg driver
*
* @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 WDG_TYPES_H
#define WDG_TYPES_H

#ifdef __cplusplus
extern "C"{
#endif

#include "Std_Types.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @defgroup WDG_Driver
  * @brief WDG driver modules
  @{
*/

/** @defgroup WDG_Macros
  @{
*/
/*******************************************************************************
                  VENDOR ID & AUTOSAR VERSION INFO
*******************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define WDG_TYPES_H_VENDOR_ID                        0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_TYPES_H_AR_RELEASE_MAJOR_VERSION         0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_TYPES_H_AR_RELEASE_MINOR_VERSION         0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_TYPES_H_AR_RELEASE_REVISION_VERSION      0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_TYPES_H_SW_MAJOR_VERSION                 0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_TYPES_H_SW_MINOR_VERSION                 0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_TYPES_H_SW_PATCH_VERSION                 0x00U

/**@} end of group WDG_Macros */

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

/**************************************************************************************************
                    ENUMERATION DEFINITION
**************************************************************************************************/
/** @defgroup WDG_Enumerations
  @{
*/

/**
 * @brief   Defines Wdg_InstanceType.
 */
typedef enum
{
    Wdg_Instance0   = 0x00U
} Wdg_InstanceType;

/**
 * @brief   WDG Timebase(Prescaler) define
 */
typedef enum
{
    WDG_DIV_4     = ((uint8)0x00),
    WDG_DIV_8     = ((uint8)0x01),
    WDG_DIV_16    = ((uint8)0x02),
    WDG_DIV_32    = ((uint8)0x03),
    WDG_DIV_64    = ((uint8)0x04),
    WDG_DIV_128   = ((uint8)0x05),
    WDG_DIV_256   = ((uint8)0x06)
} Wdg_DivType;

/**
 * @brief   WDT key definition
 */
typedef enum
{
    WDG_KEY_REFRESH = ((uint16)0xAAAA), //!< refresh wdg counter
    WDG_KEY_ENABLE  = ((uint16)0xCCCC), //!< start watchdog count
    WDG_KEY_ACCESS  = ((uint16)0x5555)  //!< Rewrite the value of the IWDT_PSC, IWDT_CNTRLD and IWDT_WIN Register
} Wdg_KeyType;

/**@} end of group WDG_Enumerations */

/**************************************************************************************************
                    STRUCT DEFINITION
**************************************************************************************************/
/** @defgroup WDG_Structure
  @{
*/

/**
 * @brief   This struct stores specific mode paraters.
 */
typedef struct
{
    boolean       wdgRecfgEn;       //!< Flag indicating whether the watchdog is reconfigurable
    boolean       wdgWindowEn;      //!< Flag to enable the window watchdog
    Wdg_DivType   psc;              //!< watchdog clock prescaler
    uint32        wdgModeTimeout;   //!< Timeout Value
    uint32        wdgModeWindow;    //!< Window Value
#if (STD_ON == WDG_USE_GPT)
    uint32        wdgTimerClock;    //!< wdg clock frequency(for process calculation)
#endif
} Wdg_ModeParamterType;

/**@} end of group WDG_Structure */

#ifdef __cplusplus
}
#endif

#endif

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