/**
*   @file   Wdg_43_Instance0.c
*  
*   @version 1.0.0
*
*   @brief   AUTOSAR Wdg - contains the data exported by the watchodg module
*   @details Contains the information that will be exported by the module, as requested by Autosar.
*
*   @addtogroup  Wdg
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : Swt
*   Dependencies         : none
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/



#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and namespace shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
* The used compilers use more than 31 chars for identifiers.
*
* @section [global]
* Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
* The used compilers use more than 31 chars for identifiers.
*
* @section Wdg_43_Instance0_c_REF_1
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once.
* This violation is not fixed since the inclusion of <MA>_MemMap.h is as per AUTOSAR requirement [SWS_MemMap_00003].
*
* @section Wdg_43_Instance0_c_REF_2
* Violates MISRA 2012 Advisory Rule 8.7, Functions and objects should not be defined with external linkage
* if they are referenced in only one translation unit. These functions represent the API of the driver. 
* External linkage is needed to "export" the API.
*
* @section Wdg_43_Instance0_c_REF_3
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor directives or comments.
* <MA>_MemMap.h is included after each section define in order to set the current memory section as defined by AUTOSAR.
*
*/

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Wdg_43_Instance0.h"
#include "Wdg_Channel.h"
#ifdef WDG_INSTANCE0
#if (WDG_INSTANCE0 == STD_ON)
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
/**
* @file           Wdg_43_Instance0.c    
*/
#define WDG_VENDOR_ID_C                    43
#define WDG_AR_RELEASE_MAJOR_VERSION_C     4
#define WDG_AR_RELEASE_MINOR_VERSION_C     3
#define WDG_AR_RELEASE_REVISION_VERSION_C  1
#define WDG_SW_MAJOR_VERSION_C             1
#define WDG_SW_MINOR_VERSION_C             0
#define WDG_SW_PATCH_VERSION_C             0

/*==================================================================================================
                                      FILE VERSION CHECKS
==================================================================================================*/
/* Check if current file and WDG configuration header file are of the same vendor */
#if (WDG_VENDOR_ID_C != WDG_CHANNEL_VENDOR_ID)
    #error "Wdg_43_Instance0.c and Wdg_Channel.h have different vendor ids"
#endif

/* Check if current file and WDG channel header file are of the same Autosar version */

#if ((WDG_AR_RELEASE_MAJOR_VERSION_C    != WDG_CHANNEL_AR_RELEASE_MAJOR_VERSION) || \
     (WDG_AR_RELEASE_MINOR_VERSION_C    != WDG_CHANNEL_AR_RELEASE_MINOR_VERSION) || \
     (WDG_AR_RELEASE_REVISION_VERSION_C != WDG_CHANNEL_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Wdg.c and Wdg_Channel.h are different"
#endif
/* Check if current file and WDG configuration header file are of the same software version */
#if ((WDG_SW_MAJOR_VERSION_C != WDG_CHANNEL_SW_MAJOR_VERSION) || \
     (WDG_SW_MINOR_VERSION_C != WDG_CHANNEL_SW_MINOR_VERSION) || \
     (WDG_SW_PATCH_VERSION_C != WDG_CHANNEL_SW_PATCH_VERSION)    \
    )
    #error "Software Version Numbers of Wdg_43_Instance0.c and Wdg_Channel.h are different"
#endif

/* Check if current file and WDG header file are of the same vendor */
#if (WDG_VENDOR_ID_C != WDG_VENDOR_ID)
    #error "Wdg_43_Instance0.c and Wdg_43_Instance0.h have different vendor ids"
#endif

/* Check if current file and WDG header file are of the same Autosar version */
#if ((WDG_AR_RELEASE_MAJOR_VERSION_C   != WDG_43_INSTANCE0_AR_RELEASE_MAJOR_VERSION) || \
     (WDG_AR_RELEASE_MINOR_VERSION_C     != WDG_43_INSTANCE0_AR_RELEASE_MINOR_VERSION) || \
     (WDG_AR_RELEASE_REVISION_VERSION_C != WDG_AR_RELEASE_REVISION_VERSION) \
    )
    #error "AutoSar Version Numbers of Wdg_43_Instance0.c and Wdg_43_Instance0.h are different"
#endif

/* Check if current file and WDG header file are of the same software version */
#if ((WDG_SW_MAJOR_VERSION_C != 1) || \
     (WDG_SW_MINOR_VERSION_C != 0) || \
     (WDG_SW_PATCH_VERSION_C != 0)    \
    )
    #error "Software Version Numbers of Wdg_43_Instance0.c and Wdg_43_Instance0.h are different"
#endif
/*==================================================================================================
*                                          CONSTANTS
==================================================================================================*/

/*==================================================================================================
*                                      DEFINES AND MACROS
==================================================================================================*/

/*==================================================================================================
*                                             ENUMS
==================================================================================================*/

/*==================================================================================================
*                                STRUCTURES AND OTHER TYPEDEFS
==================================================================================================*/

/*==================================================================================================
*                                GLOBAL VARIABLE DECLARATIONS
==================================================================================================*/

/*==================================================================================================
*                                    FUNCTION PROTOTYPES
==================================================================================================*/

#ifdef WDG_ROM
    #if (WDG_ROM == 1U)
        #define WDG_START_SEC_CODE
    #endif
#else
    #if (WDG_RAM == 0U)
        #define WDG_START_SEC_RAMCODE
    #endif
#endif
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref Wdg_43_Instance0_c_REF_1 MISRA 2012 Required 4.10*/
#include "Wdg_MemMap.h"


/**
* @brief   This function initializes the WDG module.
* @details The @p Wdg_43_Instance0_Init function shall initialize the Wdg module and the
*          watchdog hardware, i.e. it shall set the default watchdog mode and
*          timeout period as provided in the configuration set.
*
* @param[in] ConfigPtr     Pointer to configuration set.
*
* @implements      Wdg_InstanceNo_Init_Activity
*
* @violates @ref Wdg_43_Instance0_c_REF_2 Advisory Rule 8.7, Functions and objects should not be defined with external
* linkage if they are referenced in only one translation unit.
**/
FUNC(void, WDG_CODE) Wdg_43_Instance0_Init(P2CONST(Wdg_ConfigType, AUTOMATIC, WDG_APPL_CONST) pConfigPtr)
{
    Wdg_ChannelInit(pConfigPtr, WDG_IPW_INSTANCE0);
}



/**
* @brief   Switches the watchdog into the mode Mode.
* @details By choosing one of a limited number of statically configured
*          settings (e.g. toggle or window watchdog, different timeout periods)
*          the Wdg module and the watchdog hardware can be switched between the
*          following three different watchdog modes using the @p  Wdg_43_Instance0_SetMode
*          function:<br>
*          - WDGIF_OFF_MODE,
*          - WDGIF_SLOW_MODE,
*          - WDGIF_FAST_MODE.
*          .
*
* @param[in] Mode      One of the following statically configured modes:<br>
*                      -# WDGIF_OFF_MODE,
*                      -# WDGIF_SLOW_MODE,
*                      -# WDGIF_FAST_MODE.
*                      .
*
* @return              Std_ReturnType.
* @retval  E_OK        Mode switch executed completely and successfully.
* @retval  E_NOT_OK    The mode switch encountered errors.
*
* @implements      Wdg_InstanceNo_SetMode_Activity
*
* @violates @ref Wdg_43_Instance0_c_REF_2 Advisory Rule 8.7, Functions and objects should not be defined with external
* linkage if they are referenced in only one translation unit.
**/
FUNC(Std_ReturnType, WDG_CODE) Wdg_43_Instance0_SetMode(WdgIf_ModeType Mode)
{
    return Wdg_ChannelSetMode(Mode, WDG_IPW_INSTANCE0);
}




/**
* @brief   Reset the watchdog timeout counter according to the timeout value passed.
* @details 
*
* @param[in] Timeout value (milliseconds) for setting the trigger counter.
* 
* @implements      Wdg_InstanceNo_SetTriggerCondition_Activity
*
* @violates @ref Wdg_43_Instance0_c_REF_2 Advisory Rule 8.7, Functions and objects should not be defined with external
* linkage if they are referenced in only one translation unit.
**/
FUNC(void, WDG_CODE) Wdg_43_Instance0_SetTriggerCondition(uint16 u16Timeout)
{
    Wdg_ChannelSetTriggerCondition(u16Timeout, WDG_IPW_INSTANCE0);
}

        
#if (WDG_VERSION_INFO_API == STD_ON)

/**
* @brief   Returns the version information of the module.
* @details The Wdg_43_Instance0_ChannelGetVersionInfo function shall return the version
*          information of this module. The version information includes:
*          - Module Id,
*          - Vendor Id,
*          - Vendor specific version numbers.
*          .
*
* @pre    This function is only required if the WDG_VERSION_INFO_API has to be
*         equal STD_ON.
*
* @param[in,out] pVersioninfo   Pointer to where to store the version
*                              information of this module.
*
*
* @implements     Wdg_InstanceNo_GetVersionInfo_Activity
*
* @violates @ref Wdg_43_Instance0_c_REF_2 Advisory Rule 8.7, Functions and objects should not be defined with external
* linkage if they are referenced in only one translation unit.
**/
FUNC(void, WDG_CODE) Wdg_43_Instance0_GetVersionInfo(P2VAR(Std_VersionInfoType, AUTOMATIC, WDG_APPL_DATA) pVersioninfo)
{
    Wdg_ChannelGetVersionInfo(pVersioninfo, WDG_IPW_INSTANCE0);
}

#endif /* WDG_VERSION_INFO_API == STD_ON */
#ifdef WDG_ROM
    #if (WDG_ROM == 1U)
        #define WDG_STOP_SEC_CODE
    #endif
#else
    #if (WDG_RAM == 0U)
        #define WDG_STOP_SEC_RAMCODE
    #endif
#endif
/**
* @brief Include Memory mapping specification
*/
/* @violates @ref Wdg_43_Instance0_c_REF_1 MISRA 2012 Required 4.10*/
/* @violates @ref Wdg_43_Instance0_c_REF_3 MISRA 2012 Advisory 20.1 */
#include "Wdg_MemMap.h"

#endif /*#if (WDG_INSTANCE0 == STD_ON)*/
#ifdef __cplusplus
}
#endif
#endif

/** @} */
