/*!
* @file     Wdg_Cfg.h
*
* @version  1.0.0
*
* @brief    Header file of Wdg parameter configuration
*
* @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_CFG_H
#define WDG_CFG_H

#ifdef __cplusplus
extern "C"{
#endif

#include "WdgIf_Types.h"
#include "Mcal.h"
#include "Dem.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

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

/** @defgroup WDG_Macros
  @{
*/
/*************************************************************************************************
*                              VENDOR ID & AUTOSAR VERSION RECORD INFO
*************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define WDG_CFG_H_VENDOR_ID                    0x00C1U
/** Module ID of this module, as defined in the BSW Module List. */
#define WDG_CFG_H_MODULE_ID                    0x0066U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_CFG_H_AR_RELEASE_MAJOR_VERSION     0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_CFG_H_AR_RELEASE_MINOR_VERSION     0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define WDG_CFG_H_AR_RELEASE_REVISION_VERSION  0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_CFG_H_SW_MAJOR_VERSION             0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_CFG_H_SW_MINOR_VERSION             0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define WDG_CFG_H_SW_PATCH_VERSION             0x00U

/**@} end of group WDG_Macros */

/*************************************************************************************************
                               VERSION INFOMATION VERIFICATION
*************************************************************************************************/

/**************************************************************************************************
                                        CONSTANT DEFINITION
**************************************************************************************************/
#define WDG_START_SEC_CONST_UNSPECIFIED
#include "Wdg_MemMap.h"

/** @defgroup WDG_Variable
  @{
*/

/** Dem error references information */
extern CONST(Mcal_DemErrorType, WDG_CONST)g_wdgEDisableRejected;
extern CONST(Mcal_DemErrorType, WDG_CONST)g_wdgEModeFailed;
extern CONST(Mcal_DemErrorType, WDG_CONST)g_wdgETimeout;

/**@} end of group WDG_Variable */

#define WDG_STOP_SEC_CONST_UNSPECIFIED
#include "Wdg_MemMap.h"

/***************************************************************************************************
*                                      MACRO DEFINITION
***************************************************************************************************/
/** @defgroup WDG_Macros
  @{
*/

/** The WDG instance configuration status is on or off */
#define WDG_INSTANCE0                        (STD_ON)

/** Wdg configuration */
#define WDG_PBCONFIGURATION  \
                                extern CONST(Wdg_ConfigType, WDG_CONST) g_wdgConfig;

/** Enable/Disable the the Pre-compile Support */
#define WDG_PRECOMPILE_SUPPORT               (STD_OFF)

/** The number of configured WDG instance can be used */
#define WDG_INSTANCES_SUPPORT_NUMBER          0x1U

/** Internal watchdog */
#define WDG_INTERNAL_DIRECT                   0x00U

/** Watchdog module instance implementation type of driver */
#define WDG_IMPLEMENTATION_TYPE              (WDG_INTERNAL_DIRECT)

/** External watchdog module instance shall use the functionality and API of SPI handler */
#define WDG_EXTERNAL_VIA_SPI                  0x01U

/** External watchdog module instance shall use the functionality and API of r DIO driver */
#define WDG_EXTERNAL_VIA_DIO                  0x02U

/** Compile switch to enable / disable the version information API */
#define WDG_VERSION_INFO_API                 (STD_OFF)

/** Switch development error detection on or off */
#define WDG_DET_ERROR_DETECT_ENABLE          (STD_OFF)

/** Enable/Disable using GPT for WDG internal timing. */
#define WDG_USE_GPT                          (STD_ON)

/** Compile switch to allow/forbid disabling the watchdog driver during runtime */
#define WDG_DISABLE_ALLOWED                  (STD_ON)

/** The initial timeout (sec) for the trigger condition to be initialized during Init function. It shall be not larger than WdgMaxTimeout */
#define WDG_INITIAL_TIMEOUT                  ((uint16)50)

/** Specifies the InstanceId of this module instance. If only one instance is present it shall have the Id 0 */
#define WDG_INDEX                            ((uint8)0)

/** The maximum timeout (sec) to which the watchdog trigger condition can be initialized. */
#define WDG_MAX_TIMEOUT                      (5000)

/** Switch the configuration check and refresh service on or off */
#define WDG_CHECK_CONFIG_REFRESH             (STD_ON)

/** The maximum value for 16 bits integer */
#define WDG_MAX_VALUE                        (4095U)

/** The timeout (sec) for the WDT_CSTS[RCSUSFLG] is reset success */
#define WDG_RECONFIGURE_FLAG_TIMEOUT         (65535UL)

/** Switch the DEM reporting on or off */
#define WDG_DEM_ERROR_DETECT                 (STD_ON)

/** Represents the watchdog driver execution area is either from ROM(Flash) or RAM as required with the particular microcontroller. */
#define WDG_RUN_AREA_ROM

/**@} end of group WDG_Macros */

#ifdef __cplusplus
}
#endif

#endif

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